1import{S as kk,ca as Mk,da as Ak,ea as Pk,fa as Fk,ga as Rk,ha as Ok,ia as Nk,s as Qi,x as Oc}from"./chunk-FNH2DWIR.js";import{a as _r}from"./chunk-FK6H3RFT.js";import{$ as kt,$a as qn,$b as on,A as Fn,Aa as Z3,Ab as gs,Ac as Jt,B as bd,Ba as Pu,Bb as He,Bc as mn,C as P_,Ca as Q3,Cb as nr,Cc as bk,D as zx,Da as Fu,Db as rr,Dc as oC,E as xo,Ea as Ed,Eb as fk,Ec as Zs,F as Yx,Fa as hg,Fb as gk,Fc as Rc,G as xl,Ga as tC,Gb as vk,Gc as _g,H as bm,Ha as Ru,Hb as p,Hc as G_,I as qx,Ia as Wp,Ib as s,Ic as sC,J as G3,Ja as ek,Jb as o,Jc as yg,K as Kx,Ka as tk,Kb as B,Kc as xk,L as $3,La as ik,Lb as Nu,Lc as Ck,M as Xx,Ma as nk,Mb as Lu,Mc as Kn,N as F_,Na as rk,Nb as Jl,Nc as lC,O as hs,Oa as ak,Ob as Ui,Oc as Ek,P as Tn,Pa as ok,Pb as ji,Pc as wk,Q as gr,Qa as wd,Qb as he,Qc as Tk,R as z3,Ra as fg,Rb as Fc,Rc as Cn,S as La,Sa as O_,Sb as _k,Sc as Zl,T as Hi,Ta as sk,Tb as Xs,Tc as Dk,U as ug,Ua as Hp,Ub as Sa,Uc as $_,V as xd,Va as lk,Vb as S,Vc as Ik,W as Cl,Wa as m,Wb as w,Wc as Sg,X as nt,Xa as Ou,Xb as Ya,Xc as Vu,Y as vi,Ya as Td,Yb as ar,Yc as Dd,Z as Y3,Za as ck,Zb as Js,Zc as Uu,_ as Gt,_a as Va,_b as An,_c as ju,a as us,aa as fe,ab as x,ac as sn,b as U3,ba as Cd,bb as N_,bc as yk,c as za,ca as q3,cb as Ks,cc as vg,d as jx,da as Go,db as Gp,dc as aC,e as Wx,ea as fs,eb as L_,ec as Qt,f as ci,fa as U,fb as dk,fc as gi,g as da,ga as j,gb as B_,gc as Re,h as Hx,ha as xm,hb as te,hc as Co,i as Xl,ia as K3,ib as _i,ic as l,j as j3,ja as rn,jb as Ci,jc as b,jd as Lk,k as W3,ka as Vi,kb as Cm,kc as _,kd as bg,l as Na,la as Mu,lb as lr,lc as Pi,ld as z_,m as Fi,ma as Jx,mb as mk,mc as j_,n as fr,na as pg,nb as T,nc as W_,nd as Bk,o as Gx,oa as Au,ob as uk,oc as H_,p as H3,pa as vr,pb as xn,pc as q,pd as Y_,q as Ki,qa as X3,qb as Ri,qc as K,r as Up,ra as J3,rb as $o,rc as X,rd as Vk,s as ps,sa as Zx,sb as iC,sc as Sk,t as mg,ta as jp,tb as pk,tc as Ii,u as M_,ua as R_,ub as V_,uc as Bu,v as Pc,va as kn,vb as U_,vc as Z,w as A_,wa as Ba,wb as nC,wc as Et,wd as Uk,x as Sd,xa as Qx,xb as gg,xc as El,y as Vn,ya as Ai,yb as rC,yc as I,z as $x,za as eC,zb as hk,zc as M}from"./chunk-L6VLSH7Q.js";import{a as le,b as tt,c as Ux,d as eU,e as tU,f as Di,g as ye}from"./chunk-GAL4ENT6.js";var Ti=eU((KT,XT)=>{"use strict";(function(i,n){typeof define=="function"&&define.amd?define([],n):typeof KT<"u"?n():(n(),i.FileSaver={})})(KT,function(){"use strict";function i(d,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function n(d,u,h){var f=new XMLHttpRequest;f.open("GET",d),f.responseType="blob",f.onload=function(){c(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function t(d){var u=new XMLHttpRequest;u.open("HEAD",d,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function e(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");
1u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(u)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,a=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(d,u,h){var f=r.URL||r.webkitURL,v=document.createElement("a");u=u||d.name||"download",v.download=u,v.rel="noopener",typeof d=="string"?(v.href=d,v.origin===location.origin?e(v):t(v.href)?n(d,u,h):e(v,v.target="_blank")):(v.href=f.createObjectURL(d),setTimeout(function(){f.revokeObjectURL(v.href)},4e4),setTimeout(function(){e(v)},0))}:"msSaveOrOpenBlob"in navigator?function(d,u,h){if(u=u||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(i(d,h),u);else if(t(d))n(d,u,h);else{var f=document.createElement("a");f.href=d,f.target="_blank",setTimeout(function(){e(f)})}}:function(d,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof d=="string")return n(d,u,h);var v=d.type==="application/octet-stream",C=/constructor/i.test(r.HTMLElement)||r.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||v&&C||a)&&typeof FileReader<"u"){var A=new FileReader;A.onloadend=function(){var R=A.result;R=y?R:R.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=R:location=R,f=null},A.readAsDataURL(d)}else{var D=r.URL||r.webkitURL,F=D.createObjectURL(d);f?f.location=F:location.href=F,f=null,setTimeout(function(){D.revokeObjectURL(F)},4e4)}});r.saveAs=c.saveAs=c,typeof XT<"u"&&(XT.exports=c)})});var Hk=null;function Qs(){return Hk}function cC(i){Hk??=i}var xg=class{},Cg=(()=>{class i{historyGo(t){throw new Error("")}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>fe(Gk),providedIn:"platform"})}return i})(),dC=new Gt(""),Gk=(()=>{class i extends Cg{_location;_history;_doc=fe(Vi);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Qs().getBaseHref(this._doc)}onPopState(t){let e=Qs().getGlobalEventTarget(this._doc,"window");return e.addEventListener("popstate",t,!1),()=>e.removeEventListener("popstate",t)}onHashChange(t){let e=Qs().getGlobalEventTarget(this._doc,"window");return e.addEventListener("hashchange",t,!1),()=>e.removeEventListener("hashchange",t)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(t){this._location.pathname=t}pushState(t,e,r){this._history.pushState(t,e,r)}replaceState(t,e,r){this._history.replaceState(t,e,r)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>new i,providedIn:"platform"})}return i})();function q_(i,n){return i?n?i.endsWith("/")?n.startsWith("/")?i+n.slice(1):i+n:n.startsWith("/")?i+n:`${i}/${n}`:i:n}function jk(i){let n=i.search(/#|\?|$/);return i[n-1]==="/"?i.slice(0,n-1)+i.slice(n):i}function Ql(i){return i&&i[0]!=="?"?`?${i}`:i}var ec=(()=>{class i{historyGo(t){throw new Error("")}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>fe(X_),providedIn:"root"})}return i})(),K_=new Gt(""),X_=(()=>{class i extends ec{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,e){super(),this._platformLocation=t,this._baseHref=e??this._platformLocation.getBaseHrefFromDOM()??fe(Vi).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.on
vendor: 11,394 bytes, line 1
1HashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return q_(this._baseHref,t)}path(t=!1){let e=this._platformLocation.pathname+Ql(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${e}${r}`:e}pushState(t,e,r,a){let c=this.prepareExternalUrl(r+Ql(a));this._platformLocation.pushState(t,e,c)}replaceState(t,e,r,a){let c=this.prepareExternalUrl(r+Ql(a));this._platformLocation.replaceState(t,e,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(e){return new(e||i)(kt(Cg),kt(K_,8))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Nc=(()=>{class i{_subject=new ci;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;let e=this._locationStrategy.getBaseHref();this._basePath=rU(jk(Wk(e))),this._locationStrategy.onPopState(r=>{this._subject.next({url:this.path(!0),pop:!0,state:r.state,type:r.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+Ql(e))}normalize(t){return i.stripTrailingSlash(nU(this._basePath,Wk(t)))}prepareExternalUrl(t){return t&&t[0]!=="/"&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,e="",r=null){this._locationStrategy.pushState(r,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Ql(e)),r)}replaceState(t,e="",r=null){this._locationStrategy.replaceState(r,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Ql(e)),r)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription??=this.subscribe(e=>{this._notifyUrlChangeListeners(e.url,e.state)}),()=>{let e=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(e,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(r=>r(t,e))}subscribe(t,e,r){return this._subject.subscribe({next:t,error:e??void 0,complete:r??void 0})}static normalizeQueryParams=Ql;static joinWithSlash=q_;static stripTrailingSlash=jk;static \u0275fac=function(e){return new(e||i)(kt(ec))};static \u0275prov=nt({token:i,factory:()=>iU(),providedIn:"root"})}return i})();function iU(){return new Nc(kt(ec))}function nU(i,n){if(!i||!n.startsWith(i))return n;let t=n.substring(i.length);return t===""||["/",";","?","#"].includes(t[0])?t:n}function Wk(i){return i.replace(/\/index.html$/,"")}function rU(i){if(new RegExp("^(https?:)?//").test(i)){let[,t]=i.split(/\/\/[^\/]+/);return t}return i}var vC=(()=>{class i extends ec{_platformLocation;_baseHref="";_removeListenerFns=[];constructor(t,e){super(),this._platformLocation=t,e!=null&&(this._baseHref=e)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash??"#";return e.length>0?e.substring(1):e}prepareExternalUrl(t){let e=q_(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,r,a){let c=this.prepareExternalUrl(r+Ql(a))||this._platformLocation.pathname;this._platformLocation.pushState(t,e,c)}replaceState(t,e,r,a){let c=this.prepareExternalUrl(r+Ql(a))||this._platformLocation.pathname;this._platformLocation.replaceState(t,e,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(e){return new(e||i)(kt(Cg),kt(K_,8))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();var _C=function(i){return i[i.Decimal=0]="Decimal",i[i.Percent=1]="Percent",i[i.Currency=2]="Currency",i[i.Scientific=3]="Scientific",i}(_C||{});var Eo=function(i){return i[i.Format=0]="Format",i[i.Standalone=1]="Standalone",i}(Eo||{}),yr=function(i){return i[i.Narrow=0]="Narrow",i[i.Abbreviated=1]="Abbreviated",i[i.Wide=2]="Wide",i[i.Short=3]="Short",i}(yr||{}),vs=function(i){return i[i.Short=0]="Short",i[i.Medium=1]="Medium",i[i.Long=2]="Long",i[i.Full=3]="Full",i}(vs||{}),_s={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function Xk(i){return Xs(i)[Sa.LocaleId]}function Jk(i,n,t){let e=Xs(i),r=[e[Sa.DayPeriodsFormat],e[Sa.DayPeriodsStandalone]],a=wl(r,n);return wl(a,t)}function Zk(i,n,t){let e=Xs(i),r=[e[Sa.DaysFormat],e[Sa.DaysStandalone]],a=wl(r,n);return wl(a,t)}function Qk(i,n,t){let e=Xs(i),r=[e[Sa.MonthsFormat],e[Sa.MonthsStandalone]],a=wl(r,n);return wl(a,t)}function e5(i,n){let e=Xs(i)[Sa.Eras];return wl(e,n)}function Eg(i,n){let t=Xs(i);return wl(t[Sa.DateFormat],n)}function wg(i,n){let t=Xs(i);return wl(t[Sa.TimeFormat],n)}function Tg(i,n){let e=Xs(i)[Sa.DateTimeFormat];return wl(e,n)}function Lc(i,n){let t=Xs(i),e=t[Sa.NumberSymbols][n];if(typeof e>"u"){if(n===_s.CurrencyDecimal)return t[Sa.NumberSymbols][_s.Decimal];if(n===_s.CurrencyGroup)return t[Sa.NumberSymbols][_s.Group]}return e}function t5(i,n){return Xs(i)[Sa.NumberFormats][n]}function i5(i){if(!i[Sa.ExtraData])throw new Hi(2303,!1)}function n5(i){let n=Xs(i);return i5(n),(n[Sa.ExtraData][2]||[]).map(e=>typeof e=="string"?mC(e):[mC(e[0]),mC(e[1])])}function r5(i,n,t){let e=Xs(i);i5(e);let r=[e[Sa.ExtraData][0],e[Sa.ExtraData][1]],a=wl(r,n)||[];return wl(a,t)||[]}function wl(i,n){for(let t=n;t>-1;t--)if(typeof i[t]<"u")return i[t];throw new Hi(2304,!1)}function mC(i){let[n,t]=i.split(":");return{hours:+n,minutes:+t}}var aU=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,J_={},oU=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;function a5(i,n,t,e){let r=fU(i);n=Id(t,n)||n;let c=[],d;for(;n;)if(d=oU.exec(n),d){c=c.concat(d.slice(1));let f=c.pop();if(!f)break;n=f}else{c.push(n);break}let u=r.getTimezoneOffset();e&&(u=s5(e,u),r=hU(r,e));let h="";return c.forEach(f=>{let v=uU(f);h+=v?v(r,t,u):f==="''"?"'":f.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),h}function iy(i,n,t){let e=new Date(0);return e.setFullYear(i,n,t),e.setHours(0,0,0),e}function Id(i,n){let t=Xk(i);if(J_[t]??={},J_[t][n])return J_[t][n];let e="";switch(n){case"shortDate":e=Eg(i,vs.Short);break;case"mediumDate":e=Eg(i,vs.Medium);break;case"longDate":e=Eg(i,vs.Long);break;case"fullDate":e=Eg(i,vs.Full);break;case"shortTime":e=wg(i,vs.Short);break;case"mediumTime":e=wg(i,vs.Medium);break;case"longTime":e=wg(i,vs.Long);break;case"fullTime":e=wg(i,vs.Full);break;case"short":let r=Id(i,"shortTime"),a=Id(i,"shortDate");e=Z_(Tg(i,vs.Short),[r,a]);break;case"medium":let c=Id(i,"mediumTime"),d=Id(i,"mediumDate");e=Z_(Tg(i,vs.Medium),[c,d]);break;case"long":let u=Id(i,"longTime"),h=Id(i,"longDate");e=Z_(Tg(i,vs.Long),[u,h]);break;case"full":let f=Id(i,"fullTime"),v=Id(i,"fullDate");e=Z_(Tg(i,vs.Full),[f,v]);break}return e&&(J_[t][n]=e),e}function Z_(i,n){return n&&(i=i.replace(/\{([^}]+)}/g,function(t,e){return n!=null&&e in n?n[e]:t})),i}function tc(i,n,t="-",e,r){let a="";(i<0||r&&i<=0)&&(r?i=-i+1:(i=-i,a=t));let c=String(i);for(;c.length<n;)c="0"+c;return e&&(c=c.slice(c.length-n)),a+c}function sU(i,n){return tc(i,3).substring(0,n)}function ba(i,n,t=0,e=!1,r=!1){return function(a,c){let d=lU(i,a);if((t>0||d>-t)&&(d+=t),i===3)d===0&&t===-12&&(d=12);else if(i===6)return sU(d,n);let u=Lc(c,_s.MinusSign);return tc(d,n,u,e,r)}}function lU(i,n){switch(i){case 0:return n.getFullYear();case 1:return n.getMonth();case 2:return n.getDate();case 3:return n.getHours();case 4:return n.getMinutes();case 5:return n.getSeconds();case 6:return n.getMilliseconds();case 7:return n.getDay();default:throw new Hi(2301,!1)}}function Pr(i,n,t=Eo.Format,e=!1){return function(r,a){return cU(r,a,i,n,t,e)}}function cU(i,n,t,e,r,a){switch(t){case 2:return Qk(n,r,e)[i.getMonth()];case 1:return Zk(n,r,e)[i.getDay()];case 0:let c=i.getHours(),d=i.getMinutes();if(a){let h=n5(n),f=r5(n,r,e),v=h.findIndex(C=>{if(Array.isArray(C)){let[y,A]=C,D=c>=y.hours&&d>=y.minutes,F=c<A.hours||c===A.hours&&d<A.minutes;if(y.hours<A.hours){if(D&&F)return!0}else if(D||F)return!0}else if(C.hours===c&&C.minutes===d)return!0;return!1});if(v!==-1)return f[v]}return Jk(n,r,e)[c<12?0:1];case 3:return e5(n,e)[i.getFullYear()<=0?0:1];default:let u=t;throw new Hi(2302,!1)}}function Q_(i){return function(n,t,e){let r=-1*e,a=Lc(t,_s.MinusSign),c=r>0?Math.floor(r/60):Math.ceil(r/60);switch(i){case 0:return(r>=0?"+":"")+tc(c,2,a)+tc(Math.abs(r%60),2,a);case 1:return"GMT"+(r>=0?"+":"")+tc(c,1,a);case 2:return"GMT"+(r>=0?"+":"")+tc(c,2,a)+":"+tc(Math.abs(r%60),2,a);case 3:return e===0?"Z":(r>=0?"+":"")+tc(c,2,a)+":"+tc(Math.abs(r%60),2,a);default:throw new Hi(2302,!1)}}}var dU=0,ty=4;function mU(i){let n=iy(i,dU,1).getDay();return iy(i,0,1+(n<=ty?ty:ty+7)-n)}function o5(i){let n=i.getDay(),t=n===0?-3:ty-n;return iy(i.getFullYear(),i.getMonth(),i.getDate()+t)}function uC(i,n=!1){return function(t,e){let r;if(n){let a=new Date(t.getFullYear(),t.getMonth(),1).getDay()-1,c=t.getDate();r=1+Math.floor((c+a)/7)}else{let a=o5(t),c=mU(a.getFullYear()),d=a.getTime()-c.getTime();r=1+Math.round(d/6048e5)}return tc(r,i,Lc(e,_s.MinusSign))}}function ey(i,n=!1){return function(t,e){let a=o5(t).getFullYear();return tc(a,i,Lc(e,_s.MinusSign),n)}}var pC={};function uU(i){if(pC[i])return pC[i];let n;switch(i){case"G":case"GG":case"GGG":n=Pr(3,yr.Abbreviated);break;case"GGGG":n=Pr(3,yr.Wide);break;case"GGGGG":n=Pr(3,yr.Narrow);break;case"y":n=ba(0,1,0,!1,!0);break;case"yy":n=ba(0,2,0,!0,!0);break;case"yyy":n=ba(0,3,0,!1,!0);break;case"yyyy":n=ba(0,4,0,!1,!0);break;case"Y":n=ey(1);break;case"YY":n=ey(2,!0);break;case"YYY":n=ey(3);break;case"YYYY":n=ey(4);break;case"M":case"L":n=ba(1,1,1);break;case"MM":case"LL":n=ba(1,2,1);break;case"MMM":n=Pr(2,yr.Abbreviated);break;case"MMMM":n=Pr(2,yr.Wide);break;case"MMMMM":n=Pr(2,yr.Narrow);break;case"LLL":n=Pr(2,yr.Abbreviated,Eo.Standalone);break;case"LLLL":n=Pr(2,yr.Wide,Eo.Standalone);break;case"LLLLL":n=Pr(2,yr.Narrow,Eo.Standalone);break;case"w":n=uC(1);break;case"ww":n=uC(2);break;case"W":n=uC(1,!0);break;case"d":n=ba(2,1);break;case"dd":n=ba(2,2);break;case"c":case"cc":n=ba(7,1);break;case"ccc":n=Pr(1,yr.Abbreviated,Eo.Standalone);break;case"cccc":n=Pr(1,yr.Wide,Eo.Standalone);break;case"ccccc":n=Pr(1,yr.Narrow,Eo.Standalone);break;case"cccccc":n=Pr(1,yr.Short,Eo.Standalone);break;case"E":case"EE":case"EEE":n=Pr(1,yr.Abbreviated);break;case"EEEE":n=Pr(1,yr.Wide);break;case"EEEEE":n=Pr(1,yr.Narrow);break;case"EEEEEE":n=Pr(1,yr.Short);break;case"a":case"aa":case"aaa":n=Pr(0,yr.Abbreviated);break;case"aaaa":n=Pr(0,yr.Wide);break;case"aaaaa":n=Pr(0,yr.Narrow);break;
1case"b":case"bb":case"bbb":n=Pr(0,yr.Abbreviated,Eo.Standalone,!0);break;case"bbbb":n=Pr(0,yr.Wide,Eo.Standalone,!0);break;case"bbbbb":n=Pr(0,yr.Narrow,Eo.Standalone,!0);break;case"B":case"BB":case"BBB":n=Pr(0,yr.Abbreviated,Eo.Format,!0);break;case"BBBB":n=Pr(0,yr.Wide,Eo.Format,!0);break;case"BBBBB":n=Pr(0,yr.Narrow,Eo.Format,!0);break;case"h":n=ba(3,1,-12);break;case"hh":n=ba(3,2,-12);break;case"H":n=ba(3,1);break;case"HH":n=ba(3,2);break;case"m":n=ba(4,1);break;case"mm":n=ba(4,2);break;case"s":n=ba(5,1);break;case"ss":n=ba(5,2);break;case"S":n=ba(6,1);break;case"SS":n=ba(6,2);break;case"SSS":n=ba(6,3);break;case"Z":case"ZZ":case"ZZZ":n=Q_(0);break;case"ZZZZZ":n=Q_(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":n=Q_(1);break;case"OOOO":case"ZZZZ":case"zzzz":n=Q_(2);break;default:return null}return pC[i]=n,n}function s5(i,n){i=i.replace(/:/g,"");let t=Date.parse("Jan 01, 1970 00:00:00 "+i)/6e4;return isNaN(t)?n:t}function pU(i,n){return i=new Date(i.getTime()),i.setMinutes(i.getMinutes()+n),i}function hU(i,n,t){let r=i.getTimezoneOffset(),a=s5(n,r);return pU(i,-1*(a-r))}function fU(i){if($k(i))return i;if(typeof i=="number"&&!isNaN(i))return new Date(i);if(typeof i=="string"){if(i=i.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(i)){let[r,a=1,c=1]=i.split("-").map(d=>+d);return iy(r,a-1,c)}let t=parseFloat(i);if(!isNaN(i-t))return new Date(t);let e;if(e=i.match(aU))return gU(e)}let n=new Date(i);if(!$k(n))throw new Hi(2302,!1);return n}function gU(i){let n=new Date(0),t=0,e=0,r=i[8]?n.setUTCFullYear:n.setFullYear,a=i[8]?n.setUTCHours:n.setHours;i[9]&&(t=Number(i[9]+i[10]),e=Number(i[9]+i[11])),r.call(n,Number(i[1]),Number(i[2])-1,Number(i[3]));let c=Number(i[4]||0)-t,d=Number(i[5]||0)-e,u=Number(i[6]||0),h=Math.floor(parseFloat("0."+(i[7]||0))*1e3);return a.call(n,c,d,u,h),n}function $k(i){return i instanceof Date&&!isNaN(i.valueOf())}var vU=/^(\d+)?\.((\d+)(-(\d+))?)?$/,zk=22,ny=".",Dg="0",_U=";",yU=",",hC="#";function SU(i,n,t,e,r,a,c=!1){let d="",u=!1;if(!isFinite(i))d=Lc(t,_s.Infinity);else{let h=CU(i);c&&(h=xU(h));let f=n.minInt,v=n.minFrac,C=n.maxFrac;if(a){let L=a.match(vU);if(L===null)throw new Hi(2306,!1);let H=L[1],se=L[3],Ce=L[5];H!=null&&(f=fC(H)),se!=null&&(v=fC(se)),Ce!=null?C=fC(Ce):se!=null&&v>C&&(C=v)}EU(h,v,C);let y=h.digits,A=h.integerLen,D=h.exponent,F=[];for(u=y.every(L=>!L);A<f;A++)y.unshift(0);for(;A<0;A++)y.unshift(0);A>0?F=y.splice(A,y.length):(F=y,y=[0]);let R=[];for(y.length>=n.lgSize&&R.unshift(y.splice(-n.lgSize,y.length).join(""));y.length>n.gSize;)R.unshift(y.splice(-n.gSize,y.length).join(""));y.length&&R.unshift(y.join("")),d=R.join(Lc(t,e)),F.length&&(d+=Lc(t,r)+F.join("")),D&&(d+=Lc(t,_s.Exponential)+"+"+D)}return i<0&&!u?d=n.negPre+d+n.negSuf:d=n.posPre+d+n.posSuf,d}function l5(i,n,t){let e=t5(n,_C.Decimal),r=bU(e,Lc(n,_s.MinusSign));return SU(i,r,n,_s.Group,_s.Decimal,t)}function bU(i,n="-"){let t={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},e=i.split(_U),r=e[0],a=e[1],c=r.indexOf(ny)!==-1?r.split(ny):[r.substring(0,r.lastIndexOf(Dg)+1),r.substring(r.lastIndexOf(Dg)+1)],d=c[0],u=c[1]||"";t.posPre=d.substring(0,d.indexOf(hC));for(let f=0;f<u.length;f++){let v=u.charAt(f);v===Dg?t.minFrac=t.maxFrac=f+1:v===hC?t.maxFrac=f+1:t.posSuf+=v}let h=d.split(yU);if(t.gSize=h[1]?h[1].length:0,t.lgSize=h[2]||h[1]?(h[2]||h[1]).length:0,a){let f=r.length-t.posPre.length-t.posSuf.length,v=a.indexOf(hC);t.negPre=a.substring(0,v).replace(/'/g,""),t.negSuf=a.slice(v+f).replace(/'/g,"")}else t.negPre=n+t.posPre,t.negSuf=t.posSuf;return t}function xU(i){if(i.digits[0]===0)return i;let n=i.digits.length-i.integerLen;return i.exponent?i.exponent+=2:(n===0?i.digits.push(0,0):n===1&&i.digits.push(0),i.integerLen+=2),i}function CU(i){let n=Math.abs(i)+"",t=0,e,r,a,c,d;for((r=n.indexOf(ny))>-1&&(n=n.replace(ny,"")),(a=n.search(/e/i))>0?(r<0&&(r=a),r+=+n.slice(a+1),n=n.substring(0,a)):r<0&&(r=n.length),a=0;n.charAt(a)===Dg;a++);if(a===(d=n.length))e=[0],r=1;else{for(d--;n.charAt(d)===Dg;)d--;for(r-=a,e=[],c=0;a<=d;a++,c++)e[c]=Number(n.charAt(a))}return r>zk&&(e=e.splice(0,zk-1),t=r-1,r=1),{digits:e,exponent:t,integerLen:r}}function EU(i,n,t){if(n>t)throw new Hi(2307,!1);let e=i.digits,r=e.length-i.integerLen,a=Math.min(Math.max(n,r),t),c=a+i.integerLen,d=e[c];if(c>0){e.splice(Math.max(i.integerLen,c));for(let v=c;v<e.length;v++)e[v]=0}else{r=Math.max(0,r),i.integerLen=1,e.length=Math.max(1,c=a+1),e[0]=0;for(let v=1;v<c;v++)e[v]=0}if(d>=5)if(c-1<0){for(let v=0;v>c;v--)e.unshift(0),i.integerLen++;e.unshift(1),i.integerLen++}else e[c-1]++;for(;r<Math.max(0,a);r++)e.push(0);let u=a!==0,h=n+i.integerLen,f=e.reduceRight(function(v,C,y,A){return C=C+v,A[y]=C<10?C:C-10,u&&(A[y]===0&&y>=h?A.pop():u=!1),C>=10?1:0},0);f&&(e.unshift(f),i.integerLen++)}function fC(i){let n=parseInt(i);if(isNaN(n))throw new Hi(2305,!1);return n}var gC=/\s+/,Yk=[],ue=(()=>{class i{_ngEl;_renderer;initialClasses=Yk;rawClass;stateMap=new Map;constructor(t,e){this._ngEl=t,this._renderer=e}set klass(t){this.initialClasses=t!=null?t.trim().split(gC):Yk}set ngClass(t){this.rawClass=typeof t=="string"?t.trim().split(gC):t}ngDoCheck(){for(let e of this.initialClasses)this._updateState(e,!0);let t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(let e of t)this._updateState(e,!0);else if(t!=null)for(let e of Object.keys(t))this._updateState(e,!!t[e]);this._applyStateDiff()}_updateState(t,e){let r=this.stateMap.get(t);r!==void 0?(r.enabled!==e&&(r.changed=!0,r.enabled=e),r.touched=!0):this.stateMap.set(t,{enabled:e,changed:!0,touched:!0})}_applyStateDiff(){for(let t of this.stateMap){let e=t[0],r=t[1];r.changed?(this._toggleClass(e,r.enabled),r.changed=!1):r.touched||(r.enabled&&this._toggleClass(e,!1),this.stateMap.delete(e)),r.touched=!1}}_toggleClass(t,e){t=t.trim(),t.length>
vendor: 6,902 bytes, line 1
10&&t.split(gC).forEach(r=>{e?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}static \u0275fac=function(e){return new(e||i)(x(Ai),x(qn))};static \u0275dir=Ci({type:i,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return i})();var ry=class{$implicit;ngForOf;index;count;constructor(n,t,e,r){this.$implicit=n,this.ngForOf=t,this.index=e,this.count=r}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},_e=(()=>{class i{_viewContainer;_template;_differs;set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(t,e,r){this._viewContainer=t,this._template=e,this._differs=r}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let t=this._ngForOf;!this._differ&&t&&(this._differ=this._differs.find(t).create(this.ngForTrackBy))}if(this._differ){let t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){let e=this._viewContainer;t.forEachOperation((r,a,c)=>{if(r.previousIndex==null)e.createEmbeddedView(this._template,new ry(r.item,this._ngForOf,-1,-1),c===null?void 0:c);else if(c==null)e.remove(a===null?void 0:a);else if(a!==null){let d=e.get(a);e.move(d,c),qk(d,r)}});for(let r=0,a=e.length;r<a;r++){let d=e.get(r).context;d.index=r,d.count=a,d.ngForOf=this._ngForOf}t.forEachIdentityChange(r=>{let a=e.get(r.currentIndex);qk(a,r)})}static ngTemplateContextGuard(t,e){return!0}static \u0275fac=function(e){return new(e||i)(x(Ks),x(Td),x(lC))};static \u0275dir=Ci({type:i,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return i})();function qk(i,n){i.context.$implicit=n.item}var Dt=(()=>{class i{_viewContainer;_context=new ay;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(t,e){this._viewContainer=t,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){Kk(t,!1),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Kk(t,!1),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(t,e){return!0}static \u0275fac=function(e){return new(e||i)(x(Ks),x(Td))};static \u0275dir=Ci({type:i,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return i})(),ay=class{$implicit=null;ngIf=null};function Kk(i,n){if(i&&!i.createEmbeddedView)throw new Hi(2020,!1)}var Ig=(()=>{class i{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(t,e,r){this._ngEl=t,this._differs=e,this._renderer=r}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){let t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){let[r,a]=t.split("."),c=r.indexOf("-")===-1?void 0:Ou.DashCase;e!=null?this._renderer.setStyle(this._ngEl.nativeElement,r,a?`${e}${a}`:e,c):this._renderer.removeStyle(this._ngEl.nativeElement,r,c)}_applyChanges(t){t.forEachRemovedItem(e=>this._setStyle(e.key,null)),t.forEachAddedItem(e=>this._setStyle(e.key,e.currentValue)),t.forEachChangedItem(e=>this._setStyle(e.key,e.currentValue))}static \u0275fac=function(e){return new(e||i)(x(Ai),x(Ek),x(qn))};static \u0275dir=Ci({type:i,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return i})(),yC=(()=>{class i{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){let e=this._viewContainerRef;if(this._viewRef&&e.remove(e.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let r=this._createContextForwardProxy();this._viewRef=e.createEmbeddedView(this.ngTemplateOutlet,r,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,e,r)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,e,r):!1,get:(t,e,r)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,e,r)}})}static \u0275fac=function(e){return new(e||i)(x(Ks))};static \u0275dir=Ci({type:i,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[kn]})}return i})();function SC(i,n){return new Hi(2100,!1)}var wU=/(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u
10EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g,bC=(()=>{class i{transform(t){if(t==null)return null;if(typeof t!="string")throw SC(i,t);return t.replace(wU,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}static \u0275fac=function(e){return new(e||i)};static \u0275pipe=Cm({name:"titlecase",type:i,pure:!0})}return i})();var TU="mediumDate",c5=new Gt(""),d5=new Gt(""),St=(()=>{class i{locale;defaultTimezone;defaultOptions;constructor(t,e,r){this.locale=t,this.defaultTimezone=e,this.defaultOptions=r}transform(t,e,r,a){if(t==null||t===""||t!==t)return null;try{let c=e??this.defaultOptions?.dateFormat??TU,d=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return a5(t,c,a||this.locale,d)}catch(c){throw SC(i,c.message)}}static \u0275fac=function(e){return new(e||i)(x(oC,16),x(c5,24),x(d5,24))};static \u0275pipe=Cm({name:"date",type:i,pure:!0})}return i})();var Dn=(()=>{class i{_locale;constructor(t){this._locale=t}transform(t,e,r){if(!DU(t))return null;r||=this._locale;try{let a=IU(t);return l5(a,r,e)}catch(a){throw SC(i,a.message)}}static \u0275fac=function(e){return new(e||i)(x(oC,16))};static \u0275pipe=Cm({name:"number",type:i,pure:!0})}return i})();function DU(i){return!(i==null||i===""||i!==i)}function IU(i){if(typeof i=="string"&&!isNaN(Number(i)-parseFloat(i)))return Number(i);if(typeof i!="number")throw new Hi(2309,!1);return i}var xC=(()=>
vendor: 31,369 bytes, lines 1-2
1{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})();function kg(i,n){n=encodeURIComponent(n);for(let t of i.split(";")){let e=t.indexOf("="),[r,a]=e==-1?[t,""]:[t.slice(0,e),t.slice(e+1)];if(r.trim()===n)return decodeURIComponent(a)}return null}var Wu=class{};var EC="browser";function u5(i){return i===EC}var p5=(()=>{class i{static \u0275prov=nt({token:i,providedIn:"root",factory:()=>new CC(fe(Vi),window)})}return i})(),CC=class{document;window;offset=()=>[0,0];constructor(n,t){this.document=n,this.window=t}setOffset(n){Array.isArray(n)?this.offset=()=>n:this.offset=n}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(n,t){this.window.scrollTo(tt(le({},t),{left:n[0],top:n[1]}))}scrollToAnchor(n,t){let e=MU(this.document,n);e&&(this.scrollToElement(e,t),e.focus())}setHistoryScrollRestoration(n){try{this.window.history.scrollRestoration=n}catch{console.warn(ug(2400,!1))}}scrollToElement(n,t){let e=n.getBoundingClientRect(),r=e.left+this.window.pageXOffset,a=e.top+this.window.pageYOffset,c=this.offset();this.window.scrollTo(tt(le({},t),{left:r-c[0],top:a-c[1]}))}};function MU(i,n){let t=i.getElementById(n)||i.getElementsByName(n)[0];if(t)return t;if(typeof i.createTreeWalker=="function"&&i.body&&typeof i.body.attachShadow=="function"){let e=i.createTreeWalker(i.body,NodeFilter.SHOW_ELEMENT),r=e.currentNode;for(;r;){let a=r.shadowRoot;if(a){let c=a.getElementById(n)||a.querySelector(`[name="${n}"]`);if(c)return c}r=e.nextNode()}}return null}var sy=new Gt(""),kC=(()=>{class i{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,e){this._zone=e,t.forEach(r=>{r.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,e,r,a){return this._findPluginFor(e).addEventListener(t,e,r,a)}getZone(){return this._zone}_findPluginFor(t){let e=this._eventNameToPlugin.get(t);if(e)return e;if(e=this._plugins.find(a=>a.supports(t)),!e)throw new Hi(5101,!1);return this._eventNameToPlugin.set(t,e),e}static \u0275fac=function(e){return new(e||i)(kt(sy),kt(Ri))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),Mg=class{_doc;constructor(n){this._doc=n}manager},wC="ng-app-id";function h5(i){for(let n of i)n.remove()}function f5(i,n){let t=n.createElement("style");return t.textContent=i,t}function AU(i,n,t,e){let r=i.head?.querySelectorAll(`style[${wC}="${n}"],link[${wC}="${n}"]`);if(r)for(let a of r)a.removeAttribute(wC),a instanceof HTMLLinkElement?e.set(a.href.slice(a.href.lastIndexOf("/")+1),{usage:0,elements:[a]}):a.textContent&&t.set(a.textContent,{usage:0,elements:[a]})}function DC(i,n){let t=n.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",i),t}var MC=(()=>{class i{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(t,e,r,a={}){this.doc=t,this.appId=e,this.nonce=r,AU(t,e,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,e){for(let r of t)this.addUsage(r,this.inline,f5);e?.forEach(r=>this.addUsage(r,this.external,DC))}removeStyles(t,e){for(let r of t)this.removeUsage(r,this.inline);e?.forEach(r=>this.removeUsage(r,this.external))}addUsage(t,e,r){let a=e.get(t);a?a.usage++:e.set(t,{usage:1,elements:[...this.hosts].map(c=>this.addElement(c,r(t,this.doc)))})}removeUsage(t,e){let r=e.get(t);r&&(r.usage--,r.usage<=0&&(h5(r.elements),e.delete(t)))}ngOnDestroy(){for(let[,{elements:t}]of[...this.inline,...this.external])h5(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(let[e,{elements:r}]of this.inline)r.push(this.addElement(t,f5(e,this.doc)));for(let[e,{elements:r}]of this.external)r.push(this.addElement(t,DC(e,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,e){return this.nonce&&e.setAttribute("nonce",this.nonce),t.appendChild(e)}static \u0275fac=function(e){return new(e||i)(kt(Vi),kt(Pu),kt(hg,8),kt(Fu))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),TC={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},AC=/%COMP%/g;var v5="%COMP%",PU=`_nghost-${v5}`,FU=`_ngcontent-${v5}`,RU=!0,OU=new Gt("",{providedIn:"root",factory:()=>RU});function NU(i){return FU.replace(AC,i)}function LU(i){return PU.replace(AC,i)}function _5(i,n){return n.map(t=>t.replace(AC,i))}var Hu=(()=>{class i{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,e,r,a,c,d,u,h=null,f=null){this.eventManager=t,this.sharedStylesHost=e,this.appId=r,this.removeStylesOnCompDestroy=a,this.doc=c,this.platformId=d,this.ngZone=u,this.nonce=h,this.tracingService=f,this.platformIsServer=!1,this.defaultRenderer=new Ag(t,c,u,this.platformIsServer,this.tracingService)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;let r=this.getOrCreateRenderer(t,e);return r instanceof oy?r.applyToHost(t):r instanceof Pg&&r.applyStyles(),r}getOrCreateRenderer(t,e){let r=this.rendererByCompId,a=r.get(e.id);if(!a){let c=this.doc,d=this.ngZone,u=this.eventManager,h=this.sharedStylesHost,f=this.removeStylesOnCompDestroy,v=this.platformIsServer,C=this.tracingService;switch(e.encapsulation){case tC.Emulated:a=new oy(u,h,e,this.appId,f,c,d,v,C);break;case tC.ShadowDom:return new IC(u,h,t,e,c,d,this.nonce,v,C);default:a=new Pg(u,h,e,f,c,d,v,C);break}r.set(e.id,a)}return a}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(e){return new(e||i)(kt(kC),kt(MC),kt(Pu),kt(OU),kt(Vi),kt(Fu),kt(Ri),kt(hg),kt(uk,8))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),Ag=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(n,t,e,r,a){this.eventManager=n,this.doc=t,this.ngZone=e,this.platformIsServer=r,this.tracingService=a}destroy(){}destroyNode=null;createElement(n,t){return t?this.doc.createElementNS(TC[t]||t,n):this.doc.createElement(n)}createComment(n){return this.doc.createComment(n)}createText(n){return this.doc.createTextNode(n)}appendChild(n,t){(g5(n)?n.content:n).appendChild(t)}insertBefore(n,t,e){n&&(g5(n)?n.content:n).insertBefore(t,e)}removeChild(n,t){t.remove()}selectRootElement(n,t){let e=typeof n=="string"?this.doc.querySelector(n):n;if(!e)throw new Hi(-5104,!1);return t||(e.textContent=""),e}parentNode(n){return n.parentNode}nextSibling(n){return n.nextSibling}setAttribute(n,t,e,r){if(r){t=r+":"+t;let a=TC[r];a?n.setAttributeNS(a,t,e):n.setAttribute(t,e)}else n.setAttribute(t,e)}removeAttribute(n,t,e){if(e){let r=TC[e];r?n.removeAttributeNS(r,t):n.removeAttribute(`${e}:${t}`)}else n.removeAttribute(t)}addClass(n,t){n.classList.add(t)}removeClass(n,t){n.classList.remove(t)}setStyle(n,t,e,r){r&(Ou.DashCase|Ou.Important)?n.style.setProperty(t,e,r&Ou.Important?"important":""):n.style[t]=e}removeStyle(n,t,e){e&Ou.DashCase?n.style.removeProperty(t):n.style[t]=""}setProperty(n,t,e){n!=null&&(n[t]=e)}setValue(n,t){n.nodeValue=t}listen(n,t,e,r){if(typeof n=="string"&&(n=Qs().getGlobalEventTarget(this.doc,n),!n))throw new Hi(5102,!1);let a=this.decoratePreventDefault(e);return this.tracingService?.wrapEventListener&&(a=this.tracingService.wrapEventListener(n,t,a)),this.eventManager.addEventListener(n,t,a,r)}decoratePreventDefault(n){return t=>{if(t==="__ngUnwrap__")return n;n(t)===!1&&t.preventDefault()}}};function g5(i){return i.tagName==="TEMPLATE"&&i.content!==void 0}var IC=class extends Ag{sharedStylesHost;hostEl;shadowRoot;constructor(n,t,e,r,a,c,d,u,h){super(n,a,c,u,h),this.sharedStylesHost=t,this.hostEl=e,this.shadowRoot=e.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let f=r.styles;f=_5(r.id,f);for(let C of f){let y=document.createElement("style");d&&y.setAttribute("nonce",d),y.textContent=C,this.shadowRoot.appendChild(y)}let v=r.getExternalStyles?.();if(v)for(let C of v){let y=DC(C,a);d&&y.setAttribute("nonce",d),this.shadowRoot.appendChild(y)}}nodeOrShadowRoot(n){return n===this.hostEl?this.shadowRoot:n}appendChild(n,t){return super.appendChild(this.nodeOrShadowRoot(n),t)}insertBefore(n,t,e){return super.insertBefore(this.nodeOrShadowRoot(n),t,e)}removeChild(n,t){return super.removeChild(null,t)}parentNode(n){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(n)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},Pg=class extends Ag{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(n,t,e,r,a,c,d,u,h){super(n,a,c,d,u),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=r;let f=e.styles;this.styles=h?_5(h,f):f,this.styleUrls=e.getExternalStyles?.(h)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},oy=class extends Pg{contentAttr;hostAttr;constructor(n,t,e,r,a,c,d,u,h){let f=r+"-"+e.id;super(n,t,e,a,c,d,u,h,f),this.contentAttr=NU(f),this.hostAttr=LU(f)}applyToHost(n){this.applyStyles(),this.setAttribute(n,this.hostAttr,"")}createElement(n,t){let e=super.createElement(n,t);return super.setAttribute(e,this.contentAttr,""),e}};var ly=class i extends xg{supportsDOMEvents=!0;static makeCurrent(){cC(new i)}onAndCancel(n,t,e,r){return n.addEventListener(t,e,r),()=>{n.removeEventListener(t,e,r)}}dispatchEvent(n,t){n.dispatchEvent(t)}remove(n){n.remove()}createElement(n,t){return t=t||this.getDefaultDocument(),t.createElement(n)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(n){return n.nodeType===Node.ELEMENT_NODE}isShadowRoot(n){return n instanceof DocumentFragment}getGlobalEventTarget(n,t){return t==="window"?window:t==="document"?n:t==="body"?n.body:null}getBaseHref(n){let t=BU();return t==null?null:VU(t)}resetBaseElement(){Fg=null}getUserAgent(){return window.navigator.userAgent}getCookie(n){return kg(document.cookie,n)}},Fg=null;function BU(){return Fg=Fg||document.head.querySelector("base"),Fg?Fg.getAttribute("href"):null}function VU(i){return new URL(i,document.baseURI).pathname}var cy=class{addToWindow(n){xd.getAngularTestability=(e,r=!0)=>{let a=n.findTestabilityInTree(e,r);if(a==null)throw new Hi(5103,!1);return a},xd.getAllAngularTestabilities=()=>n.getAllTestabilities(),xd.getAllAngularRootElements=()=>n.getAllRootElements();let t=e=>{let r=xd.getAllAngularTestabilities(),a=r.length,c=function(){a--,a==0&&e()};r.forEach(d=>{d.whenStable(c)})};xd.frameworkStabilizers||(xd.frameworkStabilizers=[]),xd.frameworkStabilizers.push(t)}findTestabilityInTree(n,t,e){if(t==null)return null;let r=n.getTestability(t);return r??(e?Qs().isShadowRoot(t)?this.findTestabilityInTree(n,t.host,!0):this.findTestabilityInTree(n,t.parentElement,!0):null)}},UU=(()=>{class i{build(){return new XMLHttpRequest}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),S5=(()=>{class i extends Mg{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,r,a){return t.addEventListener(e,r,a),()=>this.removeEventListener(t,e,r,a)}removeEventListener(t,e,r,a){return t.removeEventListener(e,r,a)}static \u0275fac=function(e){return new(e||i)(kt(Vi))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),y5=["alt","control","meta","shift"],jU={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},WU={alt:i=>i.altKey,control:i=>i.ctrlKey,meta:i=>i.metaKey,shift:i=>i.shiftKey},b5=(()=>{class i extends Mg{constructor(t){super(t)}supports(t){return i.parseEventName(t)!=null}addEventListener(t,e,r,a){let c=i.parseEventName(e),d=i.eventCallback(c.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Qs().onAndCancel(t,c.domEventName,d,a))}static parseEventName(t){let e=t.toLowerCase().split("."),r=e.shift();if(e.length===0||!(r==="keydown"||r==="keyup"))return null;let a=i._normalizeKey(e.pop()),c="",d=e.indexOf("code");if(d>-1&&(e.splice(d,1),c="code."),y5.forEach(h=>{let f=e.indexOf(h);f>-1&&(e.splice(f,1),c+=h+".")}),c+=a,e.length!=0||a.length===0)return null;let u={};return u.domEventName=r,u.fullKey=c,u}static matchEventFullKeyCode(t,e){let r=jU[t.key]||t.key,a="";return e.indexOf("code.")>-1&&(r=t.code,a="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),y5.forEach(c=>{if(c!==r){let d=WU[c];d(t)&&(a+=c+".")}}),a+=r,a===e)}static eventCallback(t,e,r){return a=>{i.matchEventFullKeyCode(a,t)&&r.runGuarded(()=>e(a))}}static _normalizeKey(t){return t==="esc"?"escape":t}static \u0275fac=function(e){return new(e||i)(kt(Vi))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();function HU(){ly.makeCurrent()}function GU(){return new Jx}function $U(){return Z3(document),document}var zU=[{provide:Fu,useValue:EC},{provide:Q3,useValue:HU,multi:!0},{provide:Vi,useFactory:$U}],PC=Ck(wk,"browser",zU);var YU=[{provide:V_,useClass:cy},{provide:pk,useClass:U_,deps:[Ri,nC,V_]},{provide:U_,useClass:U_,deps:[Ri,nC,V_]}],qU=[{provide:q3,useValue:"root"},{provide:Jx,useFactory:GU},{provide:sy,useClass:S5,multi:!0,deps:[Vi]},{provide:sy,useClass:b5,multi:!0,deps:[Vi]},Hu,MC,kC,{provide:Va,useExisting:Hu},{provide:Wu,useClass:UU},[]],Rg=(()=>{class i{constructor(){}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[...qU,...YU],imports:[xC,Tk]})}return i})();var Yp=class{},Og=class{},xe=class i{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(n){n?typeof n=="string"?this.lazyInit=()=>{this.headers=new Map,n.split(` 2`).forEach(t=>{let e=t.indexOf(":");if(e>0){let r=t.slice(0,e),a=t.slice(e+1).trim();this.addHeaderEntry(r,a)}})}:typeof Headers<"u"&&n instanceof Headers?(this.headers=new Map,n.forEach((t,e)=>{this.addHeaderEntry(e,t)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(n).forEach(([t,e])=>{this.setHeaderEntries(t,e)})}:this.headers=new Map}has(n){return this.init(),this.headers.has(n.toLowerCase())}get(n){this.init();let t=this.headers.get(n.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(n){return this.init(),this.headers.get(n.toLowerCase())||null}append(n,t){return this.clone({name:n,value:t,op:"a"})}set(n,t){return this.clone({name:n,value:t,op:"s"})}delete(n,t){return this.clone({name:n,value:t,op:"d"})}maybeSetNormalizedName(n,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,n)}init(){this.lazyInit&&(this.lazyInit instanceof i?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(n=>this.applyUpdate(n)),this.lazyUpdate=null))}copyFrom(n){n.init(),Array.from(n.headers.keys()).forEach(t=>{this.headers.set(t,n.headers.get(t)),this.normalizedNames.set(t,n.normalizedNames.get(t))})}clone(n){let t=new i;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof i?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([n]),t}applyUpdate(n){let t=n.name.toLowerCase();switch(n.op){case"a":case"s":let e=n.value;if(typeof e=="string"&&(e=[e]),e.length===0)return;this.maybeSetNormalizedName(n.name,t);let r=(n.op==="a"?this.headers.get(t):void 0)||[];r.push(...e),this.headers.set(t,r);break;case"d":let a=n.value;if(!a)this.headers.delete(t),this.normalizedNames.delete(t);else{let c=this.headers.get(t);if(!c)return;c=c.filter(d=>a.indexOf(d)===-1),c.length===0?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,c)}break}}addHeaderEntry(n,t){let e=n.toLowerCase();this.maybeSetNormalizedName(n,e),this.headers.has(e)?this.headers.get(e).push(t):this.headers.set(e,[t])}setHeaderEntries(n,t){let e=(Array.isArray(t)?t:[t]).map(a=>a.toString()),r=n.toLowerCase();this.headers.set(r,e),this.maybeSetNormalizedName(n,r)}forEach(n){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>n(this.normalizedNames.get(t),this.headers.get(t)))}};var my=class{encodeKey(n){return x5(n)}encodeValue(n){return x5(n)}decodeKey(n){return decodeURIComponent(n)}decodeValue(n){return decodeURIComponent(n)}};function KU(i,n){let t=new Map;return i.length>0&&i.replace(/^\?/,"").split("&").forEach(r=>{let a=r.indexOf("="),[c,d]=a==-1?[n.decodeKey(r),""]:[n.decodeKey(r.slice(0,a)),n.decodeValue(r.slice(a+1))],u=t.get(c)||[];u.push(d),t.set(c,u)}),t}var XU=/%(\d[a-f0-9])/gi,JU={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function x5(i){return encodeURIComponent(i).replace(XU,(n,t)=>JU[t]??n)}function dy(i){return`${i}`}var kd=class i{map;encoder;updates=null;cloneFrom=null;constructor(n={}){if(this.encoder=n.encoder||new my,n.fromString){if(n.fromObject)throw new Hi(2805,!1);this.map=KU(n.fromString,this.encoder)}else n.fromObject?(this.map=new Map,Object.keys(n.fromObject).forEach(t=>{let e=n.fromObject[t],r=Array.isArray(e)?e.map(dy):[dy(e)];this.map.set(t,r)})):this.map=null}has(n){return this.init(),this.map.has(n)}get(n){this.init();let t=this.map.get(n);return t?t[0]:null}getAll(n){return this.init(),this.map.get(n)||null}keys(){return this.init(),Array.from(this.map.keys())}append(n,t){return this.clone({param:n,value:t,op:"a"})}appendAll(n){let t=[];return Object.keys(n).forEach(e=>{let r=n[e];Array.isArray(r)?r.forEach(a=>{t.push({param:e,value:a,op:"a"})}):t.push({param:e,value:r,op:"a"})}),this.clone(t)}set(n,t){return this.clone({param:n,value:t,op:"s"})}delete(n,t){return this.clone({param:n,value:t,op:"d"})}toString(){return this.init(),this.keys().map(n=>{let t=this.encoder.encodeKey(n);return this.map.get(n).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).filter(n=>n!=="").join("&")}clone(n){let t=new i({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(n),t}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(n=>this.map.set(n,this.cloneFrom.map.get(n))),this.updates.forEach(n=>{switch(n.op){case"a":case"s":let t=(n.op==="a"?this.map.get(n.param):void 0)||[];t.push(dy(n.value)),this.map.set(n.param,t);break;case"d":if(n.value!==void 0){let e=this.map.get(n.param)||[],r=e.indexOf(dy(n.value));r!==-1&&e.splice(r,1),e.length>0?this.map.set(n.param,e):this.map.delete(n.param)}else{this.map.delete(n.param);break}}}),this.cloneFrom=this.updates=null)}};var uy=class{map=new Map;set(n,t){return this.map.set(n,t),this}get(n){return this.map.has(n)||this.map.set(n,n.defaultValue()),this.map.get(n)}delete(n){return this.map.delete(n),this}has(n){return this.map.has(n)}keys(){return this.map.keys()}};function ZU(i){switch(i){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function C5(i){return typeof ArrayBuffer<"u"&&i instanceof ArrayBuffer}function E5(i){return typeof Blob<"u"&&i instanceof Blob}function w5(i){return typeof FormData<"u"&&i instanceof FormData}function QU(i){return typeof URLSearchParams<"u"&&i instanceof URLSearchParams}var T5="Content-Type",D5="Accept",k5="X-Request-URL",M5="text/plain",A5="application/json",ej=`${A5}, ${M5}, */*`,$p=class i{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(n,t,e,r){this.url=t,this.method=n.toUpperCase();let a;if(ZU(this.method)||r?(this.body=e!==void 0?e:null,a=r):a=e,a){if(this.reportProgress=!!a.reportProgress,this.withCredentials=!!a.withCredentials,this.keepalive=!!a.keepalive,a.responseType&&(this.responseType=a.responseType),a.headers&&(this.headers=a.headers),a.context&&(this.context=a.context),a.params&&(this.params=a.params),a.priority&&(this.priority=a.priority),a.cache&&(this.cache=a.cache),a.credentials&&(this.credentials=a.credentials),typeof a.timeout=="number"){if(a.timeout<1||!Number.isInteger(a.timeout))throw new Error("");this.timeout=a.timeout}a.mode&&(this.mode=a.mode),a.redirect&&(this.redirect=a.redirect),this.transferCache=a.transferCache}if(this.headers??=new xe,this.context??=new uy,!this.params)this.params=new kd,this.urlWithParams=t;else{let c=this.params.toString();if(c.length===0)this.urlWithParams=t;else{let d=t.indexOf("?"),u=d===-1?"?":d<t.length-1?"&":"";this.urlWithParams=t+u+c}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||C5(this.body)||E5(this.body)||w5(this.body)||QU(this.body)?this.body:this.body instanceof kd?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||w5(this.body)?null:E5(this.body)?this.body.type||null:C5(this.body)?null:typeof this.body=="string"?M5:this.body instanceof kd?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?A5:null}clone(n={}){let t=n.method||this.method,e=n.url||this.url,r=n.responseType||this.responseType,a=n.keepalive??this.keepalive,c=n.priority||this.priority,d=n.cache||this.cache,u=n.mode||this.mode,h=n.redirect||this.redirect,f=n.credentials||this.credentials,v=n.transferCache??this.transferCache,C=n.timeout??this.timeout,y=n.body!==void 0?n.body:this.body,A=n.withCredentials??this.withCredentials,D=n.reportProgress??this.reportProgress,F=n.headers||this.headers,R=n.params||this.params,L=n.context??this.context;return n.setHeaders!==void 0&&(F=Object.keys(n.setHeaders).reduce((H,se)=>H.set(se,n.setHeaders[se]),F)),n.setParams&&(R=Object.keys(n.setParams).reduce((H,se)=>H.set(se,n.setParams[se]),R)),new i(t,e,y,{params:R,headers:F,context:L,reportProgress:D,responseType:r,withCredentials:A,transferCache:v,keepalive:a,cache:d,priority:c,timeout:C,mode:u,redirect:h,credentials:f})}},Gu=function(i){return i[i.Sent=0]="Sent",i[i.UploadProgress=1]="UploadProgress",i[i.ResponseHeader=2]="ResponseHeader",i[i.DownloadProgress=3]="DownloadProgress",i[i.Response=4]="Response",i[i.User=5]="User",i}(Gu||{}),qp=class{headers;status;statusText;url;ok;type;constructor(n,t=200,e="OK"){this.headers=n.headers||new xe,this.status=n.status!==void 0?n.status:t,this.statusText=n.statusText||e,this.url=n.url||null,this.ok=this.status>=200&&this.status<300}},py=class i extends qp{constructor(n={}){super(n)}type=Gu.ResponseHeader;clone(n={}){return new i({headers:n.headers||this.headers,status:n.status!==void 0?n.status:this.status,statusText:n.statusText||this.statusText,url:n.url||this.url||void 0})}},Ng=class i extends qp{body;constructor(n={}){super(n),this.body=n.body!==void 0?n.body:null}type=Gu.Response;clone(n={}){return new i({body:n.body!==void 0?n.body:this.body,headers:n.headers||this.headers,status:n.status!==void 0?n.status:this.status,statusText:n.statusText||this.statusText,url:n.url||this.url||void 0})}},zp=class extends qp{name="HttpErrorResponse";message;error;ok=!1;constructor(n){super(n,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${n.url||"(unknown url)"}`:this.message=`Http failure response for ${n.url||"(unknown url)"}: ${n.status} ${n.statusText}`,this.error=n.error||null}},tj=200,ij=204;function FC(i,n){return{body:n,headers:i.headers,context:i.context,observe:i.observe,params:i.params,reportProgress:i.reportProgress,responseType:i.responseType,withCredentials:i.withCredentials,transferCache:i.transferCache,keepalive:i.keepalive,priority:i.priority,cache:i.cache,mode:i.mode,redirect:i.redirect}}var Bi=(()=>{class i{handler;constructor(t){this.handler=t}request(t,e,r={}){let a;if(t instanceof $p)a=t;else{let u;r.headers instanceof xe?u=r.headers:u=new xe(r.headers);let h;r.params&&(r.params instanceof kd?h=r.params:h=new kd({fromObject:r.params})),a=new $p(t,e,r.body!==void 0?r.body:null,{headers:u,context:r.context,params:h,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials,transferCache:r.transferCache,keepalive:r.keepalive,priority:r.priority,cache:r.cache,mode:r.mode,redirect:r.redirect,credentials:r.credentials})}let c=Fi(a).pipe(bd(u=>this.handler.handle(u)));if(t instanceof $p||r.observe==="events")return c;let d=c.pipe(Vn(u=>u instanceof Ng));switch(r.observe||"body"){case"body":switch(a.responseType){case"arraybuffer":return d.pipe(Ki(u=>{if(u.body!==null&&!(u.body instanceof ArrayBuffer))throw new Hi(2806,!1);return u.body}));case"blob":return d.pipe(Ki(u=>{if(u.body!==null&&!(u.body instanceof Blob))throw new Hi(2807,!1);return u.body}));case"text":return d.pipe(Ki(u=>{if(u.body!==null&&typeof u.body!="string")throw new Hi(2808,!1);return u.body}));case"json":default:return d.pipe(Ki(u=>u.body))}case"response":return d;default:throw new Hi(2809,!1)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:new kd().append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,r={}){return this.request("PATCH",t,FC(r,e))}post(t,e,r={}){return this.request("POST",t,FC(r,e))}put(t,e,r={}){return this.request("PUT",t,FC(r,e))}static \u0275fac=function(e){return new(e||i)(kt(Yp))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();var nj=new Gt("");function P5(i,n){return n(i)}function rj(i,n){return(t,e)=>n.intercept(t,{handle:r=>i(r,e)})}function aj(i,n,t){return(e,r)=>fs(t,()=>n(e,a=>i(a,r)))}var fy=new Gt(""),OC=new Gt(""),F5=new Gt(""),NC=new Gt("",{providedIn:"root",factory:()=>!0});function oj(){let i=null;return(n,t)=>{i===null&&(i=(fe(fy,{optional:!0})??[]).reduceRight(rj,P5));let e=fe(Zx);if(fe(NC)){let a=e.add();return i(n,t).pipe(xl(a))}else return i(n,t)}}var hy=(()=>{class i extends Yp{backend;injector;chain=null;pendingTasks=fe(Zx);contributeToStability=fe(NC);constructor(t,e){super(),this.backend=t,this.injector=e}handle(t){if(this.chain===null){let e=Array.from(new Set([...this.injector.get(OC),...this.injector.get(F5,[])]));this.chain=e.reduceRight((r,a)=>aj(r,a,this.injector),P5)}if(this.contributeToStability){let e=this.pendingTasks.add();return this.chain(t,r=>this.backend.handle(r)).pipe(xl(e))}else return this.chain(t,e=>this.backend.handle(e))}static \u0275fac=function(e){return new(e||i)(kt(Og),kt(Go))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();var sj=/^\)\]\}',?\n/,lj=RegExp(`^${k5}:`,"m");function cj(i){return"responseURL"in i&&i.responseURL?i.responseURL:lj.test(i.getAllResponseHeaders())?i.getResponseHeader(k5):null}var RC=(()=>{class i{xhrFactory;constructor(t){this.xhrFactory=t}handle(t){if(t.method==="JSONP")throw new Hi(-2800,!1);let e=this.xhrFactory;return Fi(null).pipe(Tn(()=>new za(a=>{let c=e.build();if(c.open(t.method,t.urlWithParams),t.withCredentials&&(c.withCredentials=!0),t.headers.forEach((F,R)=>c.setRequestHeader(F,R.join(","))),t.headers.has(D5)||c.setRequestHeader(D5,ej),!t.headers.has(T5)){let F=t.detectContentTypeHeader();F!==null&&c.setRequestHeader(T5,F)}if(t.timeout&&(c.timeout=t.timeout),t.responseType){let F=t.responseType.toLowerCase();c.responseType=F!=="json"?F:"text"}let d=t.serializeBody(),u=null,h=()=>{if(u!==null)return u;let F=c.statusText||"OK",R=new xe(c.getAllResponseHeaders()),L=cj(c)||t.url;return u=new py({headers:R,status:c.status,statusText:F,url:L}),u},f=()=>{let{headers:F,status:R,statusText:L,url:H}=h(),se=null;R!==ij&&(se=typeof c.response>"u"?c.responseText:c.response),R===0&&(R=se?tj:0);let Ce=R>=200&&R<300;if(t.responseType==="json"&&typeof se=="string"){let Ue=se;se=se.replace(sj,"");try{se=se!==""?JSON.parse(se):null}catch(re){se=Ue,Ce&&(Ce=!1,se={error:re,text:se})}}Ce?(a.next(new Ng({body:se,headers:F,status:R,statusText:L,url:H||void 0})),a.complete()):a.error(new zp({error:se,headers:F,status:R,statusText:L,url:H||void 0}))},v=F=>{let{url:R}=h(),L=new zp({error:F,status:c.status||0,statusText:c.statusText||"Unknown Error",url:R||void 0});a.error(L)},C=v;t.timeout&&(C=F=>{let{url:R}=h(),L=new zp({error:new DOMException("Request timed out","TimeoutError"),status:c.status||0,statusText:c.statusText||"Request timeout",url:R||void 0});a.error(L)});let y=!1,A=F=>{y||(a.next(h()),y=!0);let R={type:Gu.DownloadProgress,loaded:F.loaded};F.lengthComputable&&(R.total=F.total),t.responseType==="text"&&c.responseText&&(R.partialText=c.responseText),a.next(R)},D=F=>{let R={type:Gu.UploadProgress,loaded:F.loaded};F.lengthComputable&&(R.total=F.total),a.next(R)};return c.addEventListener("load",f),c.addEventListener("error",v),c.addEventListener("timeout",C),c.addEventListener("abort",v),t.reportProgress&&(c.addEventListener("progress",A),d!==null&&c.upload&&c.upload.addEventListener("progress",D)),c.send(d),a.next({type:Gu.Sent}),()=>{c.removeEventListener("error",v),c.removeEventListener("abort",v),c.removeEventListener("load",f),c.removeEventListener("timeout",C),t.reportProgress&&(c.removeEventListener("progress",A),d!==null&&c.upload&&c.upload.removeEventListener("progress",D)),c.readyState!==c.DONE&&c.abort()}})))}static \u0275fac=function(e){return new(e||i)(kt(Wu))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),R5=new Gt(""),dj="XSRF-TOKEN",mj=new Gt("",{providedIn:"root",factory:()=>dj}),uj="X-XSRF-TOKEN",pj=new Gt("",{providedIn:"root",factory:()=>uj}),Lg=class{},hj=(()=>{class i{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(t,e){this.doc=t,this.cookieName=e}getToken(){let t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=kg(t,this.cookieName),this.lastCookieString=t),this.lastToken}static \u0275fac=function(e){return new(e||i)(kt(Vi),kt(mj))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();function fj(i,n){let t=i.url.toLowerCase();if(!fe(R5)||i.method==="GET"||i.method==="HEAD"||t.startsWith("http://")||t.startsWith("https://"))return n(i);let e=fe(Lg).getToken(),r=fe(pj);return e!=null&&!i.headers.has(r)&&(i=i.clone({headers:i.headers.set(r,e)})),n(i)}var LC=function(i){return i[i.Interceptors=0]="Interceptors",i[i.LegacyInterceptors=1]="LegacyInterceptors",i[i.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",i[i.NoXsrfProtection=3]="NoXsrfProtection",i[i.JsonpSupport=4]="JsonpSupport",i[i.RequestsMadeViaParent=5]="RequestsMadeViaParent",i[i.Fetch=6]="Fetch",i}(LC||{});function gj(i,n){return{\u0275kind:i,\u0275providers:n}}function BC(...i){let n=[Bi,RC,hy,{provide:Yp,useExisting:hy},{provide:Og,useFactory:()=>fe(nj,{optional:!0})??fe(RC)},{provide:OC,useValue:fj,multi:!0},{provide:R5,useValue:!0},{provide:Lg,useClass:hj}];for(let t of i)n.push(...t.\u0275providers);return Cd(n)}var I5=new Gt("");function VC(){return gj(LC.LegacyInterceptors,[{provide:I5,useFactory:oj},{provide:OC,useExisting:I5,multi:!0}])}var O5=(()=>{class i{_doc;constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}static \u0275fac=function(e){return new(e||i)(kt(Vi))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $u=(()=>
2{class i{static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:function(e){let r=null;return e?r=new(e||i):r=kt(_j),r},providedIn:"root"})}return i})(),_j=(()=>{class i extends $u{_doc;constructor(t){super(),this._doc=t}sanitize(t,e){if(e==null)return null;switch(t){case wd.NONE:return e;case wd.HTML:return Wp(e,"HTML")?Ru(e):ok(this._doc,String(e)).toString();case wd.STYLE:return Wp(e,"Style")?Ru(e):e;case wd.SCRIPT:if(Wp(e,"Script"))return Ru(e);throw new Hi(5200,!1);case wd.URL:return Wp(e,"URL")?Ru(e):ak(String(e));case wd.RESOURCE_URL:if(Wp(e,"ResourceURL"))return Ru(e);throw new Hi(5201,!1);default:throw new Hi(5202,!1)}}bypassSecurityTrustHtml(t){return ek(t)}bypassSecurityTrustStyle(t){return tk(t)}bypassSecurityTrustScript(t){return ik(t)}bypassSecurityTrustUrl(t){return nk(t)}bypassSecurityTrustResourceUrl(t){return rk(t)}static \u0275fac=function(e){return new(e||i)(kt(Vi))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var yn="primary",Jg=Symbol("RouteTitle"),GC=class{params;constructor(n){this.params=n||{}}has(n){return Object.prototype.hasOwnProperty.call(this.params,n)}get(n){if(this.has(n)){let t=this.params[n];return Array.isArray(t)?t[0]:t}return null}getAll(n){if(this.has(n)){let t=this.params[n];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}};function qu(i){return new GC(i)}function H5(i,n,t){let e=t.path.split("/");if(e.length>i.length||t.pathMatch==="full"&&(n.hasChildren()||e.length<i.length))return null;let r={};for(let a=0;a<e.length;a++){let c=e[a],d=i[a];if(c[0]===":")r[c.substring(1)]=d;else if(c!==d.path)return null}return{consumed:i.slice(0,e.length),posParams:r}}function yj(i,n){if(i.length!==n.length)return!1;for(let t=0;t<i.length;++t)if(!Bc(i[t],n[t]))return!1;return!0}function Bc(i,n){let t=i?$C(i):void 0,e=n?$C(n):void 0;if(!t||!e||t.length!=e.length)return!1;let r;for(let a=0;a<t.length;a++)if(r=t[a],!G5(i[r],n[r]))return!1;return!0}function $C(i){return[...Object.keys(i),...Object.getOwnPropertySymbols(i)]}function G5(i,n){if(Array.isArray(i)&&Array.isArray(n)){if(i.length!==n.length)return!1;let t=[...i].sort(),e=[...n].sort();return t.every((r,a)=>e[a]===r)}else return i===n}function $5(i){return i.length>0?i[i.length-1]:null}function Ad(i){return Gx(i)?i:gg(i)?Na(Promise.resolve(i)):Fi(i)}var Sj={exact:Y5,subset:q5},z5={exact:bj,subset:xj,ignored:()=>!0};function N5(i,n,t){return Sj[t.paths](i.root,n.root,t.matrixParams)&&z5[t.queryParams](i.queryParams,n.queryParams)&&!(t.fragment==="exact"&&i.fragment!==n.fragment)}function bj(i,n){return Bc(i,n)}function Y5(i,n,t){if(!zu(i.segments,n.segments)||!_y(i.segments,n.segments,t)||i.numberOfChildren!==n.numberOfChildren)return!1;for(let e in n.children)if(!i.children[e]||!Y5(i.children[e],n.children[e],t))return!1;return!0}function xj(i,n){return Object.keys(n).length<=Object.keys(i).length&&Object.keys(n).every(t=>G5(i[t],n[t]))}function q5(i,n,t){return K5(i,n,n.segments,t)}function K5(i,n,t,e){if(i.segments.length>t.length){let r=i.segments.slice(0,t.length);return!(!zu(r,t)||n.hasChildren()||!_y(r,t,e))}else if(i.segments.length===t.length){if(!zu(i.segments,t)||!_y(i.segments,t,e))return!1;for(let r in n.children)if(!i.children[r]||!q5(i.children[r],n.children[r],e))return!1;return!0}else{let r=t.slice(0,i.segments.length),a=t.slice(i.segments.length);return!zu(i.segments,r)||!_y(i.segments,r,e)||!i.children[yn]?!1:K5(i.children[yn],n,a,e)}}function _y(i,n,t){return n.every((e,r)=>z5[t](i[r].parameters,e.parameters))}var Uc=class{root;queryParams;fragment;_queryParamMap;constructor(n=new Xn([],{}),t={},e=null){this.root=n,this.queryParams=t,this.fragment=e}get queryParamMap(){return this._queryParamMap??=qu(this.queryParams),this._queryParamMap}toString(){return wj.serialize(this)}},Xn=class{segments;children;parent=null;constructor(n,t){this.segments=n,this.children=t,Object.values(t).forEach(e=>e.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return yy(this)}},Em=class{path;parameters;_parameterMap;constructor(n,t){this.path=n,this.parameters=t}get parameterMap(){return this._parameterMap??=qu(this.parameters),this._parameterMap}toString(){return J5(this)}};function Cj(i,n){return zu(i,n)&&i.every((t,e)=>Bc(t.parameters,n[e].parameters))}function zu(i,n){return i.length!==n.length?!1:i.every((t,e)=>t.path===n[e].path)}function Ej(i,n){let t=[];
2return Object.entries(i.children).forEach(([e,r])=>{e===yn&&(t=t.concat(n(r,e)))}),Object.entries(i.children).forEach(([e,r])=>{e!==yn&&(t=t.concat(n(r,e)))}),t}var Ku=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>new wm,providedIn:"root"})}return i})(),wm=class{parse(n){let t=new YC(n);return new Uc(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(n){let t=`/${Vg(n.root,!0)}`,e=Ij(n.queryParams),r=typeof n.fragment=="string"?`#${Tj(n.fragment)}`:"";return`${t}${e}${r}`}},wj=new wm;function yy(i){return i.segments.map(n=>J5(n)).join("/")}function Vg(i,n){if(!i.hasChildren())return yy(i);if(n){let t=i.children[yn]?Vg(i.children[yn],!1):"",e=[];return Object.entries(i.children).forEach(([r,a])=>{r!==yn&&e.push(`${r}:${Vg(a,!1)}`)}),e.length>0?`${t}(${e.join("//")})`:t}else{let t=Ej(i,(e,r)=>r===yn?[Vg(i.children[yn],!1)]:[`${r}:${Vg(e,!1)}`]);return Object.keys(i.children).length===1&&i.children[yn]!=null?`${yy(i)}/${t[0]}`:`${yy(i)}/(${t.join("//")})`}}function X5(i){return encodeURIComponent(i).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function gy(i){return X5(i).replace(/%3B/gi,";")}function Tj(i){return encodeURI(i)}function zC(i){return X5(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Sy(i){return decodeURIComponent(i)}function L5(i){return Sy(i.replace(/\+/g,"%20"))}function J5(i){return`${zC(i.path)}${Dj(i.parameters)}`}function Dj(i){return Object.entries(i).map(([n,t])=>`;${zC(n)}=${zC(t)}`).join("")}function Ij(i){let n=Object.entries(i).map(([t,e])=>Array.isArray(e)?e.map(r=>`${gy(t)}=${gy(r)}`).join("&"):`${gy(t)}=${gy(e)}`).filter(t=>t);return n.length?`?${n.join("&")}`:""}var kj=/^[^\/()?;#]+/;function UC(i){let n=i.match(kj);return n?n[0]:""}var Mj=/^[^\/()?;=#]+/;function Aj(i){let n=i.match(Mj);return n?n[0]:""}var Pj=/^[^=?&#]+/;function Fj(i){let n=i.match(Pj);return n?n[0]:""}var Rj=/^[^&#]+/;function Oj(i){let n=i.match(Rj);return n?n[0]:""}var YC=class{url;remaining;constructor(n){this.url=n,this.remaining=n}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new Xn([],{}):new Xn([],this.parseChildren())}parseQueryParams(){let n={};if(this.consumeOptional("?"))do this.parseQueryParam(n);while(this.consumeOptional("&"));return n}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let n=[];for(this.peekStartsWith("(")||n.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),n.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let e={};return this.peekStartsWith("(")&&(e=this.parseParens(!1)),(n.length>0||Object.keys(t).length>0)&&(e[yn]=new Xn(n,t)),e}parseSegment(){let n=UC(this.remaining);if(n===""&&this.peekStartsWith(";"))throw new Hi(4009,!1);return this.capture(n),new Em(Sy(n),this.parseMatrixParams())}parseMatrixParams(){let n={};for(;this.consumeOptional(";");)this.parseParam(n);return n}parseParam(n){let t=Aj(this.remaining);if(!t)return;this.capture(t);let e="";if(this.consumeOptional("=")){let r=UC(this.remaining);r&&(e=r,this.capture(e))}n[Sy(t)]=Sy(e)}parseQueryParam(n){let t=Fj(this.remaining);if(!t)return;this.capture(t);let e="";if(this.consumeOptional("=")){let c=Oj(this.remaining);c&&(e=c,this.capture(e))}let r=L5(t),a=L5(e);if(n.hasOwnProperty(r)){let c=n[r];Array.isArray(c)||(c=[c],n[r]=c),c.push(a)}else n[r]=a}parseParens(n){let t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let e=UC(this.remaining),r=this.remaining[e.length];if(r!=="/"&&r!==")"&&r!==";")throw new Hi(4010,!1);let a;e.indexOf(":")>-1?(a=e.slice(0,e.indexOf(":")),this.capture(a),this.capture(":")):n&&(a=yn);let c=this.parseChildren();t[a]=Object.keys(c).length===1?c[yn]:new Xn([],c),this.consumeOptional("//")}return t}peekStartsWith(n){return this.remaining.startsWith(n)}consumeOptional(n){return this.peekStartsWith(n)?(this.remaining=this.remaining.substring(n.length),!0):!1}capture(n){if(!this.consumeOptional(n))throw new Hi(4011,!1)}};function Z5(i){return i.segments.length>0?new Xn([],{[yn]:i}):i}function Q5(i){let n={};for(let[e,r]of Object.entries(i.children)){let a=Q5(r);if(e===yn&&a.segments.length===0&&a.hasChildren())for(let[c,d]of Object.entries(a.children))n[c]=d;else(a.segments.length>0||a.hasChildren())&&(n[e]=a)}let t=new Xn(i.segments,n);return Nj(t)}function Nj(i){if(i.numberOfChildren===1&&i.children[yn]){let n=i.children[yn];return new Xn(i.segments.concat(n.segments),n.children)}return i}function Tm(i){return i instanceof Uc}function e4(i,n,t=null,e=null){let r=t4(i);return i4(r,n,t,e)}function t4(i){let n;function t(a){let c={};for(let u of a.children){let h=t(u);c[u.outlet]=h}let d=new Xn(a.url,c);return a===i&&(n=d),d}let e=t(i.root),r=Z5(e);return n??r}function i4(i,n,t,e){let r=i;for(;r.parent;)r=r.parent;if(n.length===0)return jC(r,r,r,t,e);let a=Lj(n);if(a.toRoot())return jC(r,r,new Xn([],{}),t,e);let c=Bj(a,r,i),d=c.processChildren?jg(c.segmentGroup,c.index,a.commands):r4(c.segmentGroup,c.index,a.commands);return jC(r,c.segmentGroup,d,t,e)}function by(i){return typeof i=="object"&&i!=null&&!i.outlets&&!i.segmentPath}function Hg(i){return typeof i=="object"&&i!=null&&i.outlets}function jC(i,n,t,e,r){let a={};e&&Object.entries(e).forEach(([u,h])=>{a[u]=Array.isArray(h)?h.map(f=>`${f}`):`${h}`});let c;i===n?c=t:c=n4(i,n,t);let d=Z5(Q5(c));return new Uc(d,a,r)}function n4(i,n,t){let e={};
2return Object.entries(i.children).forEach(([r,a])=>{a===n?e[r]=t:e[r]=n4(a,n,t)}),new Xn(i.segments,e)}var xy=class{isAbsolute;numberOfDoubleDots;commands;constructor(n,t,e){if(this.isAbsolute=n,this.numberOfDoubleDots=t,this.commands=e,n&&e.length>0&&by(e[0]))throw new Hi(4003,!1);let r=e.find(Hg);if(r&&r!==$5(e))throw new Hi(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function Lj(i){if(typeof i[0]=="string"&&i.length===1&&i[0]==="/")return new xy(!0,0,i);let n=0,t=!1,e=i.reduce((r,a,c)=>{if(typeof a=="object"&&a!=null){if(a.outlets){let d={};return Object.entries(a.outlets).forEach(([u,h])=>{d[u]=typeof h=="string"?h.split("/"):h}),[...r,{outlets:d}]}if(a.segmentPath)return[...r,a.segmentPath]}return typeof a!="string"?[...r,a]:c===0?(a.split("/").forEach((d,u)=>{u==0&&d==="."||(u==0&&d===""?t=!0:d===".."?n++:d!=""&&r.push(d))}),r):[...r,a]},[]);return new xy(t,n,e)}var Jp=class{segmentGroup;processChildren;index;constructor(n,t,e){this.segmentGroup=n,this.processChildren=t,this.index=e}};function Bj(i,n,t){if(i.isAbsolute)return new Jp(n,!0,0);if(!t)return new Jp(n,!1,NaN);if(t.parent===null)return new Jp(t,!0,0);let e=by(i.commands[0])?0:1,r=t.segments.length-1+e;return Vj(t,r,i.numberOfDoubleDots)}function Vj(i,n,t){let e=i,r=n,a=t;for(;a>r;){if(a-=r,e=e.parent,!e)throw new Hi(4005,!1);r=e.segments.length}return new Jp(e,!1,r-a)}function Uj(i){return Hg(i[0])?i[0].outlets:{[yn]:i}}function r4(i,n,t){if(i??=new Xn([],{}),i.segments.length===0&&i.hasChildren())return jg(i,n,t);let e=jj(i,n,t),r=t.slice(e.commandIndex);if(e.match&&e.pathIndex<i.segments.length){let a=new Xn(i.segments.slice(0,e.pathIndex),{});return a.children[yn]=new Xn(i.segments.slice(e.pathIndex),i.children),jg(a,0,r)}else return e.match&&r.length===0?new Xn(i.segments,{}):e.match&&!i.hasChildren()?qC(i,n,t):e.match?jg(i,0,r):qC(i,n,t)}function jg(i,n,t){if(t.length===0)return new Xn(i.segments,{});{let e=Uj(t),r={};if(Object.keys(e).some(a=>a!==yn)&&i.children[yn]&&i.numberOfChildren===1&&i.children[yn].segments.length===0){let a=jg(i.children[yn],n,t);return new Xn(i.segments,a.children)}return Object.entries(e).forEach(([a,c])=>{typeof c=="string"&&(c=[c]),c!==null&&(r[a]=r4(i.children[a],n,c))}),Object.entries(i.children).forEach(([a,c])=>{e[a]===void 0&&(r[a]=c)}),new Xn(i.segments,r)}}function jj(i,n,t){let e=0,r=n,a={match:!1,pathIndex:0,commandIndex:0};for(;r<i.segments.length;){if(e>=t.length)return a;let c=i.segments[r],d=t[e];if(Hg(d))break;let u=`${d}`,h=e<t.length-1?t[e+1]:null;if(r>0&&u===void 0)break;if(u&&h&&typeof h=="object"&&h.outlets===void 0){if(!V5(u,h,c))return a;e+=2}else{if(!V5(u,{},c))return a;e++}r++}return{match:!0,pathIndex:r,commandIndex:e}}function qC(i,n,t){let e=i.segments.slice(0,n),r=0;for(;r<t.length;){let a=t[r];if(Hg(a)){let u=Wj(a.outlets);return new Xn(e,u)}if(r===0&&by(t[0])){let u=i.segments[n];e.push(new Em(u.path,B5(t[0]))),r++;continue}let c=Hg(a)?a.outlets[yn]:`${a}`,d=r<t.length-1?t[r+1]:null;c&&d&&by(d)?(e.push(new Em(c,B5(d))),r+=2):(e.push(new Em(c,{})),r++)}return new Xn(e,{})}function Wj(i){let n={};return Object.entries(i).forEach(([t,e])=>{typeof e=="string"&&(e=[e]),e!==null&&(n[t]=qC(new Xn([],{}),0,e))}),n}function B5(i){let n={};return Object.entries(i).forEach(([t,e])=>n[t]=`${e}`),n}function V5(i,n,t){return i==t.path&&Bc(n,t.parameters)}var Zp="imperative",Ua=function(i){return i[i.NavigationStart=0]="NavigationStart",i[i.NavigationEnd=1]="NavigationEnd",i[i.NavigationCancel=2]="NavigationCancel",i[i.NavigationError=3]="NavigationError",i[i.RoutesRecognized=4]="RoutesRecognized",i[i.ResolveStart=5]="ResolveStart",i[i.ResolveEnd=6]="ResolveEnd",i[i.GuardsCheckStart=7]="GuardsCheckStart",i[i.GuardsCheckEnd=8]="GuardsCheckEnd",i[i.RouteConfigLoadStart=9]="RouteConfigLoadStart",i[i.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",i[i.ChildActivationStart=11]="ChildActivationStart",i[i.ChildActivationEnd=12]="ChildActivationEnd",i[i.ActivationStart=13]="ActivationStart",i[i.ActivationEnd=14]="ActivationEnd",i[i.Scroll=15]="Scroll",i[i.NavigationSkipped=16]="NavigationSkipped",i}(Ua||{}),tl=class{id;url;constructor(n,t){this.id=n,this.url=t}},Dm=class extends tl{type=Ua.NavigationStart;navigationTrigger;restoredState;constructor(n,t,e="imperative",r=null){super(n,t),this.navigationTrigger=e,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},Yo=class extends tl{urlAfterRedirects;type=Ua.NavigationEnd;constructor(n,t,e){super(n,t),this.urlAfterRedirects=e}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},zo=function(i){return i[i.Redirect=0]="Redirect",i[i.SupersededByNewNavigation=1]="SupersededByNewNavigation",i[i.NoDataFromRe
2solver=2]="NoDataFromResolver",i[i.GuardRejected=3]="GuardRejected",i[i.Aborted=4]="Aborted",i}(zo||{}),eh=function(i){return i[i.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",i[i.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",i}(eh||{}),Vc=class extends tl{reason;code;type=Ua.NavigationCancel;constructor(n,t,e,r){super(n,t),this.reason=e,this.code=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},jc=class extends tl{reason;code;type=Ua.NavigationSkipped;constructor(n,t,e,r){super(n,t),this.reason=e,this.code=r}},th=class extends tl{error;target;type=Ua.NavigationError;constructor(n,t,e,r){super(n,t),this.error=e,this.target=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},Gg=class extends tl{urlAfterRedirects;state;type=Ua.RoutesRecognized;constructor(n,t,e,r){super(n,t),this.urlAfterRedirects=e,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Cy=class extends tl{urlAfterRedirects;state;type=Ua.GuardsCheckStart;constructor(n,t,e,r){super(n,t),this.urlAfterRedirects=e,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ey=class extends tl{urlAfterRedirects;state;shouldActivate;type=Ua.GuardsCheckEnd;constructor(n,t,e,r,a){super(n,t),this.urlAfterRedirects=e,this.state=r,this.shouldActivate=a}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},wy=class extends tl{urlAfterRedirects;state;type=Ua.ResolveStart;constructor(n,t,e,r){super(n,t),this.urlAfterRedirects=e,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ty=class extends tl{urlAfterRedirects;state;type=Ua.ResolveEnd;constructor(n,t,e,r){super(n,t),this.urlAfterRedirects=e,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Dy=class{route;type=Ua.RouteConfigLoadStart;constructor(n){this.route=n}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Iy=class{route;type=Ua.RouteConfigLoadEnd;constructor(n){this.route=n}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},ky=class{snapshot;type=Ua.ChildActivationStart;constructor(n){this.snapshot=n}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},My=class{snapshot;type=Ua.ChildActivationEnd;constructor(n){this.snapshot=n}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Ay=class{snapshot;type=Ua.ActivationStart;constructor(n){this.snapshot=n}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Py=class{snapshot;type=Ua.ActivationEnd;constructor(n){this.snapshot=n}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},ih=class{routerEvent;position;anchor;type=Ua.Scroll;constructor(n,t,e){this.routerEvent=n,this.position=t,this.anchor=e}toString(){let n=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${n}')`}},$g=class{},nh=class{url;navigationBehaviorOptions;constructor(n,t){this.url=n,this.navigationBehaviorOptions=t}};function Hj(i){return!(i instanceof $g)&&!(i instanceof nh)}function Gj(i,n){return i.providers&&!i._injector&&(i._injector=B_(i.providers,n,`Route: ${i.path}`)),i._injector??n}function ic(i){return i.outlet||yn}function $j(i,n){let t=i.filter(e=>ic(e)===n);return t.push(...i.filter(e=>ic(e)!==n)),t}function oh(i){if(!i)return null;if(i.routeConfig?._injector)return i.routeConfig._injector;for(let n=i.parent;n;n=n.parent){let t=n.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}var Fy=class{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return oh(this.route?.snapshot)??this.rootInjector}constructor(n){this.rootInjector=n,this.children=new Xu(this.rootInjector)}},Xu=(()=>{class i{rootInjector;contexts=new Map;constructor(t){this.rootInjector=t}onChildOutletCreated(t,e){let r=this.getOrCreateContext(t);r.outlet=e,this.contexts.set(t,r)}onChildOutletDestroyed(t){let e=this.getContext(t);e&&(e.outlet=null,e.attachRef=null)}onOutletDeactivated(){let t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new Fy(this.rootInjector),this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}static \u0275fac=function(e){return new(e||i)(kt(Go))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Ry=class{_root;constructor(n){this._root=n}get root(){return this._root.value}
2parent(n){let t=this.pathFromRoot(n);return t.length>1?t[t.length-2]:null}children(n){let t=KC(n,this._root);return t?t.children.map(e=>e.value):[]}firstChild(n){let t=KC(n,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(n){let t=XC(n,this._root);return t.length<2?[]:t[t.length-2].children.map(r=>r.value).filter(r=>r!==n)}pathFromRoot(n){return XC(n,this._root).map(t=>t.value)}};function KC(i,n){if(i===n.value)return n;for(let t of n.children){let e=KC(i,t);if(e)return e}return null}function XC(i,n){if(i===n.value)return[n];for(let t of n.children){let e=XC(i,t);if(e.length)return e.unshift(n),e}return[]}var el=class{value;children;constructor(n,t){this.value=n,this.children=t}toString(){return`TreeNode(${this.value})`}};function Xp(i){let n={};return i&&i.children.forEach(t=>n[t.value.outlet]=t),n}var zg=class extends Ry{snapshot;constructor(n,t){super(n),this.snapshot=t,rE(this,n)}toString(){return this.snapshot.toString()}};function a4(i){let n=zj(i),t=new da([new Em("",{})]),e=new da({}),r=new da({}),a=new da({}),c=new da(""),d=new Md(t,e,a,c,r,yn,i,n.root);return d.snapshot=n.root,new zg(new el(d,[]),n)}function zj(i){let n={},t={},e={},r="",a=new Yu([],n,e,r,t,yn,i,null,{});return new Yg("",new el(a,[]))}var Md=class{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(n,t,e,r,a,c,d,u){this.urlSubject=n,this.paramsSubject=t,this.queryParamsSubject=e,this.fragmentSubject=r,this.dataSubject=a,this.outlet=c,this.component=d,this._futureSnapshot=u,this.title=this.dataSubject?.pipe(Ki(h=>h[Jg]))??Fi(void 0),this.url=n,this.params=t,this.queryParams=e,this.fragment=r,this.data=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(Ki(n=>qu(n))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ki(n=>qu(n))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function Oy(i,n,t="emptyOnly"){let e,{routeConfig:r}=i;return n!==null&&(t==="always"||r?.path===""||!n.component&&!n.routeConfig?.loadComponent)?e={params:le(le({},n.params),i.params),data:le(le({},n.data),i.data),resolve:le(le(le(le({},i.data),n.data),r?.data),i._resolvedData)}:e={params:le({},i.params),data:le({},i.data),resolve:le(le({},i.data),i._resolvedData??{})},r&&s4(r)&&(e.resolve[Jg]=r.title),e}var Yu=class{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[Jg]}constructor(n,t,e,r,a,c,d,u,h){this.url=n,this.params=t,this.queryParams=e,this.fragment=r,this.data=a,this.outlet=c,this.component=d,this.routeConfig=u,this._resolve=h}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=qu(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=qu(this.queryParams),this._queryParamMap}toString(){let n=this.url.map(e=>e.toString()).join("/"),t=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${n}', path:'${t}')`}},Yg=class extends Ry{url;constructor(n,t){super(t),this.url=n,rE(this,t)}toString(){return o4(this._root)}};function rE(i,n){n.value._routerState=i,n.children.forEach(t=>rE(i,t))}function o4(i){let n=i.children.length>0?` { ${i.children.map(o4).join(", ")} } `:"";return`${i.value}${n}`}function WC(i){if(i.snapshot){let n=i.snapshot,t=i._futureSnapshot;i.snapshot=t,Bc(n.queryParams,t.queryParams)||i.queryParamsSubject.next(t.queryParams),n.fragment!==t.fragment&&i.fragmentSubject.next(t.fragment),Bc(n.params,t.params)||i.paramsSubject.next(t.params),yj(n.url,t.url)||i.urlSubject.next(t.url),Bc(n.data,t.data)||i.dataSubject.next(t.data)}else i.snapshot=i._futureSnapshot,i.dataSubject.next(i._futureSnapshot.data)}function JC(i,n){let t=Bc(i.params,n.params)&&Cj(i.url,n.url),e=!i.parent!=!n.parent;return t&&!e&&(!i.parent||JC(i.parent,n.parent))}function s4(i){return typeof i.title=="string"||i.title===null}var l4=new Gt(""),Zg=(()=>{class i{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=yn;activateEvents=new xn;deactivateEvents=new xn;attachEvents=new xn;detachEvents=new xn;routerOutletData=sC(void 0);parentContexts=fe(Xu);location=fe(Ks);changeDetector=fe(Kn);inputBinder=fe(Qg,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(t){if(t.name){let{firstChange:e,previousValue:r}=t.name;if(e)return;this.isTrackedInParentContexts(r)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(r)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Hi(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Hi(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Hi(4012,!1);this.location.detach();let t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){let t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Hi(4013,!1);this._activatedRoute=t;let r=this.location,c=t.snapshot.component,d=this.parentContexts.getOrCreateContext(this.name).children,u=new ZC(t,d,r.injector,this.routerOutletData);this.activated=r.createComponent(c,{index:r.length,injector:u,environmentInjector:e}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"}
2,exportAs:["outlet"],features:[kn]})}return i})(),ZC=class{route;childContexts;parent;outletData;constructor(n,t,e,r){this.route=n,this.childContexts=t,this.parent=e,this.outletData=r}get(n,t){return n===Md?this.route:n===Xu?this.childContexts:n===l4?this.outletData:this.parent.get(n,t)}},Qg=new Gt(""),aE=(()=>{class i{outletDataSubscriptions=new Map;bindActivatedRouteToOutletComponent(t){this.unsubscribeFromRouteData(t),this.subscribeToRouteData(t)}unsubscribeFromRouteData(t){this.outletDataSubscriptions.get(t)?.unsubscribe(),this.outletDataSubscriptions.delete(t)}subscribeToRouteData(t){let{activatedRoute:e}=t,r=Up([e.queryParams,e.params,e.data]).pipe(Tn(([a,c,d],u)=>(d=le(le(le({},a),c),d),u===0?Fi(d):Promise.resolve(d)))).subscribe(a=>{if(!t.isActivated||!t.activatedComponentRef||t.activatedRoute!==e||e.component===null){this.unsubscribeFromRouteData(t);return}let c=Ik(e.component);if(!c){this.unsubscribeFromRouteData(t);return}for(let{templateName:d}of c.inputs)t.activatedComponentRef.setInput(d,a[d])});this.outletDataSubscriptions.set(t,r)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),oE=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(e,r){e&1&&B(0,"router-outlet")},dependencies:[Zg],encapsulation:2})}return i})();function sE(i){let n=i.children&&i.children.map(sE),t=n?tt(le({},i),{children:n}):le({},i);return!t.component&&!t.loadComponent&&(n||t.loadChildren)&&t.outlet&&t.outlet!==yn&&(t.component=oE),t}function Yj(i,n,t){let e=qg(i,n._root,t?t._root:void 0);return new zg(e,n)}function qg(i,n,t){if(t&&i.shouldReuseRoute(n.value,t.value.snapshot)){let e=t.value;e._futureSnapshot=n.value;let r=qj(i,n,t);return new el(e,r)}else{if(i.shouldAttach(n.value)){let a=i.retrieve(n.value);if(a!==null){let c=a.route;return c.value._futureSnapshot=n.value,c.children=n.children.map(d=>qg(i,d)),c}}let e=Kj(n.value),r=n.children.map(a=>qg(i,a));return new el(e,r)}}function qj(i,n,t){return n.children.map(e=>{for(let r of t.children)if(i.shouldReuseRoute(e.value,r.value.snapshot))return qg(i,e,r);return qg(i,e)})}function Kj(i){return new Md(new da(i.url),new da(i.params),new da(i.queryParams),new da(i.fragment),new da(i.data),i.outlet,i.component,i)}var rh=class{redirectTo;navigationBehaviorOptions;constructor(n,t){this.redirectTo=n,this.navigationBehaviorOptions=t}},c4="ngNavigationCancelingError";function Ny(i,n){let{redirectTo:t,navigationBehaviorOptions:e}=Tm(n)?{redirectTo:n,navigationBehaviorOptions:void 0}:n,r=d4(!1,zo.Redirect);return r.url=t,r.navigationBehaviorOptions=e,r}function d4(i,n){let t=new Error(`NavigationCancelingError: ${i||""}`);return t[c4]=!0,t.cancellationCode=n,t}function Xj(i){return m4(i)&&Tm(i.url)}function m4(i){return!!i&&i[c4]}var Jj=(i,n,t,e)=>Ki(r=>(new QC(n,r.targetRouterState,r.currentRouterState,t,e).activate(i),r)),QC=class{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(n,t,e,r,a){this.routeReuseStrategy=n,this.futureState=t,this.currState=e,this.forwardEvent=r,this.inputBindingEnabled=a}activate(n){let t=this.futureState._root,e=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,e,n),WC(this.futureState.root),this.activateChildRoutes(t,e,n)}deactivateChildRoutes(n,t,e){let r=Xp(t);n.children.forEach(a=>{let c=a.value.outlet;this.deactivateRoutes(a,r[c],e),delete r[c]}),Object.values(r).forEach(a=>{this.deactivateRouteAndItsChildren(a,e)})}deactivateRoutes(n,t,e){let r=n.value,a=t?t.value:null;if(r===a)if(r.component){let c=e.getContext(r.outlet);c&&this.deactivateChildRoutes(n,t,c.children)}else this.deactivateChildRoutes(n,t,e);else a&&this.deactivateRouteAndItsChildren(t,e)}deactivateRouteAndItsChildren(n,t){n.value.component&&this.routeReuseStrategy.shouldDetach(n.value.snapshot)?this.detachAndStoreRouteSubtree(n,t):this.deactivateRouteAndOutlet(n,t)}detachAndStoreRouteSubtree(n,t){let e=t.getContext(n.value.outlet),r=e&&n.value.component?e.children:t,a=Xp(n);for(let c of Object.values(a))this.deactivateRouteAndItsChildren(c,r);if(e&&e.outlet){let c=e.outlet.detach(),d=e.children.onOutletDeactivated();this.routeReuseStrategy.store(n.value.snapshot,{componentRef:c,route:n,contexts:d})}}deactivateRouteAndOutlet(n,t){let e=t.getContext(n.value.outlet),r=e&&n.value.component?e.children:t,a=Xp(n);for(let c of Object.values(a))this.deactivateRouteAndItsChildren(c,r);e&&(e.outlet&&(e.outlet.deactivate(),e.children.onOutletDeactivated()),e.attachRef=null,e.route=null)}activateChildRoutes(n,t,e){let r=Xp(t);
2n.children.forEach(a=>{this.activateRoutes(a,r[a.value.outlet],e),this.forwardEvent(new Py(a.value.snapshot))}),n.children.length&&this.forwardEvent(new My(n.value.snapshot))}activateRoutes(n,t,e){let r=n.value,a=t?t.value:null;if(WC(r),r===a)if(r.component){let c=e.getOrCreateContext(r.outlet);this.activateChildRoutes(n,t,c.children)}else this.activateChildRoutes(n,t,e);else if(r.component){let c=e.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){let d=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),c.children.onOutletReAttached(d.contexts),c.attachRef=d.componentRef,c.route=d.route.value,c.outlet&&c.outlet.attach(d.componentRef,d.route.value),WC(d.route.value),this.activateChildRoutes(n,null,c.children)}else c.attachRef=null,c.route=r,c.outlet&&c.outlet.activateWith(r,c.injector),this.activateChildRoutes(n,null,c.children)}else this.activateChildRoutes(n,null,e)}},Ly=class{path;route;constructor(n){this.path=n,this.route=this.path[this.path.length-1]}},Qp=class{component;route;constructor(n,t){this.component=n,this.route=t}};function Zj(i,n,t){let e=i._root,r=n?n._root:null;return Ug(e,r,t,[e.value])}function Qj(i){let n=i.routeConfig?i.routeConfig.canActivateChild:null;return!n||n.length===0?null:{node:i,guards:n}}function sh(i,n){let t=Symbol(),e=n.get(i,t);return e===t?typeof i=="function"&&!Y3(i)?i:n.get(i):e}function Ug(i,n,t,e,r={canDeactivateChecks:[],canActivateChecks:[]}){let a=Xp(n);return i.children.forEach(c=>{eW(c,a[c.value.outlet],t,e.concat([c.value]),r),delete a[c.value.outlet]}),Object.entries(a).forEach(([c,d])=>Wg(d,t.getContext(c),r)),r}function eW(i,n,t,e,r={canDeactivateChecks:[],canActivateChecks:[]}){let a=i.value,c=n?n.value:null,d=t?t.getContext(i.value.outlet):null;if(c&&a.routeConfig===c.routeConfig){let u=tW(c,a,a.routeConfig.runGuardsAndResolvers);u?r.canActivateChecks.push(new Ly(e)):(a.data=c.data,a._resolvedData=c._resolvedData),a.component?Ug(i,n,d?d.children:null,e,r):Ug(i,n,t,e,r),u&&d&&d.outlet&&d.outlet.isActivated&&r.canDeactivateChecks.push(new Qp(d.outlet.component,c))}else c&&Wg(n,d,r),r.canActivateChecks.push(new Ly(e)),a.component?Ug(i,null,d?d.children:null,e,r):Ug(i,null,t,e,r);return r}function tW(i,n,t){if(typeof t=="function")return t(i,n);switch(t){case"pathParamsChange":return!zu(i.url,n.url);case"pathParamsOrQueryParamsChange":return!zu(i.url,n.url)||!Bc(i.queryParams,n.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!JC(i,n)||!Bc(i.queryParams,n.queryParams);case"paramsChange":default:return!JC(i,n)}}function Wg(i,n,t){let e=Xp(i),r=i.value;Object.entries(e).forEach(([a,c])=>{r.component?n?Wg(c,n.children.getContext(a),t):Wg(c,null,t):Wg(c,n,t)}),r.component?n&&n.outlet&&n.outlet.isActivated?t.canDeactivateChecks.push(new Qp(n.outlet.component,r)):t.canDeactivateChecks.push(new Qp(null,r)):t.canDeactivateChecks.push(new Qp(null,r))}function e1(i){return typeof i=="function"}function iW(i){return typeof i=="boolean"}function nW(i){return i&&e1(i.canLoad)}function rW(i){return i&&e1(i.canActivate)}function aW(i){return i&&e1(i.canActivateChild)}function oW(i){return i&&e1(i.canDeactivate)}function sW(i){return i&&e1(i.canMatch)}function u4(i){return i instanceof H3||i?.name==="EmptyError"}var vy=Symbol("INITIAL_VALUE");function ah(){return Tn(i=>Up(i.map(n=>n.pipe(xo(1),hs(vy)))).pipe(Ki(n=>{for(let t of n)if(t!==!0){if(t===vy)return vy;if(t===!1||lW(t))return t}return!0}),Vn(n=>n!==vy),xo(1)))}function lW(i){return Tm(i)||i instanceof rh}function cW(i,n){return ps(t=>{let{targetSnapshot:e,currentSnapshot:r,guards:{canActivateChecks:a,canDeactivateChecks:c}}=t;return c.length===0&&a.length===0?Fi(tt(le({},t),{guardsResult:!0})):dW(c,e,r,i).pipe(ps(d=>d&&iW(d)?mW(e,a,i,n):Fi(d)),Ki(d=>tt(le({},t),{guardsResult:d})))})}function dW(i,n,t,e){return Na(i).pipe(ps(r=>gW(r.component,r.route,t,n,e)),bm(r=>r!==!0,!0))}function mW(i,n,t,e){return Na(n).pipe(bd(r=>M_(pW(r.route.parent,e),uW(r.route,e),fW(i,r.path,t),hW(i,r.route,t))),bm(r=>r!==!0,!0))}function uW(i,n){return i!==null&&n&&n(new Ay(i)),Fi(!0)}function pW(i,n){return i!==null&&n&&n(new ky(i)),Fi(!0)}
2function hW(i,n,t){let e=n.routeConfig?n.routeConfig.canActivate:null;if(!e||e.length===0)return Fi(!0);let r=e.map(a=>Pc(()=>{let c=oh(n)??t,d=sh(a,c),u=rW(d)?d.canActivate(n,i):fs(c,()=>d(n,i));return Ad(u).pipe(bm())}));return Fi(r).pipe(ah())}function fW(i,n,t){let e=n[n.length-1],a=n.slice(0,n.length-1).reverse().map(c=>Qj(c)).filter(c=>c!==null).map(c=>Pc(()=>{let d=c.guards.map(u=>{let h=oh(c.node)??t,f=sh(u,h),v=aW(f)?f.canActivateChild(e,i):fs(h,()=>f(e,i));return Ad(v).pipe(bm())});return Fi(d).pipe(ah())}));return Fi(a).pipe(ah())}function gW(i,n,t,e,r){let a=n&&n.routeConfig?n.routeConfig.canDeactivate:null;if(!a||a.length===0)return Fi(!0);let c=a.map(d=>{let u=oh(n)??r,h=sh(d,u),f=oW(h)?h.canDeactivate(i,n,t,e):fs(u,()=>h(i,n,t,e));return Ad(f).pipe(bm())});return Fi(c).pipe(ah())}function vW(i,n,t,e){let r=n.canLoad;if(r===void 0||r.length===0)return Fi(!0);let a=r.map(c=>{let d=sh(c,i),u=nW(d)?d.canLoad(n,t):fs(i,()=>d(n,t));return Ad(u)});return Fi(a).pipe(ah(),p4(e))}function p4(i){return U3(La(n=>{if(typeof n!="boolean")throw Ny(i,n)}),Ki(n=>n===!0))}function _W(i,n,t,e){let r=n.canMatch;if(!r||r.length===0)return Fi(!0);let a=r.map(c=>{let d=sh(c,i),u=sW(d)?d.canMatch(n,t):fs(i,()=>d(n,t));return Ad(u)});return Fi(a).pipe(ah(),p4(e))}var Kg=class{segmentGroup;constructor(n){this.segmentGroup=n||null}},Xg=class extends Error{urlTree;constructor(n){super(),this.urlTree=n}};function Kp(i){return fr(new Kg(i))}function yW(i){return fr(new Hi(4e3,!1))}function SW(i){return fr(d4(!1,zo.GuardRejected))}var eE=class{urlSerializer;urlTree;constructor(n,t){this.urlSerializer=n,this.urlTree=t}lineralizeSegments(n,t){let e=[],r=t.root;for(;;){if(e=e.concat(r.segments),r.numberOfChildren===0)return Fi(e);if(r.numberOfChildren>1||!r.children[yn])return yW(`${n.redirectTo}`);r=r.children[yn]}}applyRedirectCommands(n,t,e,r,a){return bW(t,r,a).pipe(Ki(c=>{if(c instanceof Uc)throw new Xg(c);let d=this.applyRedirectCreateUrlTree(c,this.urlSerializer.parse(c),n,e);if(c[0]==="/")throw new Xg(d);return d}))}applyRedirectCreateUrlTree(n,t,e,r){let a=this.createSegmentGroup(n,t.root,e,r);return new Uc(a,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(n,t){let e={};return Object.entries(n).forEach(([r,a])=>{if(typeof a=="string"&&a[0]===":"){let d=a.substring(1);e[r]=t[d]}else e[r]=a}),e}createSegmentGroup(n,t,e,r){let a=this.createSegments(n,t.segments,e,r),c={};return Object.entries(t.children).forEach(([d,u])=>{c[d]=this.createSegmentGroup(n,u,e,r)}),new Xn(a,c)}createSegments(n,t,e,r){return t.map(a=>a.path[0]===":"?this.findPosParam(n,a,r):this.findOrReturn(a,e))}findPosParam(n,t,e){let r=e[t.path.substring(1)];if(!r)throw new Hi(4001,!1);return r}findOrReturn(n,t){let e=0;for(let r of t){if(r.path===n.path)return t.splice(e),r;e++}return n}};function bW(i,n,t){if(typeof i=="string")return Fi(i);let e=i,{queryParams:r,fragment:a,routeConfig:c,url:d,outlet:u,params:h,data:f,title:v}=n;return Ad(fs(t,()=>e({params:h,data:f,queryParams:r,fragment:a,routeConfig:c,url:d,outlet:u,title:v})))}var tE={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function xW(i,n,t,e,r){let a=h4(i,n,t);return a.matched?(e=Gj(n,e),_W(e,n,t,r).pipe(Ki(c=>c===!0?a:le({},tE)))):Fi(a)}function h4(i,n,t){if(n.path==="**")return CW(t);if(n.path==="")return n.pathMatch==="full"&&(i.hasChildren()||t.length>0)?le({},tE):{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};let r=(n.matcher||H5)(t,i,n);if(!r)return le({},tE);let a={};Object.entries(r.posParams??{}).forEach(([d,u])=>{a[d]=u.path});let c=r.consumed.length>0?le(le({},a),r.consumed[r.consumed.length-1].parameters):a;return{matched:!0,consumedSegments:r.consumed,remainingSegments:t.slice(r.consumed.length),parameters:c,positionalParamSegments:r.posParams??{}}}function CW(i){return{matched:!0,parameters:i.length>0?$5(i).parameters:{},consumedSegments:i,remainingSegments:[],positionalParamSegments:{}}}function U5(i,n,t,e){return t.length>0&&TW(i,t,e)?{segmentGroup:new Xn(n,wW(e,new Xn(t,i.children))),slicedSegments:[]}:t.length===0&&DW(i,t,e)?{segmentGroup:new Xn(i.segments,EW(i,t,e,i.children)),slicedSegments:t}:{segmentGroup:new Xn(i.segments,i.children),slicedSegments:t}}function EW(i,n,t,e){let r={};for(let a of t)if(Vy(i,n,a)&&!e[ic(a)]){let c=new Xn([],{});r[ic(a)]=c}return le(le({},e),r)}function wW(i,n){let t={};t[yn]=n;for(let e of i)if(e.path===""&&ic(e)!==yn){let r=new Xn([],{});
2t[ic(e)]=r}return t}function TW(i,n,t){return t.some(e=>Vy(i,n,e)&&ic(e)!==yn)}function DW(i,n,t){return t.some(e=>Vy(i,n,e))}function Vy(i,n,t){return(i.hasChildren()||n.length>0)&&t.pathMatch==="full"?!1:t.path===""}function IW(i,n,t){return n.length===0&&!i.children[t]}var iE=class{};function kW(i,n,t,e,r,a,c="emptyOnly"){return new nE(i,n,t,e,r,c,a).recognize()}var MW=31,nE=class{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(n,t,e,r,a,c,d){this.injector=n,this.configLoader=t,this.rootComponentType=e,this.config=r,this.urlTree=a,this.paramsInheritanceStrategy=c,this.urlSerializer=d,this.applyRedirects=new eE(this.urlSerializer,this.urlTree)}noMatchError(n){return new Hi(4002,`'${n.segmentGroup}'`)}recognize(){let n=U5(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(n).pipe(Ki(({children:t,rootSnapshot:e})=>{let r=new el(e,t),a=new Yg("",r),c=e4(e,[],this.urlTree.queryParams,this.urlTree.fragment);return c.queryParams=this.urlTree.queryParams,a.url=this.urlSerializer.serialize(c),{state:a,tree:c}}))}match(n){let t=new Yu([],Object.freeze({}),Object.freeze(le({},this.urlTree.queryParams)),this.urlTree.fragment,Object.freeze({}),yn,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,n,yn,t).pipe(Ki(e=>({children:e,rootSnapshot:t})),Fn(e=>{if(e instanceof Xg)return this.urlTree=e.urlTree,this.match(e.urlTree.root);throw e instanceof Kg?this.noMatchError(e):e}))}processSegmentGroup(n,t,e,r,a){return e.segments.length===0&&e.hasChildren()?this.processChildren(n,t,e,a):this.processSegment(n,t,e,e.segments,r,!0,a).pipe(Ki(c=>c instanceof el?[c]:[]))}processChildren(n,t,e,r){let a=[];for(let c of Object.keys(e.children))c==="primary"?a.unshift(c):a.push(c);return Na(a).pipe(bd(c=>{let d=e.children[c],u=$j(t,c);return this.processSegmentGroup(n,u,d,c,r)}),$3((c,d)=>(c.push(...d),c)),zx(null),G3(),ps(c=>{if(c===null)return Kp(e);let d=f4(c);return AW(d),Fi(d)}))}processSegment(n,t,e,r,a,c,d){return Na(t).pipe(bd(u=>this.processSegmentAgainstRoute(u._injector??n,t,u,e,r,a,c,d).pipe(Fn(h=>{if(h instanceof Kg)return Fi(null);throw h}))),bm(u=>!!u),Fn(u=>{if(u4(u))return IW(e,r,a)?Fi(new iE):Kp(e);throw u}))}processSegmentAgainstRoute(n,t,e,r,a,c,d,u){return ic(e)!==c&&(c===yn||!Vy(r,a,e))?Kp(r):e.redirectTo===void 0?this.matchSegmentAgainstRoute(n,r,e,a,c,u):this.allowRedirects&&d?this.expandSegmentAgainstRouteUsingRedirect(n,r,t,e,a,c,u):Kp(r)}expandSegmentAgainstRouteUsingRedirect(n,t,e,r,a,c,d){let{matched:u,parameters:h,consumedSegments:f,positionalParamSegments:v,remainingSegments:C}=h4(t,r,a);if(!u)return Kp(t);typeof r.redirectTo=="string"&&r.redirectTo[0]==="/"&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>MW&&(this.allowRedirects=!1));let y=new Yu(a,h,Object.freeze(le({},this.urlTree.queryParams)),this.urlTree.fragment,j5(r),ic(r),r.component??r._loadedComponent??null,r,W5(r)),A=Oy(y,d,this.paramsInheritanceStrategy);return y.params=Object.freeze(A.params),y.data=Object.freeze(A.data),this.applyRedirects.applyRedirectCommands(f,r.redirectTo,v,y,n).pipe(Tn(F=>this.applyRedirects.lineralizeSegments(r,F)),ps(F=>this.processSegment(n,e,t,F.concat(C),c,!1,d)))}matchSegmentAgainstRoute(n,t,e,r,a,c){let d=xW(t,e,r,n,this.urlSerializer);return e.path==="**"&&(t.children={}),d.pipe(Tn(u=>u.matched?(n=e._injector??n,this.getChildConfig(n,e,r).pipe(Tn(({routes:h})=>{let f=e._loadedInjector??n,{parameters:v,consumedSegments:C,remainingSegments:y}=u,A=new Yu(C,v,Object.freeze(le({},this.urlTree.queryParams)),this.urlTree.fragment,j5(e),ic(e),e.component??e._loadedComponent??null,e,W5(e)),D=Oy(A,c,this.paramsInheritanceStrategy);A.params=Object.freeze(D.params),A.data=Object.freeze(D.data);let{segmentGroup:F,slicedSegments:R}=U5(t,C,y,h);if(R.length===0&&F.hasChildren())return this.processChildren(f,h,F,A).pipe(Ki(H=>new el(A,H)));if(h.length===0&&R.length===0)return Fi(new el(A,[]));let L=ic(e)===a;return this.processSegment(f,h,F,R,L?yn:a,!0,A).pipe(Ki(H=>new el(A,H instanceof el?[H]:[])))}))):Kp(t)))}getChildConfig(n,t,e){return t.children?Fi({routes:t.children,injector:n}):t.loadChildren?t._loadedRoutes!==void 0?Fi({routes:t._loadedRoutes,injector:t._loadedInjector}):vW(n,t,e,this.urlSerializer).pipe(ps(r=>r?this.configLoader.loadChildren(n,t).pipe(La(a=>{t._loadedRoutes=a.routes,t._loadedInjector=a.injector})):SW(t))):Fi({routes:[],injector:n})}};function AW(i){i.sort((n,t)=>n.value.outlet===yn?-1:t.value.outlet===yn?1:n.value.outlet.localeCompare(t.value.outlet))}function PW(i){let n=i.value.routeConfig;return n&&n.path===""}function f4(i){let n=[],t=new Set;for(let e of i){if(!PW(e)){n.push(e);continue}let r=n.find(a=>e.value.routeConfig===a.value.routeConfig);r!==void 0?(r.children.push(...e.children),t.add(r)):n.push(e)}for(let e of t){let r=f4(e.children);n.push(new el(e.value,r))}return n.filter(e=>!t.has(e))}function j5(i){return i.data||{}}function W5(i){return i.resolve||{}}function FW(i,n,t,e,r,a){return ps(c=>kW(i,n,t,e,c.extractedUrl,r,a).pipe(Ki(({state:d,tree:u})=>tt(le({},c),{targetSnapshot:d,urlAfterRedirects:u}))))}function RW(i,n){return ps(t=>{let{targetSnapshot:e,guards:{canActivateChecks:r}}=t;if(!r.length)return Fi(t);let a=new Set(r.map(u=>u.route)),c=new Set;for(let u of a)if(!c.has(u))for(let h of g4(u))c.add(h);let d=0;return Na(c).pipe(bd(u=>a.has(u)?OW(u,e,i,n):(u.data=Oy(u,u.parent,i).resolve,Fi(void 0))),La(()=>d++),qx(1),ps(u=>d===c.size?Fi(t):Xl))})}function g4(i){let n=i.children.map(t=>g4(t)).flat();return[i,...n]}function OW(i,n,t,e){let r=i.routeConfig,a=i._resolve;return r?.title!==void 0&&!s4(r)&&(a[Jg]=r.title),Pc(()=>(i.data=Oy(i,i.parent,t).resolve,NW(a,i,n,e).pipe(Ki(c=>(i._resolvedData=c,i.data=le(le({},i.data),c),null)))))}function NW(i,n,t,e){let r=$C(i);if(r.length===0)return Fi({});let a={};return Na(r).pipe(ps(c=>LW(i[c],n,t,e).pipe(bm(),La(d=>{if(d instanceof rh)throw Ny(new wm,d);a[c]=d}))),qx(1),Ki(()=>a),Fn(c=>u4(c)?Xl:fr(c)))}function LW(i,n,t,e){let r=oh(n)??e,a=sh(i,r),c=a.resolve?a.resolve(n,t):fs(r,()=>a(n,t));return Ad(c)}function HC(i){return Tn(n=>{let t=i(n);return t?Na(t).pipe(Ki(()=>n)):Fi(n)})}var lE=(()=>{class i{buildTitle(t){let e,r=t.root;for(;r!==void 0;)e=this.getResolvedTitleForRoute(r)??e,r=r.children.find(a=>a.outlet===yn);return e}getResolvedTitleForRoute(t){return t.data[Jg]}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>fe(v4),providedIn:"root"})}return i})(),v4=(()=>{class i extends lE{title;constructor(t){super(),this.title=t}updateTitle(t){let e=this.buildTitle(t);e!==void 0&&this.title.setTitle(e)}static \u0275fac=function(e){return new(e||i)(kt(O5))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Im=new Gt("",{providedIn:"root",factory:()=>({})}),lh=new Gt(""),Uy=(()=>{class i{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=fe(bk);loadComponent(t,e){if(this.componentLoaders.get(e))return this.componentLoaders.get(e);if(e._loadedComponent)return Fi(e._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(e);let r=Ad(fs(t,()=>e.loadComponent())).pipe(Ki(y4),La(c=>{this.onLoadEndListener&&this.onLoadEndListener(e),e._loadedComponent=c}),xl(()=>{this.componentLoaders.delete(e)})),a=new Wx(r,()=>new ci).pipe(jx());return this.componentLoaders.set(e,a),a}loadChildren(t,e){if(this.childrenLoaders.get(e))return this.childrenLoaders.get(e);if(e._loadedRoutes)return Fi({routes:e._loadedRoutes,injector:e._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(e);let a=_4(e,this.compiler,t,this.onLoadEndListener).pipe(xl(()=>{this.childrenLoaders.delete(e)})),c=new Wx(a,()=>new ci).pipe(jx());return this.childrenLoaders.set(e,c),c}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function _4(i,n,t,e){return Ad(fs(t,()=>i.loadChildren())).pipe(Ki(y4),ps(r=>r instanceof dk||Array.isArray(r)?Fi(r):Na(n.compileModuleAsync(r))),Ki(r=>{e&&e(i);let a,c,d=!1;return Array.isArray(r)?(c=r,d=!0):(a=r.create(t).injector,c=a.get(lh,[],{optional:!0,self:!0}).flat()),{routes:c.map(sE),injector:a}}))}function BW(i){return i&&typeof i=="object"&&"default"in i}function y4(i){return BW(i)?i.default:i}var jy=(()=>
2{class i{static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>fe(VW),providedIn:"root"})}return i})(),VW=(()=>{class i{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),cE=new Gt(""),dE=new Gt("");function S4(i,n,t){let e=i.get(dE),r=i.get(Vi);if(!r.startViewTransition||e.skipNextTransition)return e.skipNextTransition=!1,new Promise(h=>setTimeout(h));let a,c=new Promise(h=>{a=h}),d=r.startViewTransition(()=>(a(),UW(i)));d.ready.catch(h=>{});let{onViewTransitionCreated:u}=e;return u&&fs(i,()=>u({transition:d,from:n,to:t})),c}function UW(i){return new Promise(n=>{$o({read:()=>setTimeout(n)},{injector:i})})}var mE=new Gt(""),Wy=(()=>{class i{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new ci;transitionAbortWithErrorSubject=new ci;configLoader=fe(Uy);environmentInjector=fe(Go);destroyRef=fe(Mu);urlSerializer=fe(Ku);rootContexts=fe(Xu);location=fe(Nc);inputBindingEnabled=fe(Qg,{optional:!0})!==null;titleStrategy=fe(lE);options=fe(Im,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=fe(jy);createViewTransition=fe(cE,{optional:!0});navigationErrorHandler=fe(mE,{optional:!0});navigationId=0;get hasRequestedNavigation(){return this.navigationId!==0}transitions;afterPreactivation=()=>Fi(void 0);rootComponentType=null;destroyed=!1;constructor(){let t=r=>this.events.next(new Dy(r)),e=r=>this.events.next(new Iy(r));this.configLoader.onLoadEndListener=e,this.configLoader.onLoadStartListener=t,this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(t){let e=++this.navigationId;this.transitions?.next(tt(le({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,abortController:new AbortController,id:e}))}setupNavigations(t){return this.transitions=new da(null),this.transitions.pipe(Vn(e=>e!==null),Tn(e=>{let r=!1;return Fi(e).pipe(Tn(a=>{if(this.navigationId>e.id)return this.cancelNavigationTransition(e,"",zo.SupersededByNewNavigation),Xl;this.currentTransition=e,this.currentNavigation={id:a.id,initialUrl:a.rawUrl,extractedUrl:a.extractedUrl,targetBrowserUrl:typeof a.extras.browserUrl=="string"?this.urlSerializer.parse(a.extras.browserUrl):a.extras.browserUrl,trigger:a.source,extras:a.extras,previousNavigation:this.lastSuccessfulNavigation?tt(le({},this.lastSuccessfulNavigation),{previousNavigation:null}):null,abort:()=>a.abortController.abort()};let c=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),d=a.extras.onSameUrlNavigation??t.onSameUrlNavigation;if(!c&&d!=="reload"){let u="";return this.events.next(new jc(a.id,this.urlSerializer.serialize(a.rawUrl),u,eh.IgnoredSameUrlNavigation)),a.resolve(!1),Xl}if(this.urlHandlingStrategy.shouldProcessUrl(a.rawUrl))return Fi(a).pipe(Tn(u=>(this.events.next(new Dm(u.id,this.urlSerializer.serialize(u.extractedUrl),u.source,u.restoredState)),u.id!==this.navigationId?Xl:Promise.resolve(u))),FW(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),La(u=>{e.targetSnapshot=u.targetSnapshot,e.urlAfterRedirects=u.urlAfterRedirects,this.currentNavigation=tt(le({},this.currentNavigation),{finalUrl:u.urlAfterRedirects});let h=new Gg(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(h)}));if(c&&this.urlHandlingStrategy.shouldProcessUrl(a.currentRawUrl)){let{id:u,extractedUrl:h,source:f,restoredState:v,extras:C}=a,y=new Dm(u,this.urlSerializer.serialize(h),f,v);this.events.next(y);let A=a4(this.rootComponentType).snapshot;return this.currentTransition=e=tt(le({},a),{targetSnapshot:A,urlAfterRedirects:h,extras:tt(le({},C),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=h,Fi(e)}else{let u="";return this.events.next(new jc(a.id,this.urlSerializer.serialize(a.extractedUrl),u,eh.IgnoredByUrlHandlingStrategy)),a.resolve(!1),Xl}}),La(a=>{let c=new Cy(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(c)}),Ki(a=>(this.currentTransition=e=tt(le({},a),{guards:Zj(a.targetSnapshot,a.currentSnapshot,this.rootContexts)}),e)),cW(this.environmentInjector,a=>this.events.next(a)),La(a=>{if(e.guardsResult=a.guardsResult,a.guardsResult&&typeof a.guardsResult!="boolean")throw Ny(this.urlSerializer,a.guardsResult);let c=new Ey(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot,!!a.guardsResult);this.events.next(c)}),Vn(a=>a.guardsResult?!0:(this.cancelNavigationTransition(a,"",zo.GuardRejected),!1)),HC(a=>
2{if(a.guards.canActivateChecks.length!==0)return Fi(a).pipe(La(c=>{let d=new wy(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(d)}),Tn(c=>{let d=!1;return Fi(c).pipe(RW(this.paramsInheritanceStrategy,this.environmentInjector),La({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(c,"",zo.NoDataFromResolver)}}))}),La(c=>{let d=new Ty(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(d)}))}),HC(a=>{let c=d=>{let u=[];if(d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent){let h=oh(d)??this.environmentInjector;u.push(this.configLoader.loadComponent(h,d.routeConfig).pipe(La(f=>{d.component=f}),Ki(()=>{})))}for(let h of d.children)u.push(...c(h));return u};return Up(c(a.targetSnapshot.root)).pipe(zx(null),xo(1))}),HC(()=>this.afterPreactivation()),Tn(()=>{let{currentSnapshot:a,targetSnapshot:c}=e,d=this.createViewTransition?.(this.environmentInjector,a.root,c.root);return d?Na(d).pipe(Ki(()=>e)):Fi(e)}),Ki(a=>{let c=Yj(t.routeReuseStrategy,a.targetSnapshot,a.currentRouterState);return this.currentTransition=e=tt(le({},a),{targetRouterState:c}),this.currentNavigation.targetRouterState=c,e}),La(()=>{this.events.next(new $g)}),Jj(this.rootContexts,t.routeReuseStrategy,a=>this.events.next(a),this.inputBindingEnabled),xo(1),gr(new za(a=>{let c=e.abortController.signal,d=()=>a.next();return c.addEventListener("abort",d),()=>c.removeEventListener("abort",d)}).pipe(Vn(()=>!r&&!e.targetRouterState),La(()=>{this.cancelNavigationTransition(e,e.abortController.signal.reason+"",zo.Aborted)}))),La({next:a=>{r=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Yo(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects))),this.titleStrategy?.updateTitle(a.targetRouterState.snapshot),a.resolve(!0)},complete:()=>{r=!0}}),gr(this.transitionAbortWithErrorSubject.pipe(La(a=>{throw a}))),xl(()=>{r||this.cancelNavigationTransition(e,"",zo.SupersededByNewNavigation),this.currentTransition?.id===e.id&&(this.currentNavigation=null,this.currentTransition=null)}),Fn(a=>{if(this.destroyed)return e.resolve(!1),Xl;if(r=!0,m4(a))this.events.next(new Vc(e.id,this.urlSerializer.serialize(e.extractedUrl),a.message,a.cancellationCode)),Xj(a)?this.events.next(new nh(a.url,a.navigationBehaviorOptions)):e.resolve(!1);else{let c=new th(e.id,this.urlSerializer.serialize(e.extractedUrl),a,e.targetSnapshot??void 0);try{let d=fs(this.environmentInjector,()=>this.navigationErrorHandler?.(c));if(d instanceof rh){let{message:u,cancellationCode:h}=Ny(this.urlSerializer,d);this.events.next(new Vc(e.id,this.urlSerializer.serialize(e.extractedUrl),u,h)),this.events.next(new nh(d.redirectTo,d.navigationBehaviorOptions))}else throw this.events.next(c),a}catch(d){this.options.resolveNavigationPromiseOnError?e.resolve(!1):e.reject(d)}}return Xl}))}))}cancelNavigationTransition(t,e,r){let a=new Vc(t.id,this.urlSerializer.serialize(t.extractedUrl),e,r);this.events.next(a),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){let t=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),e=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return t.toString()!==e?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function jW(i){return i!==Zp}var b4=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>fe(WW),providedIn:"root"})}return i})(),By=class{shouldDetach(n){return!1}store(n,t){}shouldAttach(n){return!1}retrieve(n){return null}shouldReuseRoute(n,t){return n.routeConfig===t.routeConfig}},WW=(()=>{class i extends By{static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),x4=(()=>
2{class i{urlSerializer=fe(Ku);options=fe(Im,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=fe(Nc);urlHandlingStrategy=fe(jy);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new Uc;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:t,initialUrl:e,targetBrowserUrl:r}){let a=t!==void 0?this.urlHandlingStrategy.merge(t,e):e,c=r??a;return c instanceof Uc?this.urlSerializer.serialize(c):c}commitTransition({targetRouterState:t,finalUrl:e,initialUrl:r}){e&&t?(this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(e,r),this.routerState=t):this.rawUrlTree=r}routerState=a4(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:t}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t??this.rawUrlTree)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:()=>fe(HW),providedIn:"root"})}return i})(),HW=(()=>{class i extends x4{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(e=>{e.type==="popstate"&&setTimeout(()=>{t(e.url,e.state,"popstate")})})}handleRouterEvent(t,e){t instanceof Dm?this.updateStateMemento():t instanceof jc?this.commitTransition(e):t instanceof Gg?this.urlUpdateStrategy==="eager"&&(e.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(e),e)):t instanceof $g?(this.commitTransition(e),this.urlUpdateStrategy==="deferred"&&!e.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(e),e)):t instanceof Vc&&t.code!==zo.SupersededByNewNavigation&&t.code!==zo.Redirect?this.restoreHistory(e):t instanceof th?this.restoreHistory(e,!0):t instanceof Yo&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,{extras:e,id:r}){let{replaceUrl:a,state:c}=e;if(this.location.isCurrentPathEqualTo(t)||a){let d=this.browserPageId,u=le(le({},c),this.generateNgRouterState(r,d));this.location.replaceState(t,"",u)}else{let d=le(le({},c),this.generateNgRouterState(r,this.browserPageId+1));this.location.go(t,"",d)}}restoreHistory(t,e=!1){if(this.canceledNavigationResolution==="computed"){let r=this.browserPageId,a=this.currentPageId-r;a!==0?this.location.historyGo(a):this.getCurrentUrlTree()===t.finalUrl&&a===0&&(this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(e&&this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,e){return this.canceledNavigationResolution==="computed"?{navigationId:t,\u0275routerPageId:e}:{navigationId:t}}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Hy(i,n){i.events.pipe(Vn(t=>t instanceof Yo||t instanceof Vc||t instanceof th||t instanceof jc),Ki(t=>t instanceof Yo||t instanceof jc?0:(t instanceof Vc?t.code===zo.Redirect||t.code===zo.SupersededByNewNavigation:!1)?2:1),Vn(t=>t!==2),xo(1)).subscribe(()=>{n()})}var GW={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},$W={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},_t=(()=>{class i{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=fe(iC);stateManager=fe(x4);options=fe(Im,{optional:!0})||{};pendingTasks=fe(J3);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=fe(Wy);
2urlSerializer=fe(Ku);location=fe(Nc);urlHandlingStrategy=fe(jy);injector=fe(Go);_events=new ci;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=fe(b4);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=fe(lh,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!fe(Qg,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}eventsSubscription=new us;subscribeToNavigationEvents(){let t=this.navigationTransitions.events.subscribe(e=>{try{let r=this.navigationTransitions.currentTransition,a=this.navigationTransitions.currentNavigation;if(r!==null&&a!==null){if(this.stateManager.handleRouterEvent(e,a),e instanceof Vc&&e.code!==zo.Redirect&&e.code!==zo.SupersededByNewNavigation)this.navigated=!0;else if(e instanceof Yo)this.navigated=!0;else if(e instanceof nh){let c=e.navigationBehaviorOptions,d=this.urlHandlingStrategy.merge(e.url,r.currentRawUrl),u=le({browserUrl:r.extras.browserUrl,info:r.extras.info,skipLocationChange:r.extras.skipLocationChange,replaceUrl:r.extras.replaceUrl||this.urlUpdateStrategy==="eager"||jW(r.source)},c);this.scheduleNavigation(d,Zp,null,u,{resolve:r.resolve,reject:r.reject,promise:r.promise})}}Hj(e)&&this._events.next(e)}catch(r){this.navigationTransitions.transitionAbortWithErrorSubject.next(r)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Zp,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,e,r)=>{this.navigateToSyncWithBrowser(t,r,e)})}navigateToSyncWithBrowser(t,e,r){let a={replaceUrl:!0},c=r?.navigationId?r:null;if(r){let u=le({},r);delete u.navigationId,delete u.\u0275routerPageId,Object.keys(u).length!==0&&(a.state=u)}let d=this.parseUrl(t);this.scheduleNavigation(d,e,c,a).catch(u=>{this.disposed||this.injector.get(pg)(u)})}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(sE),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,e={}){let{relativeTo:r,queryParams:a,fragment:c,queryParamsHandling:d,preserveFragment:u}=e,h=u?this.currentUrlTree.fragment:c,f=null;switch(d??this.options.defaultQueryParamsHandling){case"merge":f=le(le({},this.currentUrlTree.queryParams),a);break;case"preserve":f=this.currentUrlTree.queryParams;break;default:f=a||null}f!==null&&(f=this.removeEmptyProps(f));let v;try{let C=r?r.snapshot:this.routerState.snapshot.root;v=t4(C)}catch{(typeof t[0]!="string"||t[0][0]!=="/")&&(t=[]),v=this.currentUrlTree.root}return i4(v,t,f,h??null)}navigateByUrl(t,e={skipLocationChange:!1}){let r=Tm(t)?t:this.parseUrl(t),a=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(a,Zp,null,e)}navigate(t,e={skipLocationChange:!1}){return zW(t),this.navigateByUrl(this.createUrlTree(t,e),e)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){try{return this.urlSerializer.parse(t)}catch{return this.urlSerializer.parse("/")}}isActive(t,e){let r;if(e===!0?r=le({},GW):e===!1?r=le({},$W):r=e,Tm(t))return N5(this.currentUrlTree,t,r);let a=this.parseUrl(t);return N5(this.currentUrlTree,a,r)}removeEmptyProps(t){return Object.entries(t).reduce((e,[r,a])=>(a!=null&&(e[r]=a),e),{})}scheduleNavigation(t,e,r,a,c){if(this.disposed)return Promise.resolve(!1);let d,u,h;c?(d=c.resolve,u=c.reject,h=c.promise):h=new Promise((v,C)=>{d=v,u=C});let f=this.pendingTasks.add();return Hy(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(f))}),this.navigationTransitions.handleNavigationRequest({source:e,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:a,resolve:d,reject:u,promise:h,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),h.catch(v=>Promise.reject(v))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function zW(i){for(let n=0;n<i.length;n++)if(i[n]==null)throw new Hi(4008,!1)}var km=(()=>{class i{router;route;tabIndexAttribute;renderer;el;locationStrategy;reactiveHref=vr(null);get href(){return Zs(this.reactiveHref)}set href(t){this.reactiveHref.set(t)}target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;
2isAnchorElement;subscription;onChanges=new ci;applicationErrorHandler=fe(pg);options=fe(Im,{optional:!0});constructor(t,e,r,a,c,d){this.router=t,this.route=e,this.tabIndexAttribute=r,this.renderer=a,this.el=c,this.locationStrategy=d,this.reactiveHref.set(fe(new G_("href"),{optional:!0}));let u=c.nativeElement.tagName?.toLowerCase();this.isAnchorElement=u==="a"||u==="area"||!!(typeof customElements=="object"&&customElements.get(u)?.observedAttributes?.includes?.("href")),this.isAnchorElement?this.setTabIndexIfNotOnNativeEl("0"):this.subscribeToNavigationEventsIfNecessary()}subscribeToNavigationEventsIfNecessary(){if(this.subscription!==void 0||!this.isAnchorElement)return;let t=this.preserveFragment,e=r=>r==="merge"||r==="preserve";t||=e(this.queryParamsHandling),t||=!this.queryParamsHandling&&!e(this.options?.defaultQueryParamsHandling),t&&(this.subscription=this.router.events.subscribe(r=>{r instanceof Yo&&this.updateHref()}))}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(t){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&(this.updateHref(),this.subscribeToNavigationEventsIfNecessary()),this.onChanges.next(this)}routerLinkInput=null;set routerLink(t){t==null?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(Tm(t)?this.routerLinkInput=t:this.routerLinkInput=Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0"))}onClick(t,e,r,a,c){let d=this.urlTree;if(d===null||this.isAnchorElement&&(t!==0||e||r||a||c||typeof this.target=="string"&&this.target!="_self"))return!0;let u={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info};return this.router.navigateByUrl(d,u)?.catch(h=>{this.applicationErrorHandler(h)}),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){let t=this.urlTree;this.reactiveHref.set(t!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(t))??"":null)}applyAttributeValue(t,e){let r=this.renderer,a=this.el.nativeElement;e!==null?r.setAttribute(a,t,e):r.removeAttribute(a,t)}get urlTree(){return this.routerLinkInput===null?null:Tm(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(e){return new(e||i)(x(_t),x(Md),Qx("tabindex"),x(qn),x(Ai),x(ec))};static \u0275dir=Ci({type:i,selectors:[["","routerLink",""]],hostVars:2,hostBindings:function(e,r){e&1&&S("click",function(c){return r.onClick(c.button,c.ctrlKey,c.shiftKey,c.altKey,c.metaKey)}),e&2&&He("href",r.reactiveHref(),sk)("target",r.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",Cn],skipLocationChange:[2,"skipLocationChange","skipLocationChange",Cn],replaceUrl:[2,"replaceUrl","replaceUrl",Cn],routerLink:"routerLink"},features:[kn]})}return i})(),pE=(()=>{class i{router;element;renderer;cdr;link;links;classes=[];routerEventsSubscription;linkInputChangesSubscription;_isActive=!1;get isActive(){return this._isActive}routerLinkActiveOptions={exact:!1};ariaCurrentWhenActive;isActiveChange=new xn;constructor(t,e,r,a,c){this.router=t,this.element=e,this.renderer=r,this.cdr=a,this.link=c,this.routerEventsSubscription=t.events.subscribe(d=>{d instanceof Yo&&this.update()})}ngAfterContentInit(){Fi(this.links.changes,Fi(null)).pipe(mg()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){this.linkInputChangesSubscription?.unsubscribe();let t=[...this.links.toArray(),this.link].filter(e=>!!e).map(e=>e.onChanges);this.linkInputChangesSubscription=Na(t).pipe(mg()).subscribe(e=>{this._isActive!==this.isLinkActive(this.router)(e)&&this.update()})}set routerLinkActive(t){let e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(r=>!!r)}ngOnChanges(t){this.update()}ngOnDestroy(){this.routerEventsSubscription.unsubscribe(),this.linkInputChangesSubscription?.unsubscribe()}update(){!this.links||!this.router.navigated||queueMicrotask(()=>{let t=this.hasActiveLinks();
2this.classes.forEach(e=>{t?this.renderer.addClass(this.element.nativeElement,e):this.renderer.removeClass(this.element.nativeElement,e)}),t&&this.ariaCurrentWhenActive!==void 0?this.renderer.setAttribute(this.element.nativeElement,"aria-current",this.ariaCurrentWhenActive.toString()):this.renderer.removeAttribute(this.element.nativeElement,"aria-current"),this._isActive!==t&&(this._isActive=t,this.cdr.markForCheck(),this.isActiveChange.emit(t))})}isLinkActive(t){let e=YW(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return r=>{let a=r.urlTree;return a?t.isActive(a,e):!1}}hasActiveLinks(){let t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.links.some(t)}static \u0275fac=function(e){return new(e||i)(x(_t),x(Ai),x(qn),x(Kn),x(km,8))};static \u0275dir=Ci({type:i,selectors:[["","routerLinkActive",""]],contentQueries:function(e,r,a){if(e&1&&Js(a,km,5),e&2){let c;on(c=sn())&&(r.links=c)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",ariaCurrentWhenActive:"ariaCurrentWhenActive",routerLinkActive:"routerLinkActive"},outputs:{isActiveChange:"isActiveChange"},exportAs:["routerLinkActive"],features:[kn]})}return i})();function YW(i){return!!i.paths}var t1=class{};var C4=(()=>{class i{router;injector;preloadingStrategy;loader;subscription;constructor(t,e,r,a){this.router=t,this.injector=e,this.preloadingStrategy=r,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(Vn(t=>t instanceof Yo),bd(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,e){let r=[];for(let a of e){a.providers&&!a._injector&&(a._injector=B_(a.providers,t,`Route: ${a.path}`));let c=a._injector??t,d=a._loadedInjector??c;(a.loadChildren&&!a._loadedRoutes&&a.canLoad===void 0||a.loadComponent&&!a._loadedComponent)&&r.push(this.preloadConfig(c,a)),(a.children||a._loadedRoutes)&&r.push(this.processRoutes(d,a.children??a._loadedRoutes))}return Na(r).pipe(mg())}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>{let r;e.loadChildren&&e.canLoad===void 0?r=this.loader.loadChildren(t,e):r=Fi(null);let a=r.pipe(ps(c=>c===null?Fi(void 0):(e._loadedRoutes=c.routes,e._loadedInjector=c.injector,this.processRoutes(c.injector??t,c.routes))));if(e.loadComponent&&!e._loadedComponent){let c=this.loader.loadComponent(t,e);
2return Na([a,c]).pipe(mg())}else return a})}static \u0275fac=function(e){return new(e||i)(kt(_t),kt(Go),kt(t1),kt(Uy))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),E4=new Gt(""),qW=(()=>{class i{urlSerializer;transitions;viewportScroller;zone;options;routerEventsSubscription;scrollEventsSubscription;lastId=0;lastSource=Zp;restoredId=0;store={};constructor(t,e,r,a,c={}){this.urlSerializer=t,this.transitions=e,this.viewportScroller=r,this.zone=a,this.options=c,c.scrollPositionRestoration||="disabled",c.anchorScrolling||="disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof Dm?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof Yo?(this.lastId=t.id,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.urlAfterRedirects).fragment)):t instanceof jc&&t.code===eh.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof ih&&(t.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(t.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.zone.runOutsideAngular(()=>ye(this,null,function*(){yield new Promise(r=>{setTimeout(r),typeof requestAnimationFrame<"u"&&requestAnimationFrame(r)}),this.zone.run(()=>{this.transitions.events.next(new ih(t,this.lastSource==="popstate"?this.store[this.restoredId]:null,e))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static \u0275fac=function(e){N_()};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();function KW(i){return i.routerState.root}function i1(i,n){return{\u0275kind:i,\u0275providers:n}}function XW(){let i=fe(rn);return n=>{let t=i.get(gs);if(n!==t.components[0])return;let e=i.get(_t),r=i.get(w4);i.get(hE)===1&&e.initialNavigation(),i.get(I4,null,{optional:!0})?.setUpPreloading(),i.get(E4,null,{optional:!0})?.init(),e.resetRootComponentType(t.componentTypes[0]),r.closed||(r.next(),r.complete(),r.unsubscribe())}}var w4=new Gt("",{factory:()=>new ci}),hE=new Gt("",{providedIn:"root",factory:()=>1});function T4(){let i=[{provide:hE,useValue:0},rC(()=>{let n=fe(rn);return n.get(dC,Promise.resolve()).then(()=>new Promise(e=>{let r=n.get(_t),a=n.get(w4);Hy(r,()=>{e(!0)}),n.get(Wy).afterPreactivation=()=>(e(!0),a.closed?Fi(void 0):a),r.initialNavigation()}))})];return i1(2,i)}function D4(){let i=[rC(()=>{fe(_t).setUpLocationChangeListener()}),{provide:hE,useValue:2}];return i1(3,i)}var I4=new Gt("");function k4(i){return i1(0,[{provide:I4,useExisting:C4},{provide:t1,useExisting:i}])}function M4(){return i1(8,[aE,{provide:Qg,useExisting:aE}])}function A4(i){Gp("NgRouterViewTransitions");let n=[{provide:cE,useValue:S4},{provide:dE,useValue:le({skipNextTransition:!!i?.skipInitialTransition},i)}];return i1(9,n)}var P4=[Nc,{provide:Ku,useClass:wm},_t,Xu,{provide:Md,useFactory:KW,deps:[_t]},Uy,[]],Gy=(()=>{class i{constructor(){}static forRoot(t,e){return{ngModule:i,providers:[P4,[],{provide:lh,multi:!0,useValue:t},[],e?.errorHandler?{provide:mE,useValue:e.errorHandler}:[],{provide:Im,useValue:e||{}},e?.useHash?ZW():QW(),JW(),e?.preloadingStrategy?k4(e.preloadingStrategy).\u0275providers:[],e?.initialNavigation?eH(e):[],e?.bindToComponentInputs?M4().\u0275providers:[],e?.enableViewTransitions?A4().\u0275providers:[],tH()]}}static forChild(t){return{ngModule:i,providers:[{provide:lh,multi:!0,useValue:t}]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})();function JW(){return{provide:E4,useFactory:()=>{let i=fe(p5),n=fe(Ri),t=fe(Im),e=fe(Wy),r=fe(Ku);return t.scrollOffset&&i.setOffset(t.scrollOffset),new qW(r,e,i,n,t)}}}function ZW(){return{provide:ec,useClass:vC}}function QW(){return{provide:ec,useClass:X_}}function eH(i){return[i.initialNavigation==="disabled"?D4().\u0275providers:[],i.initialNavigation==="enabledBlocking"?T4().\u0275providers:[]]}var uE=new Gt("");function tH(){return[{provide:uE,useFactory:XW},{provide:hk,multi:!0,useExisting:uE}]}var W4=(()=>{class i{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,e){this._renderer=t,this._elementRef=e}setProperty(t,e){this._renderer.setProperty(this._elementRef.nativeElement,t,e)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(e){return new(e||i)(x(qn),x(Ai))};static \u0275dir=Ci({type:i})}return i})(),iS=(()=>{class i extends W4{static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,features:[lr]})}return i})(),uh=new Gt("");var iH={provide:uh,useExisting:Cl(()=>Ke),multi:!0};function nH(){let i=Qs()?Qs().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var rH=new Gt(""),Ke=(()=>{class i extends W4{_compositionMode;_composing=!1;constructor(t,e,r){super(t,e),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!nH())}writeValue(t){let e=t??"";this.setProperty("value",e)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}
2_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(e){return new(e||i)(x(qn),x(Ai),x(rH,8))};static \u0275dir=Ci({type:i,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,r){e&1&&S("input",function(c){return r._handleInput(c.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(c){return r._compositionEnd(c.target.value)})},standalone:!1,features:[Ii([iH]),lr]})}return i})();function _E(i){return i==null||yE(i)===0}function yE(i){return i==null?null:Array.isArray(i)||typeof i=="string"?i.length:i instanceof Set?i.size:null}var Am=new Gt(""),nS=new Gt(""),aH=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,At=class{static min(n){return H4(n)}static max(n){return oH(n)}static required(n){return G4(n)}static requiredTrue(n){return sH(n)}static email(n){return lH(n)}static minLength(n){return cH(n)}static maxLength(n){return dH(n)}static pattern(n){return mH(n)}static nullValidator(n){return zy()}static compose(n){return X4(n)}static composeAsync(n){return J4(n)}};function H4(i){return n=>{if(n.value==null||i==null)return null;let t=parseFloat(n.value);return!isNaN(t)&&t<i?{min:{min:i,actual:n.value}}:null}}function oH(i){return n=>{if(n.value==null||i==null)return null;let t=parseFloat(n.value);return!isNaN(t)&&t>i?{max:{max:i,actual:n.value}}:null}}function G4(i){return _E(i.value)?{required:!0}:null}function sH(i){return i.value===!0?null:{required:!0}}function lH(i){return _E(i.value)||aH.test(i.value)?null:{email:!0}}function cH(i){return n=>{let t=n.value?.length??yE(n.value);return t===null||t===0?null:t<i?{minlength:{requiredLength:i,actualLength:t}}:null}}function dH(i){return n=>{let t=n.value?.length??yE(n.value);return t!==null&&t>i?{maxlength:{requiredLength:i,actualLength:t}}:null}}function mH(i){if(!i)return zy;let n,t;return typeof i=="string"?(t="",i.charAt(0)!=="^"&&(t+="^"),t+=i,i.charAt(i.length-1)!=="$"&&(t+="$"),n=new RegExp(t)):(t=i.toString(),n=i),e=>{if(_E(e.value))return null;let r=e.value;return n.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}function zy(i){return null}function $4(i){return i!=null}function z4(i){return gg(i)?Na(i):i}function Y4(i){let n={};return i.forEach(t=>{n=t!=null?le(le({},n),t):n}),Object.keys(n).length===0?null:n}function q4(i,n){return n.map(t=>t(i))}function uH(i){return!i.validate}function K4(i){return i.map(n=>uH(n)?n:t=>n.validate(t))}function X4(i){if(!i)return null;let n=i.filter($4);return n.length==0?null:function(t){return Y4(q4(t,n))}}function SE(i){return i!=null?X4(K4(i)):null}function J4(i){if(!i)return null;let n=i.filter($4);return n.length==0?null:function(t){let e=q4(t,n).map(z4);return A_(e).pipe(Ki(Y4))}}function bE(i){return i!=null?J4(K4(i)):null}function F4(i,n){return i===null?[n]:Array.isArray(i)?[...i,n]:[i,n]}function Z4(i){return i._rawValidators}function Q4(i){return i._rawAsyncValidators}function fE(i){return i?Array.isArray(i)?i:[i]:[]}function Yy(i,n){return Array.isArray(i)?i.includes(n):i===n}function R4(i,n){let t=fE(n);return fE(i).forEach(r=>{Yy(t,r)||t.push(r)}),t}function O4(i,n){return fE(n).filter(t=>!Yy(i,t))}var qy=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(n){this._rawValidators=n||[],this._composedValidatorFn=SE(this._rawValidators)}_setAsyncValidators(n){this._rawAsyncValidators=n||[],this._composedAsyncValidatorFn=bE(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(n){this._onDestroyCallbacks.push(n)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(n=>n()),this._onDestroyCallbacks=[]}reset(n=void 0){this.control&&this.control.reset(n)}hasError(n,t){return this.control?this.control.hasError(n,t):!1}getError(n,t){return this.control?this.control.getError(n,t):null}},Pd=class extends qy{name;get formDirective(){return null}get path(){return null}},nc=class extends qy{_parent=null;name=null;valueAccessor=null},Ky=class{_cd;constructor(n){this._cd=n}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}
vendor: 10,441 bytes, line 2
2get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},pH={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},ake=tt(le({},pH),{"[class.ng-submitted]":"isSubmitted"}),Ne=(()=>{class i extends Ky{constructor(t){super(t)}static \u0275fac=function(e){return new(e||i)(x(nc,2))};static \u0275dir=Ci({type:i,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,r){e&2&&Re("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[lr]})}return i})(),Oi=(()=>{class i extends Ky{constructor(t){super(t)}static \u0275fac=function(e){return new(e||i)(x(Pd,10))};static \u0275dir=Ci({type:i,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(e,r){e&2&&Re("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[lr]})}return i})();var n1="VALID",$y="INVALID",ch="PENDING",r1="DISABLED",Mm=class{},Xy=class extends Mm{value;source;constructor(n,t){super(),this.value=n,this.source=t}},o1=class extends Mm{pristine;source;constructor(n,t){super(),this.pristine=n,this.source=t}},s1=class extends Mm{touched;source;constructor(n,t){super(),this.touched=n,this.source=t}},dh=class extends Mm{status;source;constructor(n,t){super(),this.status=n,this.source=t}},Jy=class extends Mm{source;constructor(n){super(),this.source=n}},Zy=class extends Mm{source;constructor(n){super(),this.source=n}};function xE(i){return(rS(i)?i.validators:i)||null}function hH(i){return Array.isArray(i)?SE(i):i||null}function CE(i,n){return(rS(n)?n.asyncValidators:i)||null}function fH(i){return Array.isArray(i)?bE(i):i||null}function rS(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}function eM(i,n,t){let e=i.controls;if(!(n?Object.keys(e):e).length)throw new Hi(1e3,"");if(!e[t])throw new Hi(1001,"")}function tM(i,n,t){i._forEachChild((e,r)=>{if(t[r]===void 0)throw new Hi(1002,"")})}var mh=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(n,t){this._assignValidators(n),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(n){this._rawValidators=this._composedValidatorFn=n}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(n){this._rawAsyncValidators=this._composedAsyncValidatorFn=n}get parent(){return this._parent}get status(){return Zs(this.statusReactive)}set status(n){Zs(()=>this.statusReactive.set(n))}_status=Rc(()=>this.statusReactive());statusReactive=vr(void 0);get valid(){return this.status===n1}get invalid(){return this.status===$y}get pending(){return this.status==ch}get disabled(){return this.status===r1}get enabled(){return this.status!==r1}errors;get pristine(){return Zs(this.pristineReactive)}set pristine(n){Zs(()=>this.pristineReactive.set(n))}_pristine=Rc(()=>this.pristineReactive());pristineReactive=vr(!0);get dirty(){return!this.pristine}get touched(){return Zs(this.touchedReactive)}set touched(n){Zs(()=>this.touchedReactive.set(n))}_touched=Rc(()=>this.touchedReactive());touchedReactive=vr(!1);get untouched(){return!this.touched}_events=new ci;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(n){this._assignValidators(n)}setAsyncValidators(n){this._assignAsyncValidators(n)}addValidators(n){this.setValidators(R4(n,this._rawValidators))}addAsyncValidators(n){this.setAsyncValidators(R4(n,this._rawAsyncValidators))}removeValidators(n){this.setValidators(O4(n,this._rawValidators))}removeAsyncValidators(n){this.setAsyncValidators(O4(n,this._rawAsyncValidators))}hasValidator(n){return Yy(this._rawValidators,n)}hasAsyncValidator(n){return Yy(this._rawAsyncValidators,n)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(n={}){let t=this.touched===!1;this.touched=!0;let e=n.sourceControl??this;this._parent&&!n.onlySelf&&this._parent.markAsTouched(tt(le({},n),{sourceControl:e})),t&&n.emitEvent!==!1&&this._events.next(new s1(!0,e))}markAllAsDirty(n={}){this.markAsDirty({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(n))}markAllAsTouched(n={}){this.markAsTouched({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(n))}markAsUntouched(n={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let e=n.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:e})}),this._parent&&!n.onlySelf&&this._parent._updateTouched(n,e),t&&n.emitEvent!==!1&&this._events.next(new s1(!1,e))}markAsDirty(n={}){let t=this.pristine===!0;this.pristine=!1;let e=n.sourceControl??this;this._parent&&!n.onlySelf&&this._parent.markAsDirty(tt(le({},n),{sourceControl:e})),t&&n.emitEvent!==!1&&this._events.next(new o1(!1,e))}markAsPristine(n={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let e=n.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:n.emitEvent})}),this._parent&&!n.onlySelf&&this._parent._updatePristine(n,e),t&&n.emitEvent!==!1&&this._events.next(new o1(!0,e))}markAsPending(n={}){this.status=ch;let t=n.sourceControl??this;n.emitEvent!==!1&&(this._events.next(new dh(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!n.onlySelf&&this._parent.markAsPending(tt(le({},n),{sourceControl:t}))}disable(n={}){let t=this._parentMarkedDirty(n.onlySelf);this.status=r1,this.errors=null,this._forEachChild(r=>{r.disable(tt(le({},n),{onlySelf:!0}))}),this._updateValue();let e=n.sourceControl??this;n.emitEvent!==!1&&(this._events.next(new Xy(this.value,e)),this._events.next(new dh(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(tt(le({},n),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(n={}){let t=this._parentMarkedDirty(n.onlySelf);this.status=n1,this._forEachChild(e=>{e.enable(tt(le({},n),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent}),this._updateAncestors(tt(le({},n),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(n,t){this._parent&&!n.onlySelf&&(this._parent.updateValueAndValidity(n),n.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(n){this._parent=n}getRawValue(){return this.value}updateValueAndValidity(n={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let e=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===n1||this.status===ch)&&this._runAsyncValidator(e,n.emitEvent)}let t=n.sourceControl??this;n.emitEvent!==!1&&(this._events.next(new Xy(this.value,t)),this._events.next(new dh(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!n.onlySelf&&this._parent.updateValueAndValidity(tt(le({},n),{sourceControl:t}))}_updateTreeValidity(n={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(n)),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?r1:n1}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(n,t){if(this.asyncValidator){this.status=ch,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:n!==!1};let e=z4(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:n})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let n=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,n}return!1}setErrors(n,t={}){this.errors=n,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(n){let t=n;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((e,r)=>e&&e._find(r),this)}getError(n,t){let e=t?this.get(t):this;return e&&e.errors?e.errors[n]:null}hasError(n,t){return!!this.getError(n,t)}get root(){let n=this;for(;n._parent;)n=n._parent;return n}_updateControlsErrors(n,t,e){this.status=this._calculateStatus(),n&&this.statusChanges.emit(this.status),(n||e)&&this._events.next(new dh(this.status,t)),this._parent&&this._parent._updateControlsErrors(n,t,e)}_initObservables(){this.valueChanges=new xn,this.statusChanges=new xn}_calculateStatus(){return this._allControlsDisabled()?r1:this.errors?$y:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ch)?ch:this._anyControlsHaveStatus($y)?$y:n1}_anyControlsHaveStatus(n){return this._anyControls(t=>t.status===n)}_anyControlsDirty(){return this._anyControls(n=>n.dirty)}_anyControlsTouched(){return this._anyControls(n=>n.touched)}_updatePristine(n,t){let e=!this._anyControlsDirty(),r=this.pristine!==e;this.pristine=e,this._parent&&!n.onlySelf&&this._parent._updatePristine(n,t),r&&this._events.next(new o1(this.pristine,t))}_updateTouched(n={},t){this.touched=this._anyControlsTouched(),this._events.next(new s1(this.touched,t)),this._parent&&!n.onlySelf&&this._parent._updateTouched(n,t)}_onDisabledChange=[];_registerOnCollectionChange(n){this._onCollectionChange=n}_setUpdateStrategy(n){rS(n)&&n.updateOn!=null&&(this._updateOn=n.updateOn)}_parentMarkedDirty(n){let t=this._parent&&this._parent.dirty;return!n&&!!t&&!this._parent._anyControlsDirty()}
2_find(n){return null}_assignValidators(n){this._rawValidators=Array.isArray(n)?n.slice():n,this._composedValidatorFn=hH(this._rawValidators)}_assignAsyncValidators(n){this._rawAsyncValidators=Array.isArray(n)?n.slice():n,this._composedAsyncValidatorFn=fH(this._rawAsyncValidators)}},Wc=class extends mh{constructor(n,t,e){super(xE(t),CE(e,t)),this.controls=n,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(n,t){return this.controls[n]?this.controls[n]:(this.controls[n]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(n,t,e={}){this.registerControl(n,t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}removeControl(n,t={}){this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),delete this.controls[n],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(n,t,e={}){this.controls[n]&&this.controls[n]._registerOnCollectionChange(()=>{}),delete this.controls[n],t&&this.registerControl(n,t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}contains(n){return this.controls.hasOwnProperty(n)&&this.controls[n].enabled}setValue(n,t={}){tM(this,!0,n),Object.keys(n).forEach(e=>{eM(this,!0,e),this.controls[e].setValue(n[e],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(n,t={}){n!=null&&(Object.keys(n).forEach(e=>{let r=this.controls[e];r&&r.patchValue(n[e],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(n={},t={}){this._forEachChild((e,r)=>{e.reset(n?n[r]:null,{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(n,t,e)=>(n[e]=t.getRawValue(),n))}_syncPendingControls(){let n=this._reduceChildren(!1,(t,e)=>e._syncPendingControls()?!0:t);return n&&this.updateValueAndValidity({onlySelf:!0}),n}_forEachChild(n){Object.keys(this.controls).forEach(t=>{let e=this.controls[t];e&&n(e,t)})}_setUpControls(){this._forEachChild(n=>{n.setParent(this),n._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(n){for(let[t,e]of Object.entries(this.controls))if(this.contains(t)&&n(e))return!0;return!1}_reduceValue(){let n={};return this._reduceChildren(n,(t,e,r)=>((e.enabled||this.disabled)&&(t[r]=e.value),t))}_reduceChildren(n,t){let e=n;return this._forEachChild((r,a)=>{e=t(e,r,a)}),e}_allControlsDisabled(){for(let n of Object.keys(this.controls))if(this.controls[n].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(n){return this.controls.hasOwnProperty(n)?this.controls[n]:null}};var gE=class extends Wc{};var c1=new Gt("",{providedIn:"root",factory:()=>aS}),aS="always";function iM(i,n){return[...n.path,i]}function Qy(i,n,t=aS){EE(i,n),n.valueAccessor.writeValue(i.value),(i.disabled||t==="always")&&n.valueAccessor.setDisabledState?.(i.disabled),vH(i,n),yH(i,n),_H(i,n),gH(i,n)}function N4(i,n,t=!0){let e=()=>{};n.valueAccessor&&(n.valueAccessor.registerOnChange(e),n.valueAccessor.registerOnTouched(e)),tS(i,n),i&&(n._invokeOnDestroyCallbacks(),i._registerOnCollectionChange(()=>{}))}function eS(i,n){i.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(n)})}function gH(i,n){if(n.valueAccessor.setDisabledState){let t=e=>{n.valueAccessor.setDisabledState(e)};i.registerOnDisabledChange(t),n._registerOnDestroy(()=>{i._unregisterOnDisabledChange(t)})}}function EE(i,n){let t=Z4(i);n.validator!==null?i.setValidators(F4(t,n.validator)):typeof t=="function"&&i.setValidators([t]);let e=Q4(i);n.asyncValidator!==null?i.setAsyncValidators(F4(e,n.asyncValidator)):typeof e=="function"&&i.setAsyncValidators([e]);let r=()=>i.updateValueAndValidity();eS(n._rawValidators,r),eS(n._rawAsyncValidators,r)}function tS(i,n){let t=!1;if(i!==null){if(n.validator!==null){let r=Z4(i);if(Array.isArray(r)&&r.length>0){let a=r.filter(c=>c!==n.validator);a.length!==r.length&&(t=!0,i.setValidators(a))}}if(n.asyncValidator!==null){let r=Q4(i);if(Array.isArray(r)&&r.length>0){let a=r.filter(c=>c!==n.asyncValidator);a.length!==r.length&&(t=!0,i.setAsyncValidators(a))}}}let e=()=>{};return eS(n._rawValidators,e),eS(n._rawAsyncValidators,e),t}function vH(i,n){n.valueAccessor.registerOnChange(t=>{i._pendingValue=t,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&nM(i,n)})}function _H(i,n){n.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&nM(i,n),i.updateOn!=="submit"&&i.markAsTouched()})}function nM(i,n){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),n.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function yH(i,n){let t=(e,r)=>{n.valueAccessor.writeValue(e),r&&n.viewToModelUpdate(e)};i.registerOnChange(t),n._registerOnDestroy(()=>{i._unregisterOnChange(t)}
2)}function rM(i,n){i==null,EE(i,n)}function SH(i,n){return tS(i,n)}function aM(i,n){if(!i.hasOwnProperty("model"))return!1;let t=i.model;return t.isFirstChange()?!0:!Object.is(n,t.currentValue)}function bH(i){return Object.getPrototypeOf(i.constructor)===iS}function oM(i,n){i._syncPendingControls(),n.forEach(t=>{let e=t.control;e.updateOn==="submit"&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})}function sM(i,n){if(!n)return null;Array.isArray(n);let t,e,r;return n.forEach(a=>{a.constructor===Ke?t=a:bH(a)?e=a:r=a}),r||e||t||null}function xH(i,n){let t=i.indexOf(n);t>-1&&i.splice(t,1)}var CH={provide:Pd,useExisting:Cl(()=>fn)},a1=Promise.resolve(),fn=(()=>{class i extends Pd{callSetDisabledState;get submitted(){return Zs(this.submittedReactive)}_submitted=Rc(()=>this.submittedReactive());submittedReactive=vr(!1);_directives=new Set;form;ngSubmit=new xn;options;constructor(t,e,r){super(),this.callSetDisabledState=r,this.form=new Wc({},SE(t),bE(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){a1.then(()=>{let e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),Qy(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}
vendor: 5,667 bytes, line 2
2removeControl(t){a1.then(()=>{let e=this._findContainer(t.path);e&&e.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){a1.then(()=>{let e=this._findContainer(t.path),r=new Wc({});rM(r,t),e.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){a1.then(()=>{let e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){a1.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),oM(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new Jy(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1),this.form._events.next(new Zy(this.form))}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(e){return new(e||i)(x(Am,10),x(nS,10),x(c1,8))};static \u0275dir=Ci({type:i,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,r){e&1&&S("submit",function(c){return r.onSubmit(c)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[Ii([CH]),lr]})}return i})();function L4(i,n){let t=i.indexOf(n);t>-1&&i.splice(t,1)}function B4(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var l1=class extends mh{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(n=null,t,e){super(xE(t),CE(e,t)),this._applyFormState(n),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),rS(t)&&(t.nonNullable||t.initialValueIsDefault)&&(B4(n)?this.defaultValue=n.value:this.defaultValue=n)}setValue(n,t={}){this.value=this._pendingValue=n,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(e=>e(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(n,t={}){this.setValue(n,t)}reset(n=this.defaultValue,t={}){this._applyFormState(n),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(n){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(n){this._onChange.push(n)}_unregisterOnChange(n){L4(this._onChange,n)}registerOnDisabledChange(n){this._onDisabledChange.push(n)}_unregisterOnDisabledChange(n){L4(this._onDisabledChange,n)}_forEachChild(n){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(n){B4(n)?(this.value=this._pendingValue=n.value,n.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=n}};var EH=i=>i instanceof l1;var wH={provide:nc,useExisting:Cl(()=>Le)},V4=Promise.resolve(),Le=(()=>{class i extends nc{_changeDetectorRef;callSetDisabledState;control=new l1;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new xn;constructor(t,e,r,a,c,d){super(),this._changeDetectorRef=c,this.callSetDisabledState=d,this._parent=t,this._setValidators(e),this._setAsyncValidators(r),this.valueAccessor=sM(this,a)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let e=t.name.previousValue;this.formDirective.removeControl({name:e,path:this._getPath(e)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),aM(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Qy(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){V4.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let e=t.isDisabled.currentValue,r=e!==0&&Cn(e);V4.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?iM(t,this._parent):[t]}static \u0275fac=function(e){return new(e||i)(x(Pd,9),x(Am,10),x(nS,10),x(uh,10),x(Kn,8),x(c1,8))};static \u0275dir=Ci({type:i,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[Ii([wH]),lr,kn]})}return i})();var Ni=(()=>
2{class i{static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return i})(),TH={provide:uh,useExisting:Cl(()=>qi),multi:!0},qi=(()=>{class i extends iS{writeValue(t){let e=t??"";this.setProperty("value",e)}registerOnChange(t){this.onChange=e=>{t(e==""?null:parseFloat(e))}}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(e,r){e&1&&S("input",function(c){return r.onChange(c.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[Ii([TH]),lr]})}return i})();var lM=new Gt("");var DH={provide:Pd,useExisting:Cl(()=>wr)},wr=(()=>{class i extends Pd{callSetDisabledState;get submitted(){return Zs(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}_submitted=Rc(()=>this._submittedReactive());_submittedReactive=vr(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new xn;constructor(t,e,r){super(),this.callSetDisabledState=r,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(tS(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let e=this.form.get(t.path);return Qy(e,t,this.callSetDisabledState),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}
2removeControl(t){N4(t.control||null,t,!1),xH(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this._submittedReactive.set(!0),oM(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new Jy(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0,e={}){this.form.reset(t,e),this._submittedReactive.set(!1),e?.emitEvent!==!1&&this.form._events.next(new Zy(this.form))}_updateDomValue(){this.directives.forEach(t=>{let e=t.control,r=this.form.get(t.path);e!==r&&(N4(e||null,t),EH(r)&&(Qy(r,t,this.callSetDisabledState),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let e=this.form.get(t.path);rM(e,t),e.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let e=this.form.get(t.path);e&&SH(e,t)&&e.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){EE(this.form,this),this._oldForm&&tS(this._oldForm,this)}static \u0275fac=function(e){return new(e||i)(x(Am,10),x(nS,10),x(c1,8))};static \u0275dir=Ci({type:i,selectors:[["","formGroup",""]],hostBindings:function(e,r){e&1&&S("submit",function(c){return r.onSubmit(c)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[Ii([DH]),lr,kn]})}return i})();var IH={provide:nc,useExisting:Cl(()=>$r)},$r=(()=>{class i extends nc{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(t){}model;update=new xn;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(t,e,r,a,c){super(),this._ngModelWarningConfig=c,this._parent=t,this._setValidators(e),this._setAsyncValidators(r),this.valueAccessor=sM(this,a)}ngOnChanges(t){this._added||this._setUpControl(),aM(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return iM(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(e){return new(e||i)(x(Pd,13),x(Am,10),x(nS,10),x(uh,10),x(lM,8))};static \u0275dir=Ci({type:i,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[Ii([IH]),lr,kn]})}return i})();var kH={provide:uh,useExisting:Cl(()=>Ot),multi:!0};function cM(i,n){return i==null?`${n}`:(n&&typeof n=="object"&&(n="Object"),`${i}: ${n}`.slice(0,50))}function MH(i){return i.split(":")[0]}var Ot=(()=>{class i extends iS{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;appRefInjector=fe(gs).injector;appRefDestroyRef=this.appRefInjector.get(Mu);destroyRef=fe(Mu);cdr=fe(Kn);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefDestroyRef.destroyed||(this._queuedWrite=!0,$o({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(t){this.cdr.markForCheck(),this.value=t;let e=this._getOptionId(t),r=cM(e,t);this.setProperty("value",r)}registerOnChange(t){this.onChange=e=>{this.value=this._getOptionValue(e),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let e of this._optionMap.keys())if(this._compareWith(this._optionMap.get(e),t))return e;return null}_getOptionValue(t){let e=MH(t);return this._optionMap.has(e)?this._optionMap.get(e):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(e,r){e&1&&S("change",function(c){return r.onChange(c.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[Ii([kH]),lr]})}return i})(),Bt=(()=>{class i{_element;_renderer;_select;id;constructor(t,e,r){this._element=t,this._renderer=e,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(cM(this.id,t)),this._select._writeValueAfterRender())}set value(t){this._setElementValue(t),this._select&&this._select._writeValueAfterRender()}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id
2),this._select._writeValueAfterRender())}static \u0275fac=function(e){return new(e||i)(x(Ai),x(qn),x(Ot,9))};static \u0275dir=Ci({type:i,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return i})(),AH={provide:uh,useExisting:Cl(()=>dM),multi:!0};function U4(i,n){return i==null?`${n}`:(typeof n=="string"&&(n=`'${n}'`),n&&typeof n=="object"&&(n="Object"),`${i}: ${n}`.slice(0,50))}function PH(i){return i.split(":")[0]}var dM=(()=>{class i extends iS{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let e;if(Array.isArray(t)){let r=t.map(a=>this._getOptionId(a));e=(a,c)=>{a._setSelected(r.indexOf(c.toString())>-1)}}else e=(r,a)=>{r._setSelected(!1)};this._optionMap.forEach(e)}registerOnChange(t){this.onChange=e=>{let r=[],a=e.selectedOptions;if(a!==void 0){let c=a;for(let d=0;d<c.length;d++){let u=c[d],h=this._getOptionValue(u.value);r.push(h)}}else{let c=e.options;for(let d=0;d<c.length;d++){let u=c[d];if(u.selected){let h=this._getOptionValue(u.value);r.push(h)}}}this.value=r,t(r)}}_registerOption(t){let e=(this._idCounter++).toString();return this._optionMap.set(e,t),e}_getOptionId(t){for(let e of this._optionMap.keys())if(this._compareWith(this._optionMap.get(e)._value,t))return e;return null}_getOptionValue(t){let e=PH(t);return this._optionMap.has(e)?this._optionMap.get(e)._value:t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(e,r){e&1&&S("change",function(c){return r.onChange(c.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[Ii([AH]),lr]})}return i})(),Vt=(()=>{class i{_element;_renderer;_select;id;_value;constructor(t,e,r){this._element=t,this._renderer=e,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(U4(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(U4(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(e){return new(e||i)(x(Ai),x(qn),x(dM,9))};static \u0275dir=Ci({type:i,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return i})();function FH(i){return typeof i=="number"?i:parseFloat(i)}var mM=(()=>{class i{_validator=zy;_onChange;_enabled;ngOnChanges(t){if(this.inputName in t){let e=this.normalizeInput(t[this.inputName].currentValue);this._enabled=this.enabled(e),this._validator=this._enabled?this.createValidator(e):zy,this._onChange&&this._onChange()}}validate(t){return this._validator(t)}registerOnValidatorChange(t){this._onChange=t}enabled(t){return t!=null}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,features:[kn]})}return i})();var RH={provide:Am,useExisting:Cl(()=>gn),multi:!0},gn=(()=>{class i extends mM{min;inputName="min";normalizeInput=t=>FH(t);createValidator=t=>H4(t);static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(e,r){e&2&&He("min",r._enabled?r.min:null)},inputs:{min:"min"},standalone:!1,features:[Ii([RH]),lr]})}return i})(),OH={provide:Am,useExisting:Cl(()=>vn),multi:!0};var vn=(()=>{class i extends mM{required;inputName="required";normalizeInput=Cn;createValidator=t=>G4;enabled(t){return t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(e,r){e&2&&He("required",r._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[Ii([OH]),lr]})}return i})();var uM=(()=>
2{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})(),vE=class extends mh{constructor(n,t,e){super(xE(t),CE(e,t)),this.controls=n,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(n){return this.controls[this._adjustIndex(n)]}push(n,t={}){this.controls.push(n),this._registerControl(n),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(n,t,e={}){this.controls.splice(n,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent})}removeAt(n,t={}){let e=this._adjustIndex(n);e<0&&(e=0),this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(n,t,e={}){let r=this._adjustIndex(n);r<0&&(r=0),this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),this.controls.splice(r,1),t&&(this.controls.splice(r,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(n,t={}){tM(this,!1,n),n.forEach((e,r)=>{eM(this,!1,r),this.at(r).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(n,t={}){n!=null&&(n.forEach((e,r)=>{this.at(r)&&this.at(r).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(n=[],t={}){this._forEachChild((e,r)=>{e.reset(n[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(n=>n.getRawValue())}clear(n={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:n.emitEvent}))}_adjustIndex(n){return n<0?n+this.length:n}_syncPendingControls(){let n=this.controls.reduce((t,e)=>e._syncPendingControls()?!0:t,!1);return n&&this.updateValueAndValidity({onlySelf:!0}),n}_forEachChild(n){this.controls.forEach((t,e)=>{n(t,e)})}_updateValue(){this.value=this.controls.filter(n=>n.enabled||this.disabled).map(n=>n.value)}_anyControls(n){return this.controls.some(t=>t.enabled&&n(t))}_setUpControls(){this._forEachChild(n=>this._registerControl(n))}_allControlsDisabled(){for(let n of this.controls)if(n.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(n){n.setParent(this),n._registerOnCollectionChange(this._onCollectionChange)}_find(n){return this.at(n)??null}};function j4(i){return!!i&&(i.asyncValidators!==void 0||i.validators!==void 0||i.updateOn!==void 0)}var Qr=(()=>{class i{useNonNullable=!1;get nonNullable(){let t=new i;return t.useNonNullable=!0,t}group(t,e=null){let r=this._reduceControls(t),a={};return j4(e)?a=e:e!==null&&(a.validators=e.validator,a.asyncValidators=e.asyncValidator),new Wc(r,a)}record(t,e=null){let r=this._reduceControls(t);return new gE(r,e)}control(t,e,r){let a={};return this.useNonNullable?(j4(e)?a=e:(a.validators=e,a.asyncValidators=r),new l1(t,tt(le({},a),{nonNullable:!0}))):new l1(t,e,r)}array(t,e,r){let a=t.map(c=>this._createControl(c));return new vE(a,e,r)}_reduceControls(t){let e={};return Object.keys(t).forEach(r=>{e[r]=this._createControl(t[r])}),e}_createControl(t){if(t instanceof l1)return t;if(t instanceof mh)return t;if(Array.isArray(t)){let e=t[0],r=t.length>1?t[1]:null,a=t.length>2?t[2]:null;return this.control(e,r,a)}else return this.control(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var pM=(()=>{class i{static withConfig(t){return{ngModule:i,providers:[{provide:c1,useValue:t.callSetDisabledState??aS}]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[uM]})}return i})(),hM=(()=>{class i{static withConfig(t){return{ngModule:i,providers:[{provide:lM,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:c1,useValue:t.callSetDisabledState??aS}]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[uM]})}return i})();var fM=["toast-component",""];function NH(i,n){if(i&1){let t=he();s(0,"button",5),S("click",function(){U(t);let r=w();return j(r.remove())}),s(1,"span",6),l(2,"\xD7"),o()()}}function LH(i,n){if(i&1&&(Ui(0),l(1),ji()),i&2){let t=w(2);m(),_("[",t.duplicatesCount+1,"]")}}function BH(i,n){if(i&1&&(s(0,"div"),l(1),T(2,LH,2,1,"ng-container",4),o()),i&2){let t=w();Co(t.options.titleClass),He("aria-label",t.title),m(),_(" ",t.title," "),m(),p("ngIf",t.duplicatesCount)}}function VH(i,n){if(i&1&&B(0,"div",7),i&2){let t=w();Co(t.options.messageClass),p("innerHTML",t.message,fg)}}function UH(i,n){if(i&1&&(s(0,"div",8),l(1),o()),i&2){let t=w();Co(t.options.messageClass),He("aria-label",t.message),m(),_(" ",t.message," ")}}function jH(i,n){if(i&1&&(s(0,"div"),B(1,"div",9),o()),i&2){let t=w();m(),gi("width",t.width()+"%")}}function WH(i,n){if(i&1){let t=he();s(0,"button",5),S("click",function(){U(t);let r=w();return j(r.remove())}),s(1,"span",6),l(2,"\xD7"),o()()}}function HH(i,n){if(i&1&&(Ui(0),l(1),ji()),i&2){let t=w(2);m(),_("[",t.duplicatesCount+1,"]")}}function GH(i,n){if(i&1&&(s(0,"div"),l(1),T(2,HH,2,1,"ng-container",4),o()),i&2){let t=w();Co(t.options.titleClass),He("aria-label",t.title),m(),_(" ",t.title," "),m(),p("ngIf",t.duplicatesCount)}}function $H(i,n){if(i&1&&B(0,"div",7),i&2){let t=w();Co(t.options.messageClass),p("innerHTML",t.message,fg)}}function zH(i,n){if(i&1&&(s(0,"div",8),l(1),o()),i&2){let t=w();Co(t.options.messageClass),He("aria-label",t.message),m(),_(" ",t.message," ")}}function YH(i,n){if(i&1&&(s(0,"div"),B(1,"div",9),o()),i&2){let t=w();m(),gi("width",t.width()+"%")}}var wE=class{_attachedHost;component;viewContainerRef;injector;constructor(n,t){this.component=n,this.injector=t}attach(n,t){return this._attachedHost=n,n.attach(this,t)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},TE=class{_attachedPortal;_disposeFn;attach(n,t){return this._attachedPortal=n,this.attachComponentPortal(n,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},DE=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new ci;_activate=new ci;_manualClose=new ci;_resetTimeout=new ci;_countDuplicate=new ci;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}
2onDuplicate(n,t){n&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},ph=class{toastId;config;message;title;toastType;toastRef;_onTap=new ci;_onAction=new ci;constructor(n,t,e,r,a,c){this.toastId=n,this.config=t,this.message=e,this.title=r,this.toastType=a,this.toastRef=c,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},gM={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},vM=new Gt("ToastConfig"),IE=class extends TE{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,t,e){super(),this._hostDomElement=n,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(n,t){let e=this._componentFactoryResolver.resolveComponentFactory(n.component),r;return r=e.create(n.injector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(r),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(r)),r}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},qH=(()=>{class i{_document=fe(Vi);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),kE=class{_portalHost;constructor(n){this._portalHost=n}attach(n,t=!0){return this._portalHost.attach(n,t)}detach(){return this._portalHost.detach()}},KH=(()=>{class i{_overlayContainer=fe(qH);_componentFactoryResolver=fe(ck);_appRef=fe(gs);_document=fe(Vi);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let r=this._document.createElement("div");return r.id="toast-container",r.classList.add(t),r.classList.add("toast-container"),e?e.getContainerElement().appendChild(r):this._overlayContainer.getContainerElement().appendChild(r),r}_createPortalHost(t){return new IE(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new kE(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),me=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,r,a,c){this.overlay=e,this._injector=r,this.sanitizer=a,this.ngZone=c,this.toastrConfig=le(le({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=le(le({},t.default.iconClasses),t.config.iconClasses))}show(t,e,r={},a=""){return this._preBuildNotification(a,t,e,this.applyConfig(r))}success(t,e,r={}){let a=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(a,t,e,this.applyConfig(r))}error(t,e,r={}){let a=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(a,t,e,this.applyConfig(r))}info(t,e,r={}){let a=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(a,t,e,this.applyConfig(r))}warning(t,e,r={}){let a=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(a,t,e,this.applyConfig(r))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let r=this.toasts[this.currentlyActive].toastRef;r.isInactive()||(this.currentlyActive=this.currentlyActive+1,r.activate())}return!0}findDuplicate(t="",e="",r,a){let{includeTitleDuplicates:c}=this.toastrConfig;for(let d of this.toasts){let u=c&&d.title===t;if((!c||u)&&d.message===e)return d.toastRef.onDuplicate(r,a),d}return null}applyConfig(t={}){return le(le({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,r,a){return a.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,r,a)):this._buildNotification(t,e,r,a)}_buildNotification(t,e,r,a){if(!a.toastComponent)throw new Error("toastComponent required");let c=this.findDuplicate(r,e,this.toastrConfig.resetTimeoutOnDuplicate&&a.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&r||e)&&this.toastrConfig.preventDuplicates&&c!==null)return c;this.previousToastMessage=e;let d=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(d=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let u=this.overlay.create(a.positionClass,this.overlayContainer);this.index=this.index+1;let h=e;e&&a.enableHtml&&(h=this.sanitizer.sanitize(wd.HTML,e));let f=new DE(u),v=new ph(this.index,a,h,r,t,f),C=[{provide:ph,useValue:v}],y=rn.create({providers:C,parent:this._injector}),A=new wE(a.toastComponent,y),D=u.attach(A,a.newestOnTop);f.componentInstance=D.instance;let F={toastId:this.index,title:r||"",message:e||"",toastRef:f,onShown:f.afterActivate(),onHidden:f.afterClosed(),onTap:v.onTap(),onAction:v.onAction(),portal:D};return d||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{F.toastRef.activate()})),this.toasts.push(F),F}static \u0275fac=function(e){return new(e||i)(kt(vM),kt(KH),kt(rn),kt($u),kt(Ri))};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),XH=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=vr(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;
2constructor(t,e,r){this.toastrService=t,this.toastPackage=e,this.ngZone=r,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(a=>{this.duplicatesCount=a}),this.state=vr({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>tt(le({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(r=>100-r),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>tt(le({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>tt(le({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(x(me),x(ph),x(Ri))};static \u0275cmp=te({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,r){e&1&&S("click",function(){return r.tapToast()})("mouseenter",function(){return r.stickAround()})("mouseleave",function(){return r.delayedHideToast()}),e&2&&(_k("@flyInOut",r._state),Co(r.toastClasses),gi("display",r.displayStyle))},attrs:fM,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,r){e&1&&T(0,NH,3,0,"button",0)(1,BH,3,5,"div",1)(2,VH,1,3,"div",2)(3,UH,2,4,"div",3)(4,jH,2,2,"div",4),e&2&&(p("ngIf",r.options.closeButton),m(
2),p("ngIf",r.title),m(),p("ngIf",r.message&&r.options.enableHtml),m(),p("ngIf",r.message&&!r.options.enableHtml),m(),p("ngIf",r.options.progressBar))},dependencies:[Dt],encapsulation:2,data:{animation:[Sg("flyInOut",[Uu("inactive",Dd({opacity:0})),Uu("active",Dd({opacity:1})),Uu("removed",Dd({opacity:0})),ju("inactive => active",Vu("{{ easeTime }}ms {{ easing }}")),ju("active => removed",Vu("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return i})(),JH=tt(le({},gM),{toastComponent:XH}),ZH=(i={})=>Cd([{provide:vM,useValue:{default:JH,config:i}}]),_M=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[ZH(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})();var QH=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=vr(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=vr("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,r){this.toastrService=t,this.toastPackage=e,this.appRef=r,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(a=>{this.duplicatesCount=a})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(r=>100-r),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(x(me),x(ph),x(gs))};static \u0275cmp=te({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,r){e&1&&S("click",function(){return r.tapToast()})("mouseenter",function(){return r.stickAround()})("mouseleave",function(){return r.delayedHideToast()}),e&2&&(Co(r.toastClasses),gi("display",r.displayStyle))},attrs:fM,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,r){e&1&&T(0,WH,3,0,"button",0)(1,GH,3,5,"div",1)(2,$H,1,3,"div",2)(3,zH,2,4,"div",3)(4,YH,2,2,"div",4),e&2&&(p("ngIf",r.options.closeButton),m(
2),p("ngIf",r.title),m(),p("ngIf",r.message&&r.options.enableHtml),m(),p("ngIf",r.message&&!r.options.enableHtml),m(),p("ngIf",r.options.progressBar))},dependencies:[Dt],encapsulation:2,changeDetection:0})}return i})(),Rke=tt(le({},gM),{toastComponent:QH});var yM="Logging",ME="x-amz-user-agent",SM="NoHubcallbackProvidedException";var il=function(i){return i.DEBUG="DEBUG",i.ERROR="ERROR",i.INFO="INFO",i.WARN="WARN",i.VERBOSE="VERBOSE",i.NONE="NONE",i}(il||{});var bM={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6},Rr=(()=>{class i{constructor(t,e=il.WARN){this.name=t,this.level=e,this._pluggables=[]}_padding(t){return t<10?"0"+t:""+t}_ts(){let t=new Date;return[this._padding(t.getMinutes()),this._padding(t.getSeconds())].join(":")+"."+t.getMilliseconds()}configure(t){return t?(this._config=t,this._config):this._config}_log(t,...e){let r=this.level;i.LOG_LEVEL&&(r=i.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);let a=bM[r];if(!(bM[t]>=a))return;let d=console.log.bind(console);t===il.ERROR&&console.error&&(d=console.error.bind(console)),t===il.WARN&&console.warn&&(d=console.warn.bind(console)),i.BIND_ALL_LOG_LEVELS&&(t===il.INFO&&console.info&&(d=console.info.bind(console)),t===il.DEBUG&&console.debug&&(d=console.debug.bind(console)));let u=`[${t}] ${this._ts()} ${this.name}`,h="";if(e.length===1&&typeof e[0]=="string")h=`${u} - ${e[0]}`,d(h);else if(e.length===1)h=`${u} ${e[0]}`,d(u,e[0]);else if(typeof e[0]=="string"){let f=e.slice(1);f.length===1&&(f=f[0]),h=`${u} - ${e[0]} ${f}`,d(`${u} - ${e[0]}`,f)}else h=`${u} ${e}`,d(u,e);for(let f of this._pluggables){let v={message:h,timestamp:Date.now()};f.pushLogs([v])}}log(...t){this._log(il.INFO,...t)}info(...t){this._log(il.INFO,...t)}warn(...t){this._log(il.WARN,...t)}error(...t){this._log(il.ERROR,...t)}debug(...t){this._log(il.DEBUG,...t)}verbose(...t){this._log(il.VERBOSE,...t)}addPluggable(t){t&&t.getCategoryName()===yM&&(this._pluggables.push(t),t.configure(this._config))}listPluggables(){return this._pluggables}}return i.LOG_LEVEL=null,i.BIND_ALL_LOG_LEVELS=!1,i})();var zr=class i extends Error{constructor({message:n,name:t,recoverySuggestion:e,underlyingError:r,metadata:a}){if(super(n),this.name=t,this.underlyingError=r,this.recoverySuggestion=e,a){let{extendedRequestId:c,httpStatusCode:d,requestId:u}=a;this.metadata={extendedRequestId:c,httpStatusCode:d,requestId:u}}this.constructor=i,Object.setPrototypeOf(this,i.prototype)}};var ys=function(i){return i.NoEndpointId="NoEndpointId",i.PlatformNotSupported="PlatformNotSupported",i.Unknown="Unknown",i.NetworkError="NetworkError",i}(ys||{});var rc=(i,n=zr)=>(t,e,r)=>{let{message:a,recoverySuggestion:c}=i[e];if(!t)throw new n({name:e,message:r?`${a} ${r}`:a,recoverySuggestion:c})};var qa=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",d1=new Rr("Hub"),oS=class{constructor(n){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=n}_remove(n,t){let e=this.listeners.get(n);if(!e){d1.warn(`No listeners for ${n}`);return}this.listeners.set(n,[...e.filter(({callback:r})=>r!==t)])}dispatch(n,t,e,r){typeof n=="string"&&this.protectedChannels.indexOf(n)>-1&&(r===qa||d1.warn(`WARNING: ${n} is protected and dispatching on it can have unintended consequences`));let a={channel:n,payload:le({},t),source:e,patternInfo:[]};try{this._toListeners(a)}catch(c){d1.error(c)}}listen(n,t,e="noname"){let r;if(typeof t!="function")throw new zr({name:SM,message:"No callback supplied to Hub"});r=t;let a=this.listeners.get(n);return a||(a=[],this.listeners.set(n,a)),a.push({name:e,callback:r}),()=>{this._remove(n,r)}}_toListeners(n){let{channel:t,payload:e}=n,r=this.listeners.get(t);r&&r.forEach(a=>{d1.debug(`Dispatching to ${t} with `,e);try{a.callback(n)}catch(c){d1.error(c)}})}},so=new oS("__default__"),Ju=new oS("internal-hub");var xM=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new zr({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},CM=()=>
2{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new zr({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},EM=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new zr({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})};var Zu={convert(i,n){let t=i;return n?.urlSafe&&(t=t.replace(/-/g,"+").replace(/_/g,"/")),EM()(t)}};var Hc=function(i){return i.AuthTokenConfigException="AuthTokenConfigException",i.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",i.AuthUserPoolException="AuthUserPoolException",i.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",i.OAuthNotConfigureException="OAuthNotConfigureException",i}(Hc||{}),eG={[Hc.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Hc.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Hc.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Hc.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Hc.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},sS=rc(eG);function Xi(i){let n=!0;i?n=!!i.userPoolId&&!!i.userPoolClientId:n=!1,sS(n,Hc.AuthUserPoolException)}function Qu(i){let n=!!i?.loginWith?.oauth?.domain&&!!i?.loginWith?.oauth?.redirectSignOut&&!!i?.loginWith?.oauth?.redirectSignIn&&!!i?.loginWith?.oauth?.responseType;sS(n,Hc.OAuthNotConfigureException)}function e0(i){let n=!!i?.identityPoolId;sS(n,Hc.InvalidIdentityPoolIdException)}function lo(i){let n=i.split(".");if(n.length!==3)throw new Error("Invalid token");try{let e=n[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(Zu.convert(e).split("").map(c=>`%${`00${c.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),a=JSON.parse(r);return{toString:()=>i,payload:a}}catch{throw new Error("Invalid token payload")}}var AE=i=>{let n=Reflect.ownKeys(i);for(let t of n){let e=i[t];(e&&typeof e=="object"||typeof e=="function")&&AE(e)}return Object.freeze(i)};var tG=new Rr("parseAWSExports"),iG={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},TM=(i={})=>{if(!Object.prototype.hasOwnProperty.call(i,"aws_project_region"))throw new zr({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});let{aws_appsync_apiKey:n,aws_appsync_authenticationType:t,aws_appsync_graphqlEndpoint:e,aws_appsync_region:r,aws_bots_config:a,aws_cognito_identity_pool_id:c,aws_cognito_sign_up_verification_method:d,aws_cognito_mfa_configuration:u,aws_cognito_mfa_types:h,aws_cognito_password_protection_settings:f,aws_cognito_verification_mechanisms:v,aws_cognito_signup_attributes:C,aws_cognito_social_providers:y,aws_cognito_username_attributes:A,aws_mandatory_sign_in:D,aws_mobile_analytics_app_id:F,aws_mobile_analytics_app_region:R,aws_user_files_s3_bucket:L,aws_user_files_s3_bucket_region:H,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:se,aws_user_pools_id:Ce,aws_user_pools_web_client_id:Ue,geo:re,oauth:ae,predictions:ve,aws_cloud_logic_custom:Me,Notifications:W,modelIntrospection:J}=i,Ee={};F&&(Ee.Analytics={Pinpoint:{appId:F,region:R}});let{InAppMessaging:Fe,Push:$e}=W??{};if(Fe?.AWSPinpoint||$e?.AWSPinpoint){if(Fe?.AWSPinpoint){let{appId:V,region:Y}=Fe.AWSPinpoint;Ee.Notifications={InAppMessaging:{Pinpoint:{appId:V,region:Y}}}}if($e?.AWSPinpoint){let{appId:V,region:Y}=$e.AWSPinpoint;Ee.Notifications=tt(le({},Ee.Notifications),{PushNotification:{Pinpoint:{appId:V,region:Y}}})}}if(Array.isArray(a)&&(Ee.Interactions={LexV1:Object.fromEntries(a.map(V=>[V.name,V]))}),e){let V=iG[t];V||tG.debug(`Invalid authentication type ${t}. Falling back to IAM.`),Ee.API={GraphQL:{endpoint:e,apiKey:n,region:r,defaultAuthMode:V??"iam"}},J&&(Ee.API.GraphQL.modelIntrospection=J)}let Qe=u?{status:u&&u.toLowerCase(),totpEnabled:h?.includes("TOTP")??!1,smsEnabled:h?.includes("SMS")??!1}
2:void 0,ot=f?{minLength:f.passwordPolicyMinLength,requireLowercase:f.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:f.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:f.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:f.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,gt=Array.from(new Set([...v??[],...C??[]])).reduce((V,Y)=>tt(le({},V),{[Y.toLowerCase()]:{required:!0}}),{}),vt=A?.includes("EMAIL")??!1,Kt=A?.includes("PHONE_NUMBER")??!1;(c||Ce)&&(Ee.Auth={Cognito:{identityPoolId:c,allowGuestAccess:D!=="enable",signUpVerificationMethod:d,userAttributes:gt,userPoolClientId:Ue,userPoolId:Ce,mfa:Qe,passwordFormat:ot,loginWith:{username:!(vt||Kt),email:vt,phone:Kt}}});let O=ae?Object.keys(ae).length>0:!1,Q=y?y.length>0:!1;if(Ee.Auth&&O&&(Ee.Auth.Cognito.loginWith=tt(le({},Ee.Auth.Cognito.loginWith),{oauth:le(le({},nG(ae)),Q&&{providers:rG(y)})})),L&&(Ee.Storage={S3:{bucket:L,region:H,dangerouslyConnectToHttpEndpointForTesting:se}}),re){let{amazon_location_service:V}=re;Ee.Geo={LocationService:{maps:V.maps,geofenceCollections:V.geofenceCollections,searchIndices:V.search_indices,region:V.region}}}if(Me&&(Ee.API=tt(le({},Ee.API),{REST:Me.reduce((V,Y)=>{let{name:we,endpoint:Ve,region:Ge,service:je}=Y;return tt(le({},V),{[we]:le(le({endpoint:Ve},je?{service:je}:void 0),Ge?{region:Ge}:void 0)})},{})})),ve){let{VoiceId:V}=ve?.convert?.speechGenerator?.defaults??{};Ee.Predictions=V?tt(le({},ve),{convert:tt(le({},ve.convert),{speechGenerator:tt(le({},ve.convert.speechGenerator),{defaults:{voiceId:V}})})}):ve}return Ee},wM=i=>i?.split(",")??[],nG=({domain:i,scope:n,redirectSignIn:t,redirectSignOut:e,responseType:r})=>({domain:i,scopes:n,redirectSignIn:wM(t),redirectSignOut:wM(e),responseType:r}),rG=i=>i.map(n=>{let t=n.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)});var m1=Symbol("oauth-listener");var co=[];for(let i=0;i<256;++i)co.push((i+256).toString(16).slice(1));function DM(i,n=0){return(co[i[n+0]]+co[i[n+1]]+co[i[n+2]]+co[i[n+3]]+"-"+co[i[n+4]]+co[i[n+5]]+"-"+co[i[n+6]]+co[i[n+7]]+"-"+co[i[n+8]]+co[i[n+9]]+"-"+co[i[n+10]]+co[i[n+11]]+co[i[n+12]]+co[i[n+13]]+co[i[n+14]]+co[i[n+15]]).toLowerCase()}var PE,aG=new Uint8Array(16);function FE(){if(!PE){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");PE=crypto.getRandomValues.bind(crypto)}return PE(aG)}var oG=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),RE={randomUUID:oG};function sG(i,n,t){if(RE.randomUUID&&!n&&!i)return RE.randomUUID();i=i||{};let e=i.random??i.rng?.()??FE();if(e.length<16)throw new Error("Random bytes length must be >= 16");if(e[6]=e[6]&15|64,e[8]=e[8]&63|128,n){if(t=t||0,t<0||t+16>n.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let r=0;r<16;++r)n[t+r]=e[r];return n}return DM(e)}var OE=sG;function kM(i){let{version:n}=i;return n?n.startsWith("1"):!1}function lG(i){if(!i)return;let{bucket_name:n,aws_region:t,buckets:e}=i;return{S3:{bucket:n,region:t,buckets:e&&_G(e)}}}function cG(i){if(!i)return;let{user_pool_id:n,user_pool_client_id:t,identity_pool_id:e,password_policy:r,mfa_configuration:a,mfa_methods:c,unauthenticated_identities_enabled:d,oauth:u,username_attributes:h,standard_required_attributes:f,groups:v}=i,C={Cognito:{userPoolId:n,userPoolClientId:t,groups:v}};return e&&(C.Cognito=tt(le({},C.Cognito),{identityPoolId:e})),r&&(C.Cognito.passwordFormat={requireLowercase:r.require_lowercase,requireNumbers:r.require_numbers,requireUppercase:r.require_uppercase,requireSpecialCharacters:r.require_symbols,minLength:r.min_length??6}),a&&(C.Cognito.mfa={status:vG(a),smsEnabled:c?.includes("SMS"),totpEnabled:c?.includes("TOTP")}),d&&(C.Cognito.allowGuestAccess=d),u&&(C.Cognito.loginWith={oauth:{domain:u.domain,redirectSignIn:u.redirect_sign_in_uri,redirectSignOut:u.redirect_sign_out_uri,responseType:u.response_type==="token"?"token":"code",scopes:u.scopes,providers:gG(u.identity_providers)}}),h&&(C.Cognito.loginWith=tt(le({},C.Cognito.loginWith),{email:h.includes("email"),phone:h.includes("phone_number"),username:h.includes("username")})),f&&(C.Cognito.userAttributes=f.reduce((y,A)=>tt(le({},y),{[A]:{required:!0}}),{})),C}function dG(i){if(!i?.amazon_pinpoint)return;let{amazon_pinpoint:n}=i;return{Pinpoint:{appId:n.app_id,region:n.aws_region}}}function mG(i){if(!i)return;let{aws_region:n,geofence_collections:t,maps:e,search_indices:r}=i;return{LocationService:{region:n,searchIndices:r,geofenceCollections:t,maps:e}}}function uG(i){if(!i)return;let{aws_region:n,default_authorization_type:t,url:e,api_key:r,model_introspection:a}=i;return{GraphQL:{endpoint:e,defaultAuthMode:AM(t),region:n,apiKey:r,modelIntrospection:a}}}function pG(i){if(!i?.events)return;let{url:n,aws_region:t,api_key:e,default_authorization_type:r}=i.events;return{Events:{endpoint:n,defaultAuthMode:AM(r),region:t,apiKey:e}}}function hG(i){if(!i)return;let{aws_region:n,channels:t,amazon_pinpoint_app_id:e}=i,r=t.includes("IN_APP_MESSAGING"),a=t.includes("APNS")||t.includes("FCM");if(!(r||a))return;let c={};return r&&(c.InAppMessaging={Pinpoint:{appId:e,region:n}}),a&&(c.PushNotification={Pinpoint:{appId:e,region:n}}),c}function MM(i){let n={};if(i.storage&&(n.Storage=lG(i.storage)),i.auth&&(n.Auth=cG(i.auth)),i.analytics&&(n.Analytics=dG(i.analytics)),i.geo&&(n.Geo=mG(i.geo)),i.data&&(n.API=uG(i.data)),i.custom){let t=pG(i.custom);t&&"Events"in t&&(n.API=le(le({},n.API),t))}return i.notifications&&(n.Notifications=hG(i.notifications)),n}var fG={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function AM(i){return fG[i]}var IM={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function gG(i=[]){return i.reduce((n,t)=>(IM[t]!==void 0&&n.push(IM[t]),n),[])}function vG(i){return i==="OPTIONAL"?"optional":i==="REQUIRED"?"on":"off"}function _G(i){let n={};
2return i.forEach(({name:t,bucket_name:e,aws_region:r,paths:a})=>{if(t in n)throw new Error(`Duplicate friendly name found: ${t}. Name must be unique.`);let c=a?Object.entries(a).reduce((d,[u,h])=>(h!==void 0&&(d[u]=h),d),{}):void 0;n[t]={bucketName:e,region:r,paths:c}}),n}var u1=i=>Object.keys(i).some(n=>n.startsWith("aws_"))?TM(i):kM(i)?MM(i):i;var Ss=64,PM=32,FM=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),RM=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],OM=Math.pow(2,53)-1;var p1=function(){function i(){this.state=Int32Array.from(RM),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return i.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,e=n.byteLength;if(this.bytesHashed+=e,this.bytesHashed*8>OM)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;e>0;)this.buffer[this.bufferLength++]=n[t++],e--,this.bufferLength===Ss&&(this.hashBuffer(),this.bufferLength=0)},i.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),e=this.bufferLength;if(t.setUint8(this.bufferLength++,128),e%Ss>=Ss-8){for(var r=this.bufferLength;r<Ss;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(var r=this.bufferLength;r<Ss-8;r++)t.setUint8(r,0);t.setUint32(Ss-8,Math.floor(n/4294967296),!0),t.setUint32(Ss-4,n),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(PM),r=0;r<8;r++)a[r*4]=this.state[r]>>>24&255,a[r*4+1]=this.state[r]>>>16&255,a[r*4+2]=this.state[r]>>>8&255,a[r*4+3]=this.state[r]>>>0&255;return a},i.prototype.hashBuffer=function(){for(var n=this,t=n.buffer,e=n.state,r=e[0],a=e[1],c=e[2],d=e[3],u=e[4],h=e[5],f=e[6],v=e[7],C=0;C<Ss;C++){if(C<16)this.temp[C]=(t[C*4]&255)<<24|(t[C*4+1]&255)<<16|(t[C*4+2]&255)<<8|t[C*4+3]&255;else{var y=this.temp[C-2],A=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10;y=this.temp[C-15];var D=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;this.temp[C]=(A+this.temp[C-7]|0)+(D+this.temp[C-16]|0)}var F=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&h^~u&f)|0)+(v+(FM[C]+this.temp[C]|0)|0)|0,R=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&a^r&c^a&c)|0;v=f,f=h,h=u,u=d+F|0,d=c,c=a,a=r,r=F+R|0}e[0]+=r,e[1]+=a,e[2]+=c,e[3]+=d,e[4]+=u,e[5]+=h,e[6]+=f,e[7]+=v},i}();var NE=i=>new TextEncoder().encode(i);var yG=typeof Buffer<"u"&&Buffer.from?function(i){return Buffer.from(i,"utf8")}:NE;function lS(i){return i instanceof Uint8Array?i:typeof i=="string"?yG(i):ArrayBuffer.isView(i)?new Uint8Array(i.buffer,i.byteOffset,i.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(i)}function LE(i){return typeof i=="string"?i.length===0:i.byteLength===0}var t0=function(){function i(n){this.secret=n,this.hash=new p1,this.reset()}return i.prototype.update=function(n){if(!(LE(n)||this.error))try{this.hash.update(lS(n))}catch(t){this.error=t}},i.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},i.prototype.digest=function(){return j3(this,void 0,void 0,function(){return W3(this,function(n){return[2,this.digestSync()]})})},i.prototype.reset=function(){if(this.hash=new p1,this.secret){this.outer=new p1;var n=SG(this.secret),t=new Uint8Array(Ss);t.set(n);for(var e=0;e<Ss;e++)n[e]^=54,t[e]^=92;this.hash.update(n),this.outer.update(t);for(var e=0;e<n.byteLength;e++)n[e]=0}},i}();function SG(i){var n=lS(i);if(n.byteLength>Ss){var t=new p1;t.update(n),n=t.digest()}var e=new Uint8Array(Ss);return e.set(n),e}var bG={},xG={};for(let i=0;i<256;i++){let n=i.toString(16).toLowerCase();n.length===1&&(n=`0${n}`),bG[i]=n,xG[n]=i}var Or=function(i){return i.WebUnknown="0",i.React="1",i.NextJs="2",i.Angular="3",i.VueJs="4",i.Nuxt="5",i.Svelte="6",i.ServerSideUnknown="100",i.ReactSSR="101",i.NextJsSSR="102",i.AngularSSR="103",i.VueJsSSR="104",i.NuxtSSR="105",i.SvelteSSR="106",i.ReactNative="201",i.Expo="202",i}(Or||{}),cS=function(i){return i.AI="ai",i.API="api",i.Auth="auth",i.Analytics="analytics",i.DataStore="datastore",i.Geo="geo",i.InAppMessaging="inappmessaging",i.Interactions="interactions",i.Predictions="predictions",i.PubSub="pubsub",i.PushNotification="pushnotification",i.Storage="storage",i}(cS||{});var Tr=function(i){return i.SignUp="1",i.ConfirmSignUp="2",i.ResendSignUpCode="3",i.SignIn="4",i.FetchMFAPreference="6",i.UpdateMFAPreference="7",i.SetUpTOTP="10",i.VerifyTOTPSetup="11",i.ConfirmSignIn="12",i.DeleteUserAttributes="15",i.DeleteUser="16",i.UpdateUserAttributes="17",i.FetchUserAttributes="18",i.ConfirmUserAttribute="22",i.SignOut="26",i.UpdatePassword="27",i.ResetPassword="28",i.ConfirmResetPassword="29",i.FederatedSignIn="30",i.RememberDevice="32",i.ForgetDevice="33",i.FetchDevices="34",i.SendUserAttributeVerificationCode="35",i.SignInWithRedirect="36",i.StartWebAuthnRegistration="37",i.CompleteWebAuthnRegistration="38",i.ListWebAuthnCredentials="39",i.DeleteWebAuthnCredential="40",i}(Tr||{});var BE="6.15.4";var Pm=()=>typeof global<"u";var Tl=()=>typeof window<"u",dS=()=>typeof document<"u",hh=()=>typeof process<"u",Fm=(i,n)=>!!Object.keys(i).find(t=>t.startsWith(n));function NM(){let i=e=>e.startsWith("_react")||e.startsWith("__react"),n=e=>Object.keys(e).find(i),t=()=>Array.from(document.querySelectorAll("[id]"));return dS()&&t().some(n)}function LM(){return hh()&&typeof process.env<"u"&&!!Object.keys(process.env).find(i=>i.includes("react"))}function BM(){return Tl()&&Fm(window,"__VUE")}
2function VM(){return Pm()&&Fm(global,"__VUE")}function UM(){return Tl()&&Fm(window,"__SVELTE")}function jM(){return hh()&&typeof process.env<"u"&&!!Object.keys(process.env).find(i=>i.includes("svelte"))}function WM(){return Tl()&&window.next&&typeof window.next=="object"}function HM(){return Pm()&&(Fm(global,"__next")||Fm(global,"__NEXT"))}function GM(){return Tl()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function $M(){return Pm()&&typeof global.__NUXT_PATHS__<"u"}function zM(){let i=!!(dS()&&document.querySelector("[ng-version]")),n=!!(Tl()&&typeof window.ng<"u");return i||n}function YM(){return hh()&&typeof process.env=="object"&&process.env.npm_lifecycle_script?.startsWith("ng ")||!1}function qM(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function KM(){return Pm()&&typeof global.expo<"u"}function XM(){return Tl()}var CG=[{platform:Or.Expo,detectionMethod:KM},{platform:Or.ReactNative,detectionMethod:qM},{platform:Or.NextJs,detectionMethod:WM},{platform:Or.Nuxt,detectionMethod:GM},{platform:Or.Angular,detectionMethod:zM},{platform:Or.React,detectionMethod:NM},{platform:Or.VueJs,detectionMethod:BM},{platform:Or.Svelte,detectionMethod:UM},{platform:Or.WebUnknown,detectionMethod:XM},{platform:Or.NextJsSSR,detectionMethod:HM},{platform:Or.NuxtSSR,detectionMethod:$M},{platform:Or.ReactSSR,detectionMethod:LM},{platform:Or.VueJsSSR,detectionMethod:VM},{platform:Or.AngularSSR,detectionMethod:YM},{platform:Or.SvelteSSR,detectionMethod:jM}];function JM(){return CG.find(i=>i.detectionMethod())?.platform||Or.ServerSideUnknown}var h1,mS=[],uS=!1,EG=10,wG=10,TG=1e3,pS=()=>{if(!h1){if(h1=JM(),uS)for(;mS.length;)mS.pop()?.();else mS.forEach(i=>{i()});ZM(Or.ServerSideUnknown,EG),ZM(Or.WebUnknown,wG)}return h1},QM=i=>{uS||mS.push(i)};function DG(){h1=void 0}function ZM(i,n){h1===i&&!uS&&setTimeout(()=>{DG(),uS=!0,setTimeout(pS,TG)},n)}var IG={};var eA=(i,n)=>IG[i]?.[n]?.additionalDetails;var tA="aws-amplify",iA=i=>i.replace(/\+.*/,""),VE=class{constructor(){this.userAgent=`${tA}/${iA(BE)}`}get framework(){return pS()}get isReactNative(){return this.framework===Or.ReactNative||this.framework===Or.Expo}observeFrameworkChanges(n){QM(n)}},kG=new VE,nA=({category:i,action:n}={})=>{let t=[[tA,iA(BE)]];if(i&&t.push([i,n]),t.push(["framework",pS()]),i&&n){let e=eA(i,n);e&&e.forEach(r=>{t.push(r)})}return t},Fd=i=>nA(i).map(([e,r])=>e&&r?`${e}/${r}`:e).join(" ");var i0=()=>typeof window<"u"&&typeof window.document<"u";var rA=new Rr("Auth"),hS=class{configure(n,t){this.authConfig=n,this.authOptions=t,n&&n.Cognito?.userPoolEndpoint&&rA.warn(aA("Amazon Cognito User Pool")),n&&n.Cognito?.identityPoolEndpoint&&rA.warn(aA("Amazon Cognito Identity Pool"))}fetchAuthSession(){return ye(this,arguments,function*(n={}){let t,e,r=yield this.getTokens(n);return r?(e=r.accessToken?.payload?.sub,t=yield this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:r,authenticated:!0,forceRefresh:n.forceRefresh})):t=yield this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:n.forceRefresh}),{tokens:r,credentials:t?.credentials,identityId:t?.identityId,userSub:e}})}clearCredentials(){return ye(this,null,function*(){yield this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()})}getTokens(n){return ye(this,null,function*(){return(yield this.authOptions?.tokenProvider?.getTokens(n))??void 0})}},aA=i=>`You are using a custom Amazon ${i} endpoint, ensure the endpoint is correct.`;var fS=class{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new hS}configure(n,t){let e=u1(n);this.resourcesConfig=e,t&&(this.libraryOptions=t),this.resourcesConfig=AE(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),so.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",qa),this.notifyOAuthListener(),this.isConfigured=!0}getConfig(){return this.isConfigured||console.warn("Amplify has not been configured. Please call Amplify.configure() before using this service."),this.resourcesConfig}[m1](n){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?n(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=n}notifyOAuthListener(){!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth||!this.oAuthListener||(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}},un=new fS;var f1=(i,n)=>i.Auth.fetchAuthSession(n);var fh=i=>f1(un,i);function g1(){return un.Auth.clearCredentials()}var n0=i=>{let{headers:n,statusCode:t}=i;return tt(le({},MG(i)?i.$metadata:{}),{httpStatusCode:t,requestId:n["x-amzn-requestid"]??n["x-amzn-request-id"]??n["x-amz-request-id"],extendedRequestId:n["x-amz-id-2"],cfId:n["x-amz-cf-id"]})},MG=i=>typeof i?.$metadata=="object";var nl=i=>ye(null,null,function*(){if(!i||i.statusCode<300)return;let n=yield Gc(i),e=(c=>{let[d]=c.toString().split(/[,:]+/);return d.includes("#")?d.split("#")[1]:d})(i.headers["x-amzn-errortype"]??n.code??n.__type??"UnknownError"),r=n.message??n.Message??"Unknown error",a=new Error(r);return Object.assign(a,{name:e,$metadata:n0(i)})}),Gc=i=>ye(null,null,function*(){if(!i.body)throw new Error("Missing response payload");let n=yield i.body.json();return Object.assign(n,{$metadata:n0(i)})});var cr=(i,n,t,e)=>(r,a)=>ye(null,null,function*(){let c=le(le({},e),r),d=yield c.endpointResolver(c,a),u=yield n(a,d),h=yield i(u,le({},c));return t(h)});function oA(i=3e5){return e=>{let r=2**e*100+100*Math.random();return r>i?!1:r}}var UE="amz-sdk-invocation-id",sA="amz-sdk-request";var v1=i=>
2{let t=oA(3e5)(i);return t===!1?3e5:t};var PG=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],lA=i=>!!i&&PG.includes(i);var _1=i=>(n,t)=>ye(null,null,function*(){let e=t??(yield i(n))??void 0,r=e?.code||e?.name,a=n?.statusCode;return{retryable:NG(t)||OG(a,r)||lA(r)||LG(a,r)}}),FG=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],RG=["TimeoutError","RequestTimeout","RequestTimeoutException"],OG=(i,n)=>i===429||!!n&&FG.includes(n),NG=i=>[ys.NetworkError,"ERR_NETWORK"].includes(i?.name),LG=(i,n)=>!!i&&[500,502,503,504].includes(i)||!!n&&RG.includes(n);var jE="cognito-identity",gS={service:jE,retryDecider:_1(nl),computeDelay:v1,cache:"no-store"};var mA=({maxAttempts:i=3,retryDecider:n,computeDelay:t,abortSignal:e})=>{if(i<1)throw new Error("maxAttempts must be greater than 0");return(r,a)=>function(d){return ye(this,null,function*(){let u,h=a.attemptsCount??0,f,v=()=>{if(f)return cA(f,h),f;throw cA(u,h),u};for(;!e?.aborted&&h<i;){try{f=yield r(d),u=void 0}catch(A){u=A,f=void 0}h=(a.attemptsCount??0)>h?a.attemptsCount??0:h+1,a.attemptsCount=h;let{isCredentialsExpiredError:C,retryable:y}=yield n(f,u,a);if(y){if(a.isCredentialsExpired=!!C,!e?.aborted&&h<i){let A=t(h);yield BG(A,e)}continue}else return v()}if(e?.aborted)throw new Error("Request aborted.");return v()})}},BG=(i,n)=>{if(n?.aborted)return Promise.resolve();let t,e,r=new Promise(a=>{e=a,t=setTimeout(a,i)});return n?.addEventListener("abort",function a(c){clearTimeout(t),n?.removeEventListener("abort",a),e()}),r},cA=(i,n)=>{Object.prototype.toString.call(i)==="[object Object]"&&(i.$metadata=tt(le({},i.$metadata??{}),{attempts:n}))};var uA=OE;var pA=()=>i=>function(t){return ye(this,null,function*(){return t.headers[UE]||(t.headers[UE]=uA()),i(t)})};var hA=({maxAttempts:i=3})=>(n,t)=>function(r){return ye(this,null,function*(){let a=t.attemptsCount??0;return r.headers[sA]=`attempt=${a+1}; max=${i}`,n(r)})};var fA=({userAgentHeader:i="x-amz-user-agent",userAgentValue:n=""})=>t=>function(r){return ye(this,null,function*(){if(n.trim().length===0)return yield t(r);{let a=i.toLowerCase();return r.headers[a]=r.headers[a]?`${r.headers[a]} ${n}`:n,yield t(r)}})};var r0=(i,n)=>(t,e)=>{let r={},a=c=>i(c,e);for(let c=n.length-1;c>=0;c--){let d=n[c];a=d(e)(a,r)}return a(t)};var vS=i=>{let n;return()=>(n||(n=i()),n)};var VG=i=>!["HEAD","GET"].includes(i.toUpperCase()),gA=(d,u)=>ye(null,[d,u],function*({url:i,method:n,headers:t,body:e},{abortSignal:r,cache:a,withCrossDomainCredentials:c}){let h;try{h=yield fetch(i,{method:n,headers:t,body:VG(n)?e:void 0,signal:r,cache:a,credentials:c?"include":"same-origin"})}catch(y){throw y instanceof TypeError?new zr({name:ys.NetworkError,message:"A network error has occurred.",underlyingError:y}):y}let f={};h.headers?.forEach((y,A)=>{f[A.toLowerCase()]=y});let v={statusCode:h.status,headers:f,body:null},C=Object.assign(h.body??{},{text:vS(()=>h.text()),blob:vS(()=>h.blob()),json:vS(()=>h.json())});return tt(le({},v),{body:C})});var y1=r0(gA,[fA,pA,mA,hA]);var vA=()=>i=>function(t){return ye(this,null,function*(){return t.headers["cache-control"]="no-store",i(t)})};var _S=r0(y1,[vA]);var yS=i=>(n,t)=>{let e=UG(i),r=JSON.stringify(n);return jG(t,e,r)},UG=i=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${i}`}),jG=({url:i},n,t)=>({headers:n,url:i,body:t,method:"POST"});var SS=i=>cr(_S,yS("GetCredentialsForIdentity"),WG,tt(le(le({},gS),i),{userAgentValue:Fd()})),WG=i=>ye(null,null,function*(){if(i.statusCode>=300)throw yield nl(i);let n=yield Gc(i);return{IdentityId:n.IdentityId,Credentials:HG(n.Credentials),$metadata:n0(i)}}),HG=(t={})=>{var e=t,{Expiration:i}=e,n=Ux(e,["Expiration"]);return tt(le({},n),{Expiration:i&&new Date(i*1e3)})};var WE=i=>cr(_S,yS("GetId"),GG,tt(le(le({},gS),i),{userAgentValue:Fd()})),GG=i=>ye(null,null,function*(){if(i.statusCode>=300)throw yield nl(i);return{IdentityId:(yield Gc(i)).IdentityId,$metadata:n0(i)}});var HE={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},_A={partitions:[HE,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]};var S1=i=>{let{partitions:n}=_A;for(let{regions:t,outputs:e,regionRegex:r}of n){let a=new RegExp(r);if(t.includes(i)||a.test(i))return e.dnsSuffix}return HE.outputs.dnsSuffix};var qo=URL;var GE=({region:i})=>({url:new qo(`https://${jE}.${i}.${S1(i)}`)});var Rd=class extends zr{constructor(){super({name:ys.PlatformNotSupported,message:"Function not supported on current platform"})}};var $c=class{constructor(n){this.storage=n}setItem(n,t){return ye(this,null,function*(){if(!this.storage)throw new Rd;this.storage.setItem(n,t)})}getItem(n){return ye(this,null,function*(){if(!this.storage)throw new Rd;return this.storage.getItem(n)})}removeItem(n){return ye(this,null,function*(){if(!this.storage)throw new Rd;this.storage.removeItem(n)})}clear(){return ye(this,null,function*(){if(!this.storage)throw new Rd;this.storage.clear()})}};var a0=class{constructor(){this.storage=new Map}get length(){return this.storage.size}key(n){return n>this.length-1?null:Array.from(this.storage.keys())[n]}setItem(n,t){this.storage.set(n,t)}getItem(n){return this.storage.get(n)??null}removeItem(n){this.storage.delete(n)}clear(){this.storage.clear()}};var yA=new Rr("CoreStorageUtils"),bS=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{yA.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new a0},xS=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return yA.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new a0}};
2var CS=class extends $c{constructor(){super(bS())}};var ES=class extends $c{constructor(){super(xS())}};var wS=class{constructor(n){this._storage=n}get storage(){if(!this._storage)throw new Rd;return this._storage}setItem(n,t){this.storage.setItem(n,t)}getItem(n){return this.storage.getItem(n)}removeItem(n){this.storage.removeItem(n)}clear(){this.storage.clear()}};var TS=class extends wS{constructor(){super(xS())}};function DS(i){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var e in t)i[e]=t[e]}return i}var $G={read:function(i){return i[0]==='"'&&(i=i.slice(1,-1)),i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function $E(i,n){function t(r,a,c){if(!(typeof document>"u")){c=DS({},n,c),typeof c.expires=="number"&&(c.expires=new Date(Date.now()+c.expires*864e5)),c.expires&&(c.expires=c.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var u in c)c[u]&&(d+="; "+u,c[u]!==!0&&(d+="="+c[u].split(";")[0]));return document.cookie=r+"="+i.write(a,r)+d}}function e(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var a=document.cookie?document.cookie.split("; "):[],c={},d=0;d<a.length;d++){var u=a[d].split("="),h=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(c[f]=i.read(h,f),r===f)break}catch{}}return r?c[r]:c}}return Object.create({set:t,get:e,remove:function(r,a){t(r,"",DS({},a,{expires:-1}))},withAttributes:function(r){return $E(this.converter,DS({},this.attributes,r))},withConverter:function(r){return $E(DS({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(i)}})}var b1=$E($G,{path:"/"});var x1=class{constructor(n={}){let{path:t,domain:e,expires:r,sameSite:a,secure:c}=n;if(this.domain=e,this.path=t||"/",this.expires=Object.prototype.hasOwnProperty.call(n,"expires")?r:365,this.secure=Object.prototype.hasOwnProperty.call(n,"secure")?c:!0,Object.prototype.hasOwnProperty.call(n,"sameSite")){if(!a||!["strict","lax","none"].includes(a))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(a==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=a}}setItem(n,t){return ye(this,null,function*(){b1.set(n,t,this.getData())})}getItem(n){return ye(this,null,function*(){return b1.get(n)??null})}removeItem(n){return ye(this,null,function*(){b1.remove(n,this.getData())})}clear(){return ye(this,null,function*(){let n=b1.get(),t=Object.keys(n).map(e=>this.removeItem(e));yield Promise.all(t)})}getData(){return le({path:this.path,expires:this.expires,domain:this.domain,secure:this.secure},this.sameSite&&{sameSite:this.sameSite})}};var ac=new CS,zG=new ES,oc=new TS,YG=new $c(new a0);var Rm={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8},Od="CurSize";function zE(i){let n=0;n=i.length;for(let t=i.length;t>=0;t-=1){let e=i.charCodeAt(t);e>127&&e<=2047?n+=1:e>2047&&e<=65535&&(n+=2),e>=56320&&e<=57343&&(t-=1)}return n}function Om(){return new Date().getTime()}var o0=i=>`${i}${Od}`;var s0=function(i){return i.NoCacheItem="NoCacheItem",i.NullNextNode="NullNextNode",i.NullPreviousNode="NullPreviousNode",i}(s0||{}),qG={[s0.NoCacheItem]:{message:"Item not found in the cache storage."},[s0.NullNextNode]:{message:"Next node is null."},[s0.NullPreviousNode]:{message:"Previous node is null."}},YE=rc(qG);var ea=new Rr("StorageCache"),IS=class{constructor({config:n,keyValueStorage:t}){this.config=le(le({},Rm),n),this.keyValueStorage=t,this.sanitizeConfig()}getModuleName(){return"Cache"}configure(n){return n&&(n.keyPrefix&&ea.warn("keyPrefix can not be re-configured on an existing Cache instance."),this.config=le(le({},this.config),n)),this.sanitizeConfig(),this.config}getCurrentCacheSize(){return ye(this,null,function*(){let n=yield this.getStorage().getItem(o0(this.config.keyPrefix));
2return n||(yield this.getStorage().setItem(o0(this.config.keyPrefix),"0"),n="0"),Number(n)})}setItem(n,t,e){return ye(this,null,function*(){if(ea.debug(`Set item: key is ${n}, value is ${t} with options: ${e}`),!n||n===Od){ea.warn(`Invalid key: should not be empty or reserved key: '${Od}'`);return}if(typeof t>"u"){ea.warn("The value of item should not be undefined!");return}let r={priority:e?.priority!==void 0?e.priority:this.config.defaultPriority,expires:e?.expires!==void 0?e.expires:this.config.defaultTTL+Om()};if(r.priority<1||r.priority>5){ea.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");return}let a=`${this.config.keyPrefix}${n}`,c=this.fillCacheItem(a,t,r);if(c.byteSize>this.config.itemMaxSize){ea.warn(`Item with key: ${n} you are trying to put into is too big!`);return}try{let d=yield this.getStorage().getItem(a);if(d&&(yield this.removeCacheItem(a,JSON.parse(d).byteSize)),yield this.isCacheFull(c.byteSize)){let u=yield this.clearInvalidAndGetRemainingKeys();if(yield this.isCacheFull(c.byteSize)){let h=yield this.sizeToPop(c.byteSize);yield this.popOutItems(u,h)}}return this.setCacheItem(a,c)}catch(d){ea.warn(`setItem failed! ${d}`)}})}getItem(n,t){return ye(this,null,function*(){ea.debug(`Get item: key is ${n} with options ${t}`);let e;if(!n||n===Od)return ea.warn(`Invalid key: should not be empty or reserved key: '${Od}'`),null;let r=`${this.config.keyPrefix}${n}`;try{if(e=yield this.getStorage().getItem(r),e!=null)if(yield this.isExpired(r))yield this.removeCacheItem(r,JSON.parse(e).byteSize);else return(yield this.updateVisitedTime(JSON.parse(e),r)).data;if(t?.callback){let a=t.callback();return a!==null&&(yield this.setItem(n,a,t)),a}return null}catch(a){return ea.warn(`getItem failed! ${a}`),null}})}removeItem(n){return ye(this,null,function*(){if(ea.debug(`Remove item: key is ${n}`),!n||n===Od){ea.warn(`Invalid key: should not be empty or reserved key: '${Od}'`);return}let t=`${this.config.keyPrefix}${n}`;try{let e=yield this.getStorage().getItem(t);e&&(yield this.removeCacheItem(t,JSON.parse(e).byteSize))}catch(e){ea.warn(`removeItem failed! ${e}`)}})}getAllKeys(){return ye(this,null,function*(){try{return yield this.getAllCacheKeys()}catch(n){return ea.warn(`getAllkeys failed! ${n}`),[]}})}getStorage(){return this.keyValueStorage}isExpired(n){return ye(this,null,function*(){let t=yield this.getStorage().getItem(n);YE(t!==null,s0.NoCacheItem,`Key: ${n}`);let e=JSON.parse(t);return Om()>=e.expires})}removeCacheItem(n,t){return ye(this,null,function*(){let e=yield this.getStorage().getItem(n);YE(e!==null,s0.NoCacheItem,`Key: ${n}`);let r=t??JSON.parse(e).byteSize;yield this.decreaseCurrentSizeInBytes(r);try{yield this.getStorage().removeItem(n)}catch(a){yield this.increaseCurrentSizeInBytes(r),ea.error(`Failed to remove item: ${a}`)}})}fillCacheItem(n,t,e){let r={key:n,data:t,timestamp:Om(),visitedTime:Om(),priority:e.priority??0,expires:e.expires??0,type:typeof t,byteSize:0};return r.byteSize=zE(JSON.stringify(r)),r.byteSize=zE(JSON.stringify(r)),r}sanitizeConfig(){this.config.itemMaxSize>this.config.capacityInBytes&&(ea.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=Rm.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(ea.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=Rm.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(ea.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=Rm.warningThreshold);let n=5*1024*1024;this.config.capacityInBytes>n&&(ea.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=Rm.capacityInBytes)}increaseCurrentSizeInBytes(n){return ye(this,null,function*(){let t=yield this.getCurrentCacheSize();yield this.getStorage().setItem(o0(this.config.keyPrefix),(t+n).toString())})}decreaseCurrentSizeInBytes(n){return ye(this,null,function*(){let t=yield this.getCurrentCacheSize();
2yield this.getStorage().setItem(o0(this.config.keyPrefix),(t-n).toString())})}updateVisitedTime(n,t){return ye(this,null,function*(){return n.visitedTime=Om(),yield this.getStorage().setItem(t,JSON.stringify(n)),n})}setCacheItem(n,t){return ye(this,null,function*(){yield this.increaseCurrentSizeInBytes(t.byteSize);try{yield this.getStorage().setItem(n,JSON.stringify(t))}catch(e){yield this.decreaseCurrentSizeInBytes(t.byteSize),ea.error(`Failed to set item ${e}`)}})}sizeToPop(n){return ye(this,null,function*(){let e=(yield this.getCurrentCacheSize())+n-this.config.capacityInBytes,r=(1-this.config.warningThreshold)*this.config.capacityInBytes;return e>r?e:r})}isCacheFull(n){return ye(this,null,function*(){let t=yield this.getCurrentCacheSize();return n+t>this.config.capacityInBytes})}popOutItems(n,t){return ye(this,null,function*(){let e=[],r=t;for(let a of n){let c=yield this.getStorage().getItem(a);if(c!=null){let d=JSON.parse(c);e.push(d)}}e.sort((a,c)=>a.priority>c.priority?-1:a.priority<c.priority?1:a.visitedTime<c.visitedTime?-1:1);for(let a of e)if(yield this.removeCacheItem(a.key,a.byteSize),r-=a.byteSize,r<=0)return})}clearInvalidAndGetRemainingKeys(){return ye(this,null,function*(){let n=[],t=yield this.getAllCacheKeys({omitSizeKey:!0});for(let e of t)(yield this.isExpired(e))?yield this.removeCacheItem(e):n.push(e);return n})}clear(){return ye(this,null,function*(){ea.debug("Clear Cache");try{let n=yield this.getAllKeys();for(let t of n){let e=`${this.config.keyPrefix}${t}`;yield this.getStorage().removeItem(e)}}catch(n){ea.warn(`clear failed! ${n}`)}})}};var KG=new Rr("StorageCache"),kS=class i extends IS{constructor(n){let t=bS();super({config:n,keyValueStorage:new $c(t)}),this.storage=t,this.getItem=this.getItem.bind(this),this.setItem=this.setItem.bind(this),this.removeItem=this.removeItem.bind(this)}getAllCacheKeys(n){return ye(this,null,function*(){let{omitSizeKey:t}=n??{},e=[];for(let r=0;r<this.storage.length;r++){let a=this.storage.key(r);t&&a===o0(this.config.keyPrefix)||a?.startsWith(this.config.keyPrefix)&&e.push(a.substring(this.config.keyPrefix.length))}return e})}createInstance(n){return(!n.keyPrefix||n.keyPrefix===Rm.keyPrefix)&&(KG.error("invalid keyPrefix, setting keyPrefix with timeStamp"),n.keyPrefix=Om.toString()),new i(n)}};var XG=new kS;var JG=new Rr("I18n"),SA=class{constructor(){this._options=null,this._lang=null,this._dict={}}setDefaultLanguage(){!this._lang&&typeof window<"u"&&window&&window.navigator&&(this._lang=window.navigator.language),JG.debug(this._lang)}setLanguage(n){this._lang=n}get(n,t=void 0){if(this.setDefaultLanguage(),!this._lang)return typeof t<"u"?t:n;let e=this._lang,r=this.getByLanguage(n,e);return r||(e.indexOf("-")>0&&(r=this.getByLanguage(n,e.split("-")[0])),r)?r:typeof t<"u"?t:n}getByLanguage(n,t,e=null){if(!t)return e;let r=this._dict[t];return r?r[n]:e}putVocabulariesForLanguage(n,t){let e=this._dict[n];e||(e=this._dict[n]={}),this._dict[n]=le(le({},e),t)}putVocabularies(n){Object.keys(n).forEach(t=>{this.putVocabulariesForLanguage(t,n[t])})}};var l0=function(i){return i.NotConfigured="NotConfigured",i}(l0||{}),ZG={[l0.NotConfigured]:{message:"i18n is not configured."}},C1=rc(ZG);var bA=new Rr("I18n"),MS={language:null},sc=null,AS=class i{static configure(n){return bA.debug("configure I18n"),n&&(MS=Object.assign({},MS,n.I18n||n),i.createInstance()),MS}static getModuleName(){return"I18n"}static createInstance(){bA.debug("create I18n instance"),!sc&&(sc=new SA)}static setLanguage(n){i.checkConfig(),C1(!!sc,l0.NotConfigured),sc.setLanguage(n)}static get(n,t){return i.checkConfig()?(C1(!!sc,l0.NotConfigured),sc.get(n,t)):typeof t>"u"?n:t}static putVocabulariesForLanguage(n,t){i.checkConfig(),C1(!!sc,l0.NotConfigured),sc.putVocabulariesForLanguage(n,t)}static putVocabularies(n){i.checkConfig(),C1(!!sc,l0.NotConfigured),sc.putVocabularies(n)}static checkConfig(){return sc||i.createInstance(),!0}};AS.createInstance();function qE(i){return(i.match(/.{2}/g)||[]).map(t=>String.fromCharCode(parseInt(t,16))).join("")}var KE=i=>{let n;return(...t)=>ye(null,null,function*(){return n||(n=new Promise((e,r)=>{i(...t).then(a=>{e(a)}).catch(a=>{r(a)}).finally(()=>{n=void 0})}),n)})};function PS({expiresAt:i,clockDrift:n,tolerance:t=5e3}){return Date.now()+n+t>i}var XE=()=>ye(null,null,function*(){let{userAgentData:i}=navigator;if(!i)return navigator.userAgent;let{platform:n="",platformVersion:t="",model:e="",architecture:r="",fullVersionList:a=[]}=yield i.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]),c=a.map(u=>`${u.brand}/${u.version}`).join(";");return[n,t,r,e,n,c].filter(u=>u).join(" ")||navigator.userAgent});function xA(i){return Array.from(i,n=>String.fromCodePoint(n)).join("")}var zc={convert(i,n={urlSafe:!1,skipPadding:!1}){let t=typeof i=="string"?i:xA(i),e=CM()(t);return n.urlSafe&&(e=e.replace(/\+/g,"-").replace(/\//g,"_")),n.skipPadding&&(e=e.replace(/=/g,"")),e}};function CA(){return xM().getRandomValues(new Uint32Array(1))[0]}function QG(i){let{words:n}=i,{sigBytes:t}=i,e=[];for(let r=0;r<t;r++){let a=n[r>>>2]>>>24-r%4*8&255;e.push((a>>>4).toString(16)),e.push((a&15).toString(16))}return e.join("")}var E1=class i{constructor(n,t){this.words=[];let e=n;e=this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=e.length*4}random(n){let t=[];for(let e=0;e<n;e+=4)t.push(CA());return new i(t,n)}toString(){return QG(this)}};var en=function(i){return i.EmptySignInUsername="EmptySignInUsername",i.EmptySignInPassword="EmptySignInPassword",i.CustomAuthSignInPassword="CustomAuthSignInPassword",i.EmptySignUpUsername="EmptySignUpUsername",i.EmptySignUpPassword="EmptySignUpPassword",i.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",i.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",i.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",i.EmptyChallengeResponse="EmptyChallengeResponse",i.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",i.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",i.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",i.EmptyResetPasswordUsername="EmptyResetPasswordUsername",i.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",i.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",i.IncorrectMFAMethod="IncorrectMFAMethod",i.EmptyUpdatePassword="EmptyUpdatePassword",i}(en||{});var FS={[en.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[en.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[en.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[en.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[en.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[en.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[en.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[en.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[en.EmptySignInPassword]:{message:"password is required to signIn"},[en.EmptySignInUsername]:{message:"username is required to signIn"},[en.EmptySignUpPassword]:{message:"password is required to signUp"},[en.EmptySignUpUsername]:{message:"username is required to signUp"},[en.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[en.IncorrectMFAMethod]:{message:"Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL",recoverySuggestion:"Try to pass SMS, TOTP, or EMAIL as the challengeResponse"},[en.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[en.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"},[en.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"}}
2,Ka=function(i){return i.DEFAULT_MSG="Authentication Error",i.EMPTY_EMAIL="Email cannot be empty",i.EMPTY_PHONE="Phone number cannot be empty",i.EMPTY_USERNAME="Username cannot be empty",i.INVALID_USERNAME="The username should either be a string or one of the sign in types",i.EMPTY_PASSWORD="Password cannot be empty",i.EMPTY_CODE="Confirmation code cannot be empty",i.SIGN_UP_ERROR="Error creating account",i.NO_MFA="No valid MFA method provided",i.INVALID_MFA="Invalid MFA type",i.EMPTY_CHALLENGE="Challenge response cannot be empty",i.NO_USER_SESSION="Failed to get the session because the user is empty",i.NETWORK_ERROR="Network Error",i.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",i.AUTOSIGNIN_ERROR="Please use your credentials to sign in",i.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings",i}(Ka||{}),Nd=function(i){return i.SignInException="SignInException",i.OAuthSignInError="OAuthSignInException",i}(Nd||{});var wi=class i extends zr{constructor(n){super(n),this.constructor=i,Object.setPrototypeOf(this,i.prototype)}};function br(i,n){let{message:t,recoverySuggestion:e}=FS[n];if(!i)throw new wi({name:n,message:t,recoverySuggestion:e})}function Un(i){let n=i?.split("_")[0];if(!i||i.indexOf("_")<0||!n||typeof n!="string")throw new wi({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return n}function w1(i){if(!i||!i.includes(":"))throw new wi({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return i.split(":")[0]}function JE(i){return Object.entries(i).map(([n,t])=>({Name:n,Value:t}))}function EA(i){let n={};return i?.forEach(t=>{t.Name&&(n[t.Name]=t.Value)}),n}var RS=function(i){return i.PasswordResetRequiredException="PasswordResetRequiredException",i.ForbiddenException="ForbiddenException",i.InternalErrorException="InternalErrorException",i.InvalidLambdaResponseException="InvalidLambdaResponseException",i.InvalidParameterException="InvalidParameterException",i.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",i.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",i.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",i.NotAuthorizedException="NotAuthorizedException",i.ResourceNotFoundException="ResourceNotFoundException",i.TooManyRequestsException="TooManyRequestsException",i.UnexpectedLambdaException="UnexpectedLambdaException",i.UserLambdaValidationException="UserLambdaValidationException",i.UserNotConfirmedException="UserNotConfirmedException",i.UserNotFoundException="UserNotFoundException",i}(RS||{});var ZE=function(i){return i.CodeDeliveryFailureException="CodeDeliveryFailureException",i.InternalErrorException="InternalErrorException",i.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",i.InvalidLambdaResponseException="InvalidLambdaResponseException",i.InvalidParameterException="InvalidParameterException",i.InvalidPasswordException="InvalidPasswordException",i.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",i.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",i.NotAuthorizedException="NotAuthorizedException",i.ResourceNotFoundException="ResourceNotFoundException",i.TooManyRequestsException="TooManyRequestsException",i.UnexpectedLambdaException="UnexpectedLambdaException",i.UserLambdaValidationException="UserLambdaValidationException",i.UsernameExistsException="UsernameExistsException",i}(ZE||{});var gh="UserUnAuthenticatedException",wA="UserAlreadyAuthenticatedException",TA="DeviceMetadataNotFoundException",OS="AutoSignInException",e$="InvalidRedirectException",t$="InvalidAppSchemeException",i$="InvalidPreferredRedirectUrlException",DA=new wi({name:e$,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."}),SFe=new wi({name:t$,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app sc
2heme is present in the config."}),IA=new wi({name:i$,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."}),n$="InvalidOriginException",kA=new wi({name:n$,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."}),MA="OAuthSignOutException",AA="TokenRefreshException",PA="UnexpectedSignInInterruptionException";function vh(i){if(!i||!i.accessToken)throw new wi({name:gh,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function FA(i){if(!i||!i.idToken)throw new wi({name:gh,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}var r$=new wi({name:AA,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. 3 Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. 4 E.g { responseType: 'code' }`}),a$=new wi({name:gh,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function NS(i){if(s$(i))throw r$;if(!o$(i))throw a$}function QE(i){if(!i||!i.deviceKey||!i.deviceGroupKey||!i.randomPassword)throw new wi({name:TA,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}var RA={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function OA(i){return i?.accessToken||i?.idToken}function o$(i){return OA(i)&&i?.refreshToken}function s$(i){return OA(i)&&!i?.refreshToken}var NA=i=>ye(null,null,function*(){let n=i.getConfig().Auth?.Cognito;Xi(n);let t=yield i.Auth.getTokens({forceRefresh:!1});vh(t);let{"cognito:username":e,sub:r}=t.idToken?.payload??{},a={username:e,userId:r},c=l$(t);return c&&(a.signInDetails=c),a});function l$(i){return i?.signInDetails}var Nm=()=>ye(null,null,function*(){return NA(un)});var Nr=(i,n)=>Fd(le({category:cS.Auth,action:i},n));var Vr=i=>(n,t)=>{let e=c$(i),r=JSON.stringify(n);return d$(t,e,r)},c$=i=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${i}`}),d$=({url:i},n,t)=>({headers:n,url:i,body:t,method:"POST"});function ma(i){if(!i||i.name==="Error"||i instanceof TypeError)throw new wi({name:ys.Unknown,message:"An unknown error has occurred.",underlyingError:i})}var ta=()=>i=>ye(null,null,function*(){if(i.statusCode>=300){let n=yield nl(i);throw ma(n),new wi({name:n.name,message:n.message,metadata:n.$metadata})}return Gc(i)});var m$=()=>(i,n)=>function(e){return ye(this,null,function*(){return e.headers["cache-control"]="no-store",i(e)})},Ur=r0(y1,[m$]);var LS="cognito-idp";var jr={service:LS,retryDecider:_1(nl),computeDelay:v1,get userAgentValue(){return Fd()},cache:"no-store"};var Lm=i=>cr(Ur,Vr("InitiateAuth"),ta(),le(le({},jr),i));var c0=i=>cr(Ur,Vr("RespondToAuthChallenge"),ta(),le(le({},jr),i));var LA=i=>cr(Ur,Vr("AssociateSoftwareToken"),ta(),le(le({},jr),i));var BA=({region:i})=>({url:new qo(`https://${LS}.${i}.${S1(i)}`)});var jn=({endpointOverride:i})=>n=>i?{url:new qo(i)}:BA(n);var VA=i=>cr(Ur,Vr("GetTokensFromRefreshToken"),ta(),le(le({},jr),i));var u$=e=>ye(null,[e],function*({tokens:i,authConfig:n,username:t}){Xi(n?.Cognito);let{userPoolId:r,userPoolClientId:a,userPoolEndpoint:c}=n.Cognito,d=Un(r);NS(i);let u=VA({endpointResolver:jn({endpointOverride:c})}),{AuthenticationResult:h}=yield u({region:d},{ClientId:a,RefreshToken:i.refreshToken,DeviceKey:i.deviceMetadata?.deviceKey}),f=lo(h?.AccessToken??""),v=h?.IdToken?lo(h.IdToken):void 0,{iat:C}=f.payload;if(!C)throw new wi({name:"iatNotFoundException",message:"iat not found in access token"});let y=C*1e3-new Date().getTime();return{accessToken:f,idToken:v,clockDrift:y,refreshToken:h?.RefreshToken??i.refreshToken,username:t}}),UA=KE(u$);var jA={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetail
4s:"signInDetails",oauthMetadata:"oauthMetadata"};var BS=function(i){return i.InvalidAuthTokens="InvalidAuthTokens",i}(BS||{}),p$={[BS.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},WA=rc(p$);var ew="CognitoIdentityServiceProvider";var VS=class{getKeyValueStorage(){if(!this.keyValueStorage)throw new wi({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(n){this.keyValueStorage=n}setAuthConfig(n){this.authConfig=n}loadTokens(){return ye(this,null,function*(){try{let n=yield this.getAuthKeys(),t=yield this.getKeyValueStorage().getItem(n.accessToken);if(!t)throw new wi({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});let e=lo(t),r=yield this.getKeyValueStorage().getItem(n.idToken),a=r?lo(r):void 0,c=(yield this.getKeyValueStorage().getItem(n.refreshToken))??void 0,d=(yield this.getKeyValueStorage().getItem(n.clockDrift))??"0",u=Number.parseInt(d),h=yield this.getKeyValueStorage().getItem(n.signInDetails),f={accessToken:e,idToken:a,refreshToken:c,deviceMetadata:(yield this.getDeviceMetadata())??void 0,clockDrift:u,username:yield this.getLastAuthUser()};return h&&(f.signInDetails=JSON.parse(h)),f}catch{return null}})}storeTokens(n){return ye(this,null,function*(){WA(n!==void 0,BS.InvalidAuthTokens);let t=n.username;yield this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),t);let e=yield this.getAuthKeys();yield this.getKeyValueStorage().setItem(e.accessToken,n.accessToken.toString()),n.idToken?yield this.getKeyValueStorage().setItem(e.idToken,n.idToken.toString()):yield this.getKeyValueStorage().removeItem(e.idToken),n.refreshToken?yield this.getKeyValueStorage().setItem(e.refreshToken,n.refreshToken):yield this.getKeyValueStorage().removeItem(e.refreshToken),n.deviceMetadata&&(n.deviceMetadata.deviceKey&&(yield this.getKeyValueStorage().setItem(e.deviceKey,n.deviceMetadata.deviceKey)),n.deviceMetadata.deviceGroupKey&&(yield this.getKeyValueStorage().setItem(e.deviceGroupKey,n.deviceMetadata.deviceGroupKey)),yield this.getKeyValueStorage().setItem(e.randomPasswordKey,n.deviceMetadata.randomPassword)),n.signInDetails?yield this.getKeyValueStorage().setItem(e.signInDetails,JSON.stringify(n.signInDetails)):yield this.getKeyValueStorage().removeItem(e.signInDetails),yield this.getKeyValueStorage().setItem(e.clockDrift,`${n.clockDrift}`)})}clearTokens(){return ye(this,null,function*(){let n=yield this.getAuthKeys();yield Promise.all([this.getKeyValueStorage().removeItem(n.accessToken),this.getKeyValueStorage().removeItem(n.idToken),this.getKeyValueStorage().removeItem(n.clockDrift),this.getKeyValueStorage().removeItem(n.refreshToken),this.getKeyValueStorage().removeItem(n.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(n.oauthMetadata)])})}getDeviceMetadata(n){return ye(this,null,function*(){let t=yield this.getAuthKeys(n),e=yield this.getKeyValueStorage().getItem(t.deviceKey),r=yield this.getKeyValueStorage().getItem(t.deviceGroupKey),a=yield this.getKeyValueStorage().getItem(t.randomPasswordKey);return a&&r&&e?{deviceKey:e,deviceGroupKey:r,randomPassword:a}:null})}clearDeviceMetadata(n){return ye(this,null,function*(){let t=yield this.getAuthKeys(n);yield Promise.all([this.getKeyValueStorage().removeItem(t.deviceKey),this.getKeyValueStorage().removeItem(t.deviceGroupKey),this.getKeyValueStorage().removeItem(t.randomPasswordKey)])})}getAuthKeys(n){return ye(this,null,function*(){Xi(this.authConfig?.Cognito);let t=n??(yield this.getLastAuthUser());return h$(ew,`${this.authConfig.Cognito.userPoolClientId}.${t}`)})}getLastAuthUserKey(){Xi(this.authConfig?.Cognito);let n=this.authConfig.Cognito.userPoolClientId;return`${ew}.${n}.LastAuthUser`}getLastAuthUser(){return ye(this,null,function*(){return(yield this.getKeyValueStorage().getItem(this.getLastAuthUserKey()))??"username"})}setOAuthMetadata(n){return ye(this,null,function*(){let{oauthMetadata:t}=yield this.getAuthKeys();yield this.getKeyValueStorage().setItem(t,JSON.stringify(n))})}getOAuthMetadata(){return ye(this,null,function*(){let{oauthMetadata:n}=yield this.getAuthKeys(),t=yield this.getKeyValueStorage().getItem(n);return t&&JSON.parse(t)})}},h$=(i,n)=>T1(jA)(`${i}`,n);function T1(i){let n=Object.values(le({},i));return(t,e)=>n.reduce((r,a)=>tt(le({},r),{[a]:`${t}.${e}.${a}`}),{})}var HA="amplify-signin-with-hostedUI",Yc="CognitoIdentityServiceProvider",_h=class{constructor(n){this.keyValueStorage=n}clearOAuthInflightData(){return ye(this,null,function*(){Xi(this.cognitoConfig);let n=qc(Yc,this.cognitoConfig.userPoolClientId);yield Promise.all([this.keyValueStorage.removeItem(n.inflightOAuth),this.keyValueStorage.removeItem(n.oauthPKCE),this.keyValueStorage.removeItem(n.oauthState)])})}clearOAuthData(){return ye(this,null,function*(){Xi(this.cognitoConfig);let n=qc(Yc,this.cognitoConfig.userPoolClientId);return yield this.clearOAuthInflightData(),yield this.keyValueStorage.removeItem(HA),this.keyValueStorage.removeItem(n.oauthSignIn)})}loadOAuthState(){Xi(this.cognitoConfig);let n=qc(Yc,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthState)}storeOAuthState(n){Xi(this.cognitoConfig);let t=qc(Yc,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthState,n)}loadPKCE(){Xi(this.cognitoConfig);let n=qc(Yc,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthPKCE)}storePKCE(n){Xi(this.cognitoConfig);let t=qc(Yc,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthPKCE,n)}setAuthConfig(n){this.cognitoConfig=n}loadOAuthInFlight(){return ye(this,null,function*(){Xi(this.cognitoConfig);let n=qc(Yc,this.cognitoConfig.userPoolClientId);return(yield this.keyValueStorage.getItem(n.inflightOAuth))==="true"})}storeOAuthInFlight(n){return ye(this,null,function*(){Xi(this.cognitoConfig);let t=qc(Yc,this.cognitoConfig.userPoolClientId);yield this.keyValueStorage.setItem(t.inflightOAuth,`${n}`)})}loadOAuthSignIn(){return ye(this,null,function*(){Xi(this.cognitoConfig);let n=qc(Yc,this.cognitoConfig.userPoolClientId),t=yield this.keyValueStorage.getItem(HA),[e,r]=(yield this.keyValueStorage.getItem(n.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:e==="true"||t==="true",preferPrivateSession:r==="true"}})}storeOAuthSignIn(n,t=!1){return ye(this,null,function*(){Xi(this.cognitoConfig);let e=qc(Yc,this.cognitoConfig.userPoolClientId);yield this.keyValueStorage.setItem(e.oauthSignIn,`${n},${t}`)})}},qc=(i,n)=>T1(RA)(i,n);var bs=new _h(ac);var tw=[],GA=i=>{tw.push(i)},US=()=>{for(;tw.length;)tw.pop()?.()};var jS=class{constructor(){this.waitForInflightOAuth=i0()?()=>ye(this,null,function*(){if(yield bs.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((n,t)=>{GA(n)}),this.inflightPromise)}):()=>ye(this,null,function*(){})}setAuthConfig(n){bs.setAuthConfig(n.Cognito),this.authConfig=n}setTokenRefresher(n){this.tokenRefresher=n}setAuthTokenStore(n){this.tokenStore=n}getTokenStore(){if(!this.tokenStore)throw new wi({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}
4getTokenRefresher(){if(!this.tokenRefresher)throw new wi({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}getTokens(n){return ye(this,null,function*(){let t;try{Xi(this.authConfig?.Cognito)}catch{return null}yield this.waitForInflightOAuth(),this.inflightPromise=void 0,t=yield this.getTokenStore().loadTokens();let e=yield this.getTokenStore().getLastAuthUser();if(t===null)return null;let r=!!t?.idToken&&PS({expiresAt:(t.idToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0}),a=PS({expiresAt:(t.accessToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0});return(n?.forceRefresh||r||a)&&(t=yield this.refreshTokens({tokens:t,username:e}),t===null)?null:{accessToken:t?.accessToken,idToken:t?.idToken,signInDetails:t?.signInDetails}})}refreshTokens(e){return ye(this,arguments,function*({tokens:n,username:t}){try{let{signInDetails:r}=n,a=yield this.getTokenRefresher()({tokens:n,authConfig:this.authConfig,username:t});return a.signInDetails=r,yield this.setTokens({tokens:a}),so.dispatch("auth",{event:"tokenRefresh"},"Auth",qa),a}catch(r){return this.handleErrors(r)}})}handleErrors(n){if(ma(n),n.name!==ys.NetworkError&&this.clearTokens(),so.dispatch("auth",{event:"tokenRefresh_failure",data:{error:n}},"Auth",qa),n.name.startsWith("NotAuthorizedException"))return null;throw n}setTokens(t){return ye(this,arguments,function*({tokens:n}){return this.getTokenStore().storeTokens(n)})}clearTokens(){return ye(this,null,function*(){return this.getTokenStore().clearTokens()})}getDeviceMetadata(n){return this.getTokenStore().getDeviceMetadata(n)}clearDeviceMetadata(n){return this.getTokenStore().clearDeviceMetadata(n)}setOAuthMetadata(n){return this.getTokenStore().setOAuthMetadata(n)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}};var WS=class{constructor(){this.authTokenStore=new VS,this.authTokenStore.setKeyValueStorage(ac),this.tokenOrchestrator=new jS,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(UA)}getTokens({forceRefresh:n}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:n})}setKeyValueStorage(n){this.authTokenStore.setKeyValueStorage(n)}setAuthConfig(n){this.authTokenStore.setAuthConfig(n),this.tokenOrchestrator.setAuthConfig(n)}};var d0=new WS,{tokenOrchestrator:Yr}=d0;function Ko(i){return ye(this,null,function*(){if(i.AccessToken){let n=lo(i.AccessToken),t=(n.payload.iat||0)*1e3,e=new Date().getTime(),r=t>0?t-e:0,a,c,d;i.RefreshToken&&(c=i.RefreshToken),i.IdToken&&(a=lo(i.IdToken)),i?.NewDeviceMetadata&&(d=i.NewDeviceMetadata);let u={accessToken:n,idToken:a,refreshToken:c,clockDrift:r,deviceMetadata:d,username:i.username};i?.signInDetails&&(u.signInDetails=i.signInDetails),yield Yr.setTokens({tokens:u})}else throw new zr({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})})}var f$="Unable to get user session following successful sign-in.",xs=()=>ye(null,null,function*(){try{so.dispatch("auth",{event:"signedIn",data:yield Nm()},"Auth",qa)}catch(i){throw i.name===gh?new wi({name:PA,message:f$,recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."}):i}});function $A(){return{active:!1}}var g$=(i,n)=>{switch(n.type){case"SET_USERNAME":return tt(le({},i),{username:n.value});case"SET_SESSION":return tt(le({},i),{session:n.value});case"START":return tt(le({},i),{active:!0});case"RESET":return $A();default:return i}},v$=i=>{let n=i($A(),{type:"RESET"});return{getState:()=>n,dispatch:t=>{n=i(n,t)}}},Dl=v$(g$);var _$=3*60*1e3,HS="CognitoSignInState",Ld={username:`${HS}.username`,challengeName:`${HS}.challengeName`,signInSession:`${HS}.signInSession`,expiry:`${HS}.expiry`},y$=(i,n)=>{switch(n.type){case"SET_SIGN_IN_SESSION":return GS({signInSession:n.value}),tt(le({},i),{signInSession:n.value});case"SET_SIGN_IN_STATE":return GS(n.value),le({},n.value);case"SET_CHALLENGE_NAME":return GS({challengeName:n.value}),tt(le({},i),{challengeName:n.value});case"SET_USERNAME":return GS({username:n.value}),tt(le({},i),{username:n.value});case"SET_INITIAL_STATE":return b$();case"RESET_STATE":return zA(),iw();default:return i}},S$=i=>{let n=Number(i),t=Date.now();return n<=t},Xo=()=>{lc.dispatch({type:"RESET_STATE"})},zA=()=>{for(let i of Object.values(Ld))oc.removeItem(i)},iw=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),b$=()=>{let i=oc.getItem(Ld.expiry);if(!i||S$(i))return zA(),iw();let n=oc.getItem(Ld.username)??void 0,t=oc.getItem(Ld.challengeName)??void 0,e=oc.getItem(Ld.signInSession)??void 0;return{username:n,challengeName:t,signInSession:e}},x$=i=>{let n=i(iw(),{type:"SET_INITIAL_STATE"});return{getState:()=>n,dispatch:t=>{n=i(n,t)}}},lc=x$(y$);function Il(i){lc.dispatch({type:"SET_SIGN_IN_STATE",value:i})}var GS=({challengeName:i,signInSession:n,username:t})=>{t&&oc.setItem(Ld.username,t),i&&oc.setItem(Ld.challengeName,i),n&&(oc.setItem(Ld.signInSession,n),oc.setItem(Ld.expiry,String(Date.now()+_$)))};var Bm=class i extends zr{constructor(n){super(n),this.constructor=i,Object.setPrototypeOf(this,i.prototype)}},qr=function(i){return i.PasskeyNotSupported="PasskeyNotSupported",i.PasskeyAlreadyExists="PasskeyAlreadyExists",i.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",i.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",i.RelyingPartyMismatch="RelyingPartyMismatch",i.PasskeyRegistrationFailed="PasskeyRegistrationFailed",i.PasskeyRetrievalFailed="PasskeyRetrievalFailed",i.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",i.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",i.PasskeyOperationAborted="PasskeyOperationAborted",i}(qr||{}),YA="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.",nw="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",qA="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",$S={[qr.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:YA},[qr.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:qA},[qr.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:qA},[qr.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:YA},[qr.PasskeyRetrievalFailed]:{message:"Device failed to retrieve passkey.",recoverySuggestion:"Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP."},[qr.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[qr.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:nw},[qr.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:nw},[qr.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:nw},[qr.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},yh=rc($S,Bm),KA=i=>{if(i instanceof Bm)return i;if(i instanceof Error&&i.name==="NotAllowedError"){let{message:n,recoverySuggestion:t}=$S[qr.PasskeyAuthenticationCanceled];return new Bm({name:qr.PasskeyAuthenticationCanceled,message:n,recoverySuggestion:t,underlyingError:i})}return C$(i)};var C$=i=>{if(i instanceof Error){if(i.name==="AbortError"){let{message:n,recoverySuggestion:t}=$S[qr.PasskeyOperationAborted];return new Bm({name:qr.PasskeyOperationAborted,message:n,recoverySuggestion:t,underlyingError:i})}if(i.name==="SecurityError"){let{message:n,recoverySuggestion:t}=$S[qr.RelyingPartyMismatch];return new Bm({name:qr.RelyingPartyMismatch,message:n,recoverySuggestion:t,underlyingError:i})}}return new Bm({name:ys.Unknown,message:"An unknown error has occurred.",underlyingError:i})};var XA=()=>i0()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function";var Sh=i=>zc.convert(new Uint8Array(i),{urlSafe:!0,skipPadding:!0});var rw=i=>Uint8Array.from(Zu.convert(i,{urlSafe:!0}),n=>n.charCodeAt(0)).buffer;var JA=i=>{let n=rw(i.challenge),t=(i.allowCredentials||[]).map(e=>tt(le({},e),{id:rw(e.id)}
4));return tt(le({},i),{challenge:n,allowCredentials:t})},ZA=i=>{let n={clientDataJSON:Sh(i.response.clientDataJSON),authenticatorData:Sh(i.response.authenticatorData),signature:Sh(i.response.signature)};i.response.userHandle&&(n.userHandle=Sh(i.response.userHandle));let t={id:i.id,rawId:Sh(i.rawId),type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:n};return i.authenticatorAttachment&&(t.authenticatorAttachment=i.authenticatorAttachment),t};function QA(i){yh(i&&i instanceof PublicKeyCredential&&i.response instanceof AuthenticatorAssertionResponse,qr.PasskeyRetrievalFailed)}var eP=i=>ye(null,null,function*(){try{let n=XA();yh(n,qr.PasskeyNotSupported);let t=JA(i),e=yield navigator.credentials.get({publicKey:t});return QA(e),ZA(e)}catch(n){throw KA(n)}});var tP=i=>cr(Ur,Vr("ConfirmDevice"),ta(),le(le({},jr),i));var bh={convert(i){return new TextEncoder().encode(i)}};function Si(i,n){i!=null&&this.fromString(i,n)}function Jo(){return new Si(null,null)}var Vm,E$=0xdeadbeefcafe,iP=(E$&16777215
4)===15715070;function w$(i,n,t,e,r,a){for(;--a>=0;){let c=n*this[i++]+t[e]+r;r=Math.floor(c/67108864),t[e++]=c&67108863}return r}function T$(i,n,t,e,r,a){let c=n&32767,d=n>>15;for(;--a>=0;){let u=this[i]&32767,h=this[i++]>>15,f=d*u+h*c;u=c*u+((f&32767)<<15)+t[e]+(r&1073741823),r=(u>>>30)+(f>>>15)+d*h+(r>>>30),t[e++]=u&1073741823}return r}function D$(i,n,t,e,r,a){let c=n&16383,d=n>>14;for(;--a>=0;){let u=this[i]&16383,h=this[i++]>>14,f=d*u+h*c;u=c*u+((f&16383)<<14)+t[e]+r,r=(u>>28)+(f>>14)+d*h,t[e++]=u&268435455}return r}var nP=typeof navigator<"u";nP&&iP&&navigator.appName==="Microsoft Internet Explorer"?(Si.prototype.am=T$,Vm=30):nP&&iP&&navigator.appName!=="Netscape"?(Si.prototype.am=w$,Vm=26):(Si.prototype.am=D$,Vm=28);Si.prototype.DB=Vm;Si.prototype.DM=(1<<Vm)-1;Si.prototype.DV=1<<Vm;var aw=52;Si.prototype.FV=Math.pow(2,aw);Si.prototype.F1=aw-Vm;Si.prototype.F2=2*Vm-aw;var I$="0123456789abcdefghijklmnopqrstuvwxyz",zS=[],xh,kl;xh=48;for(kl=0;kl<=9;++kl)zS[xh++]=kl;xh=97;for(kl=10;kl<36;++kl)zS[xh++]=kl;xh=65;for(kl=10;kl<36;++kl)zS[xh++]=kl;function rP(i){return I$.charAt(i)}function k$(i,n){let t=zS[i.charCodeAt(n)];return t??-1}function M$(i){for(let n=this.t-1;n>=0;--n)i[n]=this[n];i.t=this.t,i.s=this.s}function A$(i){this.t=1,this.s=i<0?-1:0,i>0?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0}function ow(i){let n=Jo();return n.fromInt(i),n}function P$(i,n){let t;if(n===16)t=4;else if(n===8)t=3;else if(n===2)t=1;else if(n===32)t=5;else if(n===4)t=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let e=i.length,r=!1,a=0;for(;--e>=0;){let c=k$(i,e);if(c<0){i.charAt(e)==="-"&&(r=!0);continue}r=!1,a===0?this[this.t++]=c:a+t>this.DB?(this[this.t-1]|=(c&(1<<this.DB-a)-1)<<a,this[this.t++]=c>>this.DB-a):this[this.t-1]|=c<<a,a+=t,a>=this.DB&&(a-=this.DB)}this.clamp(),r&&Si.ZERO.subTo(this,this)}function F$(){let i=this.s&this.DM;for(;this.t>0&&this[this.t-1]==i;)--this.t}function R$(i){if(this.s<0)return"-"+this.negate().toString(i);let n;if(i==16)n=4;else if(i===8)n=3;else if(i===2)n=1;else if(i===32)n=5;else if(i===4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");let t=(1<<n)-1,e,r=!1,a="",c=this.t,d=this.DB-c*this.DB%n;if(c-- >0)for(d<this.DB&&(e=this[c]>>d)>0&&(r=!0,a=rP(e));c>=0;)d<n?(e=(this[c]&(1<<d)-1)<<n-d,e|=this[--c]>>(d+=this.DB-n)):(e=this[c]>>(d-=n)&t,d<=0&&(d+=this.DB,--c)),e>0&&(r=!0),r&&(a+=rP(e));return r?a:"0"}function O$(){let i=Jo();return Si.ZERO.subTo(this,i),i}function N$(){return this.s<0?this.negate():this}function L$(i){let n=this.s-i.s;if(n!=0)return n;let t=this.t;if(n=t-i.t,n!=0)return this.s<0?-n:n;for(;--t>=0;)if((n=this[t]-i[t])!=0)return n;return 0}function sw(i){let n=1,t;return(t=i>>>16)!==0&&(i=t,n+=16),(t=i>>8)!==0&&(i=t,n+=8),(t=i>>4)!==0&&(i=t,n+=4),(t=i>>2)!==0&&(i=t,n+=2),(t=i>>1)!==0&&(i=t,n+=1),n}function B$(){return this.t<=0?0:this.DB*(this.t-1)+sw(this[this.t-1]^this.s&this.DM)}function V$(i,n){let t;for(t=this.t-1;t>=0;--t)n[t+i]=this[t];for(t=i-1;t>=0;--t)n[t]=0;n.t=this.t+i,n.s=this.s}function U$(i,n){for(let t=i;t<this.t;++t)n[t-i]=this[t];n.t=Math.max(this.t-i,0),n.s=this.s}function j$(i,n){let t=i%this.DB,e=this.DB-t,r=(1<<e)-1,a=Math.floor(i/this.DB),c=this.s<<t&this.DM,d;for(d=this.t-1;d>=0;--d)n[d+a+1]=this[d]>>e|c,c=(this[d]&r)<<t;for(d=a-1;d>=0;--d)n[d]=0;n[a]=c,n.t=this.t+a+1,n.s=this.s,n.clamp()}function W$(i,n){n.s=this.s;let t=Math.floor(i/this.DB);if(t>=this.t){n.t=0;return}let e=i%this.DB,r=this.DB-e,a=(1<<e)-1;n[0]=this[t]>>e;for(let c=t+1;c<this.t;++c)n[c-t-1]|=(this[c]&a)<<r,n[c-t]=this[c]>>e;e>0&&(n[this.t-t-1]|=(this.s&a)<<r),n.t=this.t-t,n.clamp()}function H$(i,n){let t=0,e=0,r=Math.min(i.t,this.t);for(;t<r;)e+=this[t]-i[t],n[t++]=e&this.DM,e>>=this.DB;if(i.t<this.t){for(e-=i.s;t<this.t;)e+=this[t],n[t++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;t<i.t;)e-=i[t],n[t++]=e&this.DM,e>>=this.DB;e-=i.s}n.s=e<0?-1:0,e<-1?n[t++]=this.DV+e:e>0&&(n[t++]=e),n.t=t,n.clamp()}function G$(i,n){let t=this.abs(),e=i.abs(),r=t.t;for(n.t=r+e.t;--r>=0;)n[r]=0;for(r=0;r<e.t;++r)n[r+t.t]=t.am(0,e[r],n,r,0,t.t);n.s=0,n.clamp(),this.s!==i.s&&Si.ZERO.subTo(n,n)}function $$(i){let n=this.abs(),t=i.t=2*n.t;for(;--t>=0;)i[t]=0;for(t=0;t<n.t-1;++t){let e=n.am(t,n[t],i,2*t,0,1);(i[t+n.t]+=n.am(t+1,2*n[t],i,2*t+1,e,n.t-t-1))>=n.DV&&(i[t+n.t]-=n.DV,i[t+n.t+1]=1)}i.t>0&&(i[i.t-1]+=n.am(t,n[t],i,2*t,0,1)),i.s=0,i.clamp()}function z$(i,n,t){let e=i.abs();if(e.t<=0)return;let r=this.abs();if(r.t<e.t){n?.fromInt(0),t!=null&&this.copyTo(t);return}t===null&&(t=Jo());let a=Jo(),c=this.s,d=i.s,u=this.DB-sw(e[e.t-1]);u>0?(e.lShiftTo(u,a),r.lShiftTo(u,t)):(e.copyTo(a),r.copyTo(t));let h=a.t,f=a[h-1];if(f===0)return;let v=f*(1<<this.F1)+(h>1?a[h-2]>
4>this.F2:0),C=this.FV/v,y=(1<<this.F1)/v,A=1<<this.F2,D=t.t,F=D-h,R=n===null?Jo():n;for(a.dlShiftTo(F,R),t.compareTo(R)>=0&&(t[t.t++]=1,t.subTo(R,t)),Si.ONE.dlShiftTo(h,R),R.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--F>=0;){let L=t[--D]===f?this.DM:Math.floor(t[D]*C+(t[D-1]+A)*y);if((t[D]+=a.am(0,L,t,F,0,h))<L)for(a.dlShiftTo(F,R),t.subTo(R,t);t[D]<--L;)t.subTo(R,t)}n!==null&&(t.drShiftTo(h,n),c!==d&&Si.ZERO.subTo(n,n)),t.t=h,t.clamp(),u>0&&t.rShiftTo(u,t),c<0&&Si.ZERO.subTo(t,t)}function Y$(i){let n=Jo();return this.abs().divRemTo(i,null,n),this.s<0&&n.compareTo(Si.ZERO)>0&&i.subTo(n,n),n}function q$(){if(this.t<1)return 0;let i=this[0];if((i&1)===0)return 0;let n=i&3;return n=n*(2-(i&15)*n)&15,n=n*(2-(i&255)*n)&255,n=n*(2-((i&65535)*n&65535))&65535,n=n*(2-i*n%this.DV)%this.DV,n>0?this.DV-n:-n}function K$(i){return this.compareTo(i)===0}function X$(i,n){let t=0,e=0,r=Math.min(i.t,this.t);for(;t<r;)e+=this[t]+i[t],n[t++]=e&this.DM,e>>=this.DB;if(i.t<this.t){for(e+=i.s;t<this.t;)e+=this[t],n[t++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;t<i.t;)e+=i[t],n[t++]=e&this.DM,e>>=this.DB;e+=i.s}n.s=e<0?-1:0,e>0?n[t++]=e:e<-1&&(n[t++]=this.DV+e),n.t=t,n.clamp()}function J$(i){let n=Jo();return this.addTo(i,n),n}function Z$(i){let n=Jo();return this.subTo(i,n),n}function Q$(i){let n=Jo();return this.multiplyTo(i,n),n}function ez(i){let n=Jo();return this.divRemTo(i,n,null),n}function Ch(i){this.m=i,this.mp=i.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t}function tz(i){let n=Jo();return i.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),i.s<0&&n.compareTo(Si.ZERO)>0&&this.m.subTo(n,n),n}function iz(i){let n=Jo();return i.copyTo(n),this.reduce(n),n}function nz(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(let n=0;n<this.m.t;++n){let t=i[n]&32767,e=t*this.mpl+((t*this.mph+(i[n]>>15)*this.mpl&this.um)<<15)&i.DM;for(t=n+this.m.t,i[t]+=this.m.am(0,e,i,n,0,this.m.t);i[t]>=i.DV;)i[t]-=i.DV,i[++t]++}i.clamp(),i.drShiftTo(this.m.t,i),i.compareTo(this.m)>=0&&i.subTo(this.m,i)}function rz(i,n){i.squareTo(n),this.reduce(n)}function az(i,n,t){i.multiplyTo(n,t),this.reduce(t)}Ch.prototype.convert=tz;Ch.prototype.revert=iz;Ch.prototype.reduce=nz;Ch.prototype.mulTo=az;Ch.prototype.sqrTo=rz;function oz(i,n,t){let e=i.bitLength(),r,a=ow(1),c=new Ch(n);if(e<=0)return a;e<18?r=1:e<48?r=3:e<144?r=4:e<768?r=5:r=6;let d=[],u=3,h=r-1,f=(1<<r)-1;if(d[1]=c.convert(this),r>1){let R=Jo();for(c.sqrTo(d[1],R);u<=f;)d[u]=Jo(),c.mulTo(R,d[u-2],d[u]),u+=2}let v=i.t-1,C,y=!0,A=Jo(),D;for(e=sw(i[v])-1;v>=0;){for(e>=h?C=i[v]>>e-h&f:(C=(i[v]&(1<<e+1)-1)<<h-e,v>0&&(C|=i[v-1]>>this.DB+e-h)),u=r;(C&1)===0;)C>>=1,--u;if((e-=u)<0&&(e+=this.DB,--v),y)d[C].copyTo(a),y=!1;else{for(;u>1;)c.sqrTo(a,A),c.sqrTo(A,a),u-=2;u>0?c.sqrTo(a,A):(D=a,a=A,A=D),c.mulTo(A,d[C],a)}for(;v>=0&&(i[v]&1<<e)===0;)c.sqrTo(a,A),D=a,a=A,A=D,--e<0&&(e=this.DB-1,--v)}let F=c.revert(a);return t(null,F),F}Si.prototype.copyTo=M$;Si.prototype.fromInt=A$;Si.prototype.fromString=P$;Si.prototype.clamp=F$;Si.prototype.dlShiftTo=V$;Si.prototype.drShiftTo=U$;Si.prototype.lShiftTo=j$;Si.prototype.rShiftTo=W$;Si.prototype.subTo=H$;Si.prototype.multiplyTo=G$;Si.prototype.squareTo=$$;Si.prototype.divRemTo=z$;Si.prototype.invDigit=q$;Si.prototype.addTo=X$;Si.prototype.toString=R$;Si.prototype.negate=O$;Si.prototype.abs=N$;Si.prototype.compareTo=L$;Si.prototype.bitLength=B$;Si.prototype.mod=Y$;Si.prototype.equals=K$;Si.prototype.add=J$;Si.prototype.subtract=Z$;Si.prototype.multiply=Q$;Si.prototype.divide=ez;Si.prototype.modPow=oz;Si.ZERO=ow(0);Si.ONE=ow(1);var aP=d=>ye(null,[d],function*({a:i,g:n,k:t,x:e,B:r,N:a,U:c}){return new Promise((u,h)=>{n.modPow(e,a,(f,v)=>{if(f){h(f);return}r.subtract(t.multiply(v)).modPow(i.add(c.multiply(e)),a,(C,y)=>{if(C){h(C);return}u(y.mod(a))})})})});var oP="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",lw={},YS={};for(let i=0;i<256;i++){let n=i.toString(16).toLowerCase();n.length===1&&(n=`0${n}`),lw[i]=n,YS[n]=i}var Kc=i=>{if(i.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let n=new Uint8Array(i.length/2);for(let t=0;t<i.length;t+=2){let e=i.slice(t,t+2).toLowerCase();if(e in YS)n[t/2]=YS[e];else throw new Error(`Cannot decode unrecognized sequence ${e} as hexadecimal`)}return n};var Eh=i=>{let n="";for(let t=0;t<i.byteLength;t++)n+=lw[i[t]];return n};var D1=i=>{let n=new t0;n.update(i);let t=n.digestSync(),e=Eh(t);return new Array(64-e.length).join("0")+e};var wh=i=>D1(Kc(i));var sz=/^[89a-f]/i,cc=i=>{if(!(i instanceof Si))throw new Error("Not a BigInteger");let n=i.compareTo(Si.ZERO)<0,t=i.abs().toString(16);if(t=t.length%2!==0?`0${t}`:t,t=sz.test(t)?`00${t}`:t,n){let e=t.split("").map(a=>{let c=~parseInt(a,16)&15;return"0123456789ABCDEF".charAt(c)}).join("");t=new Si(e,16).add(Si.ONE).toString(16),t.toUpperCase().startsWith("FF8")&&(t=t.
4substring(2))}return t};var sP=({A:i,B:n})=>{let t=new Si(wh(cc(i)+cc(n)),16);if(t.equals(Si.ZERO))throw new Error("U cannot be zero.");return t};var lP=(i,n,t)=>{let e=new t0(n);e.update(i);let r=e.digestSync(),a=new t0(r);return a.update(t),a.digestSync().slice(0,16)};var Th=i=>{let n=new E1().random(i).toString();return Kc(n)};var cP=()=>zc.convert(Th(40));var qS=class{constructor({userPoolName:n,a:t,g:e,A:r,N:a}){this.encoder=bh,this.userPoolName=n,this.a=t,this.g=e,this.A=r,this.N=a,this.k=new Si(wh(`${cc(a)}${cc(e)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new wi({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new wi({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new wi({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}generateHashDevice(n,t){return ye(this,null,function*(){this.randomPassword=cP();let e=`${n}${t}:${this.randomPassword}`,r=D1(e),a=Eh(Th(16));return this.saltToHashDevices=cc(new Si(a,16)),new Promise((c,d)=>{this.g.modPow(new Si(wh(this.saltToHashDevices+r),16),this.N,(u,h)=>{if(u){d(u);return}this.verifierDevices=cc(h),c()})})})}getPasswordAuthenticationKey(a){return ye(this,arguments,function*({username:n,password:t,serverBValue:e,salt:r}){if(e.mod(this.N).equals(Si.ZERO))throw new Error("B cannot be zero.");let c=sP({A:this.A,B:e}),d=`${this.userPoolName}${n}:${t}`,u=D1(d),h=new Si(wh(cc(r)+u),16),f=yield aP({a:this.a,g:this.g,k:this.k,x:h,B:e,N:this.N,U:c}),v=this.encoder.convert("Caldera Derived Key"),C=this.encoder.convert("�"),y=new Uint8Array(v.byteLength+C.byteLength);return y.set(v,0),y.set(C,v.byteLength),lP(Kc(cc(f)),Kc(cc(c)),y)})}};var dP=e=>ye(null,[e],function*({a:i,g:n,N:t}){return new Promise((r,a)=>{n.modPow(i,t,(c,d)=>{if(c){a(c);return}if(d.mod(t).equals(Si.ZERO)){a(new Error("Illegal parameter. A mod N cannot be 0."));return}r(d)})})});var Um=i=>ye(null,null,function*(){let n=new Si(oP,16),t=new Si("2",16),e=lz(),r=yield dP({a:e,g:t,N:n});return new qS({userPoolName:i,a:e,g:t,A:r,N:n})}),lz=()=>{let i=Eh(Th(128));return new Si(i,16)};function Ml(r){return ye(this,arguments,function*({userPoolId:i,userPoolEndpoint:n,newDeviceMetadata:t,accessToken:e}){if(!t)return;let a=i.split("_")[1]||"",c=yield Um(a),d=t?.DeviceKey,u=t?.DeviceGroupKey;try{yield c.generateHashDevice(u??"",d??"")}catch{return}let h={Salt:zc.convert(Kc(c.getSaltToHashDevices())),PasswordVerifier:zc.convert(Kc(c.getVerifierDevices()))},f=c.getRandomPassword();try{return yield tP({endpointResolver:jn({endpointOverride:n})})({region:Un(i)},{AccessToken:e,DeviceName:yield XE(),DeviceKey:t?.DeviceKey,DeviceSecretVerifierConfig:h}),{deviceKey:d,deviceGroupKey:u,randomPassword:f}}catch{return}})}function mP(i){return ye(this,null,function*(){let n=un.getConfig().Auth?.Cognito;Xi(n);let{username:t,signInSession:e,signInDetails:r,challengeName:a}=lc.getState();if(a!=="WEB_AUTHN"||!t)throw new wi({name:Nd.SignInException,message:"Unable to proceed due to invalid sign in state."});let{CREDENTIAL_REQUEST_OPTIONS:c}=i;yh(!!c,qr.InvalidPasskeyAuthenticationOptions);let d=yield eP(JSON.parse(c)),u=c0({endpointResolver:jn({endpointOverride:n.userPoolEndpoint})}),{ChallengeName:h,ChallengeParameters:f,AuthenticationResult:v,Session:C}=yield u({region:Un(n.userPoolId),userAgentValue:Nr(Tr.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:t,CREDENTIAL:JSON.stringify(d)},ClientId:n.userPoolClientId,Session:e});if(Il({signInSession:C,username:t,challengeName:h,signInDetails:r}),v)return yield Ko(tt(le({},v),{username:t,NewDeviceMetadata:yield Ml({userPoolId:n.userPoolId,userPoolEndpoint:n.userPoolEndpoint,newDeviceMetadata:v.NewDeviceMetadata,accessToken:v.AccessToken}),signInDetails:r})),lc.dispatch({type:"RESET_STATE"}),yield xs(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if(h==="WEB_AUTHN")throw new wi({name:Nd.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:h,challengeParameters:f}})}function xa({username:i,userPoolId:n,userPoolClientId:t}){if(typeof window>"u")return;let e=window.AmazonCognitoAdvancedSecurityData;if(typeof e>"u")return;let r=e.getData(i,n,t);return r?{EncodedData:r}:{}}var cz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dz=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],KS=()=>{let i=new Date,n=dz[i.getUTCDay()],t=cz[i.getUTCMonth()],e=i.getUTCDate(),r=i.getUTCHours();r<10&&(r=`0${r}`);let a=i.getUTCMinutes();a<10&&(a=`0${a}`);let c=i.getUTCSeconds();c<10&&(c=`0${c}`);let d=i.getUTCFullYear();return`${n} ${t} ${e} ${r}:${a}:${c} UTC ${d}`};var XS=({userPoolName:i,username:n,challengeParameters:t,dateNow:e,hkdf:r})=>{let a=bh.convert(i),c=bh.convert(n),d=mz(t.SECRET_BLOCK),u=bh.convert(e),h=new Uint8Array(a.byteLength+c.byteLength+d.byteLength+u.byteLength);h.set(a,0),h.set(c,a.byteLength),h.set(d,a.byteLength+c.byteLength),h.set(u,a.byteLength+c.byteLength+d.byteLength);let f=new t0(r);f.update(h);let v=f.digestSync();return zc.convert(v)},mz=i=>{let n="=".repeat((4-i.length%4)%4),t=(i+n).replace(/-/g,"+").replace(/_/g,"/"),e=Zu.convert(t),r=new Uint8Array(e.length);for(let a=0;a<e.length;++a)r[a]=e.charCodeAt(a);return r};function I1(a){return ye(this,arguments,function*({username:i,config:n,clientMetadata:t,session:e,tokenOrchestrator:r}){let{userPoolId:c,userPoolEndpoint:d}=n,u=n.userPoolClientId,h=yield r?.getDeviceMetadata(i);QE(h);let f=yield Um(h.deviceGroupKey),v={USERNAME:i,SRP_A:f.A.toString(16),DEVICE_KEY:h.deviceKey},C={ChallengeName:"DEVICE_SRP_AUTH",ClientId:u,ChallengeResponses:v,ClientMetadata:t,Session:e},y=c0({endpointResolver:jn({endpointOverride:d})}),{ChallengeParameters:A,Session:D}=yield y({region:Un(c)},C);return uz(i,A,t,D,f,n,r)})}function uz(h,f,v,C,y,A,D){return ye(this,arguments,function*(i,n,t,e,r,{userPoolId:a,userPoolClientId:c,userPoolEndpoint:d},u){let F=yield u?.getDeviceMetadata(i);QE(F);let R=new Si(n?.SRP_B,16),L=new Si(n?.SALT,16),{deviceKey:H}=F,{deviceGroupKey:se}=F,Ce=yield r.getPasswordAuthenticationKey({username:F.deviceKey,password:F.randomPassword,serverBValue:R,salt:L}),Ue=KS(),re={USERNAME:n?.USERNAME??i,PASSWORD_CLAIM_SECRET_BLOCK:n?.
4SECRET_BLOCK,TIMESTAMP:Ue,PASSWORD_CLAIM_SIGNATURE:XS({username:H,userPoolName:se,challengeParameters:n,dateNow:Ue,hkdf:Ce}),DEVICE_KEY:H},ae=xa({username:i,userPoolId:a,userPoolClientId:c}),ve={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:c,ChallengeResponses:re,Session:e,ClientMetadata:t,UserContextData:ae};return c0({endpointResolver:jn({endpointOverride:d})})({region:Un(a)},ve)})}function JS(i,n,t,e,r,a,c){return ye(this,null,function*(){let{userPoolId:d,userPoolClientId:u,userPoolEndpoint:h}=a,f=d?.split("_")[1]||"",v=new Si(n?.SRP_B,16),C=new Si(n?.SALT,16),y=n?.USER_ID_FOR_SRP;if(!y)throw new wi({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});let A=yield r.getPasswordAuthenticationKey({username:y,password:i,serverBValue:v,salt:C}),D=KS(),F={USERNAME:y,PASSWORD_CLAIM_SECRET_BLOCK:n?.SECRET_BLOCK,TIMESTAMP:D,PASSWORD_CLAIM_SIGNATURE:XS({username:y,userPoolName:f,challengeParameters:n,dateNow:D,hkdf:A})},R=yield c.getDeviceMetadata(y);R&&R.deviceKey&&(F.DEVICE_KEY=R.deviceKey);let L=xa({username:y,userPoolId:d,userPoolClientId:u}),H={ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:F,ClientMetadata:t,Session:e,ClientId:u,UserContextData:L},Ce=yield c0({endpointResolver:jn({endpointOverride:h})})({region:Un(d)},H);return Ce.ChallengeName==="DEVICE_SRP_AUTH"?I1({username:y,config:a,clientMetadata:t,session:Ce.Session,tokenOrchestrator:c}):Ce})}function jm(i,n,t,e){return ye(this,null,function*(){try{return yield i(...n)}catch(r){if(r instanceof wi&&r.name==="ResourceNotFoundException"&&r.message.includes("Device does not exist."))return yield e.clearDeviceMetadata(t),i(...n);throw r}})}function Wm(i){let{dispatch:n}=lc;n({type:"SET_USERNAME",value:i})}function ZS(d){return ye(this,arguments,function*({username:i,password:n,clientMetadata:t,config:e,tokenOrchestrator:r,authFlow:a,preferredChallenge:c}){let{userPoolId:u,userPoolClientId:h,userPoolEndpoint:f}=e,v=u?.split("_")[1]||"",C=yield Um(v),y={USERNAME:i,SRP_A:C.A.toString(16)};a==="USER_AUTH"&&c&&(y.PREFERRED_CHALLENGE=c);let A=xa({username:i,userPoolId:u,userPoolClientId:h}),D={AuthFlow:a,AuthParameters:y,ClientMetadata:t,ClientId:h,UserContextData:A},R=yield Lm({endpointResolver:jn({endpointOverride:f})})({region:Un(u),userAgentValue:Nr(Tr.SignIn)},D),{ChallengeParameters:L,Session:H}=R,se=L?.USERNAME??i;return Wm(se),R.ChallengeName==="PASSWORD_VERIFIER"?jm(JS,[n,L,t,H,C,e,r],se,r):R})}var uP="userAttributes.";function pz(i){return"isSignedIn"in i&&"nextStep"in i}function fP(i,n,t,e,r){return ye(this,null,function*(){let{userPoolClientId:a,userPoolId:c,userPoolEndpoint:d}=e,u={USERNAME:i,PASSWORD:n},h=yield r.getDeviceMetadata(i);h&&h.deviceKey&&(u.DEVICE_KEY=h.deviceKey);let f=xa({username:i,userPoolId:c,userPoolClientId:a}),v={AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:u,ClientMetadata:t,ClientId:a,UserContextData:f},y=yield Lm({endpointResolver:jn({endpointOverride:d})})({region:Un(c),userAgentValue:Nr(Tr.SignIn)},v),A=y.ChallengeParameters?.USERNAME??y.ChallengeParameters?.USER_ID_FOR_SRP??i;return Wm(A),y.ChallengeName==="DEVICE_SRP_AUTH"?I1({username:A,config:e,clientMetadata:t,session:y.Session,tokenOrchestrator:r}):y})}function gP(i,n,t,e,r){return ye(this,null,function*(){return ZS({username:i,password:n,clientMetadata:t,config:e,tokenOrchestrator:r,authFlow:"USER_SRP_AUTH"})})}function vP(i,n,t,e){return ye(this,null,function*(){let{userPoolClientId:r,userPoolId:a,userPoolEndpoint:c}=t,d={USERNAME:i},u=yield e.getDeviceMetadata(i);u&&u.deviceKey&&(d.DEVICE_KEY=u.deviceKey);let h=xa({username:i,userPoolId:a,userPoolClientId:r}),f={AuthFlow:"CUSTOM_AUTH",AuthParameters:d,ClientMetadata:n,ClientId:r,UserContextData:h},C=yield Lm({endpointResolver:jn({endpointOverride:c})})({region:Un(a),userAgentValue:Nr(Tr.SignIn)},f),y=C.ChallengeParameters?.USERNAME??i;return Wm(y),C.ChallengeName==="DEVICE_SRP_AUTH"?I1({username:y,config:t,clientMetadata:n,session:C.Session,tokenOrchestrator:e}):C})}function _P(i,n,t,e,r){return ye(this,null,function*(){Xi(e);let{userPoolId:a,userPoolClientId:c,userPoolEndpoint:d}=e,u=a?.split("_")[1]||"",h=yield Um(u),f={USERNAME:i,SRP_A:h.A.toString(16),CHALLENGE_NAME:"SRP_A"},v=xa({username:i,userPoolId:a,userPoolClientId:c}),C={AuthFlow:"CUSTOM_AUTH",AuthParameters:f,ClientMetadata:t,ClientId:c,UserContextData:v},y=Lm({endpointResolver:jn({endpointOverride:d})}),{ChallengeParameters:A,Session:D}=yield y({region:Un(a),userAgentValue:Nr(Tr.SignIn)},C),F=A?.USERNAME??i;return Wm(F),jm(JS,[n,A,t,D,h,e,r],F,r)})}function dc(i){return ye(this,null,function*(){let{challengeName:n,challengeParameters:t,availableChallenges:e}=i,r=un.getConfig().Auth?.Cognito;switch(Xi(r),n){case"CUSTOM_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE",additionalInfo:t}};case"MFA_SETUP":{let{signInSession:a,username:c}=lc.getState(),d=pP(hP(t.MFAS_CAN_SETUP))||[],u=vz(d),h=u.includes("TOTP"),f=u.includes("EMAIL");if(h&&f)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:u}};if(f)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(h){let v=LA({endpointResolver:jn({endpointOverride:r.userPoolEndpoint})}),{Session:C,SecretCode:y}=yield v({region:Un(r.userPoolId)},{Session:a});return lc.dispatch({type:"SET_SIGN_IN_SESSION",value:C}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:hz(y,c)}}}throw new wi({name:Nd.SignInException,message:`Cannot initiate MFA setup from available types: ${d}`})}case"NEW_PASSWORD_REQUIRED":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",missingAttributes:fz(t.requiredAttributes)}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:pP(hP(t.MFAS_CAN_CHOOSE))}};case"SMS_OTP":case"SMS_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_SMS_CODE",codeDeliveryDetails:{deliveryMedium:t.CODE_DELIVERY_DELIVERY_MEDIUM,destination:t.CODE_DELIVERY_DESTINATION}}};case"SOFTWARE_TOKEN_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_TOTP_CODE"}};case"EMAIL_OTP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_EMAIL_CODE",codeDeliveryDetails:{deliveryMedium:t.CODE_DELIVERY_DELIVERY_MEDIUM,destination:t.CODE_DELIVERY_DESTINATION}}};case"WEB_AUTHN":{let a=yield mP(t);return pz(a)?a:dc(a)}case"PASSWORD":case"PASSWORD_SRP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_PASSWORD"}};case"SELECT_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION",availableChallenges:e}}}throw new wi({name:Nd.SignInException,message:`An error occurred during the sign in process. ${n} challengeName returned by the underlying service was not addressed.`})})}
4function hz(i,n){return{sharedSecret:i,getSetupUri:(t,e)=>{let r=`otpauth://totp/${t}:${e??n}?secret=${i}&issuer=${t}`;return new qo(r)}}}function Xc(i){if(i===RS.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(i===RS.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function fz(i){return i?JSON.parse(i).map(t=>t.includes(uP)?t.replace(uP,""):t):[]}function gz(i){if(i==="SMS_MFA")return"SMS";if(i==="SOFTWARE_TOKEN_MFA")return"TOTP";if(i==="EMAIL_OTP")return"EMAIL"}function pP(i){if(i)return i.map(gz).filter(Boolean)}function hP(i){return i?JSON.parse(i):[]}function vz(i){return i.filter(n=>n==="EMAIL"||n==="TOTP")}function yP(){return ye(this,null,function*(){let i;try{i=yield Nm()}catch{}if(i&&i.userId&&i.username)throw new wi({name:wA,message:"There is already a signed in user.",recoverySuggestion:"Call signOut before calling signIn again."})})}function Jc(i){return lc.getState().username??i}function SP(i){return ye(this,null,function*(){let n=un.getConfig().Auth?.Cognito;Xi(n);let{username:t,password:e,options:r}=i,a={loginId:t,authFlowType:"CUSTOM_WITHOUT_SRP"},c=r?.clientMetadata;br(!!t,en.EmptySignInUsername),br(!e,en.CustomAuthSignInPassword);try{let{ChallengeName:d,ChallengeParameters:u,AuthenticationResult:h,Session:f}=yield jm(vP,[t,c,n,Yr],t,Yr),v=Jc(t);return Il({signInSession:f,username:v,challengeName:d,signInDetails:a}),h?(yield Ko(tt(le({username:v},h),{NewDeviceMetadata:yield Ml({userPoolId:n.userPoolId,userPoolEndpoint:n.userPoolEndpoint,newDeviceMetadata:h.NewDeviceMetadata,accessToken:h.AccessToken}),signInDetails:a})),Xo(),yield xs(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):dc({challengeName:d,challengeParameters:u})}catch(d){Xo(),ma(d);let u=Xc(d.name);if(u)return u;throw d}})}function bP(i){return ye(this,null,function*(){let{username:n,password:t,options:e}=i,r={loginId:n,authFlowType:"CUSTOM_WITH_SRP"},a=un.getConfig().Auth?.Cognito;Xi(a);let c=e?.clientMetadata;br(!!n,en.EmptySignInUsername),br(!!t,en.EmptySignInPassword);try{let{ChallengeName:d,ChallengeParameters:u,AuthenticationResult:h,Session:f}=yield _P(n,t,c,a,Yr),v=Jc(n);return Il({signInSession:f,username:v,challengeName:d,signInDetails:r}),h?(yield Ko(tt(le({username:v},h),{NewDeviceMetadata:yield Ml({userPoolId:a.userPoolId,userPoolEndpoint:a.userPoolEndpoint,newDeviceMetadata:h.NewDeviceMetadata,accessToken:h.AccessToken}),signInDetails:r})),Xo(),yield xs(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):dc({challengeName:d,challengeParameters:u})}catch(d){Xo(),ma(d);let u=Xc(d.name);if(u)return u;throw d}})}var xP=()=>ye(null,null,function*(){throw new wi({name:OS,message:"The autoSignIn flow has not started, or has been cancelled/completed.",recoverySuggestion:"Please try to use the signIn API or log out before starting a new autoSignIn flow."})}),CP=xP;function k1(i){CP=i}function Ca(i=!0){i&&(CP=xP),Dl.dispatch({type:"RESET"})}function cw(i){return ye(this,null,function*(){let{username:n,password:t}=i,e=un.getConfig().Auth?.Cognito,r={loginId:n,authFlowType:"USER_SRP_AUTH"};Xi(e);let a=i.options?.clientMetadata;br(!!n,en.EmptySignInUsername),br(!!t,en.EmptySignInPassword);try{let{ChallengeName:c,ChallengeParameters:d,AuthenticationResult:u,Session:h}=yield gP(n,t,a,e,Yr),f=Jc(n);return Il({signInSession:h,username:f,challengeName:c,signInDetails:r}),u?(yield Ko(tt(le({username:f},u),{NewDeviceMetadata:yield Ml({userPoolId:e.userPoolId,userPoolEndpoint:e.userPoolEndpoint,newDeviceMetadata:u.NewDeviceMetadata,accessToken:u.AccessToken}),signInDetails:r})),Xo(),yield xs(),Ca(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):dc({challengeName:c,challengeParameters:d})}catch(c){Xo(),Ca(),ma(c);let d=Xc(c.name);if(d)return d;throw c}})}function EP(i){return ye(this,null,function*(){let{username:n,password:t,options:e}=i,r=un.getConfig().Auth?.Cognito,a={loginId:n,authFlowType:"USER_PASSWORD_AUTH"};Xi(r);let c=e?.clientMetadata;br(!!n,en.EmptySignInUsername),br(!!t,en.EmptySignInPassword);try{let{ChallengeName:d,ChallengeParameters:u,AuthenticationResult:h,Session:f}=yield jm(fP,[n,t,c,r,Yr],n,Yr),v=Jc(n);return Il({signInSession:f,username:v,challengeName:d,signInDetail
4s:a}),h?(yield Ko(tt(le({},h),{username:v,NewDeviceMetadata:yield Ml({userPoolId:r.userPoolId,userPoolEndpoint:r.userPoolEndpoint,newDeviceMetadata:h.NewDeviceMetadata,accessToken:h.AccessToken}),signInDetails:a})),Xo(),yield xs(),Ca(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):dc({challengeName:d,challengeParameters:u})}catch(d){Xo(),Ca(),ma(d);let u=Xc(d.name);if(u)return u;throw d}})}function wP(d){return ye(this,arguments,function*({username:i,clientMetadata:n,config:t,tokenOrchestrator:e,preferredChallenge:r,password:a,session:c}){let{userPoolId:u,userPoolClientId:h,userPoolEndpoint:f}=t,v=xa({username:i,userPoolId:u,userPoolClientId:h}),C={USERNAME:i};if(r){if(r==="PASSWORD_SRP")return br(!!a,en.EmptySignInPassword),ZS({username:i,password:a,clientMetadata:n,config:t,tokenOrchestrator:e,authFlow:"USER_AUTH",preferredChallenge:r});r==="PASSWORD"&&(br(!!a,en.EmptySignInPassword),C.PASSWORD=a),C.PREFERRED_CHALLENGE=r}let y={AuthFlow:"USER_AUTH",AuthParameters:C,ClientMetadata:n,ClientId:h,UserContextData:v};c&&(y.Session=c);let D=yield Lm({endpointResolver:jn({endpointOverride:f})})({region:Un(u),userAgentValue:Nr(Tr.SignIn)},y);return Wm(i),D})}function QS(i){return ye(this,null,function*(){let{username:n,password:t,options:e}=i,r=un.getConfig().Auth?.Cognito,a={loginId:n,authFlowType:"USER_AUTH"};Xi(r);let c=e?.clientMetadata,d=e?.preferredChallenge;br(!!n,en.EmptySignInUsername);try{let u={username:n,config:r,tokenOrchestrator:Yr,clientMetadata:c,preferredChallenge:d,password:t},h=Dl.getState();h.active&&h.username===n&&(u.session=h.session);let f=yield wP(u),v=Jc(n);return Il({signInSession:f.Session,username:v,challengeName:f.ChallengeName,signInDetails:a}),f.AuthenticationResult?(yield Ko(tt(le({username:v},f.AuthenticationResult),{NewDeviceMetadata:yield Ml({userPoolId:r.userPoolId,userPoolEndpoint:r.userPoolEndpoint,newDeviceMetadata:f.AuthenticationResult.NewDeviceMetadata,accessToken:f.AuthenticationResult.AccessToken}),signInDetails:a})),Xo(),yield xs(),Ca(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):dc({challengeName:f.ChallengeName,challengeParameters:f.ChallengeParameters,availableChallenges:"AvailableChallenges"in f?f.AvailableChallenges:void 0})}catch(u){Xo(),Ca(),ma(u);let h=Xc(u.name);if(h)return h;throw u}})}function Dh(i){return ye(this,null,function*(){Ca(!1);let n=i.options?.authFlowType;switch(yield yP(),n){case"USER_SRP_AUTH":return cw(i);case"USER_PASSWORD_AUTH":return EP(i);case"CUSTOM_WITHOUT_SRP":return SP(i);case"CUSTOM_WITH_SRP":return bP(i);case"USER_AUTH":return QS(i);default:return cw(i)}})}var TP=3*60*1e3;function DP(i){let n=Ju.listen("auth-internal",r=>ye(null,[r],function*({payload:e}){switch(e.event){case"confirmSignUp":e.data?.isSignUpComplete&&(Ju.dispatch("auth-internal",{event:"autoSignIn"}),k1(MP(i)),n())}})),t=setTimeout(()=>{n(),clearTimeout(t),Ca()},TP)}function IP(i,n){let t;return e=>{t||i(...e),clearTimeout(t),t=setTimeout(()=>{t=void 0},n)}}function _z(i,n,t){let e=Date.now(),r=setInterval(()=>ye(null,null,function*(){if(Date.now()-e>TP)clearInterval(r),t(new wi({name:OS,message:"The account was not confirmed on time.",recoverySuggestion:"Try to verify your account by clicking the link sent your email or phone and then login manually."})),Ca();else try{let d=yield Dh(i);d.nextStep.signInStep!=="CONFIRM_SIGN_UP"&&(n(d),clearInterval(r),Ca())}catch(d){clearInterval(r),t(d),Ca()}}),5e3)}var yz=IP(_z,300),Sz=IP(bz,300);function kP(i){return()=>ye(null,null,function*(){return new Promise((n,t)=>{yz([i,n,t])})})}function bz(i,n,t){return ye(this,null,function*(){try{let e=i?.options?.authFlowType==="USER_AUTH"?yield QS(i):yield Dh(i);n(e),Ca()}catch(e){t(e),Ca()}})}function MP(i){return()=>ye(null,null,function*(){return new Promise((n,t)=>{Sz([i,n,t])})})}var AP=MP;var xz=()=>i=>ye(null,null,function*(){if(i.statusCode>=300){let n=yield nl(i);if(ma(n),n.name===ZE.InvalidParameterException&&/'password'/.test(n.message)&&/Member must not be null/.test(n.message)){let t=en.EmptySignUpPassword,{message:e,recoverySuggestion:r}=FS[t];throw new wi({name:t,message:e,recoverySuggestion:r})}throw new wi({name:n.name,message:n.message})}return Gc(i)}),PP=i=>cr(Ur,Vr("SignUp"),xz(),le(le({},jr),i));function dw(i){return ye(this,null,function*(){let{username:n,password:t,options:e}=i,r=un.getConfig().Auth?.Cognito,a=r?.signUpVerificationMethod??"code",{clientMetadata:c,validationData:d,autoSignIn:u}=i.options??{};Xi(r),br(!!n,en.EmptySignUpUsername);let h=typeof u!="boolean"?u:void 0,f={username:n,options:h};h?.authFlowType!=="CUSTOM_WITHOUT_SRP"&&(f.password=t);let{userPoolId:v,userPoolClientId:C,userPoolEndpoint:y}=r,A=PP({endpointResolver:jn({endpointOverride:y})}),D={Username:n,Password:void 0,UserAttributes:e?.userAttributes&&JE(e?.userAttributes),ClientMetadata:c,ValidationData:d&&JE(d),ClientId:C,UserContextData:xa({username:n,userPoolId:v,userPoolClientId:C})};t&&(D.Password=t);let{UserSub:F,CodeDeliveryDetails:R,UserConfirmed:L,Session:H}=yield A({region:Un(v),userAgentValue:Nr(Tr.SignUp)},D);
4(h||u===!0)&&(Dl.dispatch({type:"START"}),Dl.dispatch({type:"SET_USERNAME",value:n}),Dl.dispatch({type:"SET_SESSION",value:H}));let se={destination:R?.Destination,deliveryMedium:R?.DeliveryMedium,attributeName:R?.AttributeName},Ce=!!L,Ue=Dl.getState().active;if(Ce)return Ue?(k1(AP(f)),{isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"},userId:F}):{isSignUpComplete:!0,nextStep:{signUpStep:"DONE"},userId:F};if(Ue){if(a==="link")return k1(kP(f)),{isSignUpComplete:!1,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN",codeDeliveryDetails:se},userId:F};DP(f)}return{isSignUpComplete:!1,nextStep:{signUpStep:"CONFIRM_SIGN_UP",codeDeliveryDetails:se},userId:F}})}var FP=i=>cr(Ur,Vr("ForgotPassword"),ta(),le(le({},jr),i));function mw(i){return ye(this,null,function*(){let{username:n}=i;br(!!n,en.EmptyResetPasswordUsername);let t=un.getConfig().Auth?.Cognito;Xi(t);let{userPoolClientId:e,userPoolId:r,userPoolEndpoint:a}=t,c=i.options?.clientMetadata,d=xa({username:n,userPoolId:r,userPoolClientId:e}),f=(yield FP({endpointResolver:jn({endpointOverride:a})})({region:Un(r),userAgentValue:Nr(Tr.ResetPassword)},{Username:n,ClientMetadata:c,ClientId:e,UserContextData:d})).CodeDeliveryDetails;return{isPasswordReset:!1,nextStep:{resetPasswordStep:"CONFIRM_RESET_PASSWORD_WITH_CODE",codeDeliveryDetails:{deliveryMedium:f?.DeliveryMedium,destination:f?.Destination,attributeName:f?.AttributeName}}}})}var RP=i=>cr(Ur,Vr("ConfirmForgotPassword"),ta(),le(le({},jr),i));function uw(i){return ye(this,null,function*(){let n=un.getConfig().Auth?.Cognito;Xi(n);let{userPoolClientId:t,userPoolId:e,userPoolEndpoint:r}=n,{username:a,newPassword:c}=i;br(!!a,en.EmptyConfirmResetPasswordUsername),br(!!c,en.EmptyConfirmResetPasswordNewPassword);let d=i.confirmationCode;br(!!d,en.EmptyConfirmResetPasswordConfirmationCode);let u=i.options?.clientMetadata,h=xa({username:a,userPoolId:e,userPoolClientId:t});yield RP({endpointResolver:jn({endpointOverride:r})})({region:Un(n.userPoolId),userAgentValue:Nr(Tr.ConfirmResetPassword)},{Username:a,ConfirmationCode:d,Password:c,ClientMetadata:u,ClientId:n.userPoolClientId,UserContextData:h})})}var OP=i=>cr(Ur,Vr("ConfirmSignUp"),ta(),le(le({},jr),i));function pw(i){return ye(this,null,function*(){let{username:n,confirmationCode:t,options:e}=i,r=un.getConfig().Auth?.Cognito;Xi(r);let{userPoolId:a,userPoolClientId:c,userPoolEndpoint:d}=r,u=e?.clientMetadata;br(!!n,en.EmptyConfirmSignUpUsername),br(!!t,en.EmptyConfirmSignUpCode);let h=xa({username:n,userPoolId:a,userPoolClientId:c}),f=OP({endpointResolver:jn({endpointOverride:d})}),{Session:v}=yield f({region:Un(r.userPoolId),userAgentValue:Nr(Tr.ConfirmSignUp)},{Username:n,ConfirmationCode:t,ClientMetadata:u,ForceAliasCreation:e?.forceAliasCreation,ClientId:r.userPoolClientId,UserContextData:h});return new Promise((C,y)=>{try{let A={isSignUpComplete:!0,nextStep:{signUpStep:"DONE"}},D=Dl.getState();if(!D.active||D.username!==n){C(A),Ca();return}Dl.dispatch({type:"SET_SESSION",value:v});let F=Ju.listen("auth-internal",({payload:R})=>{switch(R.event){case"autoSignIn":C({isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"}}),F()}});Ju.dispatch("auth-internal",{event:"confirmSignUp",data:A})}catch(A){y(A)}})})}var NP=i=>cr(Ur,Vr("GetUser"),ta(),le(le({},jr),i));var qVe=new Rr("AuthError");var LP={oauthSignInError:{message:Ka.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:Ka.DEFAULT_MSG,log:` 5 Error: Amplify has not been configured correctly. 6 This error is typically caused by one of the following scenarios: 7 8 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point 9 See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information 10 11 2. There might be multiple conflicting versions of amplify packages in your node_modules. 12 Refer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) 13 `},missingAuthConfig:{message:Ka.DEFAULT_MSG,log:` 14 Error: Amplify has not been configured correctly. 15 The configuration object is missing required auth properties. 16 This error is typically caused by one of the following scenarios: 17 18 1. Did you run \`amplify push\` after adding auth via \`amplify add auth\`? 19 See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information 20 21 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages. 22 `},emptyUsername:{message:Ka.EMPTY_USERNAME},invalidUsername:{message:Ka.INVALID_USERNAME},emptyPassword:{message:Ka.EMPTY_PASSWORD},emptyCode:{message:Ka.EMPTY_CODE},signUpError:{message:Ka.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:Ka.NO_MFA},invalidMFA:{message:Ka.INVALID_MFA},emptyChallengeResponse:{message:Ka.EMPTY_CHALLENGE},noUserSession:{message:Ka.NO_USER_SESSION},deviceConfig:{message:Ka.DEVICE_CONFIG}
22,networkError:{message:Ka.NETWORK_ERROR},autoSignInError:{message:Ka.AUTOSIGNIN_ERROR},default:{message:Ka.DEFAULT_MSG}};var Ih=(i,n)=>new wi({message:i??"An error has occurred during the oauth process.",name:Nd.OAuthSignInError,recoverySuggestion:n??LP.oauthSignInError.log});var hw=function(i){return i.NoConfig="noConfig",i.MissingAuthConfig="missingAuthConfig",i.EmptyUsername="emptyUsername",i.InvalidUsername="invalidUsername",i.EmptyPassword="emptyPassword",i.EmptyCode="emptyCode",i.SignUpError="signUpError",i.NoMFA="noMFA",i.InvalidMFA="invalidMFA",i.EmptyChallengeResponse="emptyChallengeResponse",i.NoUserSession="noUserSession",i.Default="default",i.DeviceConfig="deviceConfig",i.NetworkError="networkError",i.AutoSignInError="autoSignInError",i.OAuthSignInError="oauthSignInError",i}(hw||{});var Cz="`signInWithRedirect` has been canceled.",Ez="An error occurred while validating the state.",wz="Try to initiate an OAuth flow from Amplify",fw=i=>ye(null,null,function*(){let n=yield bs.loadOAuthState(),t=i===n?n:void 0;if(!t)throw new wi({name:hw.OAuthSignInError,message:i===null?Cz:Ez,recoverySuggestion:i===null?void 0:wz});return t});var BP=d=>ye(null,[d],function*({currentUrl:i,userAgentValue:n,clientId:t,redirectUri:e,responseType:r,domain:a,preferPrivateSession:c}){let u=new qo(i),h=u.searchParams.get("error"),f=u.searchParams.get("error_description");if(h)throw Ih(f??h);return r==="code"?Tz({currentUrl:i,userAgentValue:n,clientId:t,redirectUri:e,domain:a,preferPrivateSession:c}):Dz({currentUrl:i,redirectUri:e,preferPrivateSession:c})}),Tz=c=>ye(null,[c],function*({currentUrl:i,userAgentValue:n,clientId:t,redirectUri:e,domain:r,preferPrivateSession:a}){let d=new qo(i),u=d.searchParams.get("code"),h=d.searchParams.get("state");if(!u||!h)throw Ih("User cancelled OAuth flow.");let f=yield fw(h),v="https://"+r+"/oauth2/token",C=yield bs.loadPKCE(),y=le({grant_type:"authorization_code",code:u,client_id:t,redirect_uri:e},C?{code_verifier:C}:{}),A=Object.entries(y).map(([re,ae])=>`${encodeURIComponent(re)}=${encodeURIComponent(ae)}`).join("&"),{access_token:D,refresh_token:F,id_token:R,error:L,error_message:H,token_type:se,expires_in:Ce}=yield(yield fetch(v,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[ME]:n},body:A})).json();if(L)throw Ih(H??L);let Ue=(D&&lo(D).payload.username)??"username";return yield Ko({username:Ue,AccessToken:D,IdToken:R,RefreshToken:F}),VP({redirectUri:e,state:f,preferPrivateSession:a})}),Dz=e=>ye(null,[e],function*({currentUrl:i,redirectUri:n,preferPrivateSession:t}){let r=new qo(i),{id_token:a,access_token:c,state:d,token_type:u,expires_in:h,error_description:f,error:v}=(r.hash??"#").substring(1).split("&").map(A=>A.split("=")).reduce((A,[D,F])=>tt(le({},A),{[D]:F}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(v)throw Ih(f??v);if(!c)throw Ih("No access token returned from OAuth flow.");let C=yield fw(d),y=(c&&lo(c).payload.username)??"username";return yield Ko({username:y,AccessToken:c,IdToken:a}),VP({redirectUri:n,state:C,preferPrivateSession:t})}),VP=e=>ye(null,[e],function*({redirectUri:i,state:n,preferPrivateSession:t}){yield Yr.setOAuthMetadata({oauthSignIn:!0}),yield bs.clearOAuthData(),yield bs.storeOAuthSignIn(!0,t),US(),Mz(i),Iz(n)&&so.dispatch("auth",{event:"customOAuthState",data:qE(kz(n))},"Auth",qa),so.dispatch("auth",{event:"signInWithRedirect"},"Auth",qa),yield xs()}),Iz=i=>/-/.test(i),kz=i=>i.split("-").splice(1).join("-"),Mz=i=>{typeof window<"u"&&typeof window.history<"u"&&window.history.replaceState(window.history.state,"",i)};function eb(i,n){if(n){let t=i?.find(e=>e===n);if(!t)throw IA;return t}else{let t=i?.find(Az)??i?.find(Pz),e=i?.find(Rz)??i?.find(Fz);if(t)return t;throw e?kA:DA}}var Az=i=>i.startsWith(String(window.location.origin+(window.location.pathname||"/"))),Pz=i=>i.includes(String(window.location.hostname)),Fz=i=>i.startsWith("http://"),Rz=i=>i.startsWith("https://");var UP=i=>ye(null,null,function*(){US(),yield bs.clearOAuthInflightData(),so.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:i}},"Auth",qa)});var jP=i=>ye(null,null,function*(){try{Xi(i),Qu(i),bs.setAuthConfig(i)}catch{return}if(yield bs.loadOAuthInFlight())try{let n=window.location.href,{loginWith:t,userPoolClientId:e}=i,{domain:r,redirectSignIn:a,responseType:c}=t.oauth,d=eb(a);yield BP({currentUrl:n,clientId:e,domain:r,redirectUri:d,responseType:c,userAgentValue:Nr(Tr.SignInWithRedirect)})}catch(n){yield UP(n)}});i0()&&un[m1](jP);var WP=i=>ye(null,null,function*(){window?.location&&(window.location.href=i.replace("http://","https://"))});var HP=i=>ye(null,null,function*(){let n=i.getConfig().Auth?.Cognito;Xi(n);let{userPoolEndpoint:t,userPoolId:e}=n,{tokens:r}=yield f1(i,{forceRefresh:!1});vh(r);let a=NP({endpointResolver:jn({endpointOverride:t})}),{UserAttributes:c}=yield a({region:Un(e),userAgentValue:Nr(Tr.FetchUserAttributes)},{AccessToken:r.accessToken.toString()});return EA(c)});var gw=()=>HP(un);var GP=i=>ye(null,null,function*(){yield i.clearOAuthData(),Yr.clearTokens(),yield g1(),so.dispatch("auth",{event:"signedOut"},"Auth",qa)});var $P=(i,n=!1,t)=>ye(null,null,function*(){Qu(i);let{loginWith:e,userPoolClientId:r}=i,{domain:a,redirectSignOut:c}=e.oauth,d=eb(c,t),u=`https://${a}/logout?${Object.entries({client_id:r,logout_uri:encodeURIComponent(d)}).map(([h,f])=>`${h}=${f}`).join("&")}`;return WP(u)});var zP=(i,n,t,e)=>ye(null,null,function*(){let{isOAuthSignIn:r}=yield n.loadOAuthSignIn(),a=yield t.getOAuthMetadata();if(yield GP(n),r||a?.oauthSignIn)return $P(i,!1,e)});var YP=i=>cr(Ur,Vr("RevokeToken"),ta(),le(le({},jr),i));var qP=i=>cr(Ur,Vr("GlobalSignOut"),ta(),le(le({},jr),i));var KP=new Rr("Auth");function tb(i){return ye(this,null,function*(){let n=un.getConfig().Auth?.Cognito;Xi(n),i?.global?yield Nz(n):yield Oz(n);let t;try{Qu(n),t=!0}catch{t=!1}if(t){let e=new _h(ac);e.setAuthConfig(n);let{type:r}=(yield zP(n,e,Yr,i?.oauth?.redirectUrl))??{};if(r==="error")throw new wi({name:MA,message:"An error occurred when attempting to log out from OAuth provider."})}else Yr.clearTokens(),yield g1(),so.dispatch("auth",{event:"signedOut"},"Auth",qa)})}function Oz(i){return ye(this,null,function*(){try{let{userPoolEndpoint:n,userPoolId:t,userPoolClientId:e}=i,r=yield Yr.getTokenStore().loadTokens();NS(r),Lz(r.accessToken)&&(yield YP({endpointResolver:jn({endpointOverride:n})})({region:Un(t),userAgentValue:Nr(Tr.SignOut)},{ClientId:e,Token:r.refreshToken}
22))}catch{KP.debug("Client signOut error caught but will proceed with token removal")}})}function Nz(i){return ye(this,null,function*(){try{let{userPoolEndpoint:n,userPoolId:t}=i,e=yield Yr.getTokenStore().loadTokens();vh(e),yield qP({endpointResolver:jn({endpointOverride:n})})({region:Un(t),userAgentValue:Nr(Tr.SignOut)},{AccessToken:e.accessToken.toString()})}catch{KP.debug("Global signOut error caught but will proceed with token removal")}})}var Lz=i=>!!i?.payload?.origin_jti;var XP={identityId:"identityId"};var Bz=new Rr("DefaultIdentityIdStore"),m0=class{setAuthConfig(n){e0(n.Cognito),this.authConfig=n,this._authKeys=Vz("Cognito",n.Cognito.identityPoolId)}constructor(n){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=n}loadIdentityId(){return ye(this,null,function*(){e0(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{let n=yield this.keyValueStorage.getItem(this._authKeys.identityId);return n?(this._hasGuestIdentityId=!0,{id:n,type:"guest"}):null}}catch(n){return Bz.log("Error getting stored IdentityId.",n),null}})}storeIdentityId(n){return ye(this,null,function*(){e0(this.authConfig?.Cognito),n.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,n.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=n.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))})}clearIdentityId(){return ye(this,null,function*(){this._primaryIdentityId=void 0,yield this.keyValueStorage.removeItem(this._authKeys.identityId)})}},Vz=(i,n)=>T1(XP)(`com.amplify.${i}`,n);var M1=({endpointOverride:i})=>n=>i?{url:new qo(i)}:GE(n);function ib(i){let n=lo(i).payload.iss,t={};if(!n)throw new wi({name:"InvalidIdTokenException",message:"Invalid Idtoken."});let e=n.replace(/(^\w+:|^)\/\//,"");return t[e]=i,t}function JP(e){return ye(this,arguments,function*({tokens:i,authConfig:n,identityIdStore:t}){t.setAuthConfig({Cognito:n});let r=yield t.loadIdentityId();if(r)return r.id;let a=i?.idToken?ib(i.idToken.toString()):{},c=yield Uz(a,n);return t.storeIdentityId({id:c,type:i?"primary":"guest"}),c})}function Uz(i,n){return ye(this,null,function*(){let t=n?.identityPoolId,e=w1(t),r=WE({endpointResolver:M1({endpointOverride:n.identityPoolEndpoint})}),a;try{a=(yield r({region:e},{IdentityPoolId:t,Logins:i})).IdentityId}catch(c){throw ma(c),new wi(c)}if(!a)throw new wi({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return a})}var nb=new Rr("CognitoCredentialsProvider"),ZP=50*60*1e3,u0=class{constructor(n){this._nextCredentialsRefresh=0,this._identityIdStore=n}clearCredentialsAndIdentityId(){return ye(this,null,function*(){nb.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,yield this._identityIdStore.clearIdentityId()})}clearCredentials(){return ye(this,null,function*(){nb.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0})}getCredentialsAndIdentityId(n){return ye(this,null,function*(){let t=n.authenticated,{tokens:e}=n,{authConfig:r}=n;try{e0(r?.Cognito)}catch{return}if(!t&&!r.Cognito.allowGuestAccess)return;let{forceRefresh:a}=n,c=this.hasTokenChanged(e),d=yield JP({tokens:e,authConfig:r.Cognito,identityIdStore:this._identityIdStore});return(a||c)&&this.clearCredentials(),t?(FA(e),this.credsForOIDCTokens(r.Cognito,e,d)):this.getGuestCredentials(d,r.Cognito)})}getGuestCredentials(n,t){return ye(this,null,function*(){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return nb.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();let e=w1(t.identityPoolId),r=SS({endpointResolver:M1({endpointOverride:t.identityPoolEndpoint})}),a;try{a=yield r({region:e},{IdentityId:n})}catch(c){throw ma(c),new wi(c)}if(a?.Credentials?.AccessKeyId&&a?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+ZP;let c={credentials:{accessKeyId:a.Credentials.AccessKeyId,secretAccessKey:a.Credentials.SecretKey,sessionToken:a.Credentials.SessionToken,expiration:a.Credentials.Expiration},identityId:n};return a.IdentityId&&(c.identityId=a.IdentityId,this._identityIdStore.storeIdentityId({id:a.IdentityId,type:"guest"})),this._credentialsAndIdentityId=tt(le({},c),{isAuthenticatedCreds:!1}),c}else throw new wi({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})})}credsForOIDCTokens(n,t,e){return ye(this,null,function*(){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return nb.debug("returning stored credentials as they neither past TTL n
22or expired."),this._credentialsAndIdentityId;this.clearCredentials();let r=t.idToken?ib(t.idToken.toString()):{},a=w1(n.identityPoolId),c=SS({endpointResolver:M1({endpointOverride:n.identityPoolEndpoint})}),d;try{d=yield c({region:a},{IdentityId:e,Logins:r})}catch(u){throw ma(u),new wi(u)}if(d?.Credentials?.AccessKeyId&&d?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+ZP;let u={credentials:{accessKeyId:d.Credentials.AccessKeyId,secretAccessKey:d.Credentials.SecretKey,sessionToken:d.Credentials.SessionToken,expiration:d.Credentials.Expiration},identityId:e};return d.IdentityId&&(u.identityId=d.IdentityId,this._identityIdStore.storeIdentityId({id:d.IdentityId,type:"primary"})),this._credentialsAndIdentityId=tt(le({},u),{isAuthenticatedCreds:!0,associatedIdToken:t.idToken?.toString()}),u}else throw new wi({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(n){return!!n&&!!this._credentialsAndIdentityId?.associatedIdToken&&n.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}};var vw=new u0(new m0(ac));var _w={configure(i,n){let t=u1(i),e=new x1({sameSite:"lax"}),r=n?.ssr?e:ac,a=n?.ssr?new u0(new m0(e)):vw;if(!t.Auth){un.configure(t,n);return}if(n?.Auth){un.configure(t,n);return}if(!un.libraryOptions.Auth){d0.setAuthConfig(t.Auth),d0.setKeyValueStorage(r),un.configure(t,tt(le({},n),{Auth:{tokenProvider:d0,credentialsProvider:a}}));return}if(n){let c=un.libraryOptions.Auth;n.ssr!==void 0&&(d0.setKeyValueStorage(r),c.credentialsProvider=a),un.configure(t,le({Auth:c},n));return}un.configure(t)},getConfig(){return un.getConfig()}};var ui={production:!0,cognito:{userPoolId:"ap-southeast-1_QlOVtTkLd",userPoolClientId:"1d5989pkce0mluvhsmf0q8ho5h"},apiUrl:"https://ambuluwawa-backend.web.app",ambuluwawaBackendUrl:"https://api.ambuluwawa.com/private",ambuluwawaBackendPublicUrl:"https://api.ambuluwawa.com/public",ambuluwawamgmtBackendPublicUrl:"https://ambuluwawa-backend.web.app/public",PUBLIC_API_KEY:"Fw72jaGYhs4w3siKT7taC47TuasRdzTf4FrVzmo2"};var p0=class extends Error{};p0.prototype.name="InvalidTokenError";function Wz(i){return decodeURIComponent(atob(i).replace(/(.)/g,(n,t)=>{let e=t.charCodeAt(0).toString(16).toUpperCase();return e.length<2&&(e="0"+e),"%"+e}))}function Hz(i){let n=i.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Wz(n)}catch{return atob(n)}}function QP(i,n){if(typeof i!="string")throw new p0("Invalid token specified: must be a string");n||(n={});let t=n.header===!0?0:1,e=i.split(".")[t];if(typeof e!="string")throw new p0(`Invalid token specified: missing part #${t+1}`);let r;try{r=Hz(e)}catch(a){throw new p0(`Invalid token specified: invalid base64 for part #${t+1} (${a.message})`)}try{return JSON.parse(r)}catch(a){throw new p0(`Invalid token specified: invalid json for part #${t+1} (${a.message})`)}}var ze=(()=>{let n=class n{constructor(){this.TOKEN_BUFFER_TIME=3600,this.TOKEN_DURATION=86400,_w.configure({Auth:{Cognito:ui.cognito}}
22),this.authenticationSubject=new da(!1)}resetPassWord(e){return mw({username:e.name})}confirmResetPassword(e){return uw({username:e.name,confirmationCode:e.code,newPassword:e.password})}signUp(e){let r=`+${e.email}`;return dw({username:r,password:e.password,options:{userAttributes:{name:e.name}}})}confirmSignUp(e){return pw({username:e.email,confirmationCode:e.code})}signIn(e){return ye(this,null,function*(){try{let r=yield Gz();console.log("current_user",JSON.stringify(r,null,2)),r!==null&&(yield tb())}catch{}return Dh({username:e.email,password:e.password}).then(r=>ye(this,null,function*(){this.authenticationSubject.next(!0);let a=yield gw(),c=a.given_name,d=a.family_name,u=a.email;return localStorage.setItem("name",c+" "+d),localStorage.setItem("email",u??""),yield this.storeJwtToken(),r})).catch(r=>{throw this.authenticationSubject.next(!1),console.error("Login failed:",r),r})})}signOut(){return tb().then(()=>{this.authenticationSubject.next(!1)})}getUser(){return Nm()}isAuthenticated(){return this.authenticationSubject.value?Promise.resolve(!0):this.getUser().then(e=>!!e).catch(()=>!1)}getJwt(){return ye(this,null,function*(){let{idToken:e}=(yield fh({forceRefresh:!0})).tokens??{};return e?.toString()})}storeJwtToken(){return ye(this,null,function*(){try{let e=yield this.getJwt();e&&localStorage.setItem("jwtToken",e)}catch(e){console.error("Error storing JWT token:",e)}})}getCognitoIdToken(){for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);if(r&&r.includes("CognitoIdentityServiceProvider")&&r.endsWith(".idToken"))return!0}return!1}getUserRole(){return ye(this,null,function*(){try{let r=(yield fh()).tokens?.idToken?.payload?.["custom:role"];return typeof r=="string"?r:null}catch(e){return console.error("Error fetching user role:",e),null}})}isTokenExpired(){return ye(this,arguments,function*(e=this.TOKEN_BUFFER_TIME){try{let r=localStorage.getItem("jwtToken");if(!r)return console.log("Token not found"),!0;let a=this.jwt_decode(r),c=Math.floor(Date.now()/1e3),d=a.exp,u=d-c;if(c>=d)return console.log("Token is expired"),!0;let h=a.iat;return d-h>this.TOKEN_DURATION+300&&console.warn("Token duration exceeds expected 1-day period"),u<=e?!0:(console.log(`Token is valid for another ${Math.floor(u/3600)} hours`),!1)}catch(r){return console.error("Error checking token expiration:",r),!0}})}refreshIdToken(){return ye(this,null,function*(){try{let e=yield fh({forceRefresh:!0});if(e.tokens?.idToken){let r=e.tokens.idToken.toString(),a=this.jwt_decode(r),c=a.exp-a.iat;return console.log("New token duration:",{hours:Math.floor(c/3600),minutes:Math.floor(c%3600/60)}),localStorage.setItem("jwtToken",r),!0}else return console.error("Failed to refresh token - no new token received"),!1}catch(e){return console.error("Error refreshing token:",e),!1}})}getValidToken(){return ye(this,null,function*(){try{let e=localStorage.getItem("jwtToken");return e?(yield this.isTokenExpired())?(yield this.refreshIdToken())?localStorage.getItem("jwtToken"):(console.error("Token refresh failed"),null):e:(console.log("No token found in storage"),null)}catch(e){return console.error("Error getting valid token:",e),null}})}jwt_decode(e){try{return QP(e)}catch(r){throw console.error("Error decoding JWT token:",r),new Error("Invalid JWT token")}}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Gz(){return ye(this,null,function*(){try{return yield Nm()}catch{return null}})}var $z=["overlay"],zz=["*"];function Yz(i,n){i&1&&B(0,"div")}function qz(i,n){if(i&1&&(s(0,"div"),T(1,Yz,1,0,"div",6),o()),i&2){let t=w(2);Co(t.spinner.class),gi("color",t.spinner.color),m(),p("ngForOf",t.spinner.divArray)}}function Kz(i,n){if(i&1&&(B(0,"div",7),I(1,"safeHtml")),i&2){let t=w(2);p("innerHTML",M(1,1,t.template),fg)}}
22function Xz(i,n){if(i&1&&(s(0,"div",2,0),T(2,qz,2,5,"div",3)(3,Kz,2,3,"div",4),s(4,"div",5),ar(5),o()()),i&2){let t=w();gi("background-color",t.spinner.bdColor)("z-index",t.spinner.zIndex)("position",t.spinner.fullScreen?"fixed":"absolute"),p("@.disabled",t.disableAnimation)("@fadeIn","in"),m(2),p("ngIf",!t.template),m(),p("ngIf",t.template),m(),gi("z-index",t.spinner.zIndex)}}var Jz={"ball-8bits":16,"ball-atom":4,"ball-beat":3,"ball-circus":5,"ball-climbing-dot":4,"ball-clip-rotate":1,"ball-clip-rotate-multiple":2,"ball-clip-rotate-pulse":2,"ball-elastic-dots":5,"ball-fall":3,"ball-fussion":4,"ball-grid-beat":9,"ball-grid-pulse":9,"ball-newton-cradle":4,"ball-pulse":3,"ball-pulse-rise":5,"ball-pulse-sync":3,"ball-rotate":1,"ball-running-dots":5,"ball-scale":1,"ball-scale-multiple":3,"ball-scale-pulse":2,"ball-scale-ripple":1,"ball-scale-ripple-multiple":3,"ball-spin":8,"ball-spin-clockwise":8,"ball-spin-clockwise-fade":8,"ball-spin-clockwise-fade-rotating":8,"ball-spin-fade":8,"ball-spin-fade-rotating":8,"ball-spin-rotate":2,"ball-square-clockwise-spin":8,"ball-square-spin":8,"ball-triangle-path":3,"ball-zig-zag":2,"ball-zig-zag-deflect":2,cog:1,"cube-transition":2,fire:3,"line-scale":5,"line-scale-party":5,"line-scale-pulse-out":5,"line-scale-pulse-out-rapid":5,"line-spin-clockwise-fade":8,"line-spin-clockwise-fade-rotating":8,"line-spin-fade":8,"line-spin-fade-rotating":8,pacman:6,"square-jelly-box":2,"square-loader":1,"square-spin":1,timer:1,"triangle-skew-spin":1},yw={BD_COLOR:"rgba(51,51,51,0.8)",SPINNER_COLOR:"#fff",Z_INDEX:99999},Sw="primary",h0=class i{constructor(n){Object.assign(this,n)}static create(n){return!n?.template&&!n?.type&&console.warn(`[ngx-spinner]: Property "type" is missed. Please, provide animation type to <ngx-spinner> component 23 and ensure css is added to angular.json file`),new i(n)}},pe=(()=>{let n=class n{constructor(){this.spinnerObservable=new da(null)}getSpinner(e){return this.spinnerObservable.asObservable().pipe(Vn(r=>r&&r.name===e))}show(e=Sw,r){return new Promise((a,c)=>{setTimeout(()=>{r&&Object.keys(r).length?(r.name=e,this.spinnerObservable.next(new h0(tt(le({},r),{show:!0}))),a(!0)):(this.spinnerObservable.next(new h0({name:e,show:!0})),a(!0))},10)})}hide(e=Sw,r=10){return new Promise((a,c)=>{setTimeout(()=>{this.spinnerObservable.next(new h0({name:e,show:!1})),a(!0)},r)})}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),e6=new Gt("NGX_SPINNER_CONFIG"),Zz=(()=>{let n=class n{constructor(e){this.sanitizer=e}transform(e){return e?this.sanitizer.bypassSecurityTrustHtml(e):""}};n.\u0275fac=function(r){return new(r||n)(x($u,16))},n.\u0275pipe=Cm({name:"safeHtml",type:n,pure:!0});let i=n;return i})(),wo=(()=>{let n=class n{constructor(e,r,a,c){this.spinnerService=e,this.changeDetector=r,this.elementRef=a,this.globalConfig=c,this.disableAnimation=!1,this.spinner=new h0,this.ngUnsubscribe=new ci,this.setDefaultOptions=()=>{let{type:d}=this.globalConfig??{};this.spinner=h0.create({name:this.name,bdColor:this.bdColor,size:this.size,color:this.color,type:this.type??d,fullScreen:this.fullScreen,divArray:this.divArray,divCount:this.divCount,show:this.show,zIndex:this.zIndex,template:this.template,showSpinner:this.showSpinner})},this.bdColor=yw.BD_COLOR,this.zIndex=yw.Z_INDEX,this.color=yw.SPINNER_COLOR,this.size="large",this.fullScreen=!0,this.name=Sw,this.template=null,this.showSpinner=!1,this.divArray=[],this.divCount=0,this.show=!1}initObservable(){this.spinnerService.getSpinner(this.name).pipe(gr(this.ngUnsubscribe)).subscribe(e=>{this.setDefaultOptions(),Object.assign(this.spinner,e),e.show&&this.onInputChange(),this.changeDetector.detectChanges()})}ngOnInit(){this.setDefaultOptions(),this.initObservable()}isSpinnerZone(e){return e===this.elementRef.nativeElement.parentElement?!0:e.parentNode&&this.isSpinnerZone(e.parentNode)}ngOnChanges(e){for(let r in e)if(r){let a=e[r];if(a.isFirstChange())return;typeof a.currentValue<"u"&&a.currentValue!==a.previousValue&&a.currentValue!==""&&(this.spinner[r]=a.currentValue,r==="showSpinner"&&(a.currentValue?this.spinnerService.show(this.spinner.name,this.spinner):this.spinnerService.hide(this.spinner.name)),r==="name"&&this.initObservable())}}getClass(e,r){this.spinner.divCount=Jz[e],this.spinner.divArray=Array(this.spinner.divCount).fill(0).map((c,d)=>d);let a="";switch(r.toLowerCase()){case"small":a="la-sm";break;case"medium":a="la-2x";break;case"large":a="la-3x";break;default:break}return"la-"+e+" "+a}onInputChange(){this.spinner.class=this.getClass(this.spinner.type,this.spinner.size)}ngOnDestroy(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(Kn),x(Ai),x(e6,8))},n.\u0275cmp=te({type:n,selectors:[["ngx-spinner"]],viewQuery:function(r,a){
23if(r&1&&An($z,5),r&2){let c;on(c=sn())&&(a.spinnerDOM=c.first)}},inputs:{bdColor:"bdColor",size:"size",color:"color",type:"type",fullScreen:"fullScreen",name:"name",zIndex:"zIndex",template:"template",showSpinner:"showSpinner",disableAnimation:"disableAnimation"},features:[kn],ngContentSelectors:zz,decls:1,vars:1,consts:[["overlay",""],["class","ngx-spinner-overlay",3,"background-color","z-index","position",4,"ngIf"],[1,"ngx-spinner-overlay"],[3,"class","color",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[1,"loading-text"],[4,"ngFor","ngForOf"],[3,"innerHTML"]],template:function(r,a){r&1&&(Ya(),T(0,Xz,6,12,"div",1)),r&2&&p("ngIf",a.spinner.show)},dependencies:[Zz,Dt,_e],styles:[".ngx-spinner-overlay[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%}.ngx-spinner-overlay[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(.loading-text){top:50%;left:50%;margin:0;position:absolute;transform:translate(-50%,-50%)}.loading-text[_ngcontent-%COMP%]{position:absolute;top:60%;left:50%;transform:translate(-50%,-60%)}"],data:{animation:[Sg("fadeIn",[Uu("in",Dd({opacity:1})),ju(":enter",[Dd({opacity:0}),Vu(300)]),ju(":leave",Vu(200,Dd({opacity:0})))])]},changeDetection:0});let i=n;return i})(),bw=(()=>{let n=class n{static forRoot(e){return{ngModule:n,providers:[{provide:e6,useValue:e}]}}};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=_i({type:n}),n.\u0275inj=vi({});let i=n;return i})();var ce=(()=>{let n=class n{constructor(){this.collapsedSubject=new da(!0),this.collapsed$=this.collapsedSubject.asObservable(),this.sidebarVisibleSubject=new da(!0),this.sidebarVisibility$=this.sidebarVisibleSubject.asObservable()}hideSidebar(){this.sidebarVisibleSubject.next(!1)}showSidebar(e=0){setTimeout(()=>{this.sidebarVisibleSubject.next(!0)},e)}toggleCollapse(){let e=!this.collapsedSubject.value;this.collapsedSubject.next(e)}setCollapseState(e){this.collapsedSubject.next(e)}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var rb=(()=>
23{let n=class n{constructor(){this.loginSuccessSubject=new ci,this.loginSuccess$=this.loginSuccessSubject.asObservable()}emitLoginSuccess(){this.loginSuccessSubject.next()}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Qz=()=>["/forgot-password"],i6=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.fb=e,this.toastr=r,this.router=a,this.cognitoService=c,this.spinner=d,this.sidebarService=u,this.eventService=h,this.passwordVisible=!1,this.loginForm=this.fb.group({email:["",[At.required,At.email]],password:["",At.required]})}ngOnInit(){this.sidebarService.hideSidebar()}onSubmit(){return ye(this,null,function*(){let{email:e,password:r}=this.loginForm.value;this.spinner.show(),this.sidebarService.hideSidebar(),this.cognitoService.signIn({email:e,password:r,name:"",code:""}).then(()=>{this.spinner.hide(),this.loginForm.reset(),this.router.navigate(["/home"]).then(()=>{this.sidebarService.showSidebar(200),this.eventService.emitLoginSuccess()})}).catch(a=>{console.error("Login error:",a),this.spinner.hide(),this.toastr.error("Login failed: "+(a.message||"Unknown error"),"Error")})})}togglePasswordVisibility(){this.passwordVisible=!this.passwordVisible}};n.\u0275fac=function(r){return new(r||n)(x(Qr),x(me),x(_t),x(ze),x(pe),x(ce),x(rb))},n.\u0275cmp=te({type:n,selectors:[["app-login"]],standalone:!1,decls:25,vars:5,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#fff","type","ball-pulse"],[2,"font-size","20px","color","white"],[1,"main-login"],[3,"ngSubmit","formGroup"],[1,"container-fluid","d-flex","justify-content-center","align-items-center","vh-100"],[1,"col-md-4","text-center"],[1,"login-wrapper"],["src","/assets/logo.svg","alt","Company Logo",1,"logo"],[1,"welcome-text"],[1,"login-field"],[1,"form-group"],["type","email","id","email","formControlName","email","required","","placeholder","Username",1,"form-control"],["id","password","formControlName","password","required","","placeholder","Password",1,"form-control",3,"type"],["aria-hidden","true",1,"eye-icon",3,"click","ngClass"],["type","submit",1,"btn","btn-primary"],[1,"otherLinks"],[1,"forget-password",3,"routerLink"]],template:function(r,a){r&1&&(s(0,"ngx-spinner",0)(1,"p",1),l(2,"Loading..."),o()(),s(3,"div",2)(4,"form",3),S("ngSubmit",function(){return a.onSubmit()}),s(5,"div",4)(6,"div",5)(7,"div",6),B(8,"img",7),s(9,"div",8)(10,"h1"),l(11,"Welcome Back"),o(),s(12,"p"),l(13,"Welcome back! Please login to your account."),o()(),s(14,"div",9)(15,"div",10),B(16,"input",11),o(),s(17,"div",10),B(18,"input",12),s(19,"i",13),S("click",function(){return a.togglePasswordVisibility()}),o()()(),s(20,"button",14),l(21,"Login"),o(),s(22,"div",15)(23,"a",16),l(24,"Forgot password?"),o()()()()()()()),r&2&&(m(4),p("formGroup",a.loginForm),m(14),p("type",a.passwordVisible?"text":"password"),m(),p("ngClass",a.passwordVisible?"fa fa-eye":"fa fa-eye-slash"),m(4),p("routerLink",Bu(4,Qz)))},dependencies:[ue,km,Ni,Ke,Ne,Oi,vn,wr,$r,wo],encapsulation:2});let i=n;return i})();var eY=i=>({collapsed:i}),n6=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.cognitoService=r,this.toastr=a,this.router=c,this.sidebarService=d,this.isCollapsed=!1}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(ze),x(me),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-home"]],standalone:!1,decls:8,vars:3,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"dashboard"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),l(3,"Dashboard"),o()(),s(4,"div",3)(5,"div",4)(6,"h1"),l(7,"Welcome to the Admin Dashboard"),o()()()()),r&2&&p("ngClass",Z(1,eY,a.isCollapsed))},dependencies:[ue],encapsulation:2});let i=n;return i})();var hb={};tU(hb,{afterMain:()=>c6,afterRead:()=>o6,afterWrite:()=>u6,applyStyles:()=>Mh,arrow:()=>ob,auto:()=>A1,basePlacements:()=>Bd,beforeMain:()=>s6,beforeRead:()=>r6,beforeWrite:()=>d6,bottom:()=>Ea,clippingParents:()=>xw,computeStyles:()=>Ph,createPopper:()=>U1,createPopperBase:()=>b6,createPopperLite:()=>x6,detectOverflow:()=>Qo,end:()=>Hm,eventListeners:()=>Fh,flip:()=>db,hide:()=>mb,left:()=>ia,main:()=>l6,modifierPhases:()=>Ew,offset:()=>ub,placements:()=>F1,popper:()=>f0,popperGenerator:()=>C0,popperOffsets:()=>Nh,preventOverflow:()=>pb,read:()=>a6,reference:()=>Cw,right:()=>ua,start:()=>Zc,top:()=>Kr,variationPlacements:()=>ab,viewport:()=>P1,write:()=>m6});
vendor: 10,212 bytes, line 23
23var Kr="top",Ea="bottom",ua="right",ia="left",A1="auto",Bd=[Kr,Ea,ua,ia],Zc="start",Hm="end",xw="clippingParents",P1="viewport",f0="popper",Cw="reference",ab=Bd.reduce(function(i,n){return i.concat([n+"-"+Zc,n+"-"+Hm])},[]),F1=[].concat(Bd,[A1]).reduce(function(i,n){return i.concat([n,n+"-"+Zc,n+"-"+Hm])},[]),r6="beforeRead",a6="read",o6="afterRead",s6="beforeMain",l6="main",c6="afterMain",d6="beforeWrite",m6="write",u6="afterWrite",Ew=[r6,a6,o6,s6,l6,c6,d6,m6,u6];function Xa(i){return i?(i.nodeName||"").toLowerCase():null}function Wr(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var n=i.ownerDocument;return n&&n.defaultView||window}return i}function Al(i){var n=Wr(i).Element;return i instanceof n||i instanceof Element}function ja(i){var n=Wr(i).HTMLElement;return i instanceof n||i instanceof HTMLElement}function kh(i){if(typeof ShadowRoot>"u")return!1;var n=Wr(i).ShadowRoot;return i instanceof n||i instanceof ShadowRoot}function tY(i){var n=i.state;Object.keys(n.elements).forEach(function(t){var e=n.styles[t]||{},r=n.attributes[t]||{},a=n.elements[t];!ja(a)||!Xa(a)||(Object.assign(a.style,e),Object.keys(r).forEach(function(c){var d=r[c];d===!1?a.removeAttribute(c):a.setAttribute(c,d===!0?"":d)}))})}function iY(i){var n=i.state,t={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,t.popper),n.styles=t,n.elements.arrow&&Object.assign(n.elements.arrow.style,t.arrow),function(){Object.keys(n.elements).forEach(function(e){var r=n.elements[e],a=n.attributes[e]||{},c=Object.keys(n.styles.hasOwnProperty(e)?n.styles[e]:t[e]),d=c.reduce(function(u,h){return u[h]="",u},{});!ja(r)||!Xa(r)||(Object.assign(r.style,d),Object.keys(a).forEach(function(u){r.removeAttribute(u)}))})}}var Mh={name:"applyStyles",enabled:!0,phase:"write",fn:tY,effect:iY,requires:["computeStyles"]};function Ja(i){return i.split("-")[0]}var mc=Math.max,g0=Math.min,Vd=Math.round;function Ah(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function R1(){return!/^((?!chrome|android).)*safari/i.test(Ah())}function Pl(i,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);var e=i.getBoundingClientRect(),r=1,a=1;n&&ja(i)&&(r=i.offsetWidth>0&&Vd(e.width)/i.offsetWidth||1,a=i.offsetHeight>0&&Vd(e.height)/i.offsetHeight||1);var c=Al(i)?Wr(i):window,d=c.visualViewport,u=!R1()&&t,h=(e.left+(u&&d?d.offsetLeft:0))/r,f=(e.top+(u&&d?d.offsetTop:0))/a,v=e.width/r,C=e.height/a;return{width:v,height:C,top:f,right:h+v,bottom:f+C,left:h,x:h,y:f}}function v0(i){var n=Pl(i),t=i.offsetWidth,e=i.offsetHeight;return Math.abs(n.width-t)<=1&&(t=n.width),Math.abs(n.height-e)<=1&&(e=n.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:e}}function O1(i,n){var t=n.getRootNode&&n.getRootNode();if(i.contains(n))return!0;if(t&&kh(t)){var e=n;do{if(e&&i.isSameNode(e))return!0;e=e.parentNode||e.host}while(e)}return!1}function Zo(i){return Wr(i).getComputedStyle(i)}function ww(i){return["table","td","th"].indexOf(Xa(i))>=0}function mo(i){return((Al(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ud(i){return Xa(i)==="html"?i:i.assignedSlot||i.parentNode||(kh(i)?i.host:null)||mo(i)}function p6(i){return!ja(i)||Zo(i).position==="fixed"?null:i.offsetParent}function nY(i){var n=/firefox/i.test(Ah()),t=/Trident/i.test(Ah());if(t&&ja(i)){var e=Zo(i);if(e.position==="fixed")return null}var r=Ud(i);for(kh(r)&&(r=r.host);ja(r)&&["html","body"].indexOf(Xa(r))<0;){var a=Zo(r);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||n&&a.willChange==="filter"||n&&a.filter&&a.filter!=="none")return r;r=r.parentNode}return null}function uc(i){for(var n=Wr(i),t=p6(i);t&&ww(t)&&Zo(t).position==="static";)t=p6(t);return t&&(Xa(t)==="html"||Xa(t)==="body"&&Zo(t).position==="static")?n:t||nY(i)||n}function _0(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function y0(i,n,t){return mc(i,g0(n,t))}function h6(i,n,t){var e=y0(i,n,t);return e>t?t:e}function N1(){return{top:0,right:0,bottom:0,left:0}}function L1(i){return Object.assign({},N1(),i)}function B1(i,n){return n.reduce(function(t,e){return t[e]=i,t},{})}var rY=function(n,t){return n=typeof n=="function"?n(Object.assign({},t.rects,{placement:t.placement})):n,L1(typeof n!="number"?n:B1(n,Bd))};function aY(i){var n,t=i.state,e=i.name,r=i.options,a=t.elements.arrow,c=t.modifiersData.popperOffsets,d=Ja(t.placement),u=_0(d),h=[ia,ua].indexOf(d)>=0,f=h?"height":"width";if(!(!a||!c)){var v=rY(r.padding,t),C=v0(a),y=u==="y"?Kr:ia,A=u==="y"?Ea:ua,D=t.rects.reference[f]+t.rects.reference[u]-c[u]-t.rects.popper[f],F=c[u]-t.rects.reference[u],R=uc(a),L=R?u==="y"?R.clientHeight||0:R.clientWidth||0:0,H=D/2-F/2,se=v[y],Ce=L-C[f]-v[A],Ue=L/2-C[f]/2+H,re=y0(se,Ue,Ce),ae=u;t.modifiersData[e]=(n={},n[ae]=re,n.centerOffset=re-Ue,n)}}function oY(i){var n=i.state,t=i.options,e=t.element,r=e===void 0?"[data-popper-arrow]":e;r!=null&&(typeof r=="string"&&(r=n.elements.popper.querySelector(r),!r)||O1(n.elements.popper,r)&&(n.elements.arrow=r))}var ob={name:"arrow",enabled:!0,phase:"main",fn:aY,effect:oY,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fl(i){return i.split("-")[1]}var sY={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lY(i,n){var t=i.x,e=i.y,r=n.devicePixelRatio||1;return{x:Vd(t*r)/r||0,y:Vd(e*r)/r||0}}function f6(i){var n,t=i.popper,e=i.popperRect,r=i.placement,a=i.variation,c=i.offsets,d=i.position,u=i.gpuAcceleration,h=i.adaptive,f=i.roundOffsets,v=i.isFixed,C=c.x,y=C===void 0?0:C,A=c.y,D=A===void 0?0:A,F=typeof f=="function"?f({x:y,y:D}):{x:y,y:D};y=F.x,D=F.y;var R=c.hasOwnProperty("x"),L=c.hasOwnProperty("y"),H=ia,se=Kr,Ce=window;if(h){var Ue=uc(t),re="clientHeight",ae="clientWidth";if(Ue===Wr(t)&&(Ue=mo(t),Zo(Ue).position!=="static"&&d==="absolute"&&(re="scrollHeight",ae="scrollWidth")),Ue=Ue,r===Kr||(r===ia||r===ua)&&a===Hm){se=Ea;var ve=v&&Ue===Ce&&Ce.visualViewport?Ce.visualViewport.height:Ue[re];D-=ve-e.height,D*=u?1:-1}if(r===ia||(r===Kr||r===Ea)&&a===Hm){H=ua;var Me=v&&Ue===Ce&&Ce.visualViewport?Ce.visualViewport.width:Ue[ae];y-=Me-e.width,y*=u?1:-1}}var W=Object.assign({position:d},h&&sY),J=f===!0?lY({x:y,y:D},Wr(t)):{x:y,y:D};if(y=J.x,D=J.y,u){var Ee;return Object.assign({},W,(Ee={},Ee[se]=L?"0":"",Ee[H]=R?"0":"",Ee.transform=(Ce.devicePixelRatio||1)<=1?"translate("+y+"px, "+D+"px)":"translate3d("+y+"px, "+D+"px, 0)",Ee))}return Object.assign({},W,(n={},n[se]=L?D+"px":"",n[H]=R?y+"px":"",n.transform="",n))}function cY(i){var n=i.state,t=i.options,e=t.gpuAcceleration,r=e===void 0?!0:e,a=t.adaptive,c=a===void 0?!0:a,d=t.roundOffsets,u=d===void 0?!0:d,h={placement:Ja(n.placement),variation:Fl(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,f6(Object.assign({},h,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:c,roundOffsets:u})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,f6(Object.assign({},h,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}var Ph={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cY,data:{}};var sb={passive:!0};function dY(i){var n=i.state,t=i.instance,e=i.options,r=e.scroll,a=r===void 0?!0:r,c=e.resize,d=c===void 0?!0:c,u=Wr(n.elements.popper),h=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&h.forEach(function(f){f.addEventListener("scroll",t.update,sb)}),d&&u.addEventListener("resize",t.update,sb),function(){a&&h.forEach(function(f){f.removeEventListener("scroll",t.update,sb)}),d&&u.removeEventListener("resize",t.update,sb)}}var Fh={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dY,data:{}};var mY={left:"right",right:"left",bottom:"top",top:"bottom"};function Rh(i){return i.replace(/left|right|bottom|top/g,function(n){return mY[n]})}var uY={start:"end",end:"start"};function lb(i){return i.replace(/start|end/g,function(n){return uY[n]})}function S0(i){var n=Wr(i),t=n.pageXOffset,e=n.pageYOffset;return{scrollLeft:t,scrollTop:e}}function b0(i){return Pl(mo(i)).left+S0(i).scrollLeft}function Tw(i,n){var t=Wr(i),e=mo(i),r=t.visualViewport,a=e.clientWidth,c=e.clientHeight,d=0,u=0;if(r){a=r.width,c=r.height;var h=R1();(h||!h&&n==="fixed")&&(d=r.offsetLeft,u=r.offsetTop)}return{width:a,height:c,x:d+b0(i),y:u}}function Dw(i){var n,t=mo(i),e=S0(i),r=(n=i.ownerDocument)==null?void 0:n.body,a=mc(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=mc(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),d=-e.scrollLeft+b0(i),u=-e.scrollTop;return Zo(r||t).direction==="rtl"&&(d+=mc(t.clientWidth,r?r.clientWidth:0)-a),{width:a,height:c,x:d,y:u}}function x0(i){var n=Zo(i),t=n.overflow,e=n.overflowX,r=n.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+e)}function cb(i){return["html","body","#document"].indexOf(Xa(i))>=0?i.ownerDocument.body:ja(i)&&x0(i)?i:cb(Ud(i))}function Gm(i,n){var t;n===void 0&&(n=[]);var e=cb(i),r=e===((t=i.ownerDocument)==null?void 0:t.body),a=Wr(e),c=r?[a].concat(a.visualViewport||[],x0(e)?e:[]):e,d=n.concat(c);return r?d:d.concat(Gm(Ud(c)))}function Oh(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function pY(i,n){var t=Pl(i,!1,n==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function g6(i,n,t){return n===P1?Oh(Tw(i,t)):Al(n)?pY(n,t):Oh(Dw(mo(i)))}function hY(i){var n=Gm(Ud(i)),t=["absolute","fixed"].indexOf(Zo(i).position)>=0,e=t&&ja(i)?uc(i):i;return Al(e)?n.filter(function(r){return Al(r)&&O1(r,e)&&Xa(r)!=="body"}):[]}function Iw(i,n,t,e){var r=n==="clippingParents"?hY(i):[].concat(n),a=[].concat(r,[t]),c=a[0],d=a.reduce(function(u,h){var f=g6(i,h,e);
vendor: 9,127 bytes, line 23
23return u.top=mc(f.top,u.top),u.right=g0(f.right,u.right),u.bottom=g0(f.bottom,u.bottom),u.left=mc(f.left,u.left),u},g6(i,c,e));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function V1(i){var n=i.reference,t=i.element,e=i.placement,r=e?Ja(e):null,a=e?Fl(e):null,c=n.x+n.width/2-t.width/2,d=n.y+n.height/2-t.height/2,u;switch(r){case Kr:u={x:c,y:n.y-t.height};break;case Ea:u={x:c,y:n.y+n.height};break;case ua:u={x:n.x+n.width,y:d};break;case ia:u={x:n.x-t.width,y:d};break;default:u={x:n.x,y:n.y}}var h=r?_0(r):null;if(h!=null){var f=h==="y"?"height":"width";switch(a){case Zc:u[h]=u[h]-(n[f]/2-t[f]/2);break;case Hm:u[h]=u[h]+(n[f]/2-t[f]/2);break;default:}}return u}function Qo(i,n){n===void 0&&(n={});var t=n,e=t.placement,r=e===void 0?i.placement:e,a=t.strategy,c=a===void 0?i.strategy:a,d=t.boundary,u=d===void 0?xw:d,h=t.rootBoundary,f=h===void 0?P1:h,v=t.elementContext,C=v===void 0?f0:v,y=t.altBoundary,A=y===void 0?!1:y,D=t.padding,F=D===void 0?0:D,R=L1(typeof F!="number"?F:B1(F,Bd)),L=C===f0?Cw:f0,H=i.rects.popper,se=i.elements[A?L:C],Ce=Iw(Al(se)?se:se.contextElement||mo(i.elements.popper),u,f,c),Ue=Pl(i.elements.reference),re=V1({reference:Ue,element:H,strategy:"absolute",placement:r}),ae=Oh(Object.assign({},H,re)),ve=C===f0?ae:Ue,Me={top:Ce.top-ve.top+R.top,bottom:ve.bottom-Ce.bottom+R.bottom,left:Ce.left-ve.left+R.left,right:ve.right-Ce.right+R.right},W=i.modifiersData.offset;if(C===f0&&W){var J=W[r];Object.keys(Me).forEach(function(Ee){var Fe=[ua,Ea].indexOf(Ee)>=0?1:-1,$e=[Kr,Ea].indexOf(Ee)>=0?"y":"x";Me[Ee]+=J[$e]*Fe})}return Me}function kw(i,n){n===void 0&&(n={});var t=n,e=t.placement,r=t.boundary,a=t.rootBoundary,c=t.padding,d=t.flipVariations,u=t.allowedAutoPlacements,h=u===void 0?F1:u,f=Fl(e),v=f?d?ab:ab.filter(function(A){return Fl(A)===f}):Bd,C=v.filter(function(A){return h.indexOf(A)>=0});C.length===0&&(C=v);var y=C.reduce(function(A,D){return A[D]=Qo(i,{placement:D,boundary:r,rootBoundary:a,padding:c})[Ja(D)],A},{});return Object.keys(y).sort(function(A,D){return y[A]-y[D]})}function fY(i){if(Ja(i)===A1)return[];var n=Rh(i);return[lb(i),n,lb(n)]}function gY(i){var n=i.state,t=i.options,e=i.name;if(!n.modifiersData[e]._skip){for(var r=t.mainAxis,a=r===void 0?!0:r,c=t.altAxis,d=c===void 0?!0:c,u=t.fallbackPlacements,h=t.padding,f=t.boundary,v=t.rootBoundary,C=t.altBoundary,y=t.flipVariations,A=y===void 0?!0:y,D=t.allowedAutoPlacements,F=n.options.placement,R=Ja(F),L=R===F,H=u||(L||!A?[Rh(F)]:fY(F)),se=[F].concat(H).reduce(function(V,Y){return V.concat(Ja(Y)===A1?kw(n,{placement:Y,boundary:f,rootBoundary:v,padding:h,flipVariations:A,allowedAutoPlacements:D}):Y)},[]),Ce=n.rects.reference,Ue=n.rects.popper,re=new Map,ae=!0,ve=se[0],Me=0;Me<se.length;Me++){var W=se[Me],J=Ja(W),Ee=Fl(W)===Zc,Fe=[Kr,Ea].indexOf(J)>=0,$e=Fe?"width":"height",Qe=Qo(n,{placement:W,boundary:f,rootBoundary:v,altBoundary:C,padding:h}),ot=Fe?Ee?ua:ia:Ee?Ea:Kr;Ce[$e]>Ue[$e]&&(ot=Rh(ot));var et=Rh(ot),gt=[];if(a&>.push(Qe[J]<=0),d&>.push(Qe[ot]<=0,Qe[et]<=0),gt.every(function(V){return V})){ve=W,ae=!1;break}re.set(W,gt)}if(ae)for(var vt=A?3:1,Kt=function(Y){var we=se.find(function(Ve){var Ge=re.get(Ve);if(Ge)return Ge.slice(0,Y).every(function(je){return je})});if(we)return ve=we,"break"},O=vt;O>0;O--){var Q=Kt(O);if(Q==="break")break}n.placement!==ve&&(n.modifiersData[e]._skip=!0,n.placement=ve,n.reset=!0)}}var db={name:"flip",enabled:!0,phase:"main",fn:gY,requiresIfExists:["offset"],data:{_skip:!1}};function v6(i,n,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-n.height-t.y,right:i.right-n.width+t.x,bottom:i.bottom-n.height+t.y,left:i.left-n.width-t.x}}function _6(i){return[Kr,ua,Ea,ia].some(function(n){return i[n]>=0})}function vY(i){var n=i.state,t=i.name,e=n.rects.reference,r=n.rects.popper,a=n.modifiersData.preventOverflow,c=Qo(n,{elementContext:"reference"}),d=Qo(n,{altBoundary:!0}),u=v6(c,e),h=v6(d,r,a),f=_6(u),v=_6(h);n.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:h,isReferenceHidden:f,hasPopperEscaped:v},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":v})}var mb={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vY};function _Y(i,n,t){var e=Ja(i),r=[ia,Kr].indexOf(e)>=0?-1:1,a=typeof t=="function"?t(Object.assign({},n,{placement:i})):t,c=a[0],d=a[1];return c=c||0,d=(d||0)*r,[ia,ua].indexOf(e)>=0?{x:d,y:c}:{x:c,y:d}}function yY(i){var n=i.state,t=i.options,e=i.name,r=t.offset,a=r===void 0?[0,0]:r,c=F1.reduce(function(f,v){return f[v]=_Y(v,n.rects,a),f},{}),d=c[n.placement],u=d.x,h=d.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=u,n.modifiersData.popperOffsets.y+=h),n.modifiersData[e]=c}var ub={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yY};function SY(i){var n=i.state,t=i.name;n.modifiersData[t]=V1({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}var Nh={name:"popperOffsets",enabled:!0,phase:"read",fn:SY,data:{}};function Mw(i){return i==="x"?"y":"x"}function bY(i){var n=i.state,t=i.options,e=i.name,r=t.mainAxis,a=r===void 0?!0:r,c=t.altAxis,d=c===void 0?!1:c,u=t.boundary,h=t.rootBoundary,f=t.altBoundary,v=t.padding,C=t.tether,y=C===void 0?!0:C,A=t.tetherOffset,D=A===void 0?0:A,F=Qo(n,{boundary:u,rootBoundary:h,padding:v,altBoundary:f}),R=Ja(n.placement),L=Fl(n.placement),H=!L,se=_0(R),Ce=Mw(se),Ue=n.modifiersData.popperOffsets,re=n.rects.reference,ae=n.rects.popper,ve=typeof D=="function"?D(Object.assign({},n.rects,{placement:n.placement})):D,Me=typeof ve=="number"?{mainAxis:ve,altAxis:ve}:Object.assign({mainAxis:0,altAxis:0},ve),W=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,J={x:0,y:0};if(Ue){if(a){var Ee,Fe=se==="y"?Kr:ia,$e=se==="y"?Ea:ua,Qe=se==="y"?"height":"width",ot=Ue[se],et=ot+F[Fe],gt=ot-F[$e],vt=y?-ae[Qe]/2:0,Kt=L===Zc?re[Qe]:ae[Qe],O=L===Zc?-ae[Qe]:-re[Qe],Q=n.elements.arrow,V=y&&Q?v0(Q):{width:0,height:0},Y=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:N1(),we=Y[Fe],Ve=Y[$e],Ge=y0(0,re[Qe],V[Qe]),je=H?re[Qe]/2-vt-Ge-we-Me.mainAxis:Kt-Ge-we-Me.mainAxis,it=H?-re[Qe]/2+vt+Ge+Ve+Me.mainAxis:O+Ge+Ve+Me.mainAxis,It=n.elements.arrow&&uc(n.elements.arrow),Nt=It?se==="y"?It.clientTop||0:It.clientLeft||0:0,qt=(Ee=W?.[se])!=null?Ee:0,ni=ot+je-qt-Nt,bt=ot+it-qt,Ae=y0(y?g0(et,ni):et,ot,y?mc(gt,bt):gt);Ue[se]=Ae,J[se]=Ae-ot}if(d){var Lt,hi=se==="x"?Kr:ia,Wt=se==="x"?Ea:ua,Xt=Ue[Ce],ri=Ce==="y"?"height":"width",di=Xt+F[hi],Mi=Xt-F[Wt],Li=[Kr,ia].indexOf(R)!==-1,Ji=(Lt=W?.[Ce])!=null?Lt:0,ln=Li?di:Xt-re[ri]-ae[ri]-Ji+Me.altAxis,Sn=Li?Xt+re[ri]+ae[ri]-Ji-Me.altAxis:Mi,wn=y&&Li?h6(ln,Xt,Sn):y0(y?ln:di,Xt,y?Sn:Mi);Ue[Ce]=wn,J[Ce]=wn-Xt}n.modifiersData[e]=J}}var pb={name:"preventOverflow",enabled:!0,phase:"main",fn:bY,requiresIfExists:["offset"]};function Aw(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function Pw(i){return i===Wr(i)||!ja(i)?S0(i):Aw(i)}function xY(i){var n=i.getBoundingClientRect(),t=Vd(n.width)/i.offsetWidth||1,e=Vd(n.height)/i.offsetHeight||1;return t!==1||e!==1}function Fw(i,n,t){t===void 0&&(t=!1);var e=ja(n),r=ja(n)&&xY(n),a=mo(n),c=Pl(i,r,t),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(e||!e&&!t)&&((Xa(n)!=="body"||x0(a))&&(d=Pw(n)),ja(n)?(u=Pl(n,!0),u.x+=n.clientLeft,u.y+=n.clientTop):a&&(u.x=b0(a))),{x:c.left+d.scrollLeft-u.x,y:c.top+d.scrollTop-u.y,width:c.width,height:c.height}}function CY(i){var n=new Map,t=new Set,e=[];i.forEach(function(a){n.set(a.name,a)});function r(a){t.add(a.name);var c=[].concat(a.requires||[],a.requiresIfExists||[]);c.forEach(function(d){if(!t.has(d)){var u=n.get(d);u&&r(u)}}),e.push(a)}return i.forEach(function(a){t.has(a.name)||r(a)}),e}function Rw(i){var n=CY(i);return Ew.reduce(function(t,e){return t.concat(n.filter(function(r){return r.phase===e}))},[])}function Ow(i){var n;return function(){return n||(n=new Promise(function(t){Promise.resolve().then(function(){n=void 0,t(i())})})),n}}function Nw(i){var n=i.reduce(function(t,e){var r=t[e.name];return t[e.name]=r?Object.assign({},r,e,{options:Object.assign({},r.options,e.options),data:Object.assign({},r.data,e.data)}):e,t},{});return Object.keys(n).map(function(t){return n[t]})}var y6={placement:"bottom",modifiers:[],strategy:"absolute"};function S6(){for(var i=arguments.length,n=new Array(i),t=0;t<i;t++)n[t]=arguments[t];return!n.some(function(e){return!(e&&typeof e.getBoundingClientRect=="function")})}function C0(i){i===void 0&&(i={});var n=i,t=n.defaultModifiers,e=t===void 0?[]:t,r=n.defaultOptions,a=r===void 0?y6:r;return function(d,u,h){h===void 0&&(h=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},y6,a),modifiersData:{},elements:{reference:d,popper:u},attributes:{},styles:{}},v=[],C=!1,y={state:f,setOptions:function(R){var L=typeof R=="function"?R(f.options):R;D(),f.options=Object.assign({},a,f.options,L),f.scrollParents={reference:Al(d)?Gm(d):d.contextElement?Gm(d.contextElement):[],popper:Gm(u)};var H=Rw(Nw([].concat(e,f.options.modifiers)));return f.orderedModifiers=H.filter(function(se){return se.enabled}),A(),y.update()}
23,forceUpdate:function(){if(!C){var R=f.elements,L=R.reference,H=R.popper;if(S6(L,H)){f.rects={reference:Fw(L,uc(H),f.options.strategy==="fixed"),popper:v0(H)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(Me){return f.modifiersData[Me.name]=Object.assign({},Me.data)});for(var se=0;se<f.orderedModifiers.length;se++){if(f.reset===!0){f.reset=!1,se=-1;continue}var Ce=f.orderedModifiers[se],Ue=Ce.fn,re=Ce.options,ae=re===void 0?{}:re,ve=Ce.name;typeof Ue=="function"&&(f=Ue({state:f,options:ae,name:ve,instance:y})||f)}}}},update:Ow(function(){return new Promise(function(F){y.forceUpdate(),F(f)})}),destroy:function(){D(),C=!0}};if(!S6(d,u))return y;y.setOptions(h).then(function(F){!C&&h.onFirstUpdate&&h.onFirstUpdate(F)});function A(){f.orderedModifiers.forEach(function(F){var R=F.name,L=F.options,H=L===void 0?{}:L,se=F.effect;if(typeof se=="function"){var Ce=se({state:f,name:R,instance:y,options:H}),Ue=function(){};v.push(Ce||Ue)}})}function D(){v.forEach(function(F){return F()}),v=[]}return y}}var b6=C0();var EY=[Fh,Nh,Ph,Mh],x6=C0({defaultModifiers:EY});var wY=[Fh,Nh,Ph,Mh,ub,db,pb,ob,mb],U1=C0({defaultModifiers:wY});var $m=new Map,Lw={set(i,n,t){$m.has(i)||$m.set(i,new Map);let e=$m.get(i);if(!e.has(n)&&e.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(e.keys())[0]}.`);return}e.set(n,t)},get(i,n){return $m.has(i)&&$m.get(i).get(n)||null},remove(i,n){if(!$m.has(i))return;let t=$m.get(i);t.delete(n),t.size===0&&$m.delete(i)}},TY=1e6,DY=1e3,Qw="transitionend",J6=i=>(i&&window.CSS&&window.CSS.escape&&(i=i.replace(/#([^\s"#']+)/g,(n,t)=>`#${CSS.escape(t)}`)),i),IY=i=>i==null?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase(),kY=i=>{do i+=Math.floor(Math.random()*TY);while(document.getElementById(i));return i},MY=i=>{if(!i)return 0;let{transitionDuration:n,transitionDelay:t}=window.getComputedStyle(i),e=Number.parseFloat(n),r=Number.parseFloat(t);return!e&&!r?0:(n=n.split(",")[0],t=t.split(",")[0],(Number.parseFloat(n)+Number.parseFloat(t))*DY)},Z6=i=>{i.dispatchEvent(new Event(Qw))},jd=i=>!i||typeof i!="object"?!1:(typeof i.jquery<"u"&&(i=i[0]),typeof i.nodeType<"u"),zm=i=>jd(i)?i.jquery?i[0]:i:typeof i=="string"&&i.length>0?document.querySelector(J6(i)):null,Hh=i=>{if(!jd(i)||i.getClientRects().length===0)return!1;let n=getComputedStyle(i).getPropertyValue("visibility")==="visible",t=i.closest("details:not([open])");if(!t)return n;if(t!==i){let e=i.closest("summary");if(e&&e.parentNode!==t||e===null)return!1}return n},Ym=i=>!i||i.nodeType!==Node.ELEMENT_NODE||i.classList.contains("disabled")?!0:typeof i.disabled<"u"?i.disabled:i.hasAttribute("disabled")&&i.getAttribute("disabled")!=="false",Q6=i=>{if(!document.documentElement.attachShadow)return null;if(typeof i.getRootNode=="function"){let n=i.getRootNode();return n instanceof ShadowRoot?n:null}return i instanceof ShadowRoot?i:i.parentNode?Q6(i.parentNode):null},Cb=()=>{},z1=i=>{i.offsetHeight},eF=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Bw=[],AY=i=>{document.readyState==="loading"?(Bw.length||document.addEventListener("DOMContentLoaded",()=>{for(let n of Bw)n()}),Bw.push(i)):i()},Rl=()=>document.documentElement.dir==="rtl",Nl=i=>{AY(()=>{let n=eF();if(n){let t=i.NAME,e=n.fn[t];n.fn[t]=i.jQueryInterface,n.fn[t].Constructor=i,n.fn[t].noConflict=()=>(n.fn[t]=e,i.jQueryInterface)}})},Cs=(i,n=[],t=i)=>typeof i=="function"?i.call(...n):t,tF=(i,n,t=!0)=>{if(!t){Cs(i);return}let r=MY(n)+5,a=!1,c=({target:d})=>{d===n&&(a=!0,n.removeEventListener(Qw,c),Cs(i))};n.addEventListener(Qw,c),setTimeout(()=>{a||Z6(n)},r)},rT=(i,n,t,e)=>{let r=i.length,a=i.indexOf(n);return a===-1?!t&&e?i[r-1]:i[0]:(a+=t?1:-1,e&&(a=(a+r)%r),i[Math.max(0,Math.min(a,r-1))])},PY=/[^.]*(?=\..*)\.|.*/,FY=/\..*/,RY=/::\d+$/,Vw={}
23,C6=1,iF={mouseenter:"mouseover",mouseleave:"mouseout"},OY=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function nF(i,n){return n&&`${n}::${C6++}`||i.uidEvent||C6++}function rF(i){let n=nF(i);return i.uidEvent=n,Vw[n]=Vw[n]||{},Vw[n]}function NY(i,n){return function t(e){return aT(e,{delegateTarget:i}),t.oneOff&&Yt.off(i,e.type,n),n.apply(i,[e])}}function LY(i,n,t){return function e(r){let a=i.querySelectorAll(n);for(let{target:c}=r;c&&c!==this;c=c.parentNode)for(let d of a)if(d===c)return aT(r,{delegateTarget:c}),e.oneOff&&Yt.off(i,r.type,n,t),t.apply(c,[r])}}function aF(i,n,t=null){return Object.values(i).find(e=>e.callable===n&&e.delegationSelector===t)}function oF(i,n,t){let e=typeof n=="string",r=e?t:n||t,a=sF(i);return OY.has(a)||(a=i),[e,r,a]}function E6(i,n,t,e,r){if(typeof n!="string"||!i)return;let[a,c,d]=oF(n,t,e);n in iF&&(c=(A=>function(D){if(!D.relatedTarget||D.relatedTarget!==D.delegateTarget&&!D.delegateTarget.contains(D.relatedTarget))return A.call(this,D)})(c));let u=rF(i),h=u[d]||(u[d]={}),f=aF(h,c,a?t:null);if(f){f.oneOff=f.oneOff&&r;return}let v=nF(c,n.replace(PY,"")),C=a?LY(i,t,c):NY(i,c);C.delegationSelector=a?t:null,C.callable=c,C.oneOff=r,C.uidEvent=v,h[v]=C,i.addEventListener(d,C,a)}function eT(i,n,t,e,r){let a=aF(n[t],e,r);a&&(i.removeEventListener(t,a,!!r),delete n[t][a.uidEvent])}function BY(i,n,t,e){let r=n[t]||{};for(let[a,c]of Object.entries(r))a.includes(e)&&eT(i,n,t,c.callable,c.delegationSelector)}function sF(i){return i=i.replace(FY,""),iF[i]||i}var Yt={on(i,n,t,e){E6(i,n,t,e,!1)},one(i,n,t,e){E6(i,n,t,e,!0)},off(i,n,t,e){if(typeof n!="string"||!i)return;let[r,a,c]=oF(n,t,e),d=c!==n,u=rF(i),h=u[c]||{},f=n.startsWith(".");if(typeof a<"u"){if(!Object.keys(h).length)return;eT(i,u,c,a,r?t:null);return}if(f)for(let v of Object.keys(u))BY(i,u,v,n.slice(1));for(let[v,C]of Object.entries(h)){let y=v.replace(RY,"");(!d||n.includes(y))&&eT(i,u,c,C.callable,C.delegationSelector)}},trigger(i,n,t){if(typeof n!="string"||!i)return null;let e=eF(),r=sF(n),a=n!==r,c=null,d=!0,u=!0,h=!1;a&&e&&(c=e.Event(n,t),e(i).trigger(c),d=!c.isPropagationStopped(),u=!c.isImmediatePropagationStopped(),h=c.isDefaultPrevented());let f=aT(new Event(n,{bubbles:d,cancelable:!0}),t);return h&&f.preventDefault(),u&&i.dispatchEvent(f),f.defaultPrevented&&c&&c.preventDefault(),f}};function aT(i,n={}){for(let[t,e]of Object.entries(n))try{i[t]=e}catch{Object.defineProperty(i,t,{configurable:!0,get(){return e}})}return i}function w6(i){if(i==="true")return!0;if(i==="false")return!1;if(i===Number(i).toString())return Number(i);if(i===""||i==="null")return null;if(typeof i!="string")return i;try{return JSON.parse(decodeURIComponent(i))}catch{return i}}function Uw(i){return i.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}var Wd={setDataAttribute(i,n,t){i.setAttribute(`data-bs-${Uw(n)}`,t)},removeDataAttribute(i,n){i.removeAttribute(`data-bs-${Uw(n)}`)},getDataAttributes(i){if(!i)return{};let n={},t=Object.keys(i.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(let e of t){let r=e.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1),n[r]=w6(i.dataset[e])}return n},getDataAttribute(i,n){return w6(i.getAttribute(`data-bs-${Uw(n)}`))}},T0=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(n){return n=this._mergeConfigObj(n),n=this._configAfterMerge(n),this._typeCheckConfig(n),n}_configAfterMerge(n){return n}_mergeConfigObj(n,t){let e=jd(t)?Wd.getDataAttribute(t,"config"):{};return le(le(le(le({},this.constructor.Default),typeof e=="object"?e:{}),jd(t)?Wd.getDataAttributes(t):{}),typeof n=="object"?n:{})}_typeCheckConfig(n,t=this.constructor.DefaultType){for(let[e,r]of Object.entries(t)){let a=n[e],c=jd(a)?"element":IY(a);if(!new RegExp(r).test(c))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${e}" provided type "${c}" but expected type "${r}".`)}}},VY="5.3.7",rl=class extends T0{constructor(n,t){super(),n=zm(n),n&&(this._element=n,this._config=this._getConfig(t),Lw.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Lw.remove(this._element,this.constructor.DATA_KEY),Yt.off(this._element,this.constructor.EVENT_KEY);for(let n of Object.getOwnPropertyNames(this))this[n]=null}_queueCallback(n,t,e=!0){tF(n,t,e)}_getConfig(n){return n=this._mergeConfigObj(n,this._element),n=this._configAfterMerge(n),this._typeCheckConfig(n),n}static getInstance(n){return Lw.get(zm(n),this.DATA_KEY)}static getOrCreateInstance(n,t={}){return this.getInstance(n)||new this(n,typeof t=="object"?t:null)}static get VERSION(){return VY}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(n){return`${n}${this.EVENT_KEY}`}},jw=i=>{let n=i.getAttribute("data-bs-target");if(!n||n==="#"){let t=i.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),n=t&&t!=="#"?t.trim():null}return n?n.split(",").map(t=>J6(t)).join(","):null},Gi={find(i,n=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(n,i))},findOne(i,n=document.documentElement){return Element.prototype.querySelector.call(n,i)},children(i,n){return[].concat(...i.children).filter(t=>t.matches(n))},parents(i,n){let t=[],e=i.parentNode.closest(n);for(;e;)t.push(e),e=e.parentNode.closest(n);return t},prev(i,n){let t=i.previousElementSibling;for(;t;){if(t.matches(n))return[t];t=t.previousElementSibling}return[]},next(i,n){let t=i.nextElementSibling;for(;t;){if(t.matches(n))return[t];t=t.nextElementSibling}return[]},focusableChildren(i){let n=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(n,i).filter(t=>!Ym(t)&&Hh(t))},getSelectorFromElement(i){let n=jw(i);return n&&Gi.findOne(n)?n:null},getElementFromSelector(i){let n=jw(i);return n?Gi.findOne(n):null},getMultipleElementsFromSelector(i){let n=jw(i);return n?Gi.find(n):[]}},Fb=(i,n="hide")=>{let t=`click.dismiss${i.EVENT_KEY}`,e=i.NAME;Yt.on(document,t,`[data-bs-dismiss="${e}"]`,function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),Ym(this))return;let a=Gi.getElementFromSelector(this)||this.closest(`.${e}`);i.getOrCreateInstance(a)[n]()})},UY="alert",jY="bs.alert",lF=`.${jY}`,WY=`close${lF}`,HY=`closed${lF}`,GY="fade",$Y="show",Eb=class i extends rl{static get NAME(){return UY}close(){if(Yt.trigger(this._element,WY).defaultPrevented)return;this._element.classList.remove($Y);let t=this._element.classList.contains(GY);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),Yt.trigger(this._element,HY),this.dispose()}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this);if(typeof n=="string"){if(t[n]===void 0||n.startsWith("_")||n==="constructor")throw new TypeError(`No method n
23amed "${n}"`);t[n](this)}})}};Fb(Eb,"close");Nl(Eb);var zY="button",YY="bs.button",qY=`.${YY}`,KY=".data-api",XY="active",T6='[data-bs-toggle="button"]',JY=`click${qY}${KY}`,wb=class i extends rl{static get NAME(){return zY}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(XY))}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this);n==="toggle"&&t[n]()})}};Yt.on(document,JY,T6,i=>{i.preventDefault();let n=i.target.closest(T6);wb.getOrCreateInstance(n).toggle()});Nl(wb);var ZY="swipe",Gh=".bs.swipe",QY=`touchstart${Gh}`,eq=`touchmove${Gh}`,tq=`touchend${Gh}`,iq=`pointerdown${Gh}`,nq=`pointerup${Gh}`,rq="touch",aq="pen",oq="pointer-event",sq=40,lq={endCallback:null,leftCallback:null,rightCallback:null},cq={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},Tb=class i extends T0{constructor(n,t){super(),this._element=n,!(!n||!i.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return lq}static get DefaultType(){return cq}static get NAME(){return ZY}dispose(){Yt.off(this._element,Gh)}_start(n){if(!this._supportPointerEvents){this._deltaX=n.touches[0].clientX;return}this._eventIsPointerPenTouch(n)&&(this._deltaX=n.clientX)}_end(n){this._eventIsPointerPenTouch(n)&&(this._deltaX=n.clientX-this._deltaX),this._handleSwipe(),Cs(this._config.endCallback)}_move(n){this._deltaX=n.touches&&n.touches.length>1?0:n.touches[0].clientX-this._deltaX}_handleSwipe(){let n=Math.abs(this._deltaX);if(n<=sq)return;let t=n/this._deltaX;this._deltaX=0,t&&Cs(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Yt.on(this._element,iq,n=>this._start(n)),Yt.on(this._element,nq,n=>this._end(n)),this._element.classList.add(oq)):(Yt.on(this._element,QY,n=>this._start(n)),Yt.on(this._element,eq,n=>this._move(n)),Yt.on(this._element,tq,n=>this._end(n)))}_eventIsPointerPenTouch(n){return this._supportPointerEvents&&(n.pointerType===aq||n.pointerType===rq)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},dq="carousel",mq="bs.carousel",Xm=`.${mq}`,cF=".data-api",uq="ArrowLeft",pq="ArrowRight",hq=500,j1="next",Lh="prev",Vh="left",bb="right",fq=`slide${Xm}`,Ww=`slid${Xm}`,gq=`keydown${Xm}`,vq=`mouseenter${Xm}`,_q=`mouseleave${Xm}`,yq=`dragstart${Xm}`,Sq=`load${Xm}${cF}`,bq=`click${Xm}${cF}`,dF="carousel",fb="active",xq="slide",Cq="carousel-item-end",Eq="carousel-item-start",wq="carousel-item-next",Tq="carousel-item-prev",mF=".active",uF=".carousel-item",Dq=mF+uF,Iq=".carousel-item img",kq=".carousel-indicators",Mq="[data-bs-slide], [data-bs-slide-to]",Aq='[data-bs-ride="carousel"]',Pq={[uq]:bb,[pq]:Vh},Fq={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Rq={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},H1=class i extends rl{constructor(n,t){super(n,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Gi.findOne(kq,this._element),this._addEventListeners(),this._config.ride===dF&&this.cycle()}static get Default(){return Fq}static get DefaultType(){return Rq}static get NAME(){return dq}next(){this._slide(j1)}nextWhenVisible(){!document.hidden&&Hh(this._element)&&this.next()}prev(){this._slide(Lh)}pause(){this._isSliding&&Z6(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){Yt.one(this._element,Ww,()=>this.cycle());return}this.cycle()}}to(n){let t=this._getItems();if(n>t.length-1||n<0)return;if(this._isSliding){Yt.one(this._element,Ww,()=>this.to(n));return}let e=this._getItemIndex(this._getActive());if(e===n)return;let r=n>e?j1:Lh;this._slide(r,t[n])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(n){return n.defaultInterval=n.interval,n}_addEventListeners(){this._config.keyboard&&Yt.on(this._element,gq,n=>
23this._keydown(n)),this._config.pause==="hover"&&(Yt.on(this._element,vq,()=>this.pause()),Yt.on(this._element,_q,()=>this._maybeEnableCycle())),this._config.touch&&Tb.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let e of Gi.find(Iq,this._element))Yt.on(e,yq,r=>r.preventDefault());let t={leftCallback:()=>this._slide(this._directionToOrder(Vh)),rightCallback:()=>this._slide(this._directionToOrder(bb)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),hq+this._config.interval))}};this._swipeHelper=new Tb(this._element,t)}_keydown(n){if(/input|textarea/i.test(n.target.tagName))return;let t=Pq[n.key];t&&(n.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(n){return this._getItems().indexOf(n)}_setActiveIndicatorElement(n){if(!this._indicatorsElement)return;let t=Gi.findOne(mF,this._indicatorsElement);t.classList.remove(fb),t.removeAttribute("aria-current");let e=Gi.findOne(`[data-bs-slide-to="${n}"]`,this._indicatorsElement);e&&(e.classList.add(fb),e.setAttribute("aria-current","true"))}_updateInterval(){let n=this._activeElement||this._getActive();if(!n)return;let t=Number.parseInt(n.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(n,t=null){if(this._isSliding)return;let e=this._getActive(),r=n===j1,a=t||rT(this._getItems(),e,r,this._config.wrap);if(a===e)return;let c=this._getItemIndex(a),d=y=>Yt.trigger(this._element,y,{relatedTarget:a,direction:this._orderToDirection(n),from:this._getItemIndex(e),to:c});if(d(fq).defaultPrevented||!e||!a)return;let h=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(c),this._activeElement=a;let f=r?Eq:Cq,v=r?wq:Tq;a.classList.add(v),z1(a),e.classList.add(f),a.classList.add(f);let C=()=>{a.classList.remove(f,v),a.classList.add(fb),e.classList.remove(fb,v,f),this._isSliding=!1,d(Ww)};this._queueCallback(C,e,this._isAnimated()),h&&this.cycle()}_isAnimated(){return this._element.classList.contains(xq)}_getActive(){return Gi.findOne(Dq,this._element)}_getItems(){return Gi.find(uF,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(n){return Rl()?n===Vh?Lh:j1:n===Vh?j1:Lh}_orderToDirection(n){return Rl()?n===Lh?Vh:bb:n===Lh?bb:Vh}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="number"){t.to(n);return}if(typeof n=="string"){if(t[n]===void 0||n.startsWith("_")||n==="constructor")throw new TypeError(`No method named "${n}"`);t[n]()}})}};Yt.on(document,bq,Mq,function(i){let n=Gi.getElementFromSelector(this);if(!n||!n.classList.contains(dF))return;i.preventDefault();let t=H1.getOrCreateInstance(n),e=this.getAttribute("data-bs-slide-to");if(e){t.to(e),t._maybeEnableCycle();return}if(Wd.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});Yt.on(window,Sq,()=>{let i=Gi.find(Aq);for(let n of i)H1.getOrCreateInstance(n)});Nl(H1);var Oq="collapse",Nq="bs.collapse",Y1=`.${Nq}`,Lq=".data-api",Bq=`show${Y1}`,Vq=`shown${Y1}`,Uq=`hide${Y1}`,jq=`hidden${Y1}`,Wq=`click${Y1}${Lq}`,Hw="show",jh="collapse",gb="collapsing",Hq="collapsed",Gq=`:scope .${jh} .${jh}`,$q="collapse-horizontal",zq="width",Yq="height",qq=".collapse.show, .collapse.collapsing",tT='[data-bs-toggle="collapse"]',Kq={parent:null,toggle:!0},Xq={parent:"(null|element)",toggle:"boolean"},Db=class i extends rl{constructor(n,t){super(n,t),this._isTransitioning=!1,this._triggerArray=[];let e=Gi.find(tT);for(let r of e){let a=Gi.getSelectorFromElement(r),c=Gi.find(a).filter(d=>d===this._element);a!==null&&c.length&&this._triggerArray.push(r)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Kq}static get DefaultType(){return Xq}static get NAME(){return Oq}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let n=[];if(this._config.parent&&(n=this._getFirstLevelChildren(qq).filter(d=>d!==this._element).map(d=>i.getOrCreateInstance(d,{toggle:!1}))),n.length&&n[0]._isTransitioning||Yt.trigger(this._element,Bq).defaultPrevented)return;for(let d of n)d.hide();let e=this._getDimension();this._element.classList.remove(jh),this._element.classList.add(gb),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let r=()=>{this._isTransitioning=!1,this._element.classList.remove(gb),this._element.classList.add(jh,Hw),this._element.style[e]="",Yt.trigger(this._element,Vq)},c=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(r,this._element,!0),this._element.style[e]=`${this._element[c]}px`}
23hide(){if(this._isTransitioning||!this._isShown()||Yt.trigger(this._element,Uq).defaultPrevented)return;let t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,z1(this._element),this._element.classList.add(gb),this._element.classList.remove(jh,Hw);for(let r of this._triggerArray){let a=Gi.getElementFromSelector(r);a&&!this._isShown(a)&&this._addAriaAndCollapsedClass([r],!1)}this._isTransitioning=!0;let e=()=>{this._isTransitioning=!1,this._element.classList.remove(gb),this._element.classList.add(jh),Yt.trigger(this._element,jq)};this._element.style[t]="",this._queueCallback(e,this._element,!0)}_isShown(n=this._element){return n.classList.contains(Hw)}_configAfterMerge(n){return n.toggle=!!n.toggle,n.parent=zm(n.parent),n}_getDimension(){return this._element.classList.contains($q)?zq:Yq}_initializeChildren(){if(!this._config.parent)return;let n=this._getFirstLevelChildren(tT);for(let t of n){let e=Gi.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(n){let t=Gi.find(Gq,this._config.parent);return Gi.find(n,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(n,t){if(n.length)for(let e of n)e.classList.toggle(Hq,!t),e.setAttribute("aria-expanded",t)}static jQueryInterface(n){let t={};return typeof n=="string"&&/show|hide/.test(n)&&(t.toggle=!1),this.each(function(){let e=i.getOrCreateInstance(this,t);if(typeof n=="string"){if(typeof e[n]>"u")throw new TypeError(`No method named "${n}"`);e[n]()}})}};Yt.on(document,Wq,tT,function(i){(i.target.tagName==="A"||i.delegateTarget&&i.delegateTarget.tagName==="A")&&i.preventDefault();for(let n of Gi.getMultipleElementsFromSelector(this))Db.getOrCreateInstance(n,{toggle:!1}).toggle()});Nl(Db);var D6="dropdown",Jq="bs.dropdown",D0=`.${Jq}`,oT=".data-api",Zq="Escape",I6="Tab",Qq="ArrowUp",k6="ArrowDown",eK=2,tK=`hide${D0}`,iK=`hidden${D0}`,nK=`show${D0}`,rK=`shown${D0}`,pF=`click${D0}${oT}`,hF=`keydown${D0}${oT}`,aK=`keyup${D0}${oT}`,Uh="show",oK="dropup",sK="dropend",lK="dropstart",cK="dropup-center",dK="dropdown-center",E0='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',mK=`${E0}.${Uh}`,xb=".dropdown-menu",uK=".navbar",pK=".navbar-nav",hK=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",fK=Rl()?"top-end":"top-start",gK=Rl()?"top-start":"top-end",vK=Rl()?"bottom-end":"bottom-start",_K=Rl()?"bottom-start":"bottom-end",yK=Rl()?"left-start":"right-start",SK=Rl()?"right-start":"left-start",bK="top",xK="bottom",CK={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},EK={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},qm=class i extends rl{constructor(n,t){super(n,t),this._popper=null,this._parent=this._element.parentNode,this._menu=Gi.next(this._element,xb)[0]||Gi.prev(this._element,xb)[0]||Gi.findOne(xb,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return CK}static get DefaultType(){return EK}static get NAME(){return D6}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ym(this._element)||this._isShown())return;let n={relatedTarget:this._element};if(!Yt.trigger(this._element,nK,n).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(pK))for(let e of[].concat(...document.body.children))Yt.on(e,"mouseover",Cb);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Uh),this._element.classList.add(Uh),Yt.trigger(this._element,rK,n)}}hide(){if(Ym(this._element)||!this._isShown())return;let n={relatedTarget:this._element};this._completeHide(n)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(n){if(!Yt.trigger(this._element,tK,n).defaultPrevented){if("ontouchstart"in document.documentElement)for(let e of[].concat(...document.body.children))Yt.off(e,"mouseover",Cb);this._popper&&this._popper.destroy(),this._menu.classList.remove(Uh),this._element.classList.remove(Uh),this._element.setAttribute("aria-expanded","fal
23se"),Wd.removeDataAttribute(this._menu,"popper"),Yt.trigger(this._element,iK,n),this._element.focus()}}_getConfig(n){if(n=super._getConfig(n),typeof n.reference=="object"&&!jd(n.reference)&&typeof n.reference.getBoundingClientRect!="function")throw new TypeError(`${D6.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return n}_createPopper(){if(typeof hb>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let n=this._element;this._config.reference==="parent"?n=this._parent:jd(this._config.reference)?n=zm(this._config.reference):typeof this._config.reference=="object"&&(n=this._config.reference);let t=this._getPopperConfig();this._popper=U1(n,this._menu,t)}_isShown(){return this._menu.classList.contains(Uh)}_getPlacement(){let n=this._parent;if(n.classList.contains(sK))return yK;if(n.classList.contains(lK))return SK;if(n.classList.contains(cK))return bK;if(n.classList.contains(dK))return xK;let t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return n.classList.contains(oK)?t?gK:fK:t?_K:vK}_detectNavbar(){return this._element.closest(uK)!==null}_getOffset(){let{offset:n}=this._config;return typeof n=="string"?n.split(",").map(t=>Number.parseInt(t,10)):typeof n=="function"?t=>n(t,this._element):n}_getPopperConfig(){let n={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Wd.setDataAttribute(this._menu,"popper","static"),n.modifiers=[{name:"applyStyles",enabled:!1}]),le(le({},n),Cs(this._config.popperConfig,[void 0,n]))}_selectMenuItem({key:n,target:t}){let e=Gi.find(hK,this._menu).filter(r=>Hh(r));e.length&&rT(e,t,n===k6,!e.includes(t)).focus()}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n]()}})}static clearMenus(n){if(n.button===eK||n.type==="keyup"&&n.key!==I6)return;let t=Gi.find(mK);for(let e of t){let r=i.getInstance(e);if(!r||r._config.autoClose===!1)continue;let a=n.composedPath(),c=a.includes(r._menu);if(a.includes(r._element)||r._config.autoClose==="inside"&&!c||r._config.autoClose==="outside"&&c||r._menu.contains(n.target)&&(n.type==="keyup"&&n.key===I6||/input|select|option|textarea|form/i.test(n.target.tagName)))continue;let d={relatedTarget:r._element};n.type==="click"&&(d.clickEvent=n),r._completeHide(d)}}static dataApiKeydownHandler(n){let t=/input|textarea/i.test(n.target.tagName),e=n.key===Zq,r=[Qq,k6].includes(n.key);if(!r&&!e||t&&!e)return;n.preventDefault();let a=this.matches(E0)?this:Gi.prev(this,E0)[0]||Gi.next(this,E0)[0]||Gi.findOne(E0,n.delegateTarget.parentNode),c=i.getOrCreateInstance(a);if(r){n.stopPropagation(),c.show(),c._selectMenuItem(n);return}c._isShown()&&(n.stopPropagation(),c.hide(),a.focus())}};Yt.on(document,hF,E0,qm.dataApiKeydownHandler);Yt.on(document,hF,xb,qm.dataApiKeydownHandler);Yt.on(document,pF,qm.clearMenus);Yt.on(document,aK,qm.clearMenus);Yt.on(document,pF,E0,function(i){i.preventDefault(),qm.getOrCreateInstance(this).toggle()});Nl(qm);var fF="backdrop",wK="fade",M6="show",A6=`mousedown.bs.${fF}`,TK={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},DK={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},Ib=class extends T0{constructor(n){super(),this._config=this._getConfig(n),this._isAppended=!1,this._element=null}static get Default(){return TK}static get DefaultType(){return DK}static get NAME(){return fF}show(n){if(!this._config.isVisible){Cs(n);return}this._append();let t=this._getElement();this._config.isAnimated&&z1(t),t.classList.add(M6),this._emulateAnimation(()=>{Cs(n)})}hide(n){if(!this._config.isVisible){Cs(n);return}this._getElement().classList.remove(M6),this._emulateAnimation(()=>{this.dispose(),Cs(n)})}dispose(){this._isAppended&&(Yt.off(this._element,A6),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let n=document.createElement("div");n.className=this._config.className,this._config.isAnimated&&n.classList.add(wK),this._element=n}return this._element}_configAfterMerge(n){return n.rootElement=zm(n.rootElement),n}_append(){if(this._isAppended)return;let n=this._getElement();this._config.rootElement.append(n),Yt.on(n,A6,()=>{Cs(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(n){tF(n,this._getElement(),this._config.isAnimated)}},IK="focustrap",kK="bs.focustrap",kb=`.${kK}`,MK=`focusin${kb}`,AK=`keydown.tab${kb}`,PK="Tab",FK="forward",P6="backward",RK={autofocus:!0,trapElement:null},OK={autofocus:"boolean",trapElement:"element"},Mb=class extends T0{constructor(n){super(),this._config=this._getConfig(n),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return RK}static get DefaultType(){return OK}static get NAME(){return IK}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Yt.off(document,kb),Yt.on(document,MK,n=>this._handleFocusin(n)),Yt.on(document,AK,n=>this._handleKeydown(n)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Yt.off(document,kb))}_handleFocusin(n){let{trapElement:t}=this._config;if(n.target===document||n.target===t||t.contains(n.target))return;let e=Gi.focusableChildren(t);e.length===0?t.focus():this._lastTabNavDirection===P6?e[e.length-1].focus():e[0].focus()}_handleKeydown(n){n.key===PK&&(this._lastTabNavDirection=n.shiftKey?P6:FK)}},F6=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",R6=".sticky-top",vb="padding-right",O6="margin-right",G1=class{constructor(){this._element=document.body}getWidth(){let n=document.documentElement.clientWidth;return Math.abs(window.innerWidth-n)}hide(){let n=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,vb,t=>t+n),this._setElementAttributes(F6,vb,t=>t+n),this._setElementAttributes(R6,O6,t=>t-n)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,vb),this._resetElementAttributes(F6,vb),this._resetElementAttributes(R6,O6)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(n,t,e){let r=this.getWidth(),a=c=>{if(c!==this._element&&window.innerWidth>c.clientWidth+r)return;this._saveInitialAttribute(c,t);let d=window.getComputedStyle(c).getPropertyValue(t);c.style.setProperty(t,`${e(Number.parseFloat(d))}px`)};this._applyManipulationCallback(n,a)}_saveInitialAttribute(n,t){let e=n.style.getPropertyValue(t);e&&Wd.setDataAttribute(n,t,e)}_resetElementAttributes(n,t){let e=r=>{let a=Wd.getDataAttribute(r,t);if(a===null){r.style.removeProperty(t);return}Wd.removeDataAttribute(r,t),r.style.setProperty(t,a)};this._applyManipulationCallback(n,e)}
23_applyManipulationCallback(n,t){if(jd(n)){t(n);return}for(let e of Gi.find(n,this._element))t(e)}},NK="modal",LK="bs.modal",Ol=`.${LK}`,BK=".data-api",VK="Escape",UK=`hide${Ol}`,jK=`hidePrevented${Ol}`,gF=`hidden${Ol}`,vF=`show${Ol}`,WK=`shown${Ol}`,HK=`resize${Ol}`,GK=`click.dismiss${Ol}`,$K=`mousedown.dismiss${Ol}`,zK=`keydown.dismiss${Ol}`,YK=`click${Ol}${BK}`,N6="modal-open",qK="fade",L6="show",Gw="modal-static",KK=".modal.show",XK=".modal-dialog",JK=".modal-body",ZK='[data-bs-toggle="modal"]',QK={backdrop:!0,focus:!0,keyboard:!0},eX={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},Zt=class i extends rl{constructor(n,t){super(n,t),this._dialog=Gi.findOne(XK,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new G1,this._addEventListeners()}static get Default(){return QK}static get DefaultType(){return eX}static get NAME(){return NK}toggle(n){return this._isShown?this.hide():this.show(n)}show(n){this._isShown||this._isTransitioning||Yt.trigger(this._element,vF,{relatedTarget:n}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(N6),this._adjustDialog(),this._backdrop.show(()=>this._showElement(n)))}hide(){!this._isShown||this._isTransitioning||Yt.trigger(this._element,UK).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(L6),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Yt.off(window,Ol),Yt.off(this._dialog,Ol),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ib({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Mb({trapElement:this._element})}_showElement(n){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;let t=Gi.findOne(JK,this._dialog);t&&(t.scrollTop=0),z1(this._element),this._element.classList.add(L6);let e=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Yt.trigger(this._element,WK,{relatedTarget:n})};this._queueCallback(e,this._dialog,this._isAnimated())}_addEventListeners(){Yt.on(this._element,zK,n=>{if(n.key===VK){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),Yt.on(window,HK,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Yt.on(this._element,$K,n=>{Yt.one(this._element,GK,t=>{if(!(this._element!==n.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(N6),this._resetAdjustments(),this._scrollBar.reset(),Yt.trigger(this._element,gF)})}_isAnimated(){return this._element.classList.contains(qK)}_triggerBackdropTransition(){if(Yt.trigger(this._element,jK).defaultPrevented)return;let t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;e==="hidden"||this._element.classList.contains(Gw)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Gw),this._queueCallback(()=>{this._element.classList.remove(Gw),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let n=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),e=t>0;if(e&&!n){let r=Rl()?"paddingLeft":"paddingRight";this._element.style[r]=`${t}px`}if(!e&&n){let r=Rl()?"paddingRight":"paddingLeft";this._element.style[r]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(n,t){return this.each(function(){let e=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(typeof e[n]>
23"u")throw new TypeError(`No method named "${n}"`);e[n](t)}})}};Yt.on(document,YK,ZK,function(i){let n=Gi.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&i.preventDefault(),Yt.one(n,vF,r=>{r.defaultPrevented||Yt.one(n,gF,()=>{Hh(this)&&this.focus()})});let t=Gi.findOne(KK);t&&Zt.getInstance(t).hide(),Zt.getOrCreateInstance(n).toggle(this)});Fb(Zt);Nl(Zt);var tX="offcanvas",iX="bs.offcanvas",Hd=`.${iX}`,_F=".data-api",nX=`load${Hd}${_F}`,rX="Escape",B6="show",V6="showing",U6="hiding",aX="offcanvas-backdrop",yF=".offcanvas.show",oX=`show${Hd}`,sX=`shown${Hd}`,lX=`hide${Hd}`,j6=`hidePrevented${Hd}`,SF=`hidden${Hd}`,cX=`resize${Hd}`,dX=`click${Hd}${_F}`,mX=`keydown.dismiss${Hd}`,uX='[data-bs-toggle="offcanvas"]',pX={backdrop:!0,keyboard:!0,scroll:!1},hX={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},Km=class i extends rl{constructor(n,t){super(n,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return pX}static get DefaultType(){return hX}static get NAME(){return tX}toggle(n){return this._isShown?this.hide():this.show(n)}show(n){if(this._isShown||Yt.trigger(this._element,oX,{relatedTarget:n}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new G1().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(V6);let e=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(B6),this._element.classList.remove(V6),Yt.trigger(this._element,sX,{relatedTarget:n})};this._queueCallback(e,this._element,!0)}hide(){if(!this._isShown||Yt.trigger(this._element,lX).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(U6),this._backdrop.hide();let t=()=>{this._element.classList.remove(B6,U6),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new G1().reset(),Yt.trigger(this._element,SF)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let n=()=>{if(this._config.backdrop==="static"){Yt.trigger(this._element,j6);return}this.hide()},t=!!this._config.backdrop;return new Ib({className:aX,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?n:null})}_initializeFocusTrap(){return new Mb({trapElement:this._element})}_addEventListeners(){Yt.on(this._element,mX,n=>{if(n.key===rX){if(this._config.keyboard){this.hide();return}Yt.trigger(this._element,j6)}})}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(t[n]===void 0||n.startsWith("_")||n==="constructor")throw new TypeError(`No method named "${n}"`);t[n](this)}})}};Yt.on(document,dX,uX,function(i){let n=Gi.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Ym(this))return;Yt.one(n,SF,()=>{Hh(this)&&this.focus()});let t=Gi.findOne(yF);t&&t!==n&&Km.getInstance(t).hide(),Km.getOrCreateInstance(n).toggle(this)});Yt.on(window,nX,()=>{for(let i of Gi.find(yF))Km.getOrCreateInstance(i).show()});Yt.on(window,cX,()=>{for(let i of Gi.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(i).position!=="fixed"&&Km.getOrCreateInstance(i).hide()});Fb(Km);Nl(Km);var fX=/^aria-[\w-]*$/i,bF={"*":["class","dir","id","lang","role",fX],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},gX=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),vX=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,_X=(i,n)=>{let t=i.nodeName.toLowerCase();return n.includes(t)?gX.has(t)?!!vX.test(i.nodeValue):!0:n.filter(e=>e instanceof RegExp).some(e=>e.test(t))};function yX(i,n,t){if(!i.length)return i;if(t&&typeof t=="function")return t(i);let r=new window.DOMParser().parseFromString(i,"text/html"),a=[].concat(...r.body.querySelectorAll("*"));for(let c of a){let d=c.nodeName.toLowerCase();if(!Object.keys(n).includes(d)){c.remove();continue}let u=[].concat(...c.attributes),h=[].concat(n["*"]||[],n[d]||[]);for(let f of u)_X(f,h)||c.removeAttribute(f.nodeName)}return r.body.innerHTML}var SX="TemplateFactory",bX={allowList:bF,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},xX={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},CX={entry:"(string|element|function|null)",selector:"(string|element)"},iT=class extends T0{constructor(n){super(),this._config=this._getConfig(n)}static get Default(){return bX}static get DefaultType(){return xX}static get NAME(){return SX}getContent(){return Object.values(this._config.content).map(n=>
23this._resolvePossibleFunction(n)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(n){return this._checkContent(n),this._config.content=le(le({},this._config.content),n),this}toHtml(){let n=document.createElement("div");n.innerHTML=this._maybeSanitize(this._config.template);for(let[r,a]of Object.entries(this._config.content))this._setContent(n,a,r);let t=n.children[0],e=this._resolvePossibleFunction(this._config.extraClass);return e&&t.classList.add(...e.split(" ")),t}_typeCheckConfig(n){super._typeCheckConfig(n),this._checkContent(n.content)}_checkContent(n){for(let[t,e]of Object.entries(n))super._typeCheckConfig({selector:t,entry:e},CX)}_setContent(n,t,e){let r=Gi.findOne(e,n);if(r){if(t=this._resolvePossibleFunction(t),!t){r.remove();return}if(jd(t)){this._putElementInTemplate(zm(t),r);return}if(this._config.html){r.innerHTML=this._maybeSanitize(t);return}r.textContent=t}}_maybeSanitize(n){return this._config.sanitize?yX(n,this._config.allowList,this._config.sanitizeFn):n}_resolvePossibleFunction(n){return Cs(n,[void 0,this])}_putElementInTemplate(n,t){if(this._config.html){t.innerHTML="",t.append(n);return}t.textContent=n.textContent}},EX="tooltip",wX=new Set(["sanitize","allowList","sanitizeFn"]),$w="fade",TX="modal",_b="show",DX=".tooltip-inner",W6=`.${TX}`,H6="hide.bs.modal",W1="hover",zw="focus",Yw="click",IX="manual",kX="hide",MX="hidden",AX="show",PX="shown",FX="inserted",RX="click",OX="focusin",NX="focusout",LX="mouseenter",BX="mouseleave",VX={AUTO:"auto",TOP:"top",RIGHT:Rl()?"left":"right",BOTTOM:"bottom",LEFT:Rl()?"right":"left"},UX={allowList:bF,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},jX={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},Wh=class i extends rl{constructor(n,t){if(typeof hb>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(n,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return UX}static get DefaultType(){return jX}static get NAME(){return EX}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),Yt.off(this._element.closest(W6),H6,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;let n=Yt.trigger(this._element,this.constructor.eventName(AX)),e=(Q6(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(n.defaultPrevented||!e)return;this._disposePopper();let r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));let{container:a}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(a.append(r),Yt.trigger(this._element,this.constructor.eventName(FX))),this._popper=this._createPopper(r),r.classList.add(_b),"ontouchstart"in document.documentElement)for(let d of[].concat(...document.body.children))Yt.on(d,"mouseover",Cb);let c=()=>{Yt.trigger(this._element,this.constructor.eventName(PX)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(c,this.tip,this._isAnimated())}
23hide(){if(!this._isShown()||Yt.trigger(this._element,this.constructor.eventName(kX)).defaultPrevented)return;if(this._getTipElement().classList.remove(_b),"ontouchstart"in document.documentElement)for(let r of[].concat(...document.body.children))Yt.off(r,"mouseover",Cb);this._activeTrigger[Yw]=!1,this._activeTrigger[zw]=!1,this._activeTrigger[W1]=!1,this._isHovered=null;let e=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Yt.trigger(this._element,this.constructor.eventName(MX)))};this._queueCallback(e,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(n){let t=this._getTemplateFactory(n).toHtml();if(!t)return null;t.classList.remove($w,_b),t.classList.add(`bs-${this.constructor.NAME}-auto`);let e=kY(this.constructor.NAME).toString();return t.setAttribute("id",e),this._isAnimated()&&t.classList.add($w),t}setContent(n){this._newContent=n,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(n){return this._templateFactory?this._templateFactory.changeContent(n):this._templateFactory=new iT(tt(le({},this._config),{content:n,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}_getContentForTemplate(){return{[DX]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(n){return this.constructor.getOrCreateInstance(n.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains($w)}_isShown(){return this.tip&&this.tip.classList.contains(_b)}_createPopper(n){let t=Cs(this._config.placement,[this,n,this._element]),e=VX[t.toUpperCase()];return U1(this._element,n,this._getPopperConfig(e))}_getOffset(){let{offset:n}=this._config;return typeof n=="string"?n.split(",").map(t=>Number.parseInt(t,10)):typeof n=="function"?t=>n(t,this._element):n}_resolvePossibleFunction(n){return Cs(n,[this._element,this._element])}_getPopperConfig(n){let t={placement:n,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return le(le({},t),Cs(this._config.popperConfig,[void 0,t]))}_setListeners(){let n=this._config.trigger.split(" ");for(let t of n)if(t==="click")Yt.on(this._element,this.constructor.eventName(RX),this._config.selector,e=>{let r=this._initializeOnDelegatedTarget(e);r._activeTrigger[Yw]=!(r._isShown()&&r._activeTrigger[Yw]),r.toggle(
23)});else if(t!==IX){let e=t===W1?this.constructor.eventName(LX):this.constructor.eventName(OX),r=t===W1?this.constructor.eventName(BX):this.constructor.eventName(NX);Yt.on(this._element,e,this._config.selector,a=>{let c=this._initializeOnDelegatedTarget(a);c._activeTrigger[a.type==="focusin"?zw:W1]=!0,c._enter()}),Yt.on(this._element,r,this._config.selector,a=>{let c=this._initializeOnDelegatedTarget(a);c._activeTrigger[a.type==="focusout"?zw:W1]=c._element.contains(a.relatedTarget),c._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Yt.on(this._element.closest(W6),H6,this._hideModalHandler)}_fixTitle(){let n=this._element.getAttribute("title");n&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",n),this._element.setAttribute("data-bs-original-title",n),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(n,t){clearTimeout(this._timeout),this._timeout=setTimeout(n,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(n){let t=Wd.getDataAttributes(this._element);for(let e of Object.keys(t))wX.has(e)&&delete t[e];return n=le(le({},t),typeof n=="object"&&n?n:{}),n=this._mergeConfigObj(n),n=this._configAfterMerge(n),this._typeCheckConfig(n),n}_configAfterMerge(n){return n.container=n.container===!1?document.body:zm(n.container),typeof n.delay=="number"&&(n.delay={show:n.delay,hide:n.delay}),typeof n.title=="number"&&(n.title=n.title.toString()),typeof n.content=="number"&&(n.content=n.content.toString()),n}_getDelegateConfig(){let n={};for(let[t,e]of Object.entries(this._config))this.constructor.Default[t]!==e&&(n[t]=e);return n.selector=!1,n.trigger="manual",n}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n]()}})}};Nl(Wh);var WX="popover",HX=".popover-header",GX=".popover-body",$X=tt(le({},Wh.Default),{content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"}),zX=tt(le({},Wh.DefaultType),{content:"(null|string|element|function)"}),nT=class i extends Wh{static get Default(){return $X}static get DefaultType(){return zX}static get NAME(){return WX}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[HX]:this._getTitle(),[GX]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n]()}})}};Nl(nT);var YX="scrollspy",qX="bs.scrollspy",sT=`.${qX}`,KX=".data-api",XX=`activate${sT}`,G6=`click${sT}`,JX=`load${sT}${KX}`,ZX="dropdown-item",Bh="active",QX='[data-bs-spy="scroll"]',qw="[href]",eJ=".nav, .list-group",$6=".nav-link",tJ=".nav-item",iJ=".list-group-item",nJ=`${$6}, ${tJ} > ${$6}, ${iJ}`,rJ=".dropdown",aJ=".dropdown-toggle",oJ={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},sJ={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},Ab=class i extends rl{constructor(n,t){super(n,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return oJ}static get DefaultType(){return sJ}static get NAME(){return YX}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let n of this._observableSections.values())this._observer.observe(n)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(n){return n.target=zm(n.target)||document.body,n.rootMargin=n.offset?`${n.offset}px 0px -30%`:n.rootMargin,typeof n.threshold=="string"&&(n.threshold=n.threshold.split(",").map(t=>Number.parseFloat(t))),n}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Yt.off(this._config.target,G6),Yt.on(this._config.target,G6,qw,n=>{let t=this._observableSections.get(n.target.hash);if(t){n.preventDefault();let e=this._rootElement||window,r=t.offsetTop-this._element.offsetTop;if(e.scrollTo){e.scrollTo({top:r,behavior:"smooth"});return}e.scrollTop=r}}))}_getNewObserver(){let n={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),n)}_observerCallback(n){let t=c=>this._targetLinks.get(`#${c.target.id}`),e=c=>{this._previousScrollData.visibleEntryTop=c.target.offsetTop,this._process(t(c))},r=(this._rootElement||document.documentElement).scrollTop,a=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;for(let c of n){if(!c.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(c));continue}let d=c.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(a&&d){if(e(c),!r)return;continue}!a&&!d&&e(c)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let n=Gi.find(qw,this._config.target);for(let t of n){if(!t.hash||Ym(t))continue;let e=Gi.findOne(decodeURI(t.hash),this._element);Hh(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(n){this._activeTarget!==n&&(this._clearActiveClass(this._config.target),this._activeTarget=n,n.classList.add(Bh),this._activateParents(n),Yt.trigger(this._element,XX,{relatedTarget:n}))}_activateParents(n){if(n.classList.contains(ZX)){Gi.findOne(aJ,n.closest(rJ)).classList.add(Bh);return}for(let t of Gi.parents(n,eJ))for(let e of Gi.prev(t,nJ))e.classList.add(Bh)}_clearActiveClass(n){n.classList.remove(Bh);let t=Gi.find(`${qw}.${Bh}`,n);for(let e of t)e.classList.remove(Bh)}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(t[n]===void 0||n.startsWith("_")||n==="constructor")throw new TypeError(`No method n
23amed "${n}"`);t[n]()}})}};Yt.on(window,JX,()=>{for(let i of Gi.find(QX))Ab.getOrCreateInstance(i)});Nl(Ab);var lJ="tab",cJ="bs.tab",I0=`.${cJ}`,dJ=`hide${I0}`,mJ=`hidden${I0}`,uJ=`show${I0}`,pJ=`shown${I0}`,hJ=`click${I0}`,fJ=`keydown${I0}`,gJ=`load${I0}`,vJ="ArrowLeft",z6="ArrowRight",_J="ArrowUp",Y6="ArrowDown",Kw="Home",q6="End",w0="active",K6="fade",Xw="show",yJ="dropdown",xF=".dropdown-toggle",SJ=".dropdown-menu",Jw=`:not(${xF})`,bJ='.list-group, .nav, [role="tablist"]',xJ=".nav-item, .list-group-item",CJ=`.nav-link${Jw}, .list-group-item${Jw}, [role="tab"]${Jw}`,CF='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Zw=`${CJ}, ${CF}`,EJ=`.${w0}[data-bs-toggle="tab"], .${w0}[data-bs-toggle="pill"], .${w0}[data-bs-toggle="list"]`,$1=class i extends rl{constructor(n){super(n),this._parent=this._element.closest(bJ),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Yt.on(this._element,fJ,t=>this._keydown(t)))}static get NAME(){return lJ}show(){let n=this._element;if(this._elemIsActive(n))return;let t=this._getActiveElem(),e=t?Yt.trigger(t,dJ,{relatedTarget:n}):null;Yt.trigger(n,uJ,{relatedTarget:t}).defaultPrevented||e&&e.defaultPrevented||(this._deactivate(t,n),this._activate(n,t))}_activate(n,t){if(!n)return;n.classList.add(w0),this._activate(Gi.getElementFromSelector(n));let e=()=>{if(n.getAttribute("role")!=="tab"){n.classList.add(Xw);return}n.removeAttribute("tabindex"),n.setAttribute("aria-selected",!0),this._toggleDropDown(n,!0),Yt.trigger(n,pJ,{relatedTarget:t})};this._queueCallback(e,n,n.classList.contains(K6))}_deactivate(n,t){if(!n)return;n.classList.remove(w0),n.blur(),this._deactivate(Gi.getElementFromSelector(n));let e=()=>{if(n.getAttribute("role")!=="tab"){n.classList.remove(Xw);return}n.setAttribute("aria-selected",!1),n.setAttribute("tabindex","-1"),this._toggleDropDown(n,!1),Yt.trigger(n,mJ,{relatedTarget:t})};this._queueCallback(e,n,n.classList.contains(K6))}_keydown(n){if(![vJ,z6,_J,Y6,Kw,q6].includes(n.key))return;n.stopPropagation(),n.preventDefault();let t=this._getChildren().filter(r=>!Ym(r)),e;if([Kw,q6].includes(n.key))e=t[n.key===Kw?0:t.length-1];else{let r=[z6,Y6].includes(n.key);e=rT(t,n.target,r,!0)}e&&(e.focus({preventScroll:!0}),i.getOrCreateInstance(e).show())}_getChildren(){return Gi.find(Zw,this._parent)}_getActiveElem(){return this._getChildren().find(n=>this._elemIsActive(n))||null}_setInitialAttributes(n,t){this._setAttributeIfNotExists(n,"role","tablist");for(let e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(n){n=this._getInnerElement(n);let t=this._elemIsActive(n),e=this._getOuterElement(n);n.setAttribute("aria-selected",t),e!==n&&this._setAttributeIfNotExists(e,"role","presentation"),t||n.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(n,"role","tab"),this._setInitialAttributesOnTargetPanel(n)}_setInitialAttributesOnTargetPanel(n){let t=Gi.getElementFromSelector(n);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),n.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${n.id}`))}_toggleDropDown(n,t){let e=this._getOuterElement(n);if(!e.classList.contains(yJ))return;let r=(a,c)=>{let d=Gi.findOne(a,e);d&&d.classList.toggle(c,t)};r(xF,w0),r(SJ,Xw),e.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(n,t,e){n.hasAttribute(t)||n.setAttribute(t,e)}_elemIsActive(n){return n.classList.contains(w0)}_getInnerElement(n){return n.matches(Zw)?n:Gi.findOne(Zw,n)}_getOuterElement(n){return n.closest(xJ)||n}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this);if(typeof n=="string"){if(t[n]===void 0||n.startsWith("_")||n==="constructor")throw new TypeError(`No method named "${n}"`);t[n]()}})}};Yt.on(document,hJ,CF,function(i){["A","AREA"].includes(this.tagName)&&i.preventDefault(),!Ym(this)&&$1.getOrCreateInstance(this).show()});Yt.on(window,gJ,()=>{for(let i of Gi.find(EJ))$1.getOrCreateInstance(i)});Nl($1);var wJ="toast",TJ="bs.toast",Jm=`.${TJ}`,DJ=`mouseover${Jm}`,IJ=`mouseout${Jm}`,kJ=`focusin${Jm}`,MJ=`focusout${Jm}`,AJ=`hide${Jm}`,PJ=`hidden${Jm}`,FJ=`show${Jm}`,RJ=`shown${Jm}`,OJ="fade",X6="hide",yb="show",Sb="showing",NJ={animation:"boolean",autohide:"boolean",delay:"number"},LJ={animation:!0,autohide:!0,delay:5e3},Pb=class i extends rl{constructor(n,t){super(n,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return LJ}static get DefaultType(){return NJ}static get NAME(){return wJ}show(){if(Yt.trigger(this._element,FJ).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(OJ);let t=()=>{this._element.classList.remove(Sb),Yt.trigger(this._element,RJ),this._maybeScheduleHide()};this._element.classList.remove(X6),z1(this._element),this._element.classList.add(yb,Sb),this._queueCallback(t,this._element,this._config.animation)}
23hide(){if(!this.isShown()||Yt.trigger(this._element,AJ).defaultPrevented)return;let t=()=>{this._element.classList.add(X6),this._element.classList.remove(Sb,yb),Yt.trigger(this._element,PJ)};this._element.classList.add(Sb),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(yb),super.dispose()}isShown(){return this._element.classList.contains(yb)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(n,t){switch(n.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}let e=n.relatedTarget;this._element===e||this._element.contains(e)||this._maybeScheduleHide()}_setListeners(){Yt.on(this._element,DJ,n=>this._onInteraction(n,!0)),Yt.on(this._element,IJ,n=>this._onInteraction(n,!1)),Yt.on(this._element,kJ,n=>this._onInteraction(n,!0)),Yt.on(this._element,MJ,n=>this._onInteraction(n,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(n){return this.each(function(){let t=i.getOrCreateInstance(this,n);if(typeof n=="string"){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n](this)}})}};Fb(Pb);Nl(Pb);var EF=(()=>{let n=class n{constructor(e){this.http=e,this.baseUrl=`${ui.ambuluwawaBackendUrl}/feedback`}getFeedbacks(){let e=new xe({"Content-Type":"application/json",path:"get"});return this.http.post(this.baseUrl,{},{headers:e})}deleteFeedbacks(e){let r={feedbackId:e},a=new xe({"Content-Type":"application/json",path:"delete"});return this.http.post(this.baseUrl,r,{headers:a})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var VJ=i=>({collapsed:i});function UJ(i,n){if(i&1){let t=he();s(0,"button",50),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onDeleteClick(r))}),B(1,"i",51),l(2," Delete "),o()}if(i&2){let t=w(2);p("disabled",t.isAccountant||t.isOfficeUser)}}function jJ(i,n){if(i&1){let t=he();s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td")(10,"span",46),l(11),o()(),s(12,"td"),l(13),I(14,"date"),o(),s(15,"td")(16,"button",47),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onView(r))}),B(17,"i",48),l(18," View "),o(),T(19,UJ,3,1,"button",49),o()()}if(i&2){let t=n.$implicit,e=w();m(2),b(t.id),m(2),b(t.name),m(2),b(t.phone_number),m(2),b(t.country),m(3),_(" ",t.message," "),m(2),b(M(14,7,t.created_at)),m(6),p("ngIf",e.isAdmin)}}function WJ(i,n){i&1&&(s(0,"tr")(1,"td",52),B(2,"i",53),s(3,"p",54),l(4,"No feedbacks found"),o()()())}function HJ(i,n){if(i&1&&(s(0,"li",29)(1,"button",55),l(2),o()()),i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}function GJ(i,n){if(i&1&&(s(0,"div",56)(1,"div",57)(2,"label",58),l(3,"Visitor Name:"),o(),s(4,"p"),l(5),o()(),s(6,"div",57)(7,"label",58),l(8,"Phone Number:"),o(),s(9,"p"),l(10),o()(),s(11,"div",57)(12,"label",58),l(13,"Country:"),o(),s(14,"p"),l(15),o()(),s(16,"div",57)(17,"label",58),l(18,"Message:"),o(),s(19,"p",59),l(20),o()()()),i&2){let t=w();m(5),b(t.selectedFeedback.name),m(5),b(t.selectedFeedback.phone_number),m(5),b(t.selectedFeedback.country),m(5),b(t.selectedFeedback.message)}}function $J(i,n){if(i&1&&(s(0,"div",56)(1,"p"),l(2),o()()),i&2){let t=w();m(2),_(" Are you sure you want to delete this feedback from ",t.feedbackToDelete.name,"? ")}}var wF=(()=>{let n=class n{constructor(e,r,a,c){this.feedbackService=e,this.sidebarService=r,this.spinner=a,this.cognitoService=c,this.dataSource=[],this.filteredData=[],this.isLoading=!1,this.isAccountant=!1,this.isOfficeUser=!1,this.currentPage=1,this.pageSize=10,this.totalItems=0,this.totalPages=0,this.pages=[],this.currentSortColumn="",this.isAscending=!0,this.Math=Math,this.isCollapsed=!1,this.selectedFeedback=null,this.isAdmin=!0,this.feedbackToDelete=null,this.viewModal=null,this.deleteModal=null,this.modal=null}ngOnInit(){this.loadFeedbacks(),this.checkUserRole(),this.sidebarService.collapsed$.subscribe(a=>{this.isCollapsed=a});let e=document.getElementById("viewFeedbackModal");e&&(this.modal=new Zt(e));let r=document.getElementById("deleteFeedbackModal");r&&(this.deleteModal=new bootstrap.Modal(r))}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadFeedbacks(){this.spinner.show(),this.feedbackService.getFeedbacks().subscribe({next:e=>{this.filteredData=e.data,this.updatePagination(),this.applyPagination(),this.spinner.hide()},error:e=>{this.spinner.hide(),console.error("Error loading feedbacks:",e)}})}applyFilter(e){let r=e.target.value.toLowerCase().trim();r===""?this.loadFeedbacks():this.filteredData=this.dataSource.filter(a=>Object.keys(a).some(c=>String(a[c]).toLowerCase().includes(r))),this.currentPage=1,this.updatePagination(),this.applyPagination()}clearSearch(e){e.value="",this.loadFeedbacks()}sort(e){this.currentSortColumn===e?this.isAscending=!this.isAscending:(this.currentSortColumn=e,this.isAscending=!0),this.filteredData.sort((r,a)=>{let c=r[e],d=a[e];
23return typeof c=="string"&&typeof d=="string"?this.isAscending?c.localeCompare(d):d.localeCompare(c):this.isAscending?c<d?-1:1:d<c?-1:1}),this.applyPagination()}updatePagination(){this.totalItems=this.filteredData.length,this.totalPages=Math.ceil(this.totalItems/this.pageSize),this.pages=Array.from({length:this.totalPages},(e,r)=>r+1)}applyPagination(){let e=(this.currentPage-1)*this.pageSize,r=e+this.pageSize;this.dataSource=this.filteredData.slice(e,r)}onPageChange(e){e>=1&&e<=this.totalPages&&(this.currentPage=e,this.applyPagination())}onPageSizeChange(){this.currentPage=1,this.updatePagination(),this.applyPagination()}onEdit(e){console.log("Edit:",e)}onDeleteClick(e){console.log(e),this.feedbackToDelete=e,this.deleteModal&&this.deleteModal.show()}confirmDelete(){this.feedbackToDelete&&(this.spinner.show(),this.feedbackService.deleteFeedbacks(this.feedbackToDelete.id).pipe(xl(()=>this.spinner.hide())).subscribe({next:e=>{e.status==="success"?(this.deleteModal?.hide(),this.showAlert("success","Feedback deleted successfully!"),this.loadFeedbacks(),this.feedbackToDelete=null):this.showAlert("error","Failed to delete feedback. Please try again.")},error:e=>{console.error("Error deleting feedback:",e),this.showAlert("error","Failed to delete feedback. Please try again.")}}))}cancelDelete(){this.deleteModal?.hide(),this.feedbackToDelete=null}showAlert(e,r){let a=document.getElementById("alertPlaceholder");if(a){let c=document.createElement("div");c.innerHTML=[`<div class="alert alert-${e==="success"?"success":"danger"} alert-dismissible fade show" role="alert">`,` <div>${r}</div>`,' <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>',"</div>"].join(""),a.innerHTML="",a.append(c),setTimeout(()=>{bootstrap.Alert.getOrCreateInstance(c.querySelector(".alert")).close()},3e3)}}onView(e){this.selectedFeedback=e,this.modal?.show()}};n.\u0275fac=function(r){return new(r||n)(x(EF),x(ce),x(pe),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-feedbacks"]],standalone:!1,decls:92,vars:20,consts:[["searchInput",""],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],["id","alertPlaceholder",1,"position-fixed","top-0","end-0","p-3",2,"z-index","1050"],[1,"content"],[1,"container-fluid"],[1,"row"],[1,"col-md-12"],[1,"card"],[1,"card-body"],[1,"row","mb-3"],[1,"col-md-6"],[1,"input-group"],[1,"input-group-text","bg-white","border-end-0"],[1,"fas","fa-search","text-primary"],["type","text","placeholder","Search feedbacks...",1,"form-control","border-start-0",3,"keyup"],[1,"btn","btn-outline-secondary",3,"click"],[1,"col-md-2","ms-auto"],[1,"form-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"table-responsive"],[1,"table","table-hover"],[1,"text-primary"],[1,"cursor-pointer",3,"click"],[1,"fas","fa-sort","ms-1"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],["id","viewFeedbackModal","tabindex","-1","aria-labelledby","viewFeedbackModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
23-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","viewFeedbackModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["id","deleteFeedbackModal","tabindex","-1","aria-labelledby","deleteFeedbackModalLabel","aria-hidden","true",1,"modal","fade"],["id","deleteFeedbackModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-danger",3,"click","disabled"],[1,"text-truncate","d-inline-block",2,"max-width","300px"],["title","View Details",1,"btn","btn-info","btn-sm","me-2",3,"click"],[1,"fas","fa-eye"],["class","btn btn-danger btn-sm","title","Delete",3,"disabled","click",4,"ngIf"],["title","Delete",1,"btn","btn-danger","btn-sm",3,"click","disabled"],[1,"fas","fa-trash"],["colspan","6",1,"text-center","py-4"],[1,"fas","fa-inbox","fa-2x","mb-3","text-muted"],[1,"text-muted","mb-0"],[1,"page-link"],[1,"modal-body"],[1,"mb-3"],[1,"fw-bold"],[2,"white-space","pre-line"]],template:function(r,a){if(r&1){let c=he();s(0,"div",1)(1,"div",2)(2,"div")(3,"div",3),l(4,"Customer Feedbacks"),o()()(),B(5,"div",4),s(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"div",12)(14,"div",13)(15,"span",14),B(16,"i",15),o(),s(17,"input",16,0),S("keyup",function(u){return U(c),j(a.applyFilter(u))}),o(),s(19,"button",17),S("click",function(){U(c);let u=Qt(18);return j(a.clearSearch(u))}),l(20," Clear "),o()()(),s(21,"div",18)(22,"select",19),X("ngModelChange",function(u){return U(c),K(a.pageSize,u)||(a.pageSize=u),j(u)}),S("change",function(){return U(c),j(a.onPageSizeChange())}),s(23,"option",20),l(24,"5 rows"),o(),s(25,"option",20),l(26,"10 rows"),o(),s(27,"option",20),l(28,"25 rows"),o(),s(29,"option",20),l(30,"100 rows"),o()()()(),s(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th",24),S("click",function(){return U(c),j(a.sort("id"))}),l(36," ID "),B(37,"i",25),o(),s(38,"th",24),S("click",function(){return U(c),j(a.sort("name"))}),l(39," Name "),B(40,"i",25),o(),s(41,"th",24),S("click",function(){return U(c),j(a.sort("phone_number"))}),l(42," Phone Number "),B(43,"i",25),o(),s(44,"th",24),S("click",function(){return U(c),j(a.sort("country"))}),l(45," Country "),B(46,"i",25),o(),s(47,"th",24),S("click",function(){return U(c),j(a.sort("message"))}),l(48," Message "),B(49,"i",25),o(),s(50,"th",24),S("click",function(){return U(c),j(a.sort("created_at"))}),l(51," Date "),B(52,"i",25),o(),s(53,"th"),l(54,"Actions"),o()()(),s(55,"tbody"),T(56,jJ,20,9,"tr",26)(57,WJ,5,0,"tr",27),o()()(),s(58,"ul",28)(59,"li",29)(60,"button",30),S("click",function(){return U(c),j(a.onPageChange(a.currentPage-1))}),s(61,"span",31),l(62,"\xAB"),o()()(),T(63,HJ,3,3,"li",32),s(64,"li",29)(65,"button",30),S("click",function(){return U(c),j(a.onPageChange(a.currentPage+1))}),s(66,"span",31),l(67,"\xBB"),o()()()()()()()()()()(),s(68,"div",33)(69,"div",34)(70,"div",35)(71,"div",36)(72,"h5",37),l(73," Feedback Details "),o(),B(74,"button",38),o(),T(75,GJ,21,4,"div",39),s(76,"div",40)(77,"button",41),l(78," Close "),o()()()()(),s(79,"div",42)(80,"div",34)(81,"div",35)(82,"div",36)(83,"h5",43),l(84," Confirm Deletion "),o(),B(85,"button",38),o(),T(86,$J,3,1,"div",39),s(87,"div",40)(88,"button",44),S("click",function(){return U(c),j(a.cancelDelete())}),l(89," No, Cancel "),o(),s(90,"button",45),S("click",function(){return U(c),j(a.confirmDelete())}),l(91," Yes, Delete "),o()()()()()}r&2&&(p("ngClass",Z(18,VJ,a.isCollapsed)),m(22),q("ngModel",a.pageSize),m(),p("value",5),m(2),p("value",10),m(2),p("value",25),m(2),p("value",100),m(27),p("ngForOf",a.dataSource),m(),p("ngIf",a.dataSource.length===0),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages),m(10),p("ngIf",a.selectedFeedback),m(11),p("ngIf",a.feedbackToDelete),m(4),p("disabled",a.isAccountant||a.isOfficeUser))},dependencies:[ue,_e,Dt,Bt,Vt,Ot,Ne,Le,St],styles:["table[_ngcontent-%COMP%]{width:100%}.mat-form-field[_ngcontent-%COMP%]{font-size:14px;width:100%;margin-bottom:20px}.container-fluid[_ngcontent-%COMP%]{padding:30px 15px}.card-header-primary[_ngcontent-%COMP%]{background:linear-gradient(60deg,#ab47bc,#8e24aa);box-shadow:0 4px 20px #00000024,0 7px 10px -5px #9c27b066;color:#fff;padding:15px;border-radius:3px;margin:-20px 15px 0}.card-title[_ngcontent-%COMP%]{margin:0;font-size:1.5em;font-weight:300}.card-category[_ngcontent-%COMP%]{margin:0;color:#ffffff9e;font-size:14px}.card-body[_ngcontent-%COMP%]{padding:20px}.table-responsive[_ngcontent-%COMP%]{overflow-x:auto}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:hover{background-color:#0000000d}.page-link[_ngcontent-%COMP%], .cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}.card-header-primary[_ngcontent-%COMP%]{background:linear-gradient(60deg,#ab47bc,#8e24aa);box-shadow:0 4px 20px #00000024,0 7px 10px -5px #9c27b066;color:#fff;padding:15px;margin:-20px 15px 0;border-radius:3px}.card[_ngcontent-%COMP%]{margin-top:20px}.content[_ngcontent-%COMP%]{padding:30px 15px;min-height:calc(100vh - 123px)}.btn-danger[_ngcontent-%COMP%], .btn-danger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000!important}.btn-danger[_ngcontent-%COMP%]:hover, .btn-danger[_ngcontent-%COMP%]:focus, .btn-danger[_ngcontent-%COMP%]:active{background-color:#ff3e52!important;border-color:#ff3e52!important;color:#fff!important}.btn-danger[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%]{color:#fff!important}"]});let i=n;return i})();var DF="v1.0.0",Se={AMBER_SWING:6,PADDLE_BOAT:7,HORSE_RIDE:8,HERBAL_SHOP:9,LAKE_FRONT_REST:11,COFFEE_SHOP:10,ADVENTURE_PARK:3,HELMET:12,SOUVENIR_SHOP:2,HORSE_RIDING_STABLE:13,THE_STABLE:13,PHOTO_BOOTH:14,SANORA_RESTAURANT:15,GELATO_HEAVEN:17,IDIKADA_VILLAGE_RESTAURANT:10,HOSTEL_REST:[19,20],BLOVBURGERSHOP:21},Je={ADMIN:["Admin"],AMBER_SWING:["Admin","AmberSwing","Accountant","OfficeUser"],PADDLE_BOAT:["Admin","PaddleBoat","Accountant","OfficeUser"],HORSE_RIDE:["Admin","HorseRide","Accountant","OfficeUser"],HERBAL_SHOP:["Admin","HerbalShop","Accountant","OfficeUser"],GELATO_HEAVEN:["Admin","GelatoHeavan","Accountant","OfficeUser"],IDIKADA_VILLAGE_RESTAURANT:["Admin","IdikadaVillageRestaurant","Accountant","OfficeUser"],LAKE_FRONT_REST:["Admin","LakeFrontRest","Accountant","OfficeUser"],COFFEE_SHOP:["Admin","CoffeeShop","Accountant","OfficeUser"],HOSTEL_REST:["Admin","HostelRestaurant-JuiceBar","Accountant","OfficeUser"],HOSTEL_BOOKINGS:["Admin","Hostel","HostelStaff","Accountant","OfficeUser"],ADVENTURE_PARK:["Admin","AdventurePark","Accountant","OfficeUser"],ENTRANCE_TICKETING:["Admin","Ticketing","Accountant","OfficeUser"],PRE_SHOOT:["Admin","PhotoShoot","Accountant","OfficeUser"],TOUR_GUIDE:["Admin","TourGuide","Accountant","OfficeUser"],HELMET:["Admin","Helmet","Accountant","OfficeUser"],SOUVENIR_SHOP:["Admin","SouvenirShop","Accountant","OfficeUser"],SANORA_RESTAURANT:["Admin","SanoraRestaurant","Accountant","OfficeUser"],THE_STABLE:["Admin","TheStable","Accountant","OfficeUser"],AUDITORIUM:["Admin","Auditorium","Accountant","OfficeUser"],PHOTO_BOOTH:["Admin","PhotoBooth","Accountant","OfficeUser"],BLOVBURGERSHOP:["Admin","BLovBurgerShop","Accountant","OfficeUser"],ACCOUNTANT:["Accountant"],OFFICE_USER:["OfficeUser"],ANALYST:["Analyst"],MEDIA_CONTENT:["Admin","MediaPerson"],GUIDE_EXPENSE:["Admin","A
23ccountant"]},IF="Admin",q1="home",kF=["Analyst"],zJ=["Accountant","Ticketing","OfficeUser"],YJ=["edit-pric","daily-transaction-verif","link-guide","register-qr-code","manage-guides"],TF={Ticketing:["visitors-report-analytics","entrance-ticketing-report-analytics","tourguide-report-analytics"],PhotoShoot:["edit-pric","daily-transaction-verif"]},qJ={SiteManager:"OfficeUser"};function K1(i){return qJ[i]??i}function Rb(i,n){let t=[];return zJ.includes(i)&&t.push(...YJ),TF[i]&&t.push(...TF[i]),t.some(e=>n.includes(e))}var MF=[{value:"Admin",label:"Admin"},{value:"AmberSwing",label:"Amber Swing"},{value:"PaddleBoat",label:"Paddle Boat"},{value:"HorseRide",label:"Horse Ride"},{value:"HerbalShop",label:"Herbal Shop"},{value:"LakeFrontRest",label:"Lake Front Rest"},{value:"CoffeeShop",label:"View Cafe"},{value:"AdventurePark",label:"Adventure Park"},{value:"Ticketing",label:"Entrance Ticketing"},{value:"PhotoShoot",label:"PhotoShoot"},{value:"SouvenirShop",label:"Souvenir Shop"},{value:"Helmet",label:"Helmet"},{value:"TheStable",label:"The Stable"},{value:"Auditorium",label:"Auditorium"},{value:"PhotoBooth",label:"Photo Booth"},{value:"Accountant",label:"Accountant"},{value:"OfficeUser",label:"Office User"},{value:"Analyst",label:"Analyst"},{value:"SiteManager",label:"Site Manager"},{value:"MediaPerson",label:"Media Person"},{value:"SanoraRestaurant",label:"Sanora Restaurant"},{value:"GelatoHeavan",label:"Gelato Heaven"},{value:"IdikadaVillageRestaurant",label:"Idikada Village Restaurant"},{value:"HostelRestaurant-JuiceBar",label:"Hostel Restaurant & Juice Bar"},{value:"HostelStaff",label:"Altitude Ambuluwawa Staff"},{value:"Hostel",label:"Altitude Amuluwawa"},{value:"BLovBurgerShop",label:"B LOV Burger And More"}],AF=[{value:"null",label:"All"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}],PF=[{value:"null",label:"All"},{value:"onsite",label:"Onsite"},{value:"online-pay-at-gate",label:"Online Pay At Gate"},{value:"online-guide-paid",label:"Online Guide Paid"},{value:"onsite-guide",label:"Onsite Guide"},{value:"online-paid",label:"Online Paid"}],X1={vehicles:new Map([["Bike","\u{1F6B2}"],["Car","\u{1F697}"],["Bus","\u{1F68C}"],["Three Wheeler","\u{1F6FA}"],["Van","\u{1F690}"]])},ai=[{name:"January",number:1},{name:"February",number:2},{name:"March",number:3},{name:"April",number:4},{name:"May",number:5},{name:"June",number:6},{name:"July",number:7},{name:"August",number:8},{name:"September",number:9},{name:"October",number:10},{name:"November",number:11},{name:"December",number:12}],FF=[{id:1,name:"Central Province"},{id:2,name:"North Central Province"},{id:3,name:"Northern Province"},{id:4,name:"Eastern Province"},{id:5,name:"North Western Province"},{id:6,name:"Southern Province"},{id:7,name:"Uva Province"},{id:8,name:"Sabaragamuwa Province"},{id:9,name:"Western Province"}],$h={1:[{id:1,name:"Kandy"},{id:2,name:"Matale"},{id:3,name:"Nuwara Eliya"}],2:[{id:4,name:"Anuradhapura"},{id:5,name:"Polonnaruwa"}],3:[{id:6,name:"Jaffna"},{id:7,name:"Kilinochchi"},{id:8,name:"Mannar"},{id:9,name:"Vavuniya"},{id:10,name:"Mullativu"},{id:11,name:"Alambil"}],4:[{id:12,name:"Ampara"},{id:13,name:"Batticaloa"},{id:14,name:"Trincomalee"}],5:[{id:15,name:"Kurunegala"},{id:16,name:"Puttalam"}],6:[{id:17,name:"Galle"},{id:18,name:"Hambantota"},{id:19,name:"Matara"}],7:[{id:20,name:"Badulla"},{id:21,name:"Monaragala"}],8:[{id:22,name:"Kegalle"},{id:23,name:"Ratnapura"}],9:[{id:24,name:"Colombo"},{id:25,name:"Gampaha"},{id:26,name:"Kalutara"}]},zh=[{id:0,name:"All",countryCode:""},{id:212,name:"Sri Lanka",countryCode:"LK"},{id:102,name:"India",countryCode:"IN"},{id:47,name:"China",countryCode:"CN"},{id:237,name:"United States",countryCode:"US"},{id:1,name:"Afghanistan",countryCode:"AF"},{id:2,name:"\xC5land Islands",countryCode:"AX"},{id:3,name:"Albania",countryCode:"AL"},{id:4,name:"Algeria",countryCode:"DZ"},{id:5,name:"American Samoa",countryCode:"AS"},{id:6,name:"Andorra",countryCode:"AD"},{id:7,name:"Angola",countryCode:"AO"},{id:8,name:"Anguilla",countryCode:"AI"},{id:9,name:"Antarctica",countryCode:"AQ"},{id:10,name:"Antigua and Barbuda",countryCode:"AG"},{id:11,name:"Argentina",countryCode:"AR"},{id:12,name:"Armenia",countryCode:"AM"},{id:13,name:"Aruba",countryCode:"AW"},{id:14,name:"Australia",countryCode:"AU"},{id:15,name:"Austria",countryCode:"AT"},{id:16,name:"Azerbaijan",countryCode:"AZ"},{id:17,name:"Bahamas",countryCode:"BS"},{id:18,name:"Bahrain",countryCode:"BH"},{id:19,name:"Bangladesh",countryCode:"BD"},{id:20,name:"Barbados",countryCode:"BB"},{id:21,name:"Belarus",countryCode:"BY"},{id:22,name:"Belgium",countryCode:"BE"},{id:23,name:"Belize",countryCode:"BZ"},{id:24,name:"Benin",countryCode:"BJ"},{id:25,name:"Bermuda",countryCode:"BM"},{id:26,name:"Bhutan",countryCode:"BT"},{id:27,name:"Bolivia",countryCode:"BO"},{id:28,name:"Bosnia and Herzegovina",countryCode:"BA"},{id:29,name:"Botswana",countryCode:"BW"},{id:30,name:"Bouvet Island",countryCode:"BV"},{id:31,name:"Brazil",countryCode:"BR"},{id:32,name:"British Indian Ocean Territory",countryCode:"IO"},{id:33,name:"British Virgin Islands",countryCode:"VG"},{id:34,name:"Brunei",countryCode:"BN"},{id:35,name:"Bulgaria",countryCode:"BG"},{id:36,name:"Burkina Faso",countryCode:"BF"},{id:37,name:"Burundi",countryCode:"BI"},{id:38,name:"Cambodia",countryCode:"KH"},{id:39,name:"Cameroon",countryCode:"CM"},{id:40,name:"Canada",countryCode:"CA"},{id:41,name:"Cape Verde",countryCode:"CV"},{id:42,name:"Caribbean Netherlands",countryCode:"BQ"},{id:43,name:"Cayman Islands",countryCode:"KY"},{id:44,name:"Central African Republic",countryCode:"CF"},{id:45,name:"Chad",countryCode:"TD"},{id:46,name:"Chile",countryCode:"CL"},{id:48,name:"Christmas Island",countryCode:"CX"},{id:49,name:"Cocos (Keeling) Islands",countryCode:"CC"},{id:50,name:"Colombia",countryCode:"CO"},{id:51,name:"Comoros",countryCode:"KM"},{id:52,name:"Cook Islands",countryCode:"CK"},{id:53,name:"Costa Rica",countryCode:"CR"},{id:54,name:"Croatia",countryCode:"HR"},{id:55,name:"Cuba",countryCode:"CU"},{id:56,name:"Cura\xE7ao",countryCode:"CW"},{id:57,name:"Cyprus",countryCode:"CY"},{id:58,name:"Czechia",countryCode:"CZ"},{id:59,name:"Denmark",countryCode:"DK"},{id:60,name:"Djibouti",countryCode:"DJ"},{id:61,name:"Dominica",countryCode:"DM"},{id:62,name:"Dominican Republic",countryCode:"DO"},{id:63,name:"DR Congo",countryCode:"CD"},{id:64,name:"Ecuador",countryCode:"EC"},{id:65,name:"Egypt",countryCode:"EG"},{id:66,name:"El Salvador",countryCode:"SV"},{id:67,name:"Equatorial Guinea",countryCode:"GQ"},{id:68,name:"Eritrea",countryCode:"ER"},{id:69,name:"Estonia",countryCode:"EE"},{id:70,name:"Eswatini",countryCode:"SZ"},{id:71,name:"Ethiopia",countryCode:"ET"},{id:72,name:"Falkland Islands",countryCode:"FK"},{id:73,name:"Faroe Islands",countryCode:"FO"},{id:74,name:"Fiji",countryCode:"FJ"},{id:75,name:"Finland",countryCode:"FI"},{id:76,name:"France",countryCode:"FR"},{id:77,name:"French Guiana",countryCode:"GF"},{id:78,name:"French Polynesia",countryCode:"PF"},{id:79,name:"French Southern and Antarctic Lands",countryCode:"TF"},{id:80,name:"Gabon",countryCode:"GA"},{id:81,name:"Gambia",countryCode:"GM"},{id:82,name:"Georgia",countryCode:"GE"},{id:83,name:"Germany",countryCode:"DE"},{id:84,name:"Ghana",countryCode:"GH"},{id:85,name:"Gibraltar",countryCode:"GI"},{id:86,name:"Greece",countryCode:"GR"},{id:87,name:"Greenland",countryCode:"GL"},{id:88,name:"Grenada",countryCode:"GD"},{id:89,name:"Guadeloupe",countryCode:"GP"},{id:90,name:"Guam",countryCode:"GU"},{id:91,name:"Guatemala",countryCode:"GT"},{id:92,name:"Guernsey",countryCode:"GG"},{id:93,name:"Guinea",countryCode:"GN"},{id:94,name:"Guinea-Bissau",countryCode:"GW"},{id:95,name:"Guyana",countryCode:"GY"},{id:96,name:"Haiti",countryCode:"HT"},{id:97,name:"Heard Island and McDonald Islands",countryCode:"HM"},{id:98,name:"Honduras",countryCode:"HN"},{id:99,name:"Hong Kong",countryCode:"HK"},{id:100,name:"Hungary",countryCode:"HU"},{id:101,name:"Iceland",countryCode:"IS"},{id:102,name:"India",countryCode:"IN"},{id:103,name:"Indonesia",countryCode:"ID"},{id:104,name:"Iran",countryCode:"IR"},{id:105,name:"Iraq",countryCode:"IQ"},{id:106,name:"Ireland",countryCode:"IE"},{id:107,name:"Isle of Man",countryCode:"IM"},{id:108,name:"Israel",countryCode:"IL"},{id:109,name:"Italy",countryCode:"IT"},{id:110,name:"Ivory Coast",countryCode:"CI"},{id:111,name:"Jamaica",countryCode:"JM"},{id:112,name:"Japan",countryCode:"JP"},{id:113,name:"Jersey",countryCode:"JE"},{id:114,name:"Jordan",countryCode:"JO"},{id:115,name:"Kazakhstan",countryCode:"KZ"},{id:116,name:"Kenya",countryCode:"KE"},{id:117,name:"Kiribati",countryCode:"KI"},{id:118,name:"Korea, North",countryCode:"KP"},{id:119,name:"Korea, South",countryCode:"KR"},{id:120,name:"Kuwait",countryCode:"KW"},{id:121,name:"Kyrgyzstan",countryCode:"KG"},{id:122,name:"Laos",countryCode:"LA"},{id:123,name:"Latvia",countryCode:"LV"},{id:124,name:"Lebanon",countryCode:"LB"},{id:125,name:"Lesotho",countryCode:"LS"},{id:126,name:"Liberia",countryCode:"LR"},{id:127,name:"Libya",countryCode:"LY"},{id:128,name:"Liechtenstein",countryCode:"LI"},{id:129,name:"Lithuania",countryCode:"LT"},{id:130,name:"Luxembourg",countryCode:"LU"},{id:131,name:"Macau",countryCode:"MO"},{id:132,name:"Madagascar",countryCode:"MG"},{id:133,name:"Malawi",countryCode:"MW"},{id:134,name:"Malaysia",countryCode:"MY"},{id:135,name:"Maldives",countryCode:"MV"},{id:136,name:"Mali",countryCode:"ML"},{id:137,name:"Malta",countryCode:"MT"},{id:138,name:"Marshall Islands",countryCode:"MH"},{id:139,name:"Martinique",countryCode:"MQ"},{id:140,name:"Mauritania",countryCode:"MR"},{id:141,name:"Mauritius",countryCode:"MU"},{id:142,name:"Mayotte",countryCode:"YT"},{id:143,name:"Mexico",countryCode:"MX"},{id:144,name:"Micronesia",countryCode:"FM"},{id:145,name:"Moldova",countryCode:"MD"}
23,{id:146,name:"Monaco",countryCode:"MC"},{id:147,name:"Mongolia",countryCode:"MN"},{id:148,name:"Montenegro",countryCode:"ME"},{id:149,name:"Montserrat",countryCode:"MS"},{id:150,name:"Morocco",countryCode:"MA"},{id:151,name:"Mozambique",countryCode:"MZ"},{id:152,name:"Myanmar",countryCode:"MM"},{id:153,name:"Namibia",countryCode:"NA"},{id:154,name:"Nauru",countryCode:"NR"},{id:155,name:"Nepal",countryCode:"NP"},{id:156,name:"Netherlands",countryCode:"NL"},{id:157,name:"New Caledonia",countryCode:"NC"},{id:158,name:"New Zealand",countryCode:"NZ"},{id:159,name:"Nicaragua",countryCode:"NI"},{id:160,name:"Niger",countryCode:"NE"},{id:161,name:"Nigeria",countryCode:"NG"},{id:162,name:"Niue",countryCode:"NU"},{id:163,name:"Norfolk Island",countryCode:"NF"},{id:164,name:"North Macedonia",countryCode:"MK"},{id:165,name:"Northern Mariana Islands",countryCode:"MP"},{id:166,name:"Norway",countryCode:"NO"},{id:167,name:"Oman",countryCode:"OM"},{id:168,name:"Pakistan",countryCode:"PK"},{id:169,name:"Palau",countryCode:"PW"},{id:170,name:"Panama",countryCode:"PA"},{id:171,name:"Papua New Guinea",countryCode:"PG"},{id:172,name:"Paraguay",countryCode:"PY"},{id:173,name:"Peru",countryCode:"PE"},{id:174,name:"Philippines",countryCode:"PH"},{id:175,name:"Pitcairn Islands",countryCode:"PN"},{id:176,name:"Poland",countryCode:"PL"},{id:177,name:"Portugal",countryCode:"PT"},{id:178,name:"Puerto Rico",countryCode:"PR"},{id:179,name:"Qatar",countryCode:"QA"},{id:180,name:"R\xE9union",countryCode:"RE"},{id:181,name:"Romania",countryCode:"RO"},{id:182,name:"Russia",countryCode:"RU"},{id:183,name:"Rwanda",countryCode:"RW"},{id:184,name:"Saint Barth\xE9lemy",countryCode:"BL"},{id:185,name:"Saint Helena, Ascension and Tristan da Cunha",countryCode:"SH"},{id:186,name:"Saint Kitts and Nevis",countryCode:"KN"},{id:187,name:"Saint Lucia",countryCode:"LC"},{id:188,name:"Saint Martin",countryCode:"MF"},{id:189,name:"Saint Pierre and Miquelon",countryCode:"PM"},{id:190,name:"Saint Vincent and the Grenadines",countryCode:"VC"},{id:191,name:"Samoa",countryCode:"WS"},{id:192,name:"San Marino",countryCode:"SM"},{id:193,name:"Sao Tome and Principe",countryCode:"ST"},{id:194,name:"Saudi Arabia",countryCode:"SA"},{id:195,name:"Senegal",countryCode:"SN"},{id:196,name:"Serbia",countryCode:"RS"},{id:197,name:"Seychelles",countryCode:"SC"},{id:198,name:"Sierra Leone",countryCode:"SL"},{id:199,name:"Singapore",countryCode:"SG"},{id:200,name:"Sint Maarten",countryCode:"SX"},{id:201,name:"Slovakia",countryCode:"SK"},{id:202,name:"Slovenia",countryCode:"SI"},{id:203,name:"Solomon Islands",countryCode:"SB"},{id:204,name:"Somalia",countryCode:"SO"},{id:205,name:"South Africa",countryCode:"ZA"},{id:206,name:"South Georgia and the South Sandwich Islands",countryCode:"GS"},{id:207,name:"South Sudan",countryCode:"SS"},{id:208,name:"Spain",countryCode:"ES"},{id:209,name:"Sri Lanka",countryCode:"LK"},{id:210,name:"Sudan",countryCode:"SD"},{id:211,name:"Suriname",countryCode:"SR"},{id:212,name:"Svalbard",countryCode:"SJ"},{id:213,name:"Sweden",countryCode:"SE"},{id:214,name:"Switzerland",countryCode:"CH"},{id:215,name:"Syria",countryCode:"SY"},{id:216,name:"Taiwan",countryCode:"TW"},{id:217,name:"Tajikistan",countryCode:"TJ"},{id:218,name:"Tanzania",countryCode:"TZ"},{id:219,name:"Thailand",countryCode:"TH"},{id:220,name:"Timor-Leste",countryCode:"TL"},{id:221,name:"Togo",countryCode:"TG"},{id:222,name:"Tokelau",countryCode:"TK"},{id:223,name:"Tonga",countryCode:"TO"},{id:224,name:"Trinidad and Tobago",countryCode:"TT"},{id:225,name:"Tunisia",countryCode:"TN"},{id:226,name:"Turkey",countryCode:"TR"},{id:227,name:"Turkmenistan",countryCode:"TM"},{id:228,name:"Tuvalu",countryCode:"TV"},{id:229,name:"Uganda",countryCode:"UG"},{id:230,name:"Ukraine",countryCode:"UA"},{id:231,name:"United Arab Emirates",countryCode:"AE"},{id:232,name:"United Kingdom",countryCode:"GB"},{id:233,name:"United States",countryCode:"US"},{id:234,name:"Uruguay",countryCode:"UY"},{id:235,name:"Uzbekistan",countryCode:"UZ"},{id:236,name:"Vanuatu",countryCode:"VU"},{id:237,name:"Vatican City",countryCode:"VA"},{id:238,name:"Venezuela",countryCode:"VE"},{id:239,name:"Vietnam",countryCode:"VN"},{id:240,name:"Western Sahara",countryCode:"EH"},{id:241,name:"Yemen",countryCode:"YE"},{id:242,name:"Zambia",countryCode:"ZM"},{id:243,name:"Zimbabwe",countryCode:"ZW"}];var Be=(()=>{let n=class n{transform(e,r=!1){if(isNaN(e))return"";let c=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!0}).format(Math.floor(e));return r?`${c}.00`:c}};n.\u0275fac=function(r){return new(r||n)},n.\u0275pipe=Cm({name:"currencyFormat",type:n,pure:!0,standalone:!1});let i=n;return i})();var J1=class{_attachedHost;attach(n){return this._attachedHost=n,n.attach(this)}detach(){let n=this._attachedHost;n!=null&&(this._attachedHost=null,n.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},Zm=class extends J1{component;viewContainerRef;injector;projectableNodes;constructor(n,t,e,r){super(),this.component=n,this.viewContainerRef
vendor: 4,648 bytes, line 23
23=t,this.injector=e,this.projectableNodes=r}},k0=class extends J1{templateRef;viewContainerRef;context;injector;constructor(n,t,e,r){super(),this.templateRef=n,this.viewContainerRef=t,this.context=e,this.injector=r}get origin(){return this.templateRef.elementRef}attach(n,t=this.context){return this.context=t,super.attach(n)}detach(){return this.context=void 0,super.detach()}},lT=class extends J1{element;constructor(n){super(),this.element=n instanceof Ai?n.nativeElement:n}},Yh=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(n){if(n instanceof Zm)return this._attachedPortal=n,this.attachComponentPortal(n);if(n instanceof k0)return this._attachedPortal=n,this.attachTemplatePortal(n);if(this.attachDomPortal&&n instanceof lT)return this._attachedPortal=n,this.attachDomPortal(n)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(n){this._disposeFn=n}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Ob=class extends Yh{outletElement;_appRef;_defaultInjector;constructor(n,t,e){super(),this.outletElement=n,this._appRef=t,this._defaultInjector=e}attachComponentPortal(n){let t;if(n.viewContainerRef){let e=n.injector||n.viewContainerRef.injector,r=e.get(L_,null,{optional:!0})||void 0;t=n.viewContainerRef.createComponent(n.component,{index:n.viewContainerRef.length,injector:e,ngModuleRef:r,projectableNodes:n.projectableNodes||void 0}),this.setDisposeFn(()=>t.destroy())}else{let e=this._appRef,r=n.injector||this._defaultInjector||rn.NULL,a=r.get(Go,e.injector);t=$_(n.component,{elementInjector:r,environmentInjector:a,projectableNodes:n.projectableNodes||void 0}),e.attachView(t.hostView),this.setDisposeFn(()=>{e.viewCount>0&&e.detachView(t.hostView),t.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(t)),this._attachedPortal=n,t}attachTemplatePortal(n){let t=n.viewContainerRef,e=t.createEmbeddedView(n.templateRef,n.context,{injector:n.injector});return e.rootNodes.forEach(r=>this.outletElement.appendChild(r)),e.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(e);r!==-1&&t.remove(r)}),this._attachedPortal=n,e}attachDomPortal=n=>{let t=n.element;t.parentNode;let e=this.outletElement.ownerDocument.createComment("dom-portal");t.parentNode.insertBefore(e,t),this.outletElement.appendChild(t),this._attachedPortal=n,super.setDisposeFn(()=>{e.parentNode&&e.parentNode.replaceChild(t,e)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(n){return n.hostView.rootNodes[0]}};var Z1=(()=>{class i extends Yh{_moduleRef=fe(L_,{optional:!0});_document=fe(Vi);_viewContainerRef=fe(Ks);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t||null)}attached=new xn;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(t){t.setAttachedHost(this);let e=t.viewContainerRef!=null?t.viewContainerRef:this._viewContainerRef,r=e.createComponent(t.component,{index:e.length,injector:t.injector||e.injector,projectableNodes:t.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return e!==this._viewContainerRef&&this._getRootNode().appendChild(r.hostView.rootNodes[0]),super.setDisposeFn(()=>r.destroy()),this._attachedPortal=t,this._attachedRef=r,this.attached.emit(r),r}attachTemplatePortal(t){t.setAttachedHost(this);let e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}attachDomPortal=t=>{let e=t.element;e.parentNode;let r=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(r,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{r.parentNode&&r.parentNode.replaceChild(e,r)})};_getRootNode(){let t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[lr]})}return i})();var M0=(()=>
23{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})();function Q1(i){return i.buttons===0||i.detail===0}function ev(i){let n=i.touches&&i.touches[0]||i.changedTouches&&i.changedTouches[0];return!!n&&n.identifier===-1&&(n.radiusX==null||n.radiusX===1)&&(n.radiusY==null||n.radiusY===1)}var cT;function RF(){if(cT==null){let i=typeof document<"u"?document.head:null;cT=!!(i&&(i.createShadowRoot||i.attachShadow))}return cT}function dT(i){if(RF()){let n=i.getRootNode?i.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&n instanceof ShadowRoot)return n}return null}function tv(){let i=typeof document<"u"&&document?document.activeElement:null;for(;i&&i.shadowRoot;){let n=i.shadowRoot.activeElement;if(n===i)break;i=n}return i}function es(i){return i.composedPath?i.composedPath()[0]:i.target}var mT;try{mT=typeof Intl<"u"&&Intl.v8BreakIterator}catch{mT=!1}var $n=(()=>{class i{_platformId=fe(Fu);isBrowser=this._platformId?u5(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||mT)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var iv;function OF(){if(iv==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>iv=!0}))}finally{iv=iv||!1}return iv}function Qm(i){return OF()?i:!!i.capture}function Gd(i,n=0){return NF(i)?Number(i):arguments.length===2?n:0}function NF(i){return!isNaN(parseFloat(i))&&!isNaN(Number(i))}function al(i){return i instanceof Ai?i.nativeElement:i}var LF=new Gt("cdk-input-modality-detector-options"),BF={ignoreKeys:[18,17,224,91,16]},VF=650,uT={passive:!0,capture:!0},UF=(()=>{class i{_platform=fe($n);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new da(null);_options;_lastTouchMs=0;_onKeydown=t=>{this._options?.ignoreKeys?.some(e=>e===t.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=es(t))};_onMousedown=t=>{Date.now()-this._lastTouchMs<VF||(this._modality.next(Q1(t)?"keyboard":"mouse"),this._mostRecentTarget=es(t))};_onTouchstart=t=>{if(ev(t)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=es(t)};constructor(){let t=fe(Ri),e=fe(Vi),r=fe(LF,{optional:!0});if(this._options=le(le({},BF),r),this.modalityDetected=this._modality.pipe(F_(1)),this.modalityChanged=this.modalityDetected.pipe(Yx()),this._platform.isBrowser){let a=fe(Va).createRenderer(null,null);this._listenerCleanups=t.runOutsideAngular(()=>[a.listen(e,"keydown",this._onKeydown,uT),a.listen(e,"mousedown",this._onMousedown,uT),a.listen(e,"touchstart",this._onTouchstart,uT)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(t=>t())}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),nv=function(i){return i[i.IMMEDIATE=0]="IMMEDIATE",i[i.EVENTUAL=1]="EVENTUAL",i}(nv||{}),jF=new Gt("cdk-focus-monitor-default-options"),Nb=Qm({passive:!0,capture:!0}),A0=(()=>{class i{_ngZone=fe(Ri);_platform=fe($n);_inputModalityDetector=fe(UF);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=fe(Vi);_stopInputModalityDetector=new ci;constructor(){let t=fe(jF,{optional:!0});this._detectionMode=t?.detectionMode||nv.IMMEDIATE}_rootNodeFocusAndBlurListener=t=>{let e=es(t);for(let r=e;r;r=r.parentElement)t.type==="focus"?this._onFocus(t,r):this._onBlur(t,r)};monitor(t,e=!1){let r=al(t);if(!this._platform.isBrowser||r.nodeType!==1)return Fi();let a=dT(r)||this._document,c=this._elementInfo.get(r);if(c)return e&&(c.checkChildren=!0),c.subject;
vendor: 4,347 bytes, line 23
23let d={checkChildren:e,subject:new ci,rootNode:a};return this._elementInfo.set(r,d),this._registerGlobalListeners(d),d.subject}stopMonitoring(t){let e=al(t),r=this._elementInfo.get(e);r&&(r.subject.complete(),this._setClasses(e),this._elementInfo.delete(e),this._removeGlobalListeners(r))}focusVia(t,e,r){let a=al(t),c=this._document.activeElement;a===c?this._getClosestElementsInfo(a).forEach(([d,u])=>this._originChanged(d,e,u)):(this._setOrigin(e),typeof a.focus=="function"&&a.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,e)=>this.stopMonitoring(e))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===nv.EVENTUAL||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,e){t.classList.toggle("cdk-focused",!!e),t.classList.toggle("cdk-touch-focused",e==="touch"),t.classList.toggle("cdk-keyboard-focused",e==="keyboard"),t.classList.toggle("cdk-mouse-focused",e==="mouse"),t.classList.toggle("cdk-program-focused",e==="program")}_setOrigin(t,e=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=t,this._originFromTouchInteraction=t==="touch"&&e,this._detectionMode===nv.IMMEDIATE){clearTimeout(this._originTimeoutId);let r=this._originFromTouchInteraction?VF:1;this._originTimeoutId=setTimeout(()=>this._origin=null,r)}})}_onFocus(t,e){let r=this._elementInfo.get(e),a=es(t);!r||!r.checkChildren&&e!==a||this._originChanged(e,this._getFocusOrigin(a),r)}_onBlur(t,e){let r=this._elementInfo.get(e);!r||r.checkChildren&&t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(this._setClasses(e),this._emitOrigin(r,null))}_emitOrigin(t,e){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(e))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;let e=t.rootNode,r=this._rootNodeFocusListenerCount.get(e)||0;r||this._ngZone.runOutsideAngular(()=>{e.addEventListener("focus",this._rootNodeFocusAndBlurListener,Nb),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,Nb)}),this._rootNodeFocusListenerCount.set(e,r+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(gr(this._stopInputModalityDetector)).subscribe(a=>{this._setOrigin(a,!0)}))}_removeGlobalListeners(t){let e=t.rootNode;if(this._rootNodeFocusListenerCount.has(e)){let r=this._rootNodeFocusListenerCount.get(e);r>1?this._rootNodeFocusListenerCount.set(e,r-1):(e.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Nb),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Nb),this._rootNodeFocusListenerCount.delete(e))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,e,r){this._setClasses(t,e),this._emitOrigin(r,e),this._lastFocusOrigin=e}_getClosestElementsInfo(t){let e=[];return this._elementInfo.forEach((r,a)=>{(a===t||r.checkChildren&&a.contains(t))&&e.push([a,r])}),e}_isLastInteractionFromInputLabel(t){let{_mostRecentTarget:e,mostRecentModality:r}=this._inputModalityDetector;if(r!=="mouse"||!e||e===t||t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"||t.disabled)return!1;let a=t.labels;if(a){for(let c=0;c<a.length;c++)if(a[c].contains(e))return!0}return!1}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Lb=new WeakMap,To=(()=>{class i{_appRef;_injector=fe(rn);_environmentInjector=fe(Go);load(t){let e=this._appRef=this._appRef||this._injector.get(gs),r=Lb.get(e);r||(r={loaders:new Set,refs:[]},Lb.set(e,r),e.onDestroy(()=>{Lb.get(e)?.refs.forEach(a=>a.destroy()),Lb.delete(e)})),r.loaders.has(t)||(r.loaders.add(t),r.refs.push($_(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var qh=(()=>
23{class i{static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(e,r){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0} 24`],encapsulation:2,changeDetection:0})}return i})();function Kh(i){return Array.isArray(i)?i:[i]}var WF=new Set,P0,Bb=(()=>{class i{_platform=fe($n);_nonce=fe(hg,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):XJ}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&KJ(t,this._nonce),this._matchMedia(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function KJ(i,n){if(!WF.has(i))try{P0||(P0=document.createElement("style"),n&&P0.setAttribute("nonce",n),P0.setAttribute("type","text/css"),document.head.appendChild(P0)),P0.sheet&&(P0.sheet.insertRule(`@media ${i} {body{ }}`,0),WF.add(i))}catch(t){console.error(t)}}function XJ(i){return{matches:i==="all"||i==="",media:i,addListener:()=>{},removeListener:()=>{}}}var pT=(()=>{class i{_mediaMatcher=fe(Bb);_zone=fe(Ri);_queries=new Map;_destroySubject=new ci;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return HF(Kh(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let r=HF(Kh(t)).map(c=>this._registerQuery(c).observable),a=Up(r);return a=M_(a.pipe(xo(1)),a.pipe(F_(1),P_(0))),a.pipe(Ki(c=>{let d={matches:!1,breakpoints:{}};return c.forEach(({matches:u,query:h})=>{d.matches=d.matches||u,d.breakpoints[h]=u}),d}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);let e=this._mediaMatcher.matchMedia(t),a={observable:new za(c=>{let d=u=>this._zone.run(()=>c.next(u));return e.addListener(d),()=>{e.removeListener(d)}}).pipe(hs(e),Ki(({matches:c})=>({query:t,matches:c})),gr(this._destroySubject)),mql:e};return this._queries.set(t,a),a}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function HF(i){return i.map(n=>n.split(",")).reduce((n,t)=>n.concat(t)).map(n=>n.trim())}var JJ=(()=>{class i{create(t){return typeof MutationObserver>"u"?null:new MutationObserver(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Vb=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[JJ]})}return i})();var gT=(()=>{class i{_platform=fe($n);constructor(){}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return QJ(t)&&getComputedStyle(t).visibility==="visible"}isTabbable(t){if(!this._platform.isBrowser)return!1;let e=ZJ(sZ(t));if(e&&(GF(e)===-1||!this.isVisible(e)))return!1;let r=t.nodeName.toLowerCase(),a=GF(t);return t.hasAttribute("contenteditable")?a!==-1:r==="iframe"||r==="object"||this._platform.WEBKIT&&this._platform.IOS&&!aZ(t)?!1:r==="audio"?t.hasAttribute("controls")?a!==-1:!1:r==="video"?a===-1?!1:a!==null?!0:this._platform.FIREFOX||t.hasAttribute("controls"):t.tabIndex>=0}isFocusable(t,e){return oZ(t)&&!this.isDisabled(t)&&(e?.ignoreVisibility||this.isVisible(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ZJ(i){try{return i.frameElement}catch{return null}}function QJ(i){return!!(i.offsetWidth||i.offsetHeight||typeof i.getClientRects=="function"&&i.getClientRects().length)}function eZ(i){let n=i.nodeName.toLowerCase();return n==="input"||n==="select"||n==="button"||n==="textarea"}function tZ(i){return nZ(i)&&i.type=="hidden"}function iZ(i){return rZ(i)&&i.hasAttribute("href")}function nZ(i){return i.nodeName.toLowerCase()=="input"}function rZ(i){return i.nodeName.toLowerCase()=="a"}function YF(i){if(!i.hasAttribute("tabindex")||i.tabIndex===void 0)return!1;let n=i.getAttribute("tabindex");return!!(n&&!isNaN(parseInt(n,10)))}function GF(i){if(!YF(i))return null;let n=parseInt(i.getAttribute("tabindex")||"",10);return isNaN(n)?-1:n}function aZ(i){let n=i.nodeName.toLowerCase(),t=n==="input"&&i.type;return t==="text"||t==="password"||n==="select"||n==="textarea"}function oZ(i){return tZ(i)?!1:eZ(i)||iZ(i)||i.hasAttribute("contenteditable")||YF(i)}function sZ(i){return i.ownerDocument&&i.ownerDocument.defaultView||window}var fT=class{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(n){this._enabled=n,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(n,this._startAnchor),this._toggleAnchorTabIndex(n,this._endAnchor))}_enabled=!0;constructor(n,t,e,r,a=!1,c){this._element=n,this._checker=t,this._ngZone=e,this._document=r,this._injector=c,a||this.attachAnchors()}destroy(){let n=this._startAnchor,t=this._endAnchor;n&&(n.removeEventListener("focus",this.startAnchorListener),n.remove()),t&&(t.removeEventListener("focus",this.endAnchorListener),t.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return this._hasAttached?!0:(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(n){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(n)))})}focusFirstTabbableElementWhenReady(n){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(n)))})}focusLastTabbableElementWhenReady(n){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(n)))})}_getRegionBoundary(n){let t=this._element.querySelectorAll(`[cdk-focus-region-${n}], [cdkFocusRegion${n}], [cdk-focus-${n}]`);return n=="start"?t.length?t[0]:this._getFirstTabbableElement(this._element):t.length?t[t.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(n){let t=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(t){if(!this._checker.isFocusable(t)){let e=this._getFirstTabbableElement(t);return e?.focus(n),!!e}return t.focus(n),!0}return this.focusFirstTabbableElement(n)}focusFirstTabbableElement(n){let t=this._getRegionBoundary("start");return t&&t.focus(n),!!t}focusLastTabbableElement(n){let t=this._getRegionBoundary("end");return t&&t.focus(n),!!t}hasAttached(){return this._hasAttached}_getFirstTabbableElement(n){if(this._checker.isFocusable(n)&&this._checker.isTabbable(n))return n;let t=n.children;for(let e=0;e<t.length;e++){let r=t[e].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(t[e]):null;if(r)return r}return null}_getLastTabbableElement(n){if(this._checker.isFocusable(n)&&this._checker.isTabbable(n))return n;let t=n.children;for(let e=t.length-1;e>=0;e--){let r=t[e].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[e]):null;if(r)return r}return null}_createAnchor(){let n=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,n),n.classList.add("cdk-visually-hidden"),n.classList.add("cdk-focus-trap-anchor"),n.setAttribute("aria-hidden","true"),n}_toggleAnchorTabIndex(n,t){n?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(n){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(n,this._startAnchor),this._toggleAnchorTabIndex(n,this._endAnchor))}_executeOnStable(n){this._injector?$o(n,{injector:this._injector}):setTimeout(n)}},vT=(()=>{class i{_checker=fe(gT);_ngZone=fe(Ri);_document=fe(Vi);_injector=fe(rn);constructor(){fe(To).load(qh)}create(t,e=!1){return new fT(t,this._checker,this._ngZone,this._document,e,this._injector)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var qF=new Gt("liveAnnouncerElement",{providedIn:"root",factory:KF});function KF(){return null}var XF=new Gt("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),lZ=0,_T=(()=>{class i{_ngZone=fe(Ri);_defaultOptions=fe(XF,{optional:!0});_liveElement;_document=fe(Vi);_previousTimeout;_currentPromise;_currentResolve;constructor(){let t=fe(qF,{optional:!0});this._liveElement=t||this._createLiveElement()}announce(t,...e){let r=this._defaultOptions,a,c;return e.length===1&&typeof e[0]=="number"?c=e[0]:[a,c]=e,this.clear(),clearTimeout(this._previousTimeout),a||(a=r&&r.politeness?r.politeness:"polite"),c==null&&r&&(c=r.duration),this._liveElement.setAttribute("aria-live",a),this._liveElement.id&&this._exposeAnnouncerToModals(this._liveElement.id),this._ngZone.runOutsideAngular(()=>(this._currentPromise||(this._currentPromise=new Promise(d=>this._currentResolve=d)),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,typeof c=="number"&&(this._previousTimeout=setTimeout(()=>this.clear(),c)),this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0},100),this._currentPromise))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){let t="cdk-live-announcer-element",e=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let a=0;a<e.length;a++)e[a].remove();return r.classList.add(t),r.classList.add("cdk-visually-hidden"),r.setAttribute("aria-atomic","true"),r.setAttribute("aria-live","polite"),r.id=`cdk-live-announcer-${lZ++}`,this._document.body.appendChild(r),r}_exposeAnnouncerToModals(t){let e=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let r=0;r<e.length;r++){let a=e[r],c=a.getAttribute("aria-owns");c?c.indexOf(t)===-1&&a.setAttribute("aria-owns",c+" "+t):a.setAttribute("aria-owns",t)}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var eu=function(i){return i[i.NONE=0]="NONE",i[i.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",i[i.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",i}(eu||{}),$F="cdk-high-contrast-black-on-white",zF="cdk-high-contrast-white-on-black",hT="cdk-high-contrast-active",Ub=(()=>{class i{_platform=fe($n);_hasCheckedHighContrastMode;_document=fe(Vi);_breakpointSubscription;constructor(){this._breakpointSubscription=fe(pT).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasse
24s())})}getHighContrastMode(){if(!this._platform.isBrowser)return eu.NONE;let t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);let e=this._document.defaultView||window,r=e&&e.getComputedStyle?e.getComputedStyle(t):null,a=(r&&r.backgroundColor||"").replace(/ /g,"");switch(t.remove(),a){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return eu.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return eu.BLACK_ON_WHITE}return eu.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let t=this._document.body.classList;t.remove(hT,$F,zF),this._hasCheckedHighContrastMode=!0;let e=this.getHighContrastMode();e===eu.BLACK_ON_WHITE?t.add(hT,$F):e===eu.WHITE_ON_BLACK&&t.add(hT,zF)}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),rv=(()=>{class i{constructor(){fe(Ub)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Vb]})}return i})();function Do(i,...n){return n.length?n.some(t=>i[t]):i.altKey||i.shiftKey||i.ctrlKey||i.metaKey}function yT(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function pa(i){return i==null?"":typeof i=="string"?i:`${i}px`}var cZ=new Gt("cdk-dir-doc",{providedIn:"root",factory:dZ});function dZ(){return fe(Vi)}var mZ=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function JF(i){let n=i?.toLowerCase()||"";return n==="auto"&&typeof navigator<"u"&&navigator?.language?mZ.test(navigator.language)?"rtl":"ltr":n==="rtl"?"rtl":"ltr"}var ts=(()=>{class i{get value(){return this.valueSignal()}valueSignal=vr("ltr");change=new xn;constructor(){let t=fe(cZ,{optional:!0});if(t){let e=t.body?t.body.dir:null,r=t.documentElement?t.documentElement.dir:null;this.valueSignal.set(JF(e||r||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var pc=function(i){return i[i.NORMAL=0]="NORMAL",i[i.NEGATED=1]="NEGATED",i[i.INVERTED=2]="INVERTED",i}(pc||{}),jb,F0;function Wb(){if(F0==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return F0=!1,F0;if("scrollBehavior"in document.documentElement.style)F0=!0;else{let i=Element.prototype.scrollTo;i?F0=!/\{\s*\[native code\]\s*\}/.test(i.toString()):F0=!1}}return F0}function Xh(){if(typeof document!="object"||!document)return pc.NORMAL;if(jb==null){let i=document.createElement("div"),n=i.style;i.dir="rtl",n.width="1px",n.overflow="auto",n.visibility="hidden",n.pointerEvents="none",n.position="absolute";let t=document.createElement("div"),e=t.style;
vendor: 62,498 bytes, lines 24-26
24e.width="2px",e.height="1px",i.appendChild(t),document.body.appendChild(i),jb=pc.NORMAL,i.scrollLeft===0&&(i.scrollLeft=1,jb=i.scrollLeft===0?pc.NEGATED:pc.INVERTED),i.remove()}return jb}var tu=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})();var uZ=20,O0=(()=>{class i{_ngZone=fe(Ri);_platform=fe($n);_renderer=fe(Va).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new ci;_scrolledCount=0;scrollContainers=new Map;register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=uZ){return this._platform.isBrowser?new za(e=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let r=t>0?this._scrolled.pipe($x(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):Fi()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((t,e)=>this.deregister(e)),this._scrolled.complete()}ancestorScrolled(t,e){let r=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(Vn(a=>!a||r.indexOf(a)>-1))}getAncestorScrollContainers(t){let e=[];return this.scrollContainers.forEach((r,a)=>{this._scrollableContainsElement(a,t)&&e.push(a)}),e}_scrollableContainsElement(t,e){let r=al(e),a=t.getElementRef().nativeElement;do if(r==a)return!0;while(r=r.parentElement);return!1}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),ST=(()=>{class i{elementRef=fe(Ai);scrollDispatcher=fe(O0);ngZone=fe(Ri);dir=fe(ts,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new ci;_renderer=fe(qn);_cleanupScroll;_elementScrolled=new ci;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",t=>this._elementScrolled.next(t))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(t){let e=this.elementRef.nativeElement,r=this.dir&&this.dir.value=="rtl";t.left==null&&(t.left=r?t.end:t.start),t.right==null&&(t.right=r?t.start:t.end),t.bottom!=null&&(t.top=e.scrollHeight-e.clientHeight-t.bottom),r&&Xh()!=pc.NORMAL?(t.left!=null&&(t.right=e.scrollWidth-e.clientWidth-t.left),Xh()==pc.INVERTED?t.left=t.right:Xh()==pc.NEGATED&&(t.left=t.right?-t.right:t.right)):t.right!=null&&(t.left=e.scrollWidth-e.clientWidth-t.right),this._applyScrollToOptions(t)}_applyScrollToOptions(t){let e=this.elementRef.nativeElement;Wb()?e.scrollTo(t):(t.top!=null&&(e.scrollTop=t.top),t.left!=null&&(e.scrollLeft=t.left))}measureScrollOffset(t){let e="left",r="right",a=this.elementRef.nativeElement;if(t=="top")return a.scrollTop;if(t=="bottom")return a.scrollHeight-a.clientHeight-a.scrollTop;let c=this.dir&&this.dir.value=="rtl";return t=="start"?t=c?r:e:t=="end"&&(t=c?e:r),c&&Xh()==pc.INVERTED?t==e?a.scrollWidth-a.clientWidth-a.scrollLeft:a.scrollLeft:c&&Xh()==pc.NEGATED?t==e?a.scrollLeft+a.scrollWidth-a.clientWidth:-a.scrollLeft:t==e?a.scrollLeft:a.scrollWidth-a.clientWidth-a.scrollLeft}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return i})(),pZ=20,$d=(()=>{class i{_platform=fe($n);_listeners;_viewportSize;_change=new ci;_document=fe(Vi);constructor(){let t=fe(Ri),e=fe(Va).createRenderer(null,null);t.runOutsideAngular(()=>{if(this._platform.isBrowser){let r=a=>this._change.next(a);this._listeners=[e.listen("window","resize",r),e.listen("window","orientationchange",r)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(t=>t()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let t=this.getViewportScrollPosition(),{width:e,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+e,height:r,width:e}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let t=this._document,e=this._getWindow(),r=t.documentElement,a=r.getBoundingClientRect(),c=-a.top||t.body.scrollTop||e.scrollY||r.scrollTop||0,d=-a.left||t.body.scrollLeft||e.scrollX||r.scrollLeft||0;return{top:c,left:d}}change(t=pZ){return t>0?this._change.pipe($x(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var R0=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})(),av=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[tu,R0,tu,R0]})}return i})();var bT={},wa=(()=>{class i{_appId=fe(Pu);getId(t){return this._appId!=="ng"&&(t+=this._appId),bT.hasOwnProperty(t)||(bT[t]=0),`${t}${bT[t]++}`}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ZF=Wb();function Qh(i){return new Hb(i.get($d),i.get(Vi))}var Hb=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(n,t){this._viewportRuler=n,this._document=t}attach(){}enable(){if(this._canBeEnabled()){let n=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=n.style.left||"",this._previousHTMLStyles.top=n.style.top||"",n.style.left=pa(-this._previousScrollPosition.left),n.style.top=pa(-this._previousScrollPosition.top),n.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let n=this._document.documentElement,t=this._document.body,e=n.style,r=t.style,a=e.scrollBehavior||"",c=r.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,n.classList.remove("cdk-global-scrollblock"),ZF&&(e.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),ZF&&(e.scrollBehavior=a,r.scrollBehavior=c)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let t=this._document.documentElement,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}};function aR(i,n){return new Gb(i.get(O0),i.get(Ri),i.get($d),n)}var Gb=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(n,t,e,r){this._scrollDispatcher=n,this._ngZone=t,this._viewportRuler=e,this._config=r}attach(n){this._overlayRef,this._overlayRef=n}enable(){if(this._scrollSubscription)return;let n=this._scrollDispatcher.scrolled(0).pipe(Vn(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=n.subscribe(()=>{let t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=n.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var ov=class{enable(){}disable(){}attach(){}};function xT(i,n){return n.some(t=>{let e=i.bottom<t.top,r=i.top>t.bottom,a=i.right<t.left,c=i.left>t.right;return e||r||a||c})}function QF(i,n){return n.some(t=>{let e=i.top<t.top,r=i.bottom>t.bottom,a=i.left<t.left,c=i.right>t.right;return e||r||a||c})}function Qc(i,n){return new $b(i.get(O0),i.get($d),i.get(Ri),n)}var $b=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(n,t,e,r){this._scrollDispatcher=n,this._viewportRuler=t,this._ngZone=e,this._config=r}attach(n){this._overlayRef,this._overlayRef=n}enable(){if(!this._scrollSubscription){let n=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(n).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:r}=this._viewportRuler.getViewportSize();xT(t,[{width:e,height:r,bottom:r,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},oR=(()=>{class i{_injector=fe(rn);constructor(){}noop=()=>new ov;close=t=>aR(this._injector,t);block=()=>Qh(this._injector);reposition=t=>Qc(this._injector,t);static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),L0=class{positionStrategy;scrollStrategy=new ov;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(n){if(n){let t=Object.keys(n);for(let e of t)n[e]!==void 0&&(this[e]=n[e])}}};var zb=class{connectionPair;scrollableViewProperties;constructor(n,t){this.connectionPair=n,this.scrollableViewProperties=t}};var sR=(()=>{class i{_attachedOverlays=[];_document=fe(Vi);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){let e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),lR=(()=>{class i extends sR{_ngZone=fe(Ri);_renderer=fe(Va).createRenderer(null,null);_cleanupKeydown;add(t){super.add(t),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=t=>{let e=this._attachedOverlays;for(let r=e.length-1;r>-1;r--)if(e[r]._keydownEvents.observers.length>0){this._ngZone.run(()=>e[r]._keydownEvents.next(t));break}};static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),cR=(()=>{class i extends sR{_platform=fe($n);_ngZone=fe(Ri);_renderer=fe(Va).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(t){if(super.add(t),!this._isAttached){let e=this._document.body,r={capture:!0},a=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[a.listen(e,"pointerdown",this._pointerDownListener,r),a.listen(e,"click",this._clickListener,r),a.listen(e,"auxclick",this._clickListener,r),a.listen(e,"contextmenu",this._clickListener,r)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=e.style.cursor,e.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(t=>t()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=t=>{this._pointerDownEventTarget=es(t)};_clickListener=t=>{let e=es(t),r=t.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:e;this._pointerDownEventTarget=null;let a=this._attachedOverlays.slice();for(let c=a.length-1;c>-1;c--){let d=a[c];if(d._outsidePointerEvents.observers.length<1||!d.hasAttached())continue;if(eR(d.overlayElement,e)||eR(d.overlayElement,r))break;let u=d._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>u.next(t)):u.next(t)}};static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function eR(i,n){let t=typeof ShadowRoot<"u"&&ShadowRoot,e=n;for(;e;){if(e===i)return!0;e=t&&e instanceof ShadowRoot?e.host:e.parentNode}return!1}var dR=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(e,r){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll} 25`],encapsulation:2,changeDetection:0})}return i})(),Kb=(()=>{class i{_platform=fe($n);_containerElement;_document=fe(Vi);_styleLoader=fe(To);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t="cdk-overlay-container";if(this._platform.isBrowser||yT()){let r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let a=0;a<r.length;a++)r[a].remove()}let e=this._document.createElement("div");e.classList.add(t),yT()?e.setAttribute("platform","test"):this._platform.isBrowser||e.setAttribute("platform","server"),this._document.body.appendChild(e),this._containerElement=e}_loadStyles(){this._styleLoader.load(dR)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),CT=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(n,t,e,r){this._renderer=t,this._ngZone=e,this.element=n.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=t.listen(this.element,"click",r)}detach(){this._ngZone.runOutsideAngular(()=>{let n=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(n,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),n.style.pointerEvents="none",n.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Jh=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new ci;_attachments=new ci;_detachments=new ci;_positionStrategy;_scrollStrategy;_locationChanges=us.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new ci;_outsidePointerEvents=new ci;_afterNextRenderRef;constructor(n,t,e,r,a,c,d,u,h,f=!1,v,C){this._portalOutlet=n,this._host=t,this._pane=e,this._config=r,this._ngZone=a,this._keyboardDispatcher=c,this._document=d,this._location=u,this._outsideClickDispatcher=h,this._animationsDisabled=f,this._injector=v,this._renderer=C,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(n){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let t=this._portalOutlet.attach(n);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=$o(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof t?.onDestroy=="function"&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let n=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),n}dispose(){let n=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,n&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(n){n!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=n,this.hasAttached()&&(n.attach(this),this.updatePosition()))}updateSize(n){this._config=le(le({},this._config),n),this._updateElementSize()}setDirection(n){this._config=tt(le({},this._config),{direction:n}),this._updateElementDirection()}addPanelClass(n){this._pane&&this._toggleClasses(this._pane,n,!0)}removePanelClass(n){this._pane&&this._toggleClasses(this._pane,n,!1)}getDirection(){let n=this._config.direction;return n?typeof n=="string"?n:n.value:"ltr"}updateScrollStrategy(n){n!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=n,this.hasAttached()&&(n.attach(this),n.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let n=this._pane.style;n.width=pa(this._config.width),n.height=pa(this._config.height),n.minWidth=pa(this._config.minWidth),n.minHeight=pa(this._config.minHeight),n.maxWidth=pa(this._config.maxWidth),n.maxHeight=pa(this._config.maxHeight)}_togglePointerEvents(n){this._pane.style.pointerEvents=n?"":"none"}_attachBackdrop(){let n="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new CT(this._document,this._renderer,this._ngZone,t=>{this._backdropClick.next(t)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(n))}):this._backdropRef.element.classList.add(n)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(n,t,e){let r=Kh(t||[]).filter(a=>!!a);r.length&&(e?n.classList.add(...r):n.classList.remove(...r))}_detachContentWhenEmpty(){let n=!1;try{this._detachContentAfterRenderRef=$o(()=>{n=!0,this._detachContent()},{injector:this._injector})}catch(t){if(n)throw t;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let n=this._scrollStrategy;n?.disable(),n?.detach?.()}},tR="cdk-overlay-connected-position-bounding-box",fZ=/([A-Za-z%]+)$/;function sv(i,n){return new Yb(n,i.get($d),i.get(Vi),i.get($n),i.get(Kb))}var Yb=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new ci;_resizeSubscription=us.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(n,t,e,r,a){this._viewportRuler=t,this._document=e,this._platform=r,this._overlayContainer=a,this.setOrigin(n)}attach(n){this._overlayRef&&this._overlayRef,this._validatePositions(),n.hostElement.classList.add(tR),this._overlayRef=n,this._boundingBox=n.hostElement,this._pane=n.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let n=this._originRect,t=this._overlayRect,e=this._viewportRect,r=this._containerRect,a=[],c;for(let d of this._preferredPositions){let u=this._getOriginPoint(n,r,d),h=this._getOverlayPoint(u,t,d),f=this._getOverlayFit(h,t,e,d);if(f.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(d,u);return}if(this._canFitWithFlexibleDimensions(f,h,e)){a.push({position:d,origin:u,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(u,d)});continue}(!c||c.overlayFit.visibleArea<f.visibleArea)&&(c={overlayFit:f,overlayPoint:h,originPoint:u,position:d,overlayRect:t})}if(a.length){let d=null,u=-1;for(let h of a){let f=h.boundingBoxRect.width*h.boundingBoxRect.height*(h.position.weight||1);f>u&&(u=f,d=h)}this._isPushed=!1,this._applyPosition(d.position,d.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(c.position,c.originPoint);return}this._applyPosition(c.position,c.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&N0(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(tR),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let n=this._lastPosition;if(n){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._getOriginPoint(this._originRect,this._containerRect,n);this._applyPosition(n,t)}else this.apply()}withScrollableContainers(n){return this._scrollables=n,this}withPositions(n){return this._preferredPositions=n,n.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(n){return this._viewportMargin=n,this}withFlexibleDimensions(n=!0){return this._hasFlexibleDimensions=n,this}withGrowAfterOpen(n=!0){return this._growAfterOpen=n,this}withPush(n=!0){return this._canPush=n,this}withLockedPosition(n=!0){return this._positionLocked=n,this}setOrigin(n){return this._origin=n,this}withDefaultOffsetX(n){return this._offsetX=n,this}withDefaultOffsetY(n){return this._offsetY=n,this}withTransformOriginOn(n){return this._transformOriginSelector=n,this}_getOriginPoint(n,t,e){let r;if(e.originX=="center")r=n.left+n.width/2;else{let c=this._isRtl()?n.right:n.left,d=this._isRtl()?n.left:n.right;r=e.originX=="start"?c:d}t.left<0&&(r-=t.left);let a;return e.originY=="center"?a=n.top+n.height/2:a=e.originY=="top"?n.top:n.bottom,t.top<0&&(a-=t.top),{x:r,y:a}}_getOverlayPoint(n,t,e){let r;e.overlayX=="center"?r=-t.width/2:e.overlayX==="start"?r=this._isRtl()?-t.width:0:r=this._isRtl()?0:-t.width;let a;return e.overlayY=="center"?a=-t.height/2:a=e.overlayY=="top"?0:-t.height,{x:n.x+r,y:n.y+a}}_getOverlayFit(n,t,e,r){let a=nR(t),{x:c,y:d}=n,u=this._getOffset(r,"x"),h=this._getOffset(r,"y");u&&(c+=u),h&&(d+=h);let f=0-c,v=c+a.width-e.width,C=0-d,y=d+a.height-e.height,A=this._subtractOverflows(a.width,f,v),D=this._subtractOverflows(a.height,C,y),F=A*D;return{visibleArea:F,isCompletelyWithinViewport:a.width*a.height===F,fitsInViewportVertically:D===a.height,fitsInViewportHorizontally:A==a.width}}_canFitWithFlexibleDimensions(n,t,e){if(this._hasFlexibleDimensions){let r=e.bottom-t.y,a=e.right-t.x,c=iR(this._overlayRef.getConfig().minHeight),d=iR(this._overlayRef.getConfig().minWidth),u=n.fitsInViewportVertically||c!=null&&c<=r,h=n.fitsInViewportHorizontally||d!=null&&d<=a;return u&&h}return!1}_pushOverlayOnScreen(n,t,e){if(this._previousPushAmount&&this._positionLocked)return{x:n.x+this._previousPushAmount.x,y:n.y+this._previousPushAmount.y};let r=nR(t),a=this._viewportRect,c=Math.max(n.x+r.width-a.width,0),d=Math.max(n.y+r.height-a.height,0),u=Math.max(a.top-e.top-n.y,0),h=Math.max(a.left-e.left-n.x,0),f=0,v=0;return r.width<=a.width?f=h||-c:f=n.x<this._viewportMargin?a.left-e.left-n.x:0,r.height<=a.height?v=u||-d:v=n.y<this._viewportMargin?a.top-e.top-n.y:0,this._previousPushAmount={x:f,y:v},{x:n.x+f,y:n.y+v}}_applyPosition(n,t){if(this._setTransformOrigin(n),this._setOverlayElementStyles(t,n),this._setBoundingBoxStyles(t,n),n.panelClass&&this._addPanelClasses(n.panelClass),this._positionChanges.observers.length){let e=this._getScrollVisibility();if(n!==this._lastPosition||!this._lastScrollVisibility||!gZ(this._lastScrollVisibility,e)){let r=new zb(n,e);this._positionChanges.next(r)}this._lastScrollVisibility=e}this._lastPosition=n,this._isInitialRender=!1}_setTransformOrigin(n){if(!this._transformOriginSelector)return;let t=this._boundingBox.querySelectorAll(this._transformOriginSelector),e,r=n.overlayY;n.overlayX==="center"?e="center":this._isRtl()?e=n.overlayX==="start"?"right":"left":e=n.overlayX==="start"?"left":"right";for(let a=0;a<t.length;a++)t[a].style.transformOrigin=`${e} ${r}`}_calculateBoundingBoxRect(n,t){let e=this._viewportRect,r=this._isRtl(),a,c,d;if(t.overlayY==="top")c=n.y,a=e.height-c+this._viewportMargin;else if(t.overlayY==="bottom")d=e.height-n.y+this._viewportMargin*2,a=e.height-d+this._viewportMargin;else{let y=Math.min(e.bottom-n.y+e.top,n.y),A=this._lastBoundingBoxSize.height;a=y*2,c=n.y-y,a>A&&!this._isInitialRender&&!this._growAfterOpen&&(c=n.y-A/2)}let u=t.overlayX==="start"&&!r||t.overlayX==="end"&&r,h=t.overlayX==="end"&&!r||t.overlayX==="start"&&r,f,v,C;if(h)C=e.width-n.x+this._viewportMargin*2,f=n.x-this._viewportMargin;else if(u)v=n.x,f=e.right-n.x;else{let y=Math.min(e.right-n.x+e.left,n.x),A=this._lastBoundingBoxSize.width;f=y*2,v=n.x-y,f>A&&!this._isInitialRender&&!this._growAfterOpen&&(v=n.x-A/2)}return{top:c,left:v,bottom:d,right:C,width:f,height:a}}_setBoundingBoxStyles(n,t){let e=this._calculateBoundingBoxRect(n,t);!this._isInitialRender&&!this._growAfterOpen&&(e.height=Math.min(e.height,this._lastBoundingBoxSize.height),e.width=Math.min(e.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let a=this._overlayRef.getConfig().maxHeight,c=this._overlayRef.getConfig().maxWidth;r.height=pa(e.height),r.top=pa(e.top),r.bottom=pa(e.bottom),r.width=pa(e.width),r.left=pa(e.left),r.right=pa(e.right),t.overlayX==="center"?r.alignItems="center":r.alignItems=t.overlayX==="end"?"flex-end":"flex-start",t.overlayY==="center"?r.justifyContent="center":r.justifyContent=t.overlayY==="bottom"?"flex-end":"flex-start",a&&(r.maxHeight=pa(a)),c&&(r.maxWidth=pa(c))}this._lastBoundingBoxSize=e,N0(this._boundingBox.style,r)}_resetBoundingBoxStyles(){N0(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){N0(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(n,t){let e={},r=this._hasExactPosition(),a=this._hasFlexibleDimensions,c=this._overlayRef.getConfig();if(r){let f=this._viewportRuler.getViewportScrollPosition();N0(e,this._getExactOverlayY(t,n,f)),N0(e,this._getExactOverlayX(t,n,f))}else e.position="static";let d="",u=this._getOffset(t,"x"),h=this._getOffset(t,"y");u&&(d+=`translateX(${u}px) `),h&&(d+=`translateY(${h}px)`),e.transform=d.trim(),c.maxHeight&&(r?e.maxHeight=pa(c.maxHeight):a&&(e.maxHeight="")),c.maxWidth&&(r?e.maxWidth=pa(c.maxWidth):a&&(e.maxWidth="")),N0(this._pane.style,e)}_getExactOverlayY(n,t,e){let r={top:"",bottom:""},a=this._getOverlayPoint(t,this._overlayRect,n);if(this._isPushed&&(a=this._pushOverlayOnScreen(a,this._overlayRect,e)),n.overlayY==="bottom"){let c=this._document.documentElement.clientHeight;r.bottom=`${c-(a.y+this._overlayRect.height)}px`}else r.top=pa(a.y);return r}_getExactOverlayX(n,t,e){let r={left:"",right:""},a=this._getOverlayPoint(t,this._overlayRect,n);this._isPushed&&(a=this._pushOverlayOnScreen(a,this._overlayRect,e));let c;if(this._isRtl()?c=n.overlayX==="end"?"left":"right":c=n.overlayX==="end"?"right":"left",c==="right"){let d=this._document.documentElement.clientWidth;r.right=`${d-(a.x+this._overlayRect.width)}px`}else r.left=pa(a.x);return r}_getScrollVisibility(){let n=this._getOriginRect(),t=this._pane.getBoundingClientRect(),e=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:QF(n,e),isOriginOutsideView:xT(n,e),isOverlayClipped:QF(t,e),isOverlayOutsideView:xT(t,e)}}_subtractOverflows(n,...t){return t.reduce((e,r)=>e-Math.max(r,0),n)}_getNarrowedViewportRect(){let n=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,e=this._viewportRuler.getViewportScrollPosition();return{top:e.top+this._viewportMargin,left:e.left+this._viewportMargin,right:e.left+n-this._viewportMargin,bottom:e.top+t-this._viewportMargin,width:n-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(n,t){return t==="x"?n.offsetX==null?this._offsetX:n.offsetX:n.offsetY==null?this._offsetY:n.offsetY}_validatePositions(){}_addPanelClasses(n){this._pane&&Kh(n).forEach(t=>{t!==""&&this._appliedPanelClasses.indexOf(t)===-1&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(n=>{this._pane.classList.remove(n)}),this._appliedPanelClasses=[])}_getOriginRect(){let n=this._origin;if(n instanceof Ai)return n.nativeElement.getBoundingClientRect();if(n instanceof Element)return n.getBoundingClientRect();let t=n.width||0,e=n.height||0;return{top:n.y,bottom:n.y+e,left:n.x,right:n.x+t,height:e,width:t}}};function N0(i,n){for(let t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}function iR(i){if(typeof i!="number"&&i!=null){let[n,t]=i.split(fZ);return!t||t==="px"?parseFloat(n):null}return i||null}function nR(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function gZ(i,n){return i===n?!0:i.isOriginClipped===n.isOriginClipped&&i.isOriginOutsideView===n.isOriginOutsideView&&i.isOverlayClipped===n.isOverlayClipped&&i.isOverlayOutsideView===n.isOverlayOutsideView}var rR="cdk-global-overlay-wrapper";function ef(i){return new qb}var qb=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(n){let t=n.getConfig();this._overlayRef=n,this._width&&!t.width&&n.updateSize({width:this._width}),this._height&&!t.height&&n.updateSize({height:this._height}),n.hostElement.classList.add(rR),this._isDisposed=!1}top(n=""){return this._bottomOffset="",this._topOffset=n,this._alignItems="flex-start",this}left(n=""){return this._xOffset=n,this._xPosition="left",this}bottom(n=""){return this._topOffset="",this._bottomOffset=n,this._alignItems="flex-end",this}right(n=""){return this._xOffset=n,this._xPosition="right",this}start(n=""){return this._xOffset=n,this._xPosition="start",this}end(n=""){return this._xOffset=n,this._xPosition="end",this}width(n=""){return this._overlayRef?this._overlayRef.updateSize({width:n}):this._width=n,this}height(n=""){return this._overlayRef?this._overlayRef.updateSize({height:n}):this._height=n,this}centerHorizontally(n=""){return this.left(n),this._xPosition="center",this}centerVertically(n=""){return this.top(n),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let n=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,e=this._overlayRef.getConfig(),{width:r,height:a,maxWidth:c,maxHeight:d}=e,u=(r==="100%"||r==="100vw")&&(!c||c==="100%"||c==="100vw"),h=(a==="100%"||a==="100vh")&&(!d||d==="100%"||d==="100vh"),f=this._xPosition,v=this._xOffset,C=this._overlayRef.getConfig().direction==="rtl",y="",A="",D="";u?D="flex-start":f==="center"?(D="center",C?A=v:y=v):C?f==="left"||f==="end"?(D="flex-end",y=v):(f==="right"||f==="start")&&(D="flex-start",A=v):f==="left"||f==="start"?(D="flex-start",y=v):(f==="right"||f==="end")&&(D="flex-end",A=v),n.position=this._cssPosition,n.marginLeft=u?"0":y,n.marginTop=h?"0":this._topOffset,n.marginBottom=this._bottomOffset,n.marginRight=u?"0":A,t.justifyContent=D,t.alignItems=h?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let n=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,e=t.style;t.classList.remove(rR),e.justifyContent=e.alignItems=n.marginTop=n.marginBottom=n.marginLeft=n.marginRight=n.position="",this._overlayRef=null,this._isDisposed=!0}},mR=(()=>{class i{_injector=fe(rn);constructor(){}global(){return ef()}flexibleConnectedTo(t){return sv(this._injector,t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function V0(i,n){i.get(To).load(dR);let t=i.get(Kb),e=i.get(Vi),r=i.get(wa),a=i.get(gs),c=i.get(ts),d=e.createElement("div"),u=e.createElement("div");u.id=r.getId("cdk-overlay-"),u.classList.add("cdk-overlay-pane"),d.appendChild(u),t.getContainerElement().appendChild(d);let h=new Ob(u,a,i),f=new L0(n),v=i.get(qn,null,{optional:!0})||i.get(Va).createRenderer(null,null);return f.direction=f.direction||c.value,new Jh(h,d,u,f,i.get(Ri),i.get(lR),e,i.get(Nc),i.get(cR),n?.disableAnimations??i.get(Ed,null,{optional:!0})==="NoopAnimations",i.get(Go),v)}var uR=(()=>{class i{scrollStrategies=fe(oR);_positionBuilder=fe(mR);_injector=fe(rn);constructor(){}create(t){return V0(this._injector,t)}position(){return this._positionBuilder}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),vZ=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],pR=new Gt("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=fe(rn);return()=>Qc(i)}}),Zh=(()=>{class i{elementRef=fe(Ai);constructor(){}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return i})(),Xb=(()=>{class i{_dir=fe(ts,{optional:!0});_injector=fe(rn);_overlayRef;_templatePortal;_backdropSubscription=us.EMPTY;_attachSubscription=us.EMPTY;_detachSubscription=us.EMPTY;_positionSubscription=us.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=fe(pR);_disposeOnNavigation=!1;_ngZone=fe(Ri);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(t){this._disposeOnNavigation=t}backdropClick=new xn;positionChange=new xn;attach=new xn;detach=new xn;overlayKeydown=new xn;overlayOutsideClick=new xn;constructor(){let t=fe(Td),e=fe(Ks);this._templatePortal=new k0(t,e),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=vZ);let t=this._overlayRef=V0(this._injector,this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(e=>{this.overlayKeydown.next(e),e.keyCode===27&&!this.disableClose&&!Do(e)&&(e.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(e=>{let r=this._getOriginElement(),a=es(e);(!r||r!==a&&!r.contains(a))&&this.overlayOutsideClick.next(e)})}_buildConfig(){let t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new L0({direction:this._dir||"ltr",positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(e.width=this.width),(this.height||this.height===0)&&(e.height=this.height),(this.minWidth||this.minWidth===0)&&(e.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){let e=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this._getOrigin()).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let t=sv(this._injector,this._getOrigin());return this._updatePositionStrategy(t),t}_getOrigin(){return this.origin instanceof Zh?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Zh?this.origin.elementRef.nativeElement:this.origin instanceof Ai?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(z3(()=>this.positionChange.observers.length>0)).subscribe(t=>{this._ngZone.run(()=>this.positionChange.emit(t)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",Cn],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",Cn],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",Cn],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",Cn],push:[2,"cdkConnectedOverlayPush","push",Cn],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",Cn]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[kn]})}return i})();function _Z(i){let n=fe(rn);return()=>Qc(n)}var yZ={provide:pR,useFactory:_Z},zd=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[uR,yZ],imports:[tu,M0,av,av]})}return i})();function SZ(i,n){}var iu=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var wT=(()=>{class i extends Yh{_elementRef=fe(Ai);_focusTrapFactory=fe(vT);_config;_interactivityChecker=fe(gT);_ngZone=fe(Ri);_focusMonitor=fe(A0);_renderer=fe(qn);_changeDetectorRef=fe(Kn);_injector=fe(rn);_platform=fe($n);_document=fe(Vi);_portalOutlet;_focusTrapped=new ci;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=fe(iu,{optional:!0})||new iu,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(t){this._ariaLabelledByQueue.push(t),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(t){let e=this._ariaLabelledByQueue.indexOf(t);e>-1&&(this._ariaLabelledByQueue.splice(e,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(t){this._portalOutlet.hasAttached();let e=this._portalOutlet.attachComponentPortal(t);return this._contentAttached(),e}attachTemplatePortal(t){this._portalOutlet.hasAttached();let e=this._portalOutlet.attachTemplatePortal(t);return this._contentAttached(),e}attachDomPortal=t=>{this._portalOutlet.hasAttached();let e=this._portalOutlet.attachDomPortal(t);return this._contentAttached(),e};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(t,e){this._interactivityChecker.isFocusable(t)||(t.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let r=()=>{a(),c(),t.removeAttribute("tabindex")},a=this._renderer.listen(t,"blur",r),c=this._renderer.listen(t,"mousedown",r)})),t.focus(e)}_focusByCssSelector(t,e){let r=this._elementRef.nativeElement.querySelector(t);r&&this._forceFocus(r,e)}_trapFocus(t){this._isDestroyed||$o(()=>{let e=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||e.focus(t);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(t)||this._focusDialogContainer(t);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',t);break;default:this._focusByCssSelector(this._config.autoFocus,t);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let t=this._config.restoreFocus,e=null;if(typeof t=="string"?e=this._document.querySelector(t):typeof t=="boolean"?e=t?this._elementFocusedBeforeDialogWasOpened:null:t&&(e=t),this._config.restoreFocus&&e&&typeof e.focus=="function"){let r=tv(),a=this._elementRef.nativeElement;(!r||r===this._document.body||r===a||a.contains(r))&&(this._focusMonitor?(this._focusMonitor.focusVia(e,this._closeInteractionType),this._closeInteractionType=null):e.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(t){this._elementRef.nativeElement.focus?.(t)}_containsFocus(){let t=this._elementRef.nativeElement,e=tv();return t===e||t.contains(e)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=tv()))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(e,r){if(e&1&&An(Z1,7),e&2){let a;on(a=sn())&&(r._portalOutlet=a.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(e,r){e&2&&He("id",r._config.id||null)("role",r._config.role)("aria-modal",r._config.ariaModal)("aria-labelledby",r._config.ariaLabel?null:r._ariaLabelledByQueue[0])("aria-label",r._config.ariaLabel)("aria-describedby",r._config.ariaDescribedBy||null)},features:[lr],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,r){e&1&&T(0,SZ,0,0,"ng-template",0)},dependencies:[Z1],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit} 26`],encapsulation:2})}return i})(),lv=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new ci;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(n,t){this.overlayRef=n,this.config=t,this.disableClose=t.disableClose,this.backdropClick=n.backdropClick(),this.keydownEvents=n.keydownEvents(),this.outsidePointerEvents=n.outsidePointerEvents(),this.id=t.id,this.keydownEvents.subscribe(e=>{e.keyCode===27&&!this.disableClose&&!Do(e)&&(e.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=n.detachments().subscribe(()=>{t.closeOnOverlayDetachments!==!1&&this.close()})}close(n,t){if(this._canClose(n)){let e=this.closed;this.containerInstance._closeInteractionType=t?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),e.next(n),e.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(n="",t=""){return this.overlayRef.updateSize({width:n,height:t}),this}addPanelClass(n){return this.overlayRef.addPanelClass(n),this}removePanelClass(n){return this.overlayRef.removePanelClass(n),this}_canClose(n){let t=this.config;return!!this.containerInstance&&(!t.closePredicate||t.closePredicate(n,t,this.componentInstance))}},bZ=new Gt("DialogScrollStrategy",{providedIn:"root",factory:()=>{let i=fe(rn);return()=>Qh(i)}}),xZ=new Gt("DialogData"),CZ=new Gt("DefaultDialogConfig");function EZ(i){let n=vr(i),t=new xn;return{valueSignal:n,get value(){return n()},change:t,ngOnDestroy(){t.complete()}}}var TT=(()=>{class i{_injector=fe(rn);_defaultOptions=fe(CZ,{optional:!0});_parentDialog=fe(i,{optional:!0,skipSelf:!0});_overlayContainer=fe(Kb);_idGenerator=fe(wa);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new ci;_afterOpenedAtThisLevel=new ci;_ariaHiddenElements=new Map;_scrollStrategy=fe(bZ);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Pc(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(hs(void 0)));constructor(){}open(t,e){let r=this._defaultOptions||new iu;e=le(le({},r),e),e.id=e.id||this._idGenerator.getId("cdk-dialog-"),e.id&&this.getDialogById(e.id);let a=this._getOverlayConfig(e),c=V0(this._injector,a),d=new lv(c,e),u=this._attachContainer(c,d,e);if(d.containerInstance=u,!this.openDialogs.length){let h=this._overlayContainer.getContainerElement();u._focusTrapped?u._focusTrapped.pipe(xo(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(h)}):this._hideNonDialogContentFromAssistiveTechnology(h)}return this._attachDialogContent(t,d,u,e),this.openDialogs.push(d),d.closed.subscribe(()=>this._removeOpenDialog(d,!0)),this.afterOpened.next(d),d}closeAll(){ET(this.openDialogs,t=>t.close())}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){ET(this._openDialogsAtThisLevel,t=>{t.config.closeOnDestroy===!1&&this._removeOpenDialog(t,!1)}),ET(this._openDialogsAtThisLevel,t=>t.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(t){let e=new L0({positionStrategy:t.positionStrategy||ef().centerHorizontally().centerVertically(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,width:t.width,height:t.height,disposeOnNavigation:t.closeOnNavigation,disableAnimations:t.disableAnimations});return t.backdropClass&&(e.backdropClass=t.backdropClass),e}_attachContainer(t,e,r){let a=r.injector||r.viewContainerRef?.injector,c=[{provide:iu,useValue:r},{provide:lv,useValue:e},{provide:Jh,useValue:t}],d;r.container?typeof r.container=="function"?d=r.container:(d=r.container.type,c.push(...r.container.providers(r))):d=wT;let u=new Zm(d,r.viewContainerRef,rn.create({parent:a||this._injector,providers:c}));return t.attach(u).instance}_attachDialogContent(t,e,r,a){if(t instanceof Td){let c=this._createInjector(a,e,r,void 0),d={$implicit:a.data,dialogRef:e};a.templateContext&&(d=le(le({},d),typeof a.templateContext=="function"?a.templateContext():a.templateContext)),r.attachTemplatePortal(new k0(t,null,d,c))}else{let c=this._createInjector(a,e,r,this._injector),d=r.attachComponentPortal(new Zm(t,a.viewContainerRef,c));e.componentRef=d,e.componentInstance=d.instance}}_createInjector(t,e,r,a){let c=t.injector||t.viewContainerRef?.injector,d=[{provide:xZ,useValue:t.data},{provide:lv,useValue:e}];return t.providers&&(typeof t.providers=="function"?d.push(...t.providers(e,t,r)):d.push(...t.providers)),t.direction&&(!c||!c.get(ts,null,{optional:!0}))&&d.push({provide:ts,useValue:EZ(t.direction)}),rn.create({parent:c||a,providers:d})}_removeOpenDialog(t,e){let r=this.openDialogs.indexOf(t);r>-1&&(this.openDialogs.splice(r,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((a,c)=>{a?c.setAttribute("aria-hidden",a):c.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),e&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(t){if(t.parentElement){let e=t.parentElement.children;for(let r=e.length-1;r>-1;r--){let a=e[r];a!==t&&a.nodeName!=="SCRIPT"&&a.nodeName!=="STYLE"&&!a.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(a,a.getAttribute("aria-hidden")),a.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ET(i,n){let t=i.length;for(;t--;)n(i[t])}var hR=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[TT],imports:[zd,M0,rv,M0]})}return i})();function Yd(i){return i!=null&&`${i}`!="false"}var wZ=new Gt("MATERIAL_ANIMATIONS");var fR=null;function TZ(){return fe(wZ,{optional:!0})?.animationsDisabled||fe(Ed,{optional:!0})==="NoopAnimations"?"di-disabled":(fR??=fe(Bb).matchMedia("(prefers-reduced-motion)").matches,fR?"reduced-motion":"enabled")}function Za(){return TZ()!=="enabled"}var DZ=200,Jb=class{_letterKeyStream=new ci;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new ci;selectedItem=this._selectedItem;constructor(n,t){let e=typeof t?.debounceInterval=="number"?t.debounceInterval:DZ;t?.skipPredicate&&(this._skipPredicateFn=t.skipPredicate),this.setItems(n),this._setupKeyHandler(e)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(n){this._selectedItemIndex=n}setItems(n){this._items=n}handleKey(n){let t=n.keyCode;n.key&&n.key.length===1?this._letterKeyStream.next(n.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(n){this._letterKeyStream.pipe(La(t=>this._pressedLetters.push(t)),P_(n),Vn(()=>this._pressedLetters.length>0),Ki(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(t=>{for(let e=1;e<this._items.length+1;e++){let r=(this._selectedItemIndex+e)%this._items.length,a=this._items[r];if(!this._skipPredicateFn?.(a)&&a.getLabel?.().toLocaleUpperCase().trim().indexOf(t)===0){this._selectedItem.next(a);break}}this._pressedLetters=[]})}};var Zb=class{_items;_activeItemIndex=vr(-1);_activeItem=vr(null);_wrap=!1;_typeaheadSubscription=us.EMPTY;_itemChangesSubscription;_vertical=!0;_horizontal;_allowedModifierKeys=[];_homeAndEnd=!1;_pageUpAndDown={enabled:!1,delta:10};_effectRef;_typeahead;_skipPredicateFn=n=>n.disabled;constructor(n,t){this._items=n,n instanceof eC?this._itemChangesSubscription=n.changes.subscribe(e=>this._itemsChanged(e.toArray())):Au(n)&&(this._effectRef=_g(()=>this._itemsChanged(n()),{injector:t}))}tabOut=new ci;change=new ci;skipPredicate(n){return this._skipPredicateFn=n,this}withWrap(n=!0){return this._wrap=n,this}withVerticalOrientation(n=!0){return this._vertical=n,this}withHorizontalOrientation(n){return this._horizontal=n,this}withAllowedModifierKeys(n){return this._allowedModifierKeys=n,this}withTypeAhead(n=200){this._typeaheadSubscription.unsubscribe();let t=this._getItemsArray();return this._typeahead=new Jb(t,{debounceInterval:typeof n=="number"?n:void 0,skipPredicate:e=>this._skipPredicateFn(e)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(e=>{this.setActiveItem(e)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(n=!0){return this._homeAndEnd=n,this}withPageUpDown(n=!0,t=10){return this._pageUpAndDown={enabled:n,delta:t},this}setActiveItem(n){let t=this._activeItem();this.updateActiveItem(n),this._activeItem()!==t&&this.change.next(this._activeItemIndex())}onKeydown(n){let t=n.keyCode,r=["altKey","ctrlKey","metaKey","shiftKey"].every(a=>!n[a]||this._allowedModifierKeys.indexOf(a)>-1);switch(t){case 9:this.tabOut.next();return;case 40:if(this._vertical&&r){this.setNextItemActive();break}else return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&r){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&r){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&r){let a=this._activeItemIndex()-this._pageUpAndDown.delta;this._setActiveItemByIndex(a>0?a:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&r){let a=this._activeItemIndex()+this._pageUpAndDown.delta,c=this._getItemsArray().length;this._setActiveItemByIndex(a<c?a:c-1,-1);break}else return;default:(r||Do(n,"shiftKey"))&&this._typeahead?.handleKey(n);return}this._typeahead?.reset(),n.preventDefault()}get activeItemIndex(){return this._activeItemIndex()}get activeItem(){return this._activeItem()}isTyping(){return!!this._typeahead&&this._typeahead.isTyping()}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._getItemsArray().length-1,-1)}setNextItemActive(){this._activeItemIndex()<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex()<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(n){let t=this._getItemsArray(),e=typeof n=="number"?n:t.indexOf(n),r=t[e];this._activeItem.set(r??null),this._activeItemIndex.set(e),this._typeahead?.setCurrentSelectedItemIndex(e)}
26destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(n){this._wrap?this._setActiveInWrapMode(n):this._setActiveInDefaultMode(n)}_setActiveInWrapMode(n){let t=this._getItemsArray();for(let e=1;e<=t.length;e++){let r=(this._activeItemIndex()+n*e+t.length)%t.length,a=t[r];if(!this._skipPredicateFn(a)){this.setActiveItem(r);return}}}_setActiveInDefaultMode(n){this._setActiveItemByIndex(this._activeItemIndex()+n,n)}_setActiveItemByIndex(n,t){let e=this._getItemsArray();if(e[n]){for(;this._skipPredicateFn(e[n]);)if(n+=t,!e[n])return;this.setActiveItem(n)}}_getItemsArray(){return Au(this._items)?this._items():this._items instanceof eC?this._items.toArray():this._items}_itemsChanged(n){this._typeahead?.setItems(n);let t=this._activeItem();if(t){let e=n.indexOf(t);e>-1&&e!==this._activeItemIndex()&&(this._activeItemIndex.set(e),this._typeahead?.setCurrentSelectedItemIndex(e))}}};var cv=class extends Zb{setActiveItem(n){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(n),this.activeItem&&this.activeItem.setActiveStyles()}};var SR=" ";function AT(i,n,t){let e=e2(i,n);t=t.trim(),!e.some(r=>r.trim()===t)&&(e.push(t),i.setAttribute(n,e.join(SR)))}function t2(i,n,t){let e=e2(i,n);t=t.trim();let r=e.filter(a=>a!==t);r.length?i.setAttribute(n,r.join(SR)):i.removeAttribute(n)}function e2(i,n){return i.getAttribute(n)?.match(/\S+/g)??[]}var bR="cdk-describedby-message",Qb="cdk-describedby-host",MT=0,xR=(()=>{class i{_platform=fe($n);_document=fe(Vi);_messageRegistry=new Map;_messagesContainer=null;_id=`${MT++}`;constructor(){fe(To).load(qh),this._id=fe(Pu)+"-"+MT++}describe(t,e,r){if(!this._canBeDescribed(t,e))return;let a=kT(e,r);typeof e!="string"?(yR(e,this._id),this._messageRegistry.set(a,{messageElement:e,referenceCount:0})):this._messageRegistry.has(a)||this._createMessageElement(e,r),this._isElementDescribedByMessage(t,a)||this._addMessageReference(t,a)}removeDescription(t,e,r){if(!e||!this._isElementNode(t))return;let a=kT(e,r);if(this._isElementDescribedByMessage(t,a)&&this._removeMessageReference(t,a),typeof e=="string"){let c=this._messageRegistry.get(a);c&&c.referenceCount===0&&this._deleteMessageElement(a)}this._messagesContainer?.childNodes.length===0&&(this._messagesContainer.remove(),this._messagesContainer=null)}ngOnDestroy(){let t=this._document.querySelectorAll(`[${Qb}="${this._id}"]`);for(let e=0;e<t.length;e++)this._removeCdkDescribedByReferenceIds(t[e]),t[e].removeAttribute(Qb);this._messagesContainer?.remove(),this._messagesContainer=null,this._messageRegistry.clear()}_createMessageElement(t,e){let r=this._document.createElement("div");yR(r,this._id),r.textContent=t,e&&r.setAttribute("role",e),this._createMessagesContainer(),this._messagesContainer.appendChild(r),this._messageRegistry.set(kT(t,e),{messageElement:r,referenceCount:0})}_deleteMessageElement(t){this._messageRegistry.get(t)?.messageElement?.remove(),this._messageRegistry.delete(t)}_createMessagesContainer(){if(this._messagesContainer)return;let t="cdk-describedby-message-container",e=this._document.querySelectorAll(`.${t}[platform="server"]`);for(let a=0;a<e.length;a++)e[a].remove();let r=this._document.createElement("div");r.style.visibility="hidden",r.classList.add(t),r.classList.add("cdk-visually-hidden"),this._platform.isBrowser||r.setAttribute("platform","server"),this._document.body.appendChild(r),this._messagesContainer=r}_removeCdkDescribedByReferenceIds(t){let e=e2(t,"aria-describedby").filter(r=>r.indexOf(bR)!=0);t.setAttribute("aria-describedby",e.join(" "))}_addMessageReference(t,e){let r=this._messageRegistry.get(e);AT(t,"aria-describedby",r.messageElement.id),t.setAttribute(Qb,this._id),r.referenceCount++}_removeMessageReference(t,e){let r=this._messageRegistry.get(e);r.referenceCount--,t2(t,"aria-describedby",r.messageElement.id),t.removeAttribute(Qb)}_isElementDescribedByMessage(t,e){let r=e2(t,"aria-describedby"),a=this._messageRegistry.get(e),c=a&&a.messageElement.id;return!!c&&r.indexOf(c)!=-1}_canBeDescribed(t,e){if(!this._isElementNode(t))return!1;if(e&&typeof e=="object")return!0;let r=e==null?"":`${e}`.trim(),a=t.getAttribute("aria-label");return r?!a||a.trim()!==r:!1}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function kT(i,n){return typeof i=="string"?`${n||""}/${i}`:i}function yR(i,n){i.id||(i.id=`${bR}-${n}-${MT++}`)}var Wn=(()=>{class i{constructor(){fe(Ub)._applyBodyHighContrastModeCssClasse
vendor: 8,739 bytes, line 26
26s()}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[tu,tu]})}return i})();function IZ(i,n){}var mv=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},PT="mdc-dialog--open",CR="mdc-dialog--opening",ER="mdc-dialog--closing",kZ=150,MZ=75,DR=(()=>{class i extends wT{_animationStateChanged=new xn;_animationsEnabled=!Za();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?TR(this._config.enterAnimationDuration)??kZ:0;_exitAnimationDuration=this._animationsEnabled?TR(this._config.exitAnimationDuration)??MZ:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(wR,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(CR,PT)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(PT),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(PT),this._animationsEnabled?(this._hostElement.style.setProperty(wR,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(ER)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(t){this._actionSectionCount+=t,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(CR,ER)}_waitForAnimationToComplete(t,e){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(e,t)}_requestAnimationFrame(t){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(t){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:t})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(t){let e=super.attachComponentPortal(t);return e.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),e}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275cmp=te({type:i,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(e,r){e&2&&(Fc("id",r._config.id),He("aria-modal",r._config.ariaModal)("role",r._config.role)("aria-labelledby",r._config.ariaLabel?null:r._ariaLabelledByQueue[0])("aria-label",r._config.ariaLabel)("aria-describedby",r._config.ariaDescribedBy||null),Re("_mat-animation-noopable",!r._animationsEnabled)("mat-mdc-dialog-container-with-actions",r._actionSectionCount>0))},features:[lr],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(e,r){e&1&&(s(0,"div",0)(1,"div",1),T(2,IZ,0,0,"ng-template",2),o()())},dependencies:[Z1],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}
26.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents} 27`],encapsulation:2})}return i})(),wR="--mat-dialog-transition-duration";function TR(i){return i==null?null:typeof i=="number"?i:i.endsWith("ms")?Gd(i.substring(0,i.length-2)):i.endsWith("s")?Gd(i.substring(0,i.length-1))*1e3:i==="0"?0:null}var dv=function(i){return i[i.OPEN=0]="OPEN",i[i.CLOSING=1]="CLOSING",i[i.CLOSED=2]="CLOSED",i}(dv||{}),U0=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new ci;_beforeClosed=new ci;_result;_closeFallbackTimeout;_state=dv.OPEN;_closeInteractionType;constructor(n,t,e){this._ref=n,this._config=t,this._containerInstance=e,this.disableClose=t.disableClose,this.id=n.id,n.addPanelClass("mat-mdc-dialog-panel"),e._animationStateChanged.pipe(Vn(r=>r.state==="opened"),xo(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(Vn(r=>r.state==="closed"),xo(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),n.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Sd(this.backdropClick(),this.keydownEvents().pipe(Vn(r=>r.keyCode===27&&!this.disableClose&&!Do(r)))).subscribe(r=>{this.disableClose||(r.preventDefault(),IR(this,r.type==="keydown"?"keyboard":"mouse"))})}close(n){let t=this._config.closePredicate;t&&!t(n,this._config,this.componentInstance)||(this._result=n,this._containerInstance._animationStateChanged.pipe(Vn(e=>e.state==="closing"),xo(1)).subscribe(e=>{this._beforeClosed.next(n),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=dv.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(n){let t=this._ref.config.positionStrategy;return n&&(n.left||n.right)?n.left?t.left(n.left):t.right(n.right):t.centerHorizontally(),n&&(n.top||n.bottom)?n.top?t.top(n.top):t.bottom(n.bottom):t.centerVertically(),this._ref.updatePosition(),this}updateSize(n="",t=""){return this._ref.updateSize(n,t),this}addPanelClass(n){return this._ref.addPanelClass(n),this}removePanelClass(n){return this._ref.removePanelClass(n),this}getState(){return this._state}_finishDialogClose(){this._state=dv.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function IR(i,n,t){return i._closeInteractionType=n,i.close(t)}var kR=new Gt("MatMdcDialogData"),MR=new Gt("mat-mdc-dialog-default-options"),AR=new Gt("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let i=fe(rn);return()=>Qh(i)}}),uv=(()=>{class i{_defaultOptions=fe(MR,{optional:!0});_scrollStrategy=fe(AR);_parentDialog=fe(i,{optional:!0,skipSelf:!0});_idGenerator=fe(wa);_injector=fe(rn);_dialog=fe(TT);_animationsDisabled=Za();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new ci;_afterOpenedAtThisLevel=new ci;dialogConfigClass=mv;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Pc(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(hs(void 0)));constructor(){this._dialogRefConstructor=U0,this._dialogContainerType=DR,this._dialogDataToken=kR}open(t,e){let r;e=le(le({},this._defaultOptions||new mv),e),e.id=e.id||this._idGenerator.getId("mat-mdc-dialog-"),e.scrollStrategy=e.scrollStrategy||this._scrollStrategy();let a=this._dialog.open(t,tt(le({},e),{positionStrategy:ef(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||e.enterAnimationDuration?.toLocaleStr
27ing()==="0"||e.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:e},{provide:iu,useValue:e}]},templateContext:()=>({dialogRef:r}),providers:(c,d,u)=>(r=new this._dialogRefConstructor(c,e,u),r.updatePosition(e?.position),[{provide:this._dialogContainerType,useValue:u},{provide:this._dialogDataToken,useValue:d.data},{provide:this._dialogRefConstructor,useValue:r}])}));return r.componentRef=a.componentRef,r.componentInstance=a.componentInstance,this.openDialogs.push(r),this.afterOpened.next(r),r.afterClosed().subscribe(()=>{let c=this.openDialogs.indexOf(r);c>-1&&(this.openDialogs.splice(c,1),this.openDialogs.length||this._getAfterAllClosed().next())}),r}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(t){let e=t.length;for(;e--;)t[e].close()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var PR=(()=>{class i{_dialogRef=fe(U0,{optional:!0});_elementRef=fe(Ai);_dialog=fe(uv);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=AZ(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i})}return i})(),FT=(()=>{class i extends PR{id=fe(wa).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(e,r){e&2&&Fc("id",r.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[lr]})}return i})(),RT=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[mk([ST])]})}return i})(),OT=(()=>{class i extends PR{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let t;return function(r){return(t||(t=Ba(i)))(r||i)}})();static \u0275dir=Ci({type:i,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(e,r){e&2&&Re("mat-mdc-dialog-actions-align-start",r.align==="start")("mat-mdc-dialog-actions-align-center",r.align==="center")("mat-mdc-dialog-actions-align-end",r.align==="end")},inputs:{align:"align"},features:[lr]})}return i})();function AZ(i,n){let t=i.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-mdc-dialog-container");)t=t.parentElement;return t?n.find(e=>e.id===t.id):null}var NT=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[uv],imports:[hR,zd,M0,Wn,Wn]})}return i})();var tf,RR=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function LT(){if(tf)return tf;if(typeof document!="object"||!document)return tf=new Set(RR),tf;let i=document.createElement("input");return tf=new Set(RR.filter(n=>(i.setAttribute("type",n),i.type===n))),tf}var Ll=function(i){return i[i.FADING_IN=0]="FADING_IN",i[i.VISIBLE=1]="VISIBLE",i[i.FADING_OUT=2]="FADING_OUT",i[i.HIDDEN=3]="HIDDEN",i}(Ll||{}),BT=class{_renderer;element;config;_animationForciblyDisabledThroughCss;state=Ll.HIDDEN;constructor(n,t,e,r=!1){this._renderer=n,this.element=t,this.config=e,this._animationForciblyDisabledThroughCss=r}fadeOut(){this._renderer.fadeOutRipple(this)}},OR=Qm({passive:!0,capture:!0}),VT=class{_events=new Map;addHandler(n,t,e,r){let a=this._events.get(t);if(a){let c=a.get(e);c?c.add(r):a.set(e,new Set([r]))}else this._events.set(t,new Map([[e,new Set([r])]])),n.runOutsideAngular(()=>{document.addEventListener(t,this._delegateEventHandler,OR)})}removeHandler(n,t,e){let r=this._events.get(n);if(!r)return;let a=r.get(t);a&&(a.delete(e),a.size===0&&r.delete(t),r.size===0&&(this._events.delete(n),document.removeEventListener(n,this._delegateEventHandler,OR)))}_delegateEventHandler=n=>{let t=es(n);t&&this._events.get(n.type)?.forEach((e,r)=>{(r===t||r.contains(t))&&e.forEach(a=>a.handleEvent(n))})}},pv={enterDuration:225,exitDuration:150},PZ=800,NR=Qm({passive:!0,capture:!0}),LR=["mousedown","touchstart"],BR=["mouseup","mouseleave","touchend","touchcancel"],FZ=(()=>
vendor: 4,719 bytes, lines 27-28
27{class i{static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["ng-component"]],hostAttrs:["mat-ripple-style-loader",""],decls:0,vars:0,template:function(e,r){},styles:[`.mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none} 28`],encapsulation:2,changeDetection:0})}return i})(),hv=class i{_target;_ngZone;_platform;_containerElement;_triggerElement;_isPointerDown=!1;_activeRipples=new Map;_mostRecentTransientRipple;_lastTouchStartEvent;_pointerUpEventsRegistered=!1;_containerRect;static _eventManager=new VT;constructor(n,t,e,r,a){this._target=n,this._ngZone=t,this._platform=r,r.isBrowser&&(this._containerElement=al(e)),a&&a.get(To).load(FZ)}fadeInRipple(n,t,e={}){let r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),a=le(le({},pv),e.animation);e.centered&&(n=r.left+r.width/2,t=r.top+r.height/2);let c=e.radius||RZ(n,t,r),d=n-r.left,u=t-r.top,h=a.enterDuration,f=document.createElement("div");f.classList.add("mat-ripple-element"),f.style.left=`${d-c}px`,f.style.top=`${u-c}px`,f.style.height=`${c*2}px`,f.style.width=`${c*2}px`,e.color!=null&&(f.style.backgroundColor=e.color),f.style.transitionDuration=`${h}ms`,this._containerElement.appendChild(f);let v=window.getComputedStyle(f),C=v.transitionProperty,y=v.transitionDuration,A=C==="none"||y==="0s"||y==="0s, 0s"||r.width===0&&r.height===0,D=new BT(this,f,e,A);f.style.transform="scale3d(1, 1, 1)",D.state=Ll.FADING_IN,e.persistent||(this._mostRecentTransientRipple=D);let F=null;return!A&&(h||a.exitDuration)&&this._ngZone.runOutsideAngular(()=>{let R=()=>{F&&(F.fallbackTimer=null),clearTimeout(H),this._finishRippleTransition(D)},L=()=>this._destroyRipple(D),H=setTimeout(L,h+100);f.addEventListener("transitionend",R),f.addEventListener("transitioncancel",L),F={onTransitionEnd:R,onTransitionCancel:L,fallbackTimer:H}}),this._activeRipples.set(D,F),(A||!h)&&this._finishRippleTransition(D),D}fadeOutRipple(n){if(n.state===Ll.FADING_OUT||n.state===Ll.HIDDEN)return;let t=n.element,e=le(le({},pv),n.config.animation);t.style.transitionDuration=`${e.exitDuration}ms`,t.style.opacity="0",n.state=Ll.FADING_OUT,(n._animationForciblyDisabledThroughCss||!e.exitDuration)&&this._finishRippleTransition(n)}fadeOutAll(){this._getActiveRipples().forEach(n=>n.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(n=>{n.config.persistent||n.fadeOut()})}setupTriggerEvents(n){let t=al(n);!this._platform.isBrowser||!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,LR.forEach(e=>{i._eventManager.addHandler(this._ngZone,e,t,this)}))}handleEvent(n){n.type==="mousedown"?this._onMousedown(n):n.type==="touchstart"?this._onTouchStart(n):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{BR.forEach(t=>{this._triggerElement.addEventListener(t,this,NR)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(n){n.state===Ll.FADING_IN?this._startFadeOutTransition(n):n.state===Ll.FADING_OUT&&this._destroyRipple(n)}_startFadeOutTransition(n){let t=n===this._mostRecentTransientRipple,{persistent:e}=n.config;n.state=Ll.VISIBLE,!e&&(!t||!this._isPointerDown)&&n.fadeOut()}_destroyRipple(n){let t=this._activeRipples.get(n)??null;this._activeRipples.delete(n),this._activeRipples.size||(this._containerRect=null),n===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),n.state=Ll.HIDDEN,t!==null&&(n.element.removeEventListener("transitionend",t.onTransitionEnd),n.element.removeEventListener("transitioncancel",t.onTransitionCancel),t.fallbackTimer!==null&&clearTimeout(t.fallbackTimer)),n.element.remove()}_onMousedown(n){let t=Q1(n),e=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+PZ;!this._target.rippleDisabled&&!t&&!e&&(this._isPointerDown=!0,this.fadeInRipple(n.clientX,n.clientY,this._target.rippleConfig))}_onTouchStart(n){if(!this._target.rippleDisabled&&!ev(n)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;let t=n.changedTouches;if(t)for(let e=0;e<t.length;e++)this.fadeInRipple(t[e].clientX,t[e].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEac
28h(n=>{let t=n.state===Ll.VISIBLE||n.config.terminateOnPointerUp&&n.state===Ll.FADING_IN;!n.config.persistent&&t&&n.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){let n=this._triggerElement;n&&(LR.forEach(t=>i._eventManager.removeHandler(t,n,this)),this._pointerUpEventsRegistered&&(BR.forEach(t=>n.removeEventListener(t,this,NR)),this._pointerUpEventsRegistered=!1))}};function RZ(i,n,t){let e=Math.max(Math.abs(i-t.left),Math.abs(i-t.right)),r=Math.max(Math.abs(n-t.top),Math.abs(n-t.bottom));return Math.sqrt(e*e+r*r)}var UT=new Gt("mat-ripple-global-options"),VR=(()=>{class i{_elementRef=fe(Ai);_animationsDisabled=Za();color;unbounded;centered;radius=0;animation;get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}_disabled=!1;get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}_trigger;_rippleRenderer;_globalOptions;_isInitialized=!1;constructor(){let t=fe(Ri),e=fe($n),r=fe(UT,{optional:!0}),a=fe(rn);this._globalOptions=r||{},this._rippleRenderer=new hv(this,t,this._elementRef,e,a)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:le(le(le({},this._globalOptions.animation),this._animationsDisabled?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,e=0,r){return typeof t=="number"?this._rippleRenderer.fadeInRipple(t,e,le(le({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,le(le({},this.rippleConfig),t))}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(e,r){e&2&&Re("mat-ripple-unbounded",r.unbounded)},inputs:{color:[0,"matRippleColor","color"],unbounded:[0,"matRippleUnbounded","unbounded"],centered:[0,"matRippleCentered","centered"],radius:[0,"matRippleRadius","radius"],animation:[0,"matRippleAnimation","animation"],disabled:[0,"matRippleDisabled","disabled"],trigger:[0,"matRippleTrigger","trigger"]},exportAs:["matRipple"]})}return i})();var OZ={capture:!0},NZ=["focus","mousedown","mouseenter","touchstart"],jT="mat-ripple-loader-uninitialized",WT="mat-ripple-loader-class-name",UR="mat-ripple-loader-centered",i2="mat-ripple-loader-disabled",jR=(()=>{class i{_document=fe(Vi);_animationsDisabled=Za();_globalRippleOptions=fe(UT,{optional:!0});_platform=fe($n);_ngZone=fe(Ri);_injector=fe(rn);_eventCleanups;_hosts=new Map;constructor(){let t=fe(Va).createRenderer(null,null);this._eventCleanups=this._ngZone.runOutsideAngular(()=>NZ.map(e=>t.listen(this._document,e,this._onInteraction,OZ)))}ngOnDestroy(){let t=this._hosts.keys();for(let e of t)this.destroyRipple(e);this._eventCleanups.forEach(e=>e())}configureRipple(t,e){t.setAttribute(jT,this._globalRippleOptions?.namespace??""),(e.className||!t.hasAttribute(WT))&&t.setAttribute(WT,e.className||""),e.centered&&t.setAttribute(UR,""),e.disabled&&t.setAttribute(i2,"")}setDisabled(t,e){let r=this._hosts.get(t);r?(r.target.rippleDisabled=e,!e&&!r.hasSetUpEvents&&(r.hasSetUpEvents=!0,r.renderer.setupTriggerEvents(t))):e?t.setAttribute(i2,""):t.removeAttribute(i2)}_onInteraction=t=>{let e=es(t);if(e instanceof HTMLElement){let r=e.closest(`[${jT}="${this._globalRippleOptions?.namespace??""}"]`);r&&this._createRipple(r)}};_createRipple(t){if(!this._document||this._hosts.has(t))return;t.querySelector(".mat-ripple")?.remove();let e=this._document.createElement("span");e.classList.add("mat-ripple",t.getAttribute(WT)),t.append(e);let r=this._globalRippleOptions,a=this._animationsDisabled?0:r?.animation?.enterDuration??pv.enterDuration,c=this._animationsDisabled?0:r?.animation?.exitDuration??pv.exitDuration,d={rippleDisabled:this._animationsDisabled||r?.disabled||t.hasAttribute(i2),rippleConfig:{centered:t.hasAttribute(UR),terminateOnPointerUp:r?.terminateOnPointerUp,animation:{enterDuration:a,exitDuration:c}}},u=new hv(d,this._ngZone,e,this._platform,this._injector),h=!d.rippleDisabled;h&&u.setupTriggerEvents(t),this._hosts.set(t,{target:d,renderer:u,hasSetUpEvents:h}),t.removeAttribute(jT)}destroyRipple(t){let e=this._hosts.get(t);e&&(e.renderer._removeTriggerEvents(),this._hosts.delete(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var n2=(()=>
28{class i{static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["structural-styles"]],decls:0,vars:0,template:function(e,r){},styles:[`.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}} 29`],encapsulation:2,changeDetection:0})}return i})();var LZ=["mat-icon-button",""],BZ=["*"],VZ=new Gt("MAT_BUTTON_CONFIG");function WR(i){return i==null?void 0:Zl(i)}var HT=(()=>{class i{_elementRef=fe(Ai);_ngZone=fe(Ri);_animationsDisabled=Za();_config=fe(VZ,{optional:!0});_focusMonitor=fe(A0);_cleanupClick;_renderer=fe(qn);_rippleLoader=fe(jR);_isAnchor;_isFab=!1;color;get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=t,this._updateRippleDisabled()}_disableRipple=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._updateRippleDisabled()}_disabled=!1;ariaDisabled;disabledInteractive;tabIndex;set _tabindex(t){this.tabIndex=t}constructor(){fe(To).load(n2);let t=this._elementRef.nativeElement;this._isAnchor=t.tagName==="A",this.disabledInteractive=this._config?.disabledInteractive??!1,this.color=this._config?.color??null,this._rippleLoader?.configureRipple(t,{className:"mat-mdc-button-ripple"})}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0),this._isAnchor&&this._setupAsAnchor()}ngOnDestroy(){this._cleanupClick?.(),this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement)}focus(t="program",e){t?this._focusMonitor.focusVia(this._elementRef.nativeElement,t,e):this._elementRef.nativeElement.focus(e)}_getAriaDisabled(){return this.ariaDisabled!=null?this.ariaDisabled:this._isAnchor?this.disabled||null:this.disabled&&this.disabledInteractive?!0:null}_getDisabledAttribute(){return this.disabledInteractive||!this.disabled?null:!0}_updateRippleDisabled(){this._rippleLoader?.setDisabled(this._elementRef.nativeElement,this.disableRipple||this.disabled)}_getTabIndex(){return this._isAnchor?this.disabled&&!this.disabledInteractive?-1:this.tabIndex:this.tabIndex}_setupAsAnchor(){this._cleanupClick=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"click",t=>{this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}))}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,hostAttrs:[1,"mat-mdc-button-base"],hostVars:13,hostBindings:function(e,r){e&2&&(He("disabled",r._getDisabledAttribute())("aria-disabled",r._getAriaDisabled())("tabindex",r._getTabIndex()),Co(r.color?"mat-"+r.color:""),Re("mat-mdc-button-disabled",r.disabled)("mat-mdc-button-disabled-interactive",r.disabledInteractive)("mat-unthemed",!r.color)("_mat-animation-noopable",r._animationsDisabled))},inputs:{color:"color",disableRipple:[2,"disableRipple","disableRipple",Cn],disabled:[2,"disabled","disabled",Cn],ariaDisabled:[2,"aria-disabled","ariaDisabled",Cn],disabledInteractive:[2,"disabledInteractive","disabledInteractive",Cn],tabIndex:[2,"tabIndex","tabIndex",WR],_tabindex:[2,"tabindex","_tabindex",WR]}})}return i})(),GT=(()=>{class i extends HT{constructor(){super(),this._rippleLoader.configureRipple(this._elementRef.nativeElement,{centered:!0})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["button","mat-icon-button",""],["a","mat-icon-button",""],["button","matIconButton",""],["a","matIconButton",""]],hostAttrs:[1,"mdc-icon-button","mat-mdc-icon-button"],exportAs:["matButton","matAnchor"],features:[lr],attrs:LZ,ngContentSelectors:BZ,decls:4,vars:0,consts:[[1,"mat-mdc-button-persistent-ripple","mdc-icon-button__ripple"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(e,r){e&1&&(Ya(),Jl(0,"span",0),ar(1),Jl(2,"span",1)(3,"span",2))},styles:[`.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%));flex-shrink:0;text-align:center;width:var(--mat-icon-button-state-layer-size, 40px);height:var(--mat-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mat-icon-button-state-layer-size, 40px) - var(--mat-icon-button-icon-size, 24px)) / 2);font-size:var(--mat-icon-button-icon-size, 24px);color:var(--mat-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}
29.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;display:var(--mat-icon-button-touch-target-display, block);left:50%;width:48px;transform:translate(-50%, -50%)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mat-icon-button-icon-size, 24px);height:var(--mat-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%))}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1} 30`,`@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}} 31`],encapsulation:2,changeDetection:0})}return i})();var r2=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn,Wn]})}return i})();var UZ=["matButton",""],jZ=[[["",8,"material-icons",3,"iconPositionEnd",""],["mat-icon",3,"iconPositionEnd",""],["","matButtonIcon","",3,"iconPositionEnd",""]],"*",[["","iconPositionEnd","",8,"material-icons"],["mat-icon","iconPositionEnd",""],["","matButtonIcon","","iconPositionEnd",""]]],WZ=[".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])","*",".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"];var HR=new Map([["text",["mat-mdc-button"]],["filled",["mdc-button--unelevated","mat-mdc-unelevated-button"]],["elevated",["mdc-button--raised","mat-mdc-raised-button"]],["outlined",["mdc-button--outlined","mat-mdc-outlined-button"]],["tonal",["mat-tonal-button"]]]),GR=(()=>{class i extends HT{get appearance(){return this._appearance}set appearance(t){this.setAppearance(t||this._config?.defaultAppearance||"text")}_appearance=null;constructor(){super();let t=HZ(this._elementRef.nativeElement);t&&this.setAppearance(t)}setAppearance(t){if(t===this._appearance)return;let e=this._elementRef.nativeElement.classList,r=this._appearance?HR.get(this._appearance):null,a=HR.get(t);r&&e.remove(...r),e.add(...a),this._appearance=t}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["button","matButton",""],["a","matButton",""],["button","mat-button",""],["button","mat-raised-button",""],["button","mat-flat-button",""],["button","mat-stroked-button",""],["a","mat-button",""],["a","mat-raised-button",""],["a","mat-flat-button",""],["a","mat-stroked-button",""]],hostAttrs:[1,"mdc-button"],inputs:{appearance:[0,"matButton","appearance"]},exportAs:["matButton","matAnchor"],features:[lr],attrs:UZ,ngContentSelectors:WZ,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(e,r){e&1&&(Ya(jZ),Jl(0,"span",0),ar(1),Nu(2,"span",1),ar(3,1),Lu(),ar(4,2),Jl(5,"span",2)(6,"span",3)),e&2&&Re("mdc-button__ripple",!r._isFab)("mdc-fab__ripple",r._isFab)},styles:[`.mat-mdc-button-base{text-decoration:none}.mat-mdc-button-base .mat-icon{min-height:fit-content;flex-shrink:0}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-button-text-horizontal-padding, 12px);height:var(--mat-button-text-container-height, 40px);font-family:var(--mat-button-text-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-text-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-text-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-text-label-text-transform);font-weight:var(--mat-button-text-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mat-button-text-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mat-button-text-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-text-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-button-text-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-button-text-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;display:var(--mat-button-text-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}
31.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-filled-container-height, 40px);font-family:var(--mat-button-filled-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-filled-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-filled-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-filled-label-text-transform);font-weight:var(--mat-button-filled-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-filled-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-button-filled-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;display:var(--mat-button-filled-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mat-button-filled-label-text-color, var(--mat-sys-on-primary));background-color:var(--mat-button-filled-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mat-button-filled-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mat-button-protected-container-elevation-shadow, var(--mat-sys-level1));height:var(--mat-button-protected-container-height, 40px);font-family:var(--mat-button-protected-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-protected-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-protected-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-protected-label-text-transform);font-weight:var(--mat-button-protected-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-protected-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-button-protected-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;display:var(--mat-button-protected-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-raised-button:not(:disabled){color:var(--mat-button-protected-label-text-color, var(--mat-sys-primary));background-color:var(--mat-button-protected-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mat-button-protected-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mat-button-protected-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mat-button-protected-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mat-button-protected-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-protected-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-protected-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mat-button-protected-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-outlined-container-height, 40px);font-family:var(--mat-button-outlined-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-outlined-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-outlined-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-outlined-label-text-transform);font-weight:var(--mat-button-outlined-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mat-button-outlined-container-shape, var(--mat-sys-corner-full));border-width:var(--mat-button-outlined-outline-width, 1px);padding:0 var(--mat-button-outlined-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-button-outlined-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;display:var(--mat-button-outlined-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-outlined-button:not(:disabled){color:var(--mat-button-outlined-label-text-color, var(--mat-sys-primary));border-color:var(--mat-button-outlined-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mat-button-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}
31.mat-tonal-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-tonal-container-height, 40px);font-family:var(--mat-button-tonal-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-tonal-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-tonal-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-tonal-label-text-transform);font-weight:var(--mat-button-tonal-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-tonal-horizontal-padding, 24px)}.mat-tonal-button:not(:disabled){color:var(--mat-button-tonal-label-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-tonal-container-color, var(--mat-sys-secondary-container))}.mat-tonal-button,.mat-tonal-button .mdc-button__ripple{border-radius:var(--mat-button-tonal-container-shape, var(--mat-sys-corner-full))}.mat-tonal-button[disabled],.mat-tonal-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-tonal-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-tonal-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-tonal-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}[dir=rtl] .mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}.mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}[dir=rtl] .mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}.mat-tonal-button .mat-ripple-element{background-color:var(--mat-button-tonal-ripple-color, color-mix(in srgb, var(--mat-sys-on-secondary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-tonal-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-tonal-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-tonal-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-tonal-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-tonal-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-tonal-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;display:var(--mat-button-tonal-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button,.mat-tonal-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}
31.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon,.mat-tonal-button .mdc-button__label,.mat-tonal-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator,.mat-tonal-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before,.mat-tonal-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable,.mat-tonal-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon,.mat-tonal-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-tonal-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)} 32`,`@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}} 33`],encapsulation:2,changeDetection:0})}return i})();function HZ(i){return i.hasAttribute("mat-raised-button")?"elevated":i.hasAttribute("mat-stroked-button")?"outlined":i.hasAttribute("mat-flat-button")?"filled":i.hasAttribute("mat-button")?"text":null}var a2=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn,r2,Wn]})}return i})();var $T=class{_box;_destroyed=new ci;_resizeSubject=new ci;_resizeObserver;_elementObservables=new Map;constructor(n){this._box=n,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(t=>this._resizeSubject.next(t)))}observe(n){return this._elementObservables.has(n)||this._elementObservables.set(n,new za(t=>{let e=this._resizeSubject.subscribe(t);return this._resizeObserver?.observe(n,{box:this._box}),()=>{this._resizeObserver?.unobserve(n),e.unsubscribe(),this._elementObservables.delete(n)}}).pipe(Vn(t=>t.some(e=>e.target===n)),Xx({bufferSize:1,refCount:!0}),gr(this._destroyed))),this._elementObservables.get(n)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},$R=(()=>{class i{_cleanupErrorListener;_observers=new Map;_ngZone=fe(Ri);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,t]of this._observers)t.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(t,e){let r=e?.box||"content-box";return this._observers.has(r)||this._observers.set(r,new $T(r)),this._observers.get(r).observe(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $Z=["notch"],zZ=["matFormFieldNotchedOutline",""],YZ=["*"],zR=["iconPrefixContainer"],YR=["textPrefixContainer"],qR=["iconSuffixContainer"],KR=["textSuffixContainer"],qZ=["textField"],KZ=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],XZ=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function JZ(i,n){i&1&&B(0,"span",20)}function ZZ(i,n){if(i&1&&(s(0,"label",19),ar(1,1),nr(2,JZ,1,0,"span",20),o()),i&2){let t=w(2);p("floating",t._shouldLabelFloat())("monitorResize",t._hasOutline())("id",t._labelId),He("for",t._control.disableAutomaticLabeling?null:t._control.id),m(2),rr(!t.hideRequiredMarker&&t._control.required?2:-1)}}function QZ(i,n){if(i&1&&nr(0,ZZ,3,5,"label",19),i&2){let t=w();rr(t._hasFloatingLabel()?0:-1)}}function eQ(i,n){i&1&&B(0,"div",7)}function tQ(i,n){}function iQ(i,n){if(i&1&&T(0,tQ,0,0,"ng-template",13),i&2){w(2);let t=Qt(1);p("ngTemplateOutlet",t)}}function nQ(i,n){if(i&1&&(s(0,"div",9),nr(1,iQ,1,1,null,13),o()),i&2){let t=w();p("matFormFieldNotchedOutlineOpen",t._shouldLabelFloat()),m(),rr(t._forceDisplayInfixLabel()?-1:1)}}function rQ(i,n){i&1&&(s(0,"div",10,2),ar(2,2),o())}function aQ(i,n){i&1&&(s(0,"div",11,3),ar(2,3),o())}function oQ(i,n){}function sQ(i,n){if(i&1&&T(0,oQ,0,0,"ng-template",13),i&2){w();let t=Qt(1);p("ngTemplateOutlet",t)}}function lQ(i,n){i&1&&(s(0,"div",14,4),ar(2,4),o())}function cQ(i,n){i&1&&(s(0,"div",15,5),ar(2,5),o())}function dQ(i,n){i&1&&B(0,"div",16)}
33function mQ(i,n){i&1&&ar(0,6)}function uQ(i,n){if(i&1&&(s(0,"mat-hint",21),l(1),o()),i&2){let t=w(2);p("id",t._hintLabelId),m(),b(t.hintLabel)}}function pQ(i,n){if(i&1&&(nr(0,uQ,2,2,"mat-hint",21),ar(1,7),B(2,"div",22),ar(3,8)),i&2){let t=w();rr(t.hintLabel?0:-1)}}var fv=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["mat-label"]]})}return i})(),YT=new Gt("MatError"),qT=(()=>{class i{id=fe(wa).getId("mat-mdc-error-");constructor(){}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["mat-error"],["","matError",""]],hostAttrs:[1,"mat-mdc-form-field-error","mat-mdc-form-field-bottom-align"],hostVars:1,hostBindings:function(e,r){e&2&&Fc("id",r.id)},inputs:{id:"id"},features:[Ii([{provide:YT,useExisting:i}])]})}return i})(),zT=(()=>{class i{align="start";id=fe(wa).getId("mat-mdc-hint-");static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(e,r){e&2&&(Fc("id",r.id),He("align",null),Re("mat-mdc-form-field-hint-end",r.align==="end"))},inputs:{align:"align",id:"id"}})}return i})(),iO=new Gt("MatPrefix");var nO=new Gt("MatSuffix");var rO=new Gt("FloatingLabelParent"),XR=(()=>{class i{_elementRef=fe(Ai);get floating(){return this._floating}set floating(t){this._floating=t,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(t){this._monitorResize=t,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=fe($R);_ngZone=fe(Ri);_parent=fe(rO);_resizeSubscription=new us;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return hQ(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(e,r){e&2&&Re("mdc-floating-label--float-above",r.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return i})();function hQ(i){let n=i;if(n.offsetParent!==null)return n.scrollWidth;let t=n.cloneNode(!0);t.style.setProperty("position","absolute"),t.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(t);let e=t.scrollWidth;return t.remove(),e}var JR="mdc-line-ripple--active",o2="mdc-line-ripple--deactivating",ZR=(()=>{class i{_elementRef=fe(Ai);_cleanupTransitionEnd;constructor(){let t=fe(Ri),e=fe(qn);t.runOutsideAngular(()=>{this._cleanupTransitionEnd=e.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let t=this._elementRef.nativeElement.classList;t.remove(o2),t.add(JR)}deactivate(){this._elementRef.nativeElement.classList.add(o2)}_handleTransitionEnd=t=>{let e=this._elementRef.nativeElement.classList,r=e.contains(o2);t.propertyName==="opacity"&&r&&e.remove(JR,o2)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),QR=(()=>{class i{_elementRef=fe(Ai);_ngZone=fe(Ri);open=!1;_notch;ngAfterViewInit(){let t=this._elementRef.nativeElement,e=t.querySelector(".mdc-floating-label");e?(t.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(e.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>e.style.transitionDuration="")}))):t.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(t){let e=this._notch.nativeElement;!this.open||!t?e.style.width="":e.style.width=`calc(${t}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(t){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${t}px)`)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(e,r){if(e&1&&An($Z,5),e&2){let a;on(a=sn())&&(r._notch=a.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(e,r){e&2&&Re("mdc-notched-outline--notched",r.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:zZ,ngContentSelectors:YZ,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(e,r){e&1&&(Ya(),Jl(0,"div",1),Nu(1,"div",2,0),ar(3),Lu(),Jl(4,"div",3))},encapsulation:2,changeDetection:0})}return i})(),nf=(()=>{class i{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i})}return i})();var rf=new Gt("MatFormField"),aO=new Gt("MAT_FORM_FIELD_DEFAULT_OPTIONS"),eO="fill",fQ="auto",tO="fixed",gQ="translateY(-50%)",j0=(()=>{class i{_elementRef=fe(Ai);_changeDetectorRef=fe(Kn);_dir=fe(ts);_platform=fe($n);_idGenerator=fe(wa);_ngZone=fe(Ri);_defaults=fe(aO,{optional:!0});_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=yg("iconPrefixContainer");_textPrefixContainerSignal=yg("textPrefixContainer");_iconSuffixContainerSignal=yg("iconSuffixContainer");_textSuffixContainerSignal=yg("textSuffixContainer");_prefixSuffixContainers=Rc(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(t=>t?.nativeElement).filter(t=>t!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=xk(fv);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Yd(t)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||fQ}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(t){let e=t||this._defaults?.appearance||eO;this._appearanceSignal.set(e)}_appearanceSignal=vr(eO);
33get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||tO}set subscriptSizing(t){this._subscriptSizing=t||this._defaults?.subscriptSizing||tO}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(t){this._explicitFormFieldControl=t}_destroyed=new ci;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=Za();constructor(){let t=this._defaults;t&&(t.appearance&&(this.appearance=t.appearance),this._hideRequiredMarker=!!t?.hideRequiredMarker,t.color&&(this.color=t.color)),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=Rc(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(t){let e=this._control,r="mat-mdc-form-field-type-";t&&this._elementRef.nativeElement.classList.remove(r+t.controlType),e.controlType&&this._elementRef.nativeElement.classList.add(r+e.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=e.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=e.stateChanges.pipe(hs([void 0,void 0]),Ki(()=>[e.errorState,e.userAriaDescribedBy]),Kx(),Vn(([[a,c],[d,u]])=>a!==d||c!==u)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),e.ngControl&&e.ngControl.valueChanges&&(this._valueChanges=e.ngControl.valueChanges.pipe(gr(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(t=>!t._isText),this._hasTextPrefix=!!this._prefixChildren.find(t=>t._isText),this._hasIconSuffix=!!this._suffixChildren.find(t=>!t._isText),this._hasTextSuffix=!!this._suffixChildren.find(t=>t._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Sd(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let t=this._control.focused;t&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!t&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",t),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",t)}_syncOutlineLabelOffset(){Dk({earlyRead:()=>
33{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let t of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(t,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:t=>this._writeOutlinedLabelStyles(t())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=Rc(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(t){let e=this._control?this._control.ngControl:null;return e&&e[t]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&t.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let a=this._hintChildren?this._hintChildren.find(d=>d.align==="start"):null,c=this._hintChildren?this._hintChildren.find(d=>d.align==="end"):null;a?t.push(a.id):this._hintLabel&&t.push(this._hintLabelId),c&&t.push(c.id)}else this._errorChildren&&t.push(...this._errorChildren.map(a=>a.id));let e=this._control.describedByIds,r;if(e){let a=this._describedByIds||t;r=t.concat(e.filter(c=>c&&!a.includes(c)))}else r=t;this._control.setDescribedByIds(r),this._describedByIds=t}}_getOutlinedLabelOffset(){let t=this._dir.valueSignal();if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,r=this._textPrefixContainer?.nativeElement,a=this._iconSuffixContainer?.nativeElement,c=this._textSuffixContainer?.nativeElement,d=e?.getBoundingClientRect().width??0,u=r?.getBoundingClientRect().width??0,h=a?.getBoundingClientRect().width??0,f=c?.getBoundingClientRect().width??0,v=t==="rtl"?"-1":"1",C=`${d+u}px`,A=`calc(${v} * (${C} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,D=`var(--mat-mdc-form-field-label-transform, ${gQ} translateX(${A}))`,F=d+u+h+f;return[D,F]}_writeOutlinedLabelStyles(t){if(t!==null){let[e,r]=t;this._floatingLabel&&(this._floatingLabel.element.style.transform=e),r!==null&&this._notchedOutline?._setMaxWidth(r)}}_isAttachedToDom(){let t=this._elementRef.nativeElement;if(t.getRootNode){let e=t.getRootNode();return e&&e!==t}return document.documentElement.contains(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["mat-form-field"]],contentQueries:function(e,r,a){if(e&1&&(yk(a,r._labelChild,fv,5),Js(a,nf,5),Js(a,iO,5),Js(a,nO,5),Js(a,YT,5),Js(a,zT,5)),e&2){aC();let c;on(c=sn())&&(r._formFieldControl=c.first),on(c=sn())&&(r._prefixChildren=c),on(c=sn())&&(r._suffixChildren=c),on(c=sn())&&(r._errorChildren=c),on(c=sn())&&(r._hintChildren=c)}},viewQuery:function(e,r){if(e&1&&(vg(r._iconPrefixContainerSignal,zR,5),vg(r._textPrefixContainerSignal,YR,5),vg(r._iconSuffixContainerSignal,qR,5),vg(r._textSuffixContainerSignal,KR,5),An(qZ,5),An(zR,5),An(YR,5),An(qR,5),An(KR,5),An(XR,5),An(QR,5),An(ZR,5)),e&2){aC(4);let a;on(a=sn())&&(r._textField=a.first),on(a=sn())&&(r._iconPrefixContainer=a.first),on(a=sn())&&(r._textPrefixContainer=a.first),on(a=sn())&&(r._iconSuffixContainer=a.first),on(a=sn())&&(r._textSuffixContainer=a.first),on(a=sn())&&(r._floatingLabel=a.first),on(a=sn())&&(r._notchedOutline=a.first),on(a=sn())&&(r._lineRipple=a.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(e,r){e&2&&Re("mat-mdc-form-field-label-always-float",r._shouldAlwaysFloat
33())("mat-mdc-form-field-has-icon-prefix",r._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",r._hasIconSuffix)("mat-form-field-invalid",r._control.errorState)("mat-form-field-disabled",r._control.disabled)("mat-form-field-autofilled",r._control.autofilled)("mat-form-field-appearance-fill",r.appearance=="fill")("mat-form-field-appearance-outline",r.appearance=="outline")("mat-form-field-hide-placeholder",r._hasFloatingLabel()&&!r._shouldLabelFloat())("mat-primary",r.color!=="accent"&&r.color!=="warn")("mat-accent",r.color==="accent")("mat-warn",r.color==="warn")("ng-untouched",r._shouldForward("untouched"))("ng-touched",r._shouldForward("touched"))("ng-pristine",r._shouldForward("pristine"))("ng-dirty",r._shouldForward("dirty"))("ng-valid",r._shouldForward("valid"))("ng-invalid",r._shouldForward("invalid"))("ng-pending",r._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[Ii([{provide:rf,useExisting:i},{provide:rO,useExisting:i}])],ngContentSelectors:XZ,decls:19,vars:25,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],["aria-atomic","true","aria-live","polite"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(e,r){if(e&1){let a=he();Ya(KZ),T(0,QZ,1,1,"ng-template",null,0,mn),s(2,"div",6,1),S("click",function(d){return U(a),j(r._control.onContainerClick(d))}),nr(4,eQ,1,0,"div",7),s(5,"div",8),nr(6,nQ,2,2,"div",9),nr(7,rQ,3,0,"div",10),nr(8,aQ,3,0,"div",11),s(9,"div",12),nr(10,sQ,1,1,null,13),ar(11),o(),nr(12,lQ,3,0,"div",14),nr(13,cQ,3,0,"div",15),o(),nr(14,dQ,1,0,"div",16),o(),s(15,"div",17)(16,"div",18),nr(17,mQ,1,0)(18,pQ,4,1),o()()}if(e&2){let a;m(2),Re("mdc-text-field--filled",!r._hasOutline())("mdc-text-field--outlined",r._hasOutline())("mdc-text-field--no-label",!r._hasFloatingLabel())("mdc-text-field--disabled",r._control.disabled)("mdc-text-field--invalid",r._control.errorState),m(2),rr(!r._hasOutline()&&!r._control.disabled?4:-1),m(2),rr(r._hasOutline()?6:-1),m(),rr(r._hasIconPrefix?7:-1),m(),rr(r._hasTextPrefix?8:-1),m(2),rr(!r._hasOutline()||r._forceDisplayInfixLabel()?10:-1),m(2),rr(r._hasTextSuffix?12:-1),m(),rr(r._hasIconSuffix?13:-1),m(),rr(r._hasOutline()?-1:14),m(),Re("mat-mdc-form-field-subscript-dynamic-size",r.subscriptSizing==="dynamic");let c=r._getSubscriptMessageType();m(),Re("mat-mdc-form-field-error-wrapper",c==="error")("mat-mdc-form-field-hint-wrapper",c==="hint"),m(),rr((a=c)==="error"?17:a==="hint"?18:-1)}},dependencies:[XR,QR,yC,ZR,zT],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}
33.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}
33.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;
33left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):h
33over .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):h
33over .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-en
33abled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)} 34`],encapsulation:2,changeDetection:0})}return i})();var nu=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn,Vb,j0,Wn]})}return i})();var _Q=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(e,r){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms} 35`],encapsulation:2,changeDetection:0})}return i})(),yQ={passive:!0},oO=(()=>{class i{_platform=fe($n);_ngZone=fe(Ri);_renderer=fe(Va).createRenderer(null,null);_styleLoader=fe(To);_monitoredElements=new Map;constructor(){}monitor(t){if(!this._platform.isBrowser)return Xl;this._styleLoader.load(_Q);let e=al(t),r=this._monitoredElements.get(e);if(r)return r.subject;let a=new ci,c="cdk-text-field-autofilled",d=h=>{h.animationName==="cdk-text-field-autofill-start"&&!e.classList.contains(c)?(e.classList.add(c),this._ngZone.run(()=>a.next({target:h.target,isAutofilled:!0}))):h.animationName==="cdk-text-field-autofill-end"&&e.classList.contains(c)&&(e.classList.remove(c),this._ngZone.run(()=>a.next({target:h.target,isAutofilled:!1})))},u=this._ngZone.runOutsideAngular(()=>(e.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(e,"animationstart",d,yQ)));return this._monitoredElements.set(e,{subject:a,unlisten:u}),a}stopMonitoring(t){let e=al(t),r=this._monitoredElements.get(e);r&&(r.unlisten(),r.subject.complete(),e.classList.remove("cdk-text-field-autofill-monitored"),e.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(e))}ngOnDestroy(){this._monitoredElements.forEach((t,e)=>this.stopMonitoring(e))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var sO=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({})}return i})();var lO=new Gt("MAT_INPUT_VALUE_ACCESSOR");var s2=(()=>{class i{isErrorState(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var af=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(n,t,e,r,a){this._defaultMatcher=n,this.ngControl=t,this._parentFormGroup=e,this._parentForm=r,this._stateChanges=a}updateErrorState(){let n=this.errorState,t=this._parentFormGroup||this._parentForm,e=this.matcher||this._defaultMatcher,r=this.ngControl?this.ngControl.control:null,a=e?.isErrorState(r,t)??!1;a!==n&&(this.errorState=a,this._stateChanges.next())}};var SQ=["button","checkbox","file","hidden","image","radio","range","reset","submit"],bQ=new Gt("MAT_INPUT_CONFIG"),cO=(()=>{class i{_elementRef=fe(Ai);_platform=fe($n);ngControl=fe(nc,{optional:!0,self:!0});_autofillMonitor=fe(oO);_ngZone=fe(Ri);_formField=fe(rf,{optional:!0});_renderer=fe(qn);_uid=fe(wa).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=fe(bQ,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new ci;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=Yd(t),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(t){this._id=t||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(At.required)??!1}set required(t){this._required=Yd(t)}_required;get type(){return this._type}
35set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&<().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(t){t!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(t):this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Yd(t)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>LT().has(t));constructor(){let t=fe(fn,{optional:!0}),e=fe(wr,{optional:!0}),r=fe(s2),a=fe(lO,{optional:!0,self:!0}),c=this._elementRef.nativeElement,d=c.nodeName.toLowerCase();a?Au(a.value)?this._signalBasedValueAccessor=a:this._inputValueAccessor=a:this._inputValueAccessor=c,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(c,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new af(r,this.ngControl,e,t,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=d==="select",this._isTextarea=d==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=c.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&_g(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(t){if(t!==this.focused){if(!this._isNativeSelect&&t&&this.disabled&&this.disabledInteractive){let e=this._elementRef.nativeElement;e.type==="number"?(e.type="text",e.setSelectionRange(0,0),e.type="number"):e.setSelectionRange(0,0)}this.focused=t,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_dirtyCheckPlaceholder(){let t=this._getPlaceholder();if(t!==this._previousPlaceholder){let e=this._elementRef.nativeElement;this._previousPlaceholder=t,t?e.setAttribute("placeholder",t):e.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){SQ.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let t=this._elementRef.nativeElement,e=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&e&&e.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(t){let e=this._elementRef.nativeElement;t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let t=this._elementRef.nativeElement;return this._isNativeSelect&&(t.multiple||t.size>1)}_iOSKeyupListener=t=>{let e=t.target;!e.value&&e.selectionStart===0&&e.selectionEnd===0&&(e.setSelectionRange(1,1),e.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(e,r){e&1&&S("focus",function(){return r._focusChanged(!0)})("blur",function(){return r._focusChanged(!1)})("input",function(){return r._onInput()}),e&2&&(Fc("id",r.id)("disabled",r.disabled&&!r.disabledInteractive)("required",r.required),He("name",r.name||null)("readonly",r._getReadonlyAttribute())("aria-disabled",r.disabled&&r.disabledInteractive?"true":null)("aria-invalid",r.empty&&r.required?null:r.errorState)("aria-required",r.required)("id",r.id),Re("mat-input-server",r._isServer)("mat-mdc-form-field-textarea-control",r._isInFormField&&r._isTextarea)("mat-mdc-form-field-input-control",r._isInFormField)("mat-mdc-input-disabled-interactive",r.disabledInteractive)("mdc-text-field__input",r._isInFormField)("mat-mdc-native-select-inline",r._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",Cn]},exportAs:["matInput"],features:[Ii([{provide:nf,useExisting:i}]),kn]})}return i})(),dO=(()=>
35{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn,nu,nu,sO,Wn]})}return i})();function CQ(i,n){i&1&&(s(0,"mat-error"),l(1,"Ticket count must be 0 or greater"),o())}function EQ(i,n){i&1&&(s(0,"mat-error"),l(1,"Total card amount must be 0 or greater"),o())}function wQ(i,n){i&1&&(s(0,"mat-error"),l(1,"Total cash amount must be 0 or greater"),o())}var mO=(()=>{let n=class n{constructor(e){this.dialogRef=e,this.ticketCount=null,this.totalCardAmount=null,this.totalCashAmount=null,this.isFormValid=!1}onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.isFormValid&&this.dialogRef.close({confirmed:!0,ticketCount:this.ticketCount,totalCardAmount:this.totalCardAmount,totalCashAmount:this.totalCashAmount})}validateFields(){this.isFormValid=(this.ticketCount??-1)>=0&&(this.totalCardAmount??-1)>=0&&(this.totalCashAmount??-1)>=0}};n.\u0275fac=function(r){return new(r||n)(x(U0))},n.\u0275cmp=te({type:n,selectors:[["app-confirmation-dialog"]],standalone:!1,decls:25,vars:7,consts:[["mat-dialog-title",""],["appearance","fill",2,"width","100%"],["matInput","","type","number","placeholder","Enter ticket count",3,"ngModelChange","input","ngModel"],[4,"ngIf"],["matInput","","type","number","placeholder","Enter total card amount",3,"ngModelChange","input","ngModel"],["matInput","","type","number","placeholder","Enter total cash amount",3,"ngModelChange","input","ngModel"],["align","end"],["mat-button","",3,"click"],["mat-button","","color","primary",3,"click","disabled"]],template:function(r,a){r&1&&(s(0,"h2",0),l(1,"Close Day"),o(),s(2,"mat-dialog-content")(3,"p"),l(4,"Are you sure you want to close the day?"),o(),s(5,"mat-form-field",1)(6,"mat-label"),l(7,"Ticket Count"),o(),s(8,"input",2),X("ngModelChange",function(d){return K(a.ticketCount,d)||(a.ticketCount=d),d}),S("input",function(){return a.validateFields()}),o(),T(9,CQ,2,0,"mat-error",3),o(),s(10,"mat-form-field",1)(11,"mat-label"),l(12,"Total Card Amount"),o(),s(13,"input",4),X("ngModelChange",function(d){return K(a.totalCardAmount,d)||(a.totalCardAmount=d),d}),S("input",function(){return a.validateFields()}),o(),T(14,EQ,2,0,"mat-error",3),o(),s(15,"mat-form-field",1)(16,"mat-label"),l(17,"Total Cash Amount"),o(),s(18,"input",5),X("ngModelChange",function(d){return K(a.totalCashAmount,d)||(a.totalCashAmount=d),d}),S("input",function(){return a.validateFields()}),o(),T(19,wQ,2,0,"mat-error",3),o()(),s(20,"mat-dialog-actions",6)(21,"button",7),S("click",function(){return a.onNoClick()}),l(22,"No"),o(),s(23,"button",8),S("click",function(){return a.onYesClick()}),l(24,"Yes"),o()()),r&2&&(m(8),q("ngModel",a.ticketCount),m(),p("ngIf",a.ticketCount!==null&&a.ticketCount<0),m(4),q("ngModel",a.totalCardAmount),m(),p("ngIf",a.totalCardAmount!==null&&a.totalCardAmount<0),m(4),q("ngModel",a.totalCashAmount),m(),p("ngIf",a.totalCashAmount!==null&&a.totalCashAmount<0),m(4),p("disabled",!a.isFormValid))},dependencies:[Dt,Ke,qi,Ne,Le,FT,OT,RT,GR,j0,fv,qT,cO],encapsulation:2});let i=n;return i})();var uO=Di(Ti());var Hr=(()=>{let n=class n{constructor(e,r){this.http=e,this.toastr=r,this.apiUrl=ui.apiUrl,this.analyticsUrl=ui.ambuluwawaBackendUrl+"/analytics",this.itemwiseReportUrl=ui.ambuluwawaBackendUrl}closeDay(e){let r=new xe({"Content-Type":"application/json"}),a={start_date:e};return this.http.post(this.apiUrl+"/close-day",a,{headers:r,responseType:"blob"})}getDailyCloseUpReportExcel(e){let r=new xe({"Content-Type":"application/json"}),a={start_date:e};return this.http.post(this.apiUrl+"/close-day-download-url",a,{headers:r})}insertCloseDayCashCardAmount(e,r,a,c){let d=new xe({"Content-Type":"application/json"}),u={date:e,cash_amount:r,card_amount:a,ticket_count:c};return this.http.post(this.apiUrl+"/insert-amount-for-day",u,{headers:d,responseType:"blob"})}getSalesReportData(e,r,a){let c=new xe({"Content-Type":"application/json",path:"sales-report-data"}),d={frequency:a,fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,d,{headers:c})}getVisitorAndVehicalsSales(e,r,a){let c=new xe({"Content-Type":"application/json",path:"visitor-report-data"}),d={frequency:a,fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,d,{headers:c})}getSalesExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"export-data"}),c={fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,c,{headers:a})}entranceTicketingReport(e,r,a,c){let d=new xe({"Content-Type":"application/json",path:"sales-by-ticket-type"}),u={fromDate:e,toDate:r,frequency:a,ticketType:c};return this.http.post(this.analyticsUrl,u,{headers:d})}tourGuideReport(e,r,a){let c=new xe({"Content-Type":"application/json",path:"sales-by-guide"}),d={frequency:a,fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,d,{headers:c})}salesByNationality(e,r,a){let c=new xe({"Content-Type":"application/json",path:"sales-by-nationality"}),d={frequency:a,fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,d,{headers:c})}topTenNations(e,r,a){let c=new xe({"Content-Type":"application/json",path:"top-ten-nations"}),d={frequency:a,fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,d,{headers:c})}getTimelySales(e,r){let a=new xe({"Content-Type":"application/json",path:"get-timely-dales"}),c={fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,c,{headers:a})}getDonationData(e,r,a){let c=new xe({"Content-Type":"application/json",path:"donations"}),d={fromDate:e,toDate:r,frequency:a};return this.http.post(this.analyticsUrl,d,{headers:c})}getItemWiseSales(e,r){let a={fromDate:e,toDate:r};console.log("item wise payload",a);let c=new xe({"Content-Type":"application/json",path:"ticket/item-wise-summary"});return this.http.post(this.itemwiseReportUrl,a,{headers:c})}getMonthlySalesReport(e,r){let a=new xe({"Content-Type":"application/json",path:"get-monthly-report"}),c={month:e,year:r};return this.http.post(this.analyticsUrl,c,{headers:a})}getMonthlySalesExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"get-monthly-report-excel"}),c={month:e,year:r};return this.http.post(this.analyticsUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Excel){let u=d.data.base64Excel;return this.convertBase64ToBlob(u,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading Excel:",d),this.toastr.error("Failed to generate Excel:","Error"),fr(d))))}convertBase64ToBlob(e,r){return new za(a=>{try{let c=e.replace(/^data:.*;base64,/,"");if(!/^[A-Za-z0-9+/]+={0,2}$/.test(c))throw new Error("Invalid Base64 string");let u=atob(c),h=new ArrayBuffer(u.length),f=new Uint8Array(h);for(let C=0;C<u.length;C++)f[C]=u.charCodeAt(C);let v=new Blob([f],{type:r});a.next(v),a.complete()}catch(c){console.error("Error decoding base64 string:",c),this.toastr.error("Failed to download file","Error"),a.error(c)}})}downloadFile(e,r){(0,uO.default)(e,r)}getMonthlySalesPDF(e,r){let a=new xe({"Content-Type":"application/json",path:"get-monthly-report-pdf"}),c={month:e,year:r};return this.http.post(this.analyticsUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Pdf){let u=d.data.base64Pdf;return this.convertBase64ToBlob(u,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading PDF:",d),this.toastr.error("Failed to generate PDF:","Error"),fr(d))))}getDailyTransactionsToVerify(e,r){let a=new xe({"Content-Type":"application/json",path:"get-daily-confirmation"}),c={month:e,year:r};return this.http.post(this.analyticsUrl,c,{headers:a})}confirmDailyTransactions(e){let r=new xe({"Content-Type":"application/json",path:"save-daily-confirmation"});return this.http.post(this.analyticsUrl,e,{headers:r})}getGuideList(){let e=new xe({"Content-Type":"application/json",path:"user/guide/get"});return this.http.post(this.itemwiseReportUrl,{},{headers:e})}getTicketList(e,r){let a=new xe({"Content-Type":"application/json",path:"ticket/get-all"}),c={page:e,ticketId:r};return this.http.post(this.itemwiseReportUrl,c,{headers:a})}linkGuideToTicket(e,r,a){let c=new xe({"Content-Type":"application/json",path:"ticket/link-guide"}),d={ticketId:e,guideId:r,reason:a};return this.http.post(this.itemwiseReportUrl,d,{headers:c})}saveQrCode(e){let r=new xe({"Content-Type":"application/json"}),a={qr_code:e};return this.http.post(`${this.apiUrl}/qr-code/save`,a,{headers:r})}getQrCodes(e=1,r=10){let a=new xe({"Content-Type":"application/json"});return this.http.get(`${this.apiUrl}/qr-code/list?page=${e}&limit=${r}`,{headers:a})}deleteQrCode(e){let r=new xe({"Content-Type":"application/json"}),a={qr_code:e};return this.http.post(`${this.apiUrl}/qr-code/delete`,a,{headers:r})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi),kt(me))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var pO=Di(Ti());var ru=(()=>{let n=class n{constructor(e,r){this.http=e,this.toastr=r,this.apiUrl=ui.ambuluwawaBackendUrl,this.apiKey=ui.PUBLIC_API_KEY,this.apiUrlPublic=ui.ambuluwawaBackendPublicUrl,this.apiUrlUpdatePrice=ui.ambuluwawaBackendUrl+"/price"}getTicketSales(e){let r=new xe({"Content-Type":"application/json",path:"ticket/get-with-filters"});return this.http.post(this.apiUrl,e,{headers:r})}getDailySales(e,r){let a=new xe({"Content-Type":"application/json",path:"ticket/get-daily"}),c={date:e,page:r};return this.http.post(this.apiUrl,c,{headers:a})}getDailySalesPDF(e){let r=new xe({"Content-Type":"application/json",path:"ticket/get-daily-pdf"}),a={date:e};return this.http.post(this.apiUrl,a,{headers:r,responseType:"json"}).pipe(Tn(c=>{if(c.status==="success"&&c.data?.base64Pdf){let d=c.data.base64Pdf;return this.convertBase64ToBlob(d,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(c=>(console.error("Error downloading PDF:",c),this.toastr.error("Failed to generate PDF:","Error"),fr(c))))}getDailySalesExcel(e){let r=new xe({"Content-Type":"application/json",path:"ticket/get-daily-excel"}),a={date:e};return this.http.post(this.apiUrl,a,{headers:r,responseType:"json"}).pipe(Tn(c=>{if(c.status==="success"&&c.data?.base64Excel){let d=c.data.base64Excel;return this.convertBase64ToBlob(d,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(c=>(console.error("Error downloading Excel:",c),this.toastr.error("Failed to generate Excel:","Error"),fr(c))))}getItemWiseReportPDF(e,r){let a=new xe({"Content-Type":"application/json",path:"ticket/item-wise-pdf"}),c={fromDate:e,toDate:r};return this.http.post(this.apiUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Pdf){let u=d.data.base64Pdf;return this.convertBase64ToBlob(u,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading PDF:",d),this.toastr.error("Failed to generate PDF:","Error"),fr(d))))}getItemWiseReportExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"ticket/item-wise-excel"}),c={fromDate:e,toDate:r};return this.http.post(this.apiUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Excel){let u=d.data.base64Excel;return this.convertBase64ToBlob(u,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading Excel:",d),this.toastr.error("Failed to generate Excel:","Error"),fr(d))))}convertBase64ToBlob(e,r){return new za(a=>{try{let c=e.replace(/^data:.*;base64,/,"");if(!/^[A-Za-z0-9+/]+={0,2}$/.test(c))throw new Error("Invalid Base64 string");let u=atob(c),h=new ArrayBuffer(u.length),f=new Uint8Array(h);for(let C=0;C<u.length;C++)f[C]=u.charCodeAt(C);let v=new Blob([f],{type:r});a.next(v),a.complete()}catch(c){console.error("Error decoding base64 string:",c),this.toastr.error("Failed to download file","Error"),a.error(c)}})}getTicketSalesExcelWithFilters(e){let r=new xe({"Content-Type":"application/json",path:"ticket/get-with-filters-excel"});return this.http.post(this.apiUrl,e,{headers:r,responseType:"json"}).pipe(Ki(a=>
35{if(a.status==="success"&&a.data.base64Excel)return a.data.base64Excel;throw new Error("Invalid API response or missing Base64 string")}),Tn(a=>this.convertBase64ToBlob(a,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")))}downloadFile(e,r){(0,pO.saveAs)(e,r)}getVisitorPrice(){let e=new xe({"Content-Type":"application/json","x-api-key":this.apiKey,path:"visitor/get-types-for-mobile"});return this.http.post(this.apiUrlPublic,{},{headers:e})}getVehiclePrice(){let e=new xe({"Content-Type":"application/json","x-api-key":this.apiKey,path:"vehicle/get-for-mobile"});return this.http.post(this.apiUrlPublic,{},{headers:e})}updateVehiclePrice(e){let r=new xe({"Content-Type":"application/json","x-api-key":this.apiKey,path:"update-vehicle-price"});return this.http.post(this.apiUrlUpdatePrice,e,{headers:r})}updateVisitorPrice(e){let r=new xe({"Content-Type":"application/json","x-api-key":this.apiKey,path:"update-visitor-price"});return this.http.post(this.apiUrlUpdatePrice,e,{headers:r})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi),kt(me))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var TQ=i=>({collapsed:i}),DQ=(i,n)=>({completed:i,pending:n});function IQ(i,n){if(i&1&&B(0,"img",37),i&2){let t=w().$implicit;p("src",t.flagUrl,O_)("alt",t.country)}}function kQ(i,n){if(i&1&&(s(0,"div",33)(1,"span"),l(2,"("),s(3,"strong"),l(4),o(),l(5,") "),o(),s(6,"span"),l(7),o(),s(8,"span",34),l(9),o(),s(10,"span",35),T(11,IQ,1,2,"img",36),l(12," : "),o(),s(13,"span")(14,"strong"),l(15),I(16,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(4),b(t.count),m(3),_(" ",t.name," / "),m(2),_(" ",t.country," "),m(2),p("ngIf",t.flagUrl),m(4),_(" ",M(16,5,t.price),"/-")}}function MQ(i,n){if(i&1&&(s(0,"div",33)(1,"span"),l(2,"("),s(3,"strong"),l(4),o(),l(5,") "),o(),s(6,"span"),l(7),o(),s(8,"span",38)(9,"span",11),l(10),o()(),s(11,"span")(12,"strong"),l(13),I(14,"currencyFormat"),o()()()),i&2){let t=n.$implicit,e=w(2);m(4),b(t.count),m(3),_(" ",t.name," "),m(3),_(" ",e.vehicleIcons.get(t.name)),m(3),_(" : ",M(14,4,t.price),"/-")}}function AQ(i,n){if(i&1&&(s(0,"div",33)(1,"span"),l(2),o()()),i&2){let t=w().$implicit;m(2),j_("Guide: ",t.guidefirstname," ",t.guidelastname," ",t.usercode," ")}}function PQ(i,n){if(i&1&&(s(0,"div",33)(1,"span"),l(2,"Expense LKR :"),o(),s(3,"span")(4,"strong"),l(5),I(6,"currencyFormat"),o()()()),i&2){let t=w().$implicit;m(5),_(" ",M(6,1,t.expense),"/-")}}function FQ(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),I(5,"date"),o(),s(6,"td"),T(7,kQ,17,7,"div",30)(8,MQ,15,6,"div",30)(9,AQ,3,3,"div",31)(10,PQ,7,3,"div",31),o(),s(11,"td")(12,"span",32),l(13),o()(),s(14,"td"),l(15),o(),s(16,"td",19)(17,"strong"),l(18),I(19,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),_("#",t.serialnumber),m(2),b(Jt(5,10,t.createdat,"MMM d, y \xB7 hh:mm a")),m(3),p("ngForOf",t.visitordetails),m(),p("ngForOf",t.vehicledetails),m(),p("ngIf",t.usercode),m(),p("ngIf",t.usercode),m(2),p("ngClass",Et(15,DQ,t.paymentstatus==="completed",t.paymentstatus==="pending")),m(),_(" ",t.paymentstatus," "),m(2),b(t.tickettype),m(3),b(M(19,13,t.amount))}}function RQ(i,n){if(i&1){let t=he();s(0,"li",26)(1,"button",39),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var hO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h,f,v,C){this.sidebarService=e,this.dialog=r,this.admissionService=a,this.spinner=c,this.toastr=d,this.currencyFormatPipe=u,this.entranceTicketingService=h,this.http=f,this.renderer=v,this.el=C,this.selectedDate="",this.formattedDate="",this.isCollapsed=!1,this.tickets=[],this.visitor=[],this.vehical=[],this.totalAmount=0,this.pendingTotalAmount=0,this.completedTotalAmount=0,this.currentPage=1,this.itemsPerPage=20,this.totalItems=0,this.totalPages=0,this.vehicleIcons=X1.vehicles,this.pages=[]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.getDailySales(this.currentPage)}closeDay(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.admissionService.closeDay(this.selectedDate).subscribe({next:e=>{this.spinner.hide(),this.toastr.success("Day is Closed!","Success")},error:e=>{console.error("Error in closing Day",e),this.spinner.hide(),this.toastr.error("Failed to Close Day","Error")}}))}getInsertCashCardAmount(e,r,a){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.admissionService.insertCloseDayCashCardAmount(this.selectedDate,e,r,a).subscribe({next:c=>{this.spinner.hide(),this.toastr.success("Close Day Amount Saved","Success")},error:c=>{console.error("Error in storing Amount",c),this.spinner.hide(),this.toastr.error("Failed to Save Amount","Error")}}))}onclickGenerateReport(){let r=new Date().toISOString().split("T")[0];this.selectedDate===r?this.toastr.error("Closeup report has not been generated for today"):this.getDailyCloseUpReportExcel()}getDailyCloseUpReportExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.admissionService.getDailyCloseUpReportExcel(this.selectedDate).subscribe({next:e=>{console.log("Received presigned URL:",e.url),this.downloadExcelFile(e.url)},error:e=>{console.error("Error getting presigned URL:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel","Error")}}))}downloadExcelFile(e){let r=`Entrance Ticketing Daily Closeup Report ${this.selectedDate}.xlsx`,a=document.createElement("a");a.href=e,a.setAttribute("download",r),a.target="_blank",document.body.appendChild(a),a.click(),document.body.removeChild(a),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")}openConfirmationDialog(){this.dialog.open(mO).afterClosed().subscribe(r=>{r?.confirmed?this.getInsertCashCardAmount(r.totalCashAmount,r.totalCardAmount,r.ticketCount):console.log("User canceled")})}
35setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(e){this.selectedDate&&(this.spinner.show(),this.entranceTicketingService.getDailySales(this.selectedDate,e).subscribe({next:r=>{console.log("API Response:",r),this.completedTotalAmount=0,this.pendingTotalAmount=0,this.tickets=r.data.listOfTickets.map(a=>(this.visitor=this.processVisitorDetails(a.visitordetails||[]),this.vehical=this.processVehicleDetails(a.vehicledetails||[]),a.visitordetails=this.visitor,a.vehicledetails=this.vehical,a.guidedetails=this.processGuideDetails(a.guidedetails),a.guidedetails=this.formatGuideDetails(a.guidedetails),a.tickettype=this.formatTicketType(a.tickettype),a))||[],this.totalAmount=r.data.totalAmount,this.pendingTotalAmount=r.data.pendingAmount,this.completedTotalAmount=r.data.completedAmount,this.currentPage=e,this.itemsPerPage=r.data.limit||20,this.totalItems=r.data.rowCount||0,this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage),this.updatePagination(),this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales(this.currentPage)}}formatTicketType(e){return e.split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join(" ")}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}formatGuideDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return r})}processVisitorDetails(e){if(!e||e.length===0)return[];let r=new Map;return e.forEach(a=>{let c=a.country.trim(),d=zh.find(v=>v.name.toLowerCase()===c.toLowerCase()),u=d?`assets/flags/${d.countryCode.toLowerCase()}.svg`:null,h=a.name.split("-").map(v=>v.charAt(0).toUpperCase()+v.slice(1).toLowerCase()).join(" "),f=`${h}-${c}`;r.has(f)||r.set(f,tt(le({},a),{name:h,country:c,flagUrl:u}))}),Array.from(r.values())}processVehicleDetails(e){if(!e||e.length===0)return[];let r=new Map;return e.forEach(a=>{let c=a.name.split("-").map(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join(" "),d=`${c}-${a.count}`;r.has(d)||r.set(d,tt(le({},a),{name:c}))}),Array.from(r.values()).map(a=>(a.price=parseFloat(a.price.toFixed(2)),a))}
35processDetails(e){return e?e.split(` 36`).map(r=>{r=r.replace(/LKR\.?/gi,"").trim(),r=r.replace(/\b([a-z])([a-z]*)\b/gi,(c,d,u)=>d.toUpperCase()+u.toLowerCase());let a=r.match(/\(([^)]+)\)/);if(a){let c=a[1].trim(),d=zh.find(u=>u.name.toLowerCase()===c.toLowerCase());d&&d.countryCode&&(r=r.replace(`(${c})`,`(${c}<img src="assets/flags/${d.countryCode.toLowerCase()}.svg" alt="${d.countryCode}" class="country-flag" />) `))}for(let[c,d]of X1.vehicles)if(r.includes(c)){r=`${d} ${r}`;break}return r}).join(` 37`).trimStart():""}ngAfterViewChecked(){this.applyFlagStyles()}applyFlagStyles(){this.el.nativeElement.querySelectorAll("img.country-flag").forEach(r=>{this.renderer.setStyle(r,"width","22px"),this.renderer.setStyle(r,"height","16px"),this.renderer.setStyle(r,"margin-left","3px"),this.renderer.setStyle(r,"margin-right","3px"),this.renderer.setStyle(r,"padding","0"),this.renderer.setStyle(r,"border-radius","2px"),this.renderer.setStyle(r,"box-shadow","0 0 0 0.5px rgba(0, 0, 0, 0.1)"),this.renderer.setStyle(r,"object-fit","cover"),this.renderer.setStyle(r,"vertical-align","text-bottom"),this.renderer.setStyle(r,"display","inline-block")})}processGuideDetails(e){return e?e.split(` 38`).map(r=>(r=r.replace(/LKR\.?/gi,"").trim(),r=r.replace(/\b([a-z])([a-z]*)\b/gi,(a,c,d)=>c.toUpperCase()+d.toLowerCase()),r)).join(` 39`).trimStart():""}onClickedPrint(){window.print()}onClickedGenerateExcel(){this.getDailySalesExcel()}onClickGeneratePDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.spinner.show(),this.entranceTicketingService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{this.entranceTicketingService.downloadFile(e,`Entrance Ticketing Daily Sales ${this.selectedDate}.pdf`),this.spinner.hide()},error:e=>{console.error("Error downloading PDF:",e),this.toastr.error("Failed to generate PDF:","Error"),this.spinner.hide()}})}getDailySalesExcel(){this.spinner.show(),this.entranceTicketingService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{this.entranceTicketingService.downloadFile(e,`Entrance Ticketing Daily Sales ${this.selectedDate}.xlsx`),this.spinner.hide()},error:e=>{console.error("Error downloading Excel:",e),this.toastr.error("Failed to generate Excel:","Error"),this.spinner.hide()}})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&this.getDailySales(e)}prevPage(){this.currentPage>1&&this.getDailySales(this.currentPage-1)}nextPage(){this.currentPage<this.totalPages&&this.getDailySales(this.currentPage+1)}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(uv),x(Hr),x(pe),x(me),x(Be),x(ru),x(Bi),x(qn),x(Ai))},n.\u0275cmp=te({type:n,selectors:[["app-dailysalesreports"]],standalone:!1,features:[Ii([Be])],decls:88,vars:24,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"sticky-bottom"],["colspan","3"],["aria-label","Page navigation"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],["class","tableDetails",4,"ngFor","ngForOf"],["class","tableDetails",4,"ngIf"],[1,"status",3,"ngClass"],[1,"tableDetails"],[1,"ms-1"],[1,"d-flex","align-items-center"],["class","country-flag",3,"src","alt",4,"ngIf"],[1,"country-flag",3,"src","alt"],[1,"vehicalImg"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Admission Tickets \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select Date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGeneratePDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickedGenerateExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickedPrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o(),s(31,"button",12),S("click",function(){return a.onclickGenerateReport()}),s(32,"span",11),l(33,"description"),o(),l(34,"CloseUP Report "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"#Serial"),o(),s(44,"th"),l(45,"Issue Date (IST)"),o(),s(46,"th"),l(47,"Details"),o(),s(48,"th"),l(49,"Payment Status"),o(),s(50,"th"),l(51,"Ticket Type"),o(),s(52,"th",19),l(53,"Amount (LKR)"),o()()(),s(54,"tbody",20),T(55,FQ,20,18,"tr",21),o(),s(56,"tfoot",22)(57,"tr")(58,"td",23),l(59," Count: "),s(60,"strong"),l(61),o()(),s(62,"td"),l(63," Completed Total: "),s(64,"strong"),l(65
39),I(66,"currencyFormat"),o()(),s(67,"td"),l(68," Pending Total: "),s(69,"strong"),l(70),I(71,"currencyFormat"),o()(),s(72,"td",19),l(73," Total Revenue: "),s(74,"strong"),l(75),I(76,"currencyFormat"),o()()()()()()()(),s(77,"nav",24)(78,"ul",25)(79,"li",26)(80,"button",27),S("click",function(){return a.prevPage()}),s(81,"span",28),l(82,"\xAB"),o()()(),T(83,RQ,3,3,"li",29),s(84,"li",26)(85,"button",27),S("click",function(){return a.nextPage()}),s(86,"span",28),l(87,"\xBB"),o()()()()()()()),r&2&&(p("ngClass",Z(22,TQ,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(6),b(a.totalItems),m(4),b(M(66,16,a.completedTotalAmount)),m(5),b(M(71,18,a.pendingTotalAmount)),m(5),b(M(76,20,a.totalAmount)),m(4),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,Dt,Ke,Ne,Le,St,Be],encapsulation:2});let i=n;return i})();var fO=Di(Ti());var OQ=i=>({collapsed:i}),NQ=(i,n)=>({completed:i,pending:n});function LQ(i,n){if(i&1&&(s(0,"option",33),l(1),o()),i&2){let t=n.$implicit;p("value",t.value),m(),_(" ",t.label," ")}}function BQ(i,n){if(i&1&&(s(0,"option",33),l(1),o()),i&2){let t=n.$implicit;p("value",t.value),m(),_(" ",t.label," ")}}function VQ(i,n){if(i&1&&(s(0,"option",33),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function UQ(i,n){if(i&1&&B(0,"img",41),i&2){let t=w().$implicit;p("src",t.flagUrl,O_)("alt",t.country)}}function jQ(i,n){if(i&1&&(s(0,"div",37)(1,"span"),l(2,"("),s(3,"strong"),l(4),o(),l(5,") "),o(),s(6,"span"),l(7),o(),s(8,"span",38),l(9),o(),s(10,"span",39),T(11,UQ,1,2,"img",40),l(12," : "),o(),s(13,"span")(14,"strong"),l(15),I(16,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(4),b(t.count),m(3),_(" ",t.name," / "),m(2),_(" ",t.country," "),m(2),p("ngIf",t.flagUrl),m(4),_(" ",M(16,5,t.price),"/-")}}function WQ(i,n){if(i&1&&(s(0,"div",37)(1,"span"),l(2,"("),s(3,"strong"),l(4),o(),l(5,") "),o(),s(6,"span"),l(7),o(),s(8,"span",42)(9,"span",17),l(10),o()(),s(11,"span")(12,"strong"),l(13),I(14,"currencyFormat"),o()()()),i&2){let t=n.$implicit,e=w(2);m(4),b(t.count),m(3),_(" ",t.name," "),m(3),_(" ",e.vehicleIcons.get(t.name)),m(3),_(" : ",M(14,4,t.price),"/-")}}function HQ(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div",34),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td"),T(11,jQ,17,7,"div",35)(12,WQ,15,6,"div",35),o(),s(13,"td")(14,"span",36),l(15),o()(),s(16,"td"),l(17),o(),s(18,"td",24)(19,"strong"),l(20),I(21,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.serialnumber),m(3),_("By ",t.issuername),m(2),b(Jt(9,9,t.createdat,"MMM d, y \xB7 hh:mm a")),m(3),p("ngForOf",t.visitordetails),m(),p("ngForOf",t.vehicledetails),m(2),p("ngClass",Et(14,NQ,t.paymentstatus==="completed",t.paymentstatus==="pending")),m(),_(" ",t.paymentstatus," "),m(2),b(t.tickettype),m(3),b(M(21,12,t.amount))}}function GQ(i,n){if(i&1){let t=he();s(0,"li",29)(1,"button",43),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var gO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h,f,v){this.entranceTicketingService=e,this.spinner=r,this.toastr=a,this.currencyFormatPipe=c,this.fb=d,this.sidebarService=u,this.renderer=h,this.el=f,this.sanitizer=v,this.isCollapsed=!1,this.currentPage=1,this.itemsPerPage=20,this.totalItems=0,this.totalPages=0,this.pages=[],this.items=[],this.visitor=[],this.vehical=[],this.today=null,this.paymentStatusOptions=AF,this.ticketTypeOptions=PF,this.countries=zh,this.vehicleIcons=X1.vehicles,this.initFilterForm()}ngOnInit(){this.today=new Date().toISOString().split("T")[0],this.getTicketSales(this.currentPage,this.filterForm.value),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}initFilterForm(){let e=this.getISTDate(new Date),r=this.getISTDate(new Date(e.getFullYear(),e.getMonth()-1,e.getDate()));this.filterForm=this.fb.group({startDate:[this.formatDate(r)],endDate:[this.formatDate(e)],paymentStatus:["null"],ticketType:["null"],country:[0]})}applyFilters(){let e=this.filterForm.value;this.currentPage=1,this.getTicketSales(this.currentPage,e)}resetFilters(){let e=this.getISTDate(new Date),r=this.getISTDate(new Date(new Date().getFullYear(),0,1));this.currentPage=1,this.filterForm.reset({startDate:this.formatDate(r),endDate:this.formatDate(e),paymentStatus:"null",ticketType:"null",country:0}),this.getTicketSales(this.currentPage,this.filterForm.value)}getTicketSales(e,r){console.log("API Call with filters:",r),this.spinner.show();let a={filterByUser:!1,page:e-1,keyword:"",payment_status:r.paymentStatus==="null"?null:r.paymentStatus,ticket_type:r.ticketType==="null"?null:r.ticketType,country:r.country,start_date:r.startDate,end_date:r.endDate};this.entranceTicketingService.getTicketSales(a).subscribe({next:c=>{console.log("API Response:",c),c&&c.data&&(this.items=c.data.listOfTickets.map(d=>(this.visitor=this.processVisitorDetails(d.visitordetails||[]),this.vehical=this.processVehicleDetails(d.vehicledetails||[]),d.visitordetails=this.visitor,d.vehicledetails=this.vehical,d.tickettype=this.formatTicketType(d.tickettype),d)),this.currentPage=e,this.itemsPerPage=c.data.limit||20,this.totalItems=c.data.rowCount||0,this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage),this.updatePagination()),this.items.length===0&&this.toastr.warning("No records available!","Warning"),this.scrollToTop(),this.spinner.hide()},error:c=>{console.error("API Error:",c),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatTicketType(e){return e.split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join(" ")}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}processVisitorDetails(e){return!e||e.length===0?[]:e.map(r=>{let a=r.country.trim(),c=zh.find(d=>d.name.toLowerCase()===a.toLowerCase());return r.flagUrl=c?`assets/flags/${c.countryCode.toLowerCase()}.svg`:null,r.name=r.name.split("-").map(d=>d.charAt(0).toUpperCase()+d.slice(1).toLowerCase()).join(" "),r})}processVehicleDetails(e){return!e||e.length===0?[]:e.map(r=>(r.name=r.name.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join(" "),r.price=parseFloat(r.price.toFixed(2)),r))}ngAfterViewChecked(){this.applyFlagStyles()}applyFlagStyles(){this.el.nativeElement.querySelectorAll("img.country-flag").forEach(r=>{this.renderer.setStyle(r,"width","22px"),this.renderer.setStyle(r,"height","16px"),this.renderer.setStyle(r,"margin-left","3px"),this.renderer.setStyle(r,"margin-right","3px"),this.renderer.setStyle(r,"padding","0"),this.renderer.setStyle(r,"border-radius","2px"),this.renderer.setStyle(r,"box-shadow","0 0 0 0.5px rgba(0, 0, 0, 0.1)"),this.renderer.setStyle(r,"object-fit","cover"),this.renderer.setStyle(r,"vertical-align","text-bottom"),this.renderer.setStyle(r,"display","inline-block")})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&this.getTicketSales(e,this.filterForm.value)}prevPage(){this.currentPage>1&&this.getTicketSales(this.currentPage-1,this.filterForm.value)}nextPage(){this.currentPage<this.totalPages&&this.getTicketSales(this.currentPage+1,this.filterForm.value)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}getISTDate(e){return new Date(e.getTime()+330*60*1e3)}formatDate(e){let r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");return`${r}-${a}-${c}`}onClickGenerateExcel(){this.getTicketingSalesExcelWithFilters(this.filterForm.value)}getTicketingSalesExcelWithFilters(e){this.spinner.show();let r={filterByUser:!1,keyword:"",payment_status:e.paymentStatus==="null"?null:e.paymentStatus,ticket_type:e.ticketType==="null"?null:e.ticketType,country:e.country,start_date:e.startDate,end_date:e.endDate};this.entranceTicketingService.getTicketSalesExcelWithFilters(r).subscribe({next:a=>{let c=`Entrance Ticketing Sales report ${e.startDate} - ${e.endDate}.xlsx`;(0,fO.default)(a,c),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:a=>{console.error("Error downloading Excel:",a),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(ru),x(pe),x(me),x(Be),x(Qr),x(ce),x(qn),x(Ai),x($u))},n.\u0275cmp=te({type:n,selectors:[["app-admissionticketsales"]],standalone:!1,features:[Ii([Be])],decls:81,vars:15,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[3,"formGroup"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","formControlName","startDate",1,"form-control"],["type","date","formControlName","endDate",1,"form-control"],["formControlName","paymentStatus",1,"form-select"],[3,"value",4,"ngFor","ngForOf"],["formControlName","ticketType",1,"form-select"],["formControlName","country",1,"form-select"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["aria-label","Page navigation"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[3,"value"],[1,"subTextline"],["class","tableDetails",4,"ngFor","ngForOf"],[1,"status",3,"ngClass"],[1,"tableDetails"],[1,"ms-1"],[1,"d-flex","align-items-center"],["class","country-flag",3,"src","alt",4,"ngIf"],[1,"country-flag",3,"src","alt"],[1,"vehicalImg"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Admission Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"form",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"label",8),l(12,"Start Date"),o(),B(13,"input",9),o(),s(14,"div",7)(1
395,"label",8),l(16,"End Date"),o(),B(17,"input",10),o(),s(18,"div",7)(19,"label",8),l(20,"Payment Status"),o(),s(21,"select",11),T(22,LQ,2,2,"option",12),o()(),s(23,"div",7)(24,"label",8),l(25,"Ticket Type"),o(),s(26,"select",13),T(27,BQ,2,2,"option",12),o()(),s(28,"div",7)(29,"label",8),l(30,"Country"),o(),s(31,"select",14),T(32,VQ,2,2,"option",12),o()(),s(33,"div",15)(34,"button",16),S("click",function(){return a.applyFilters()}),s(35,"span",17),l(36,"search"),o(),l(37," Generate "),o(),s(38,"button",16),S("click",function(){return a.resetFilters()}),s(39,"span",17),l(40,"restart_alt"),o(),l(41," Reset "),o()()(),s(42,"div",15)(43,"button",16),S("click",function(){return a.onClickGenerateExcel()}),s(44,"span",17),l(45,"description"),o(),l(46," Excel "),o()()()(),s(47,"div",18)(48,"div",19)(49,"div",20)(50,"div",21)(51,"table",22)(52,"thead",23)(53,"tr")(54,"th"),l(55,"#Serial"),o(),s(56,"th"),l(57,"User"),o(),s(58,"th"),l(59,"Issue Date (IST)"),o(),s(60,"th"),l(61,"Details"),o(),s(62,"th"),l(63,"Payment Status"),o(),s(64,"th"),l(65,"Ticket Type"),o(),s(66,"th",24),l(67,"Amount (LKR)"),o()()(),s(68,"tbody",25),T(69,HQ,22,17,"tr",26),o()()()()(),s(70,"nav",27)(71,"ul",28)(72,"li",29)(73,"button",30),S("click",function(){return a.prevPage()}),s(74,"span",31),l(75,"\xAB"),o()()(),T(76,GQ,3,3,"li",32),s(77,"li",29)(78,"button",30),S("click",function(){return a.nextPage()}),s(79,"span",31),l(80,"\xBB"),o()()()()()()()),r&2&&(p("ngClass",Z(13,OQ,a.isCollapsed)),m(7),p("formGroup",a.filterForm),m(15),p("ngForOf",a.paymentStatusOptions),m(5),p("ngForOf",a.ticketTypeOptions),m(5),p("ngForOf",a.countries),m(37),p("ngForOf",a.items),m(3),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,Ot,Ne,Oi,wr,$r,St,Be],encapsulation:2});let i=n;return i})();var c2=(()=>{let n=class n{constructor(e){this.http=e,this.guideExpenseApiUrl=ui.ambuluwawaBackendUrl+"/guide-expense",this.guidePrivateUrl=ui.ambuluwawaBackendUrl,this.bankBranchUrl=ui.ambuluwawaBackendPublicUrl,this.publicApiKey=ui.PUBLIC_API_KEY}getGuideExpenseExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"get-guide-wise-expense-excel"}),c={month:e,year:r};return this.http.post(this.guideExpenseApiUrl,c,{headers:a,responseType:"json"}).pipe(Ki(d=>{console.log("--",d);let u=atob(d.data.excel),h=new Array(u.length);for(let C=0;C<u.length;C++)h[C]=u.charCodeAt(C);let f=new Uint8Array(h);return new Blob([f],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}))}getGuideWiseExpense(e,r){let a=new xe({"Content-Type":"application/json",path:"get-guide-wise-expense"}),c={month:e,year:r};return this.http.post(this.guideExpenseApiUrl,c,{headers:a,responseType:"json"})}getGuideList(e,r){let a=new xe({"Content-Type":"application/json",path:"user/guide/get","x-api-key":this.publicApiKey}),c={page:e,filters:{province:r?.province||"",district:r?.district||""}};return this.http.post(this.guidePrivateUrl,c,{headers:a,responseType:"json"})}createGuide(e,r,a,c,d,u,h,f,v,C,y,A,D,F,R,L,H,se,Ce,Ue,re,ae,ve){let Me=new xe({"Content-Type":"application/json",path:"user/guide/new"}),W={id:R,addressLine1:e,addressLine2:r,bankAccountName:a,bankAccountNumber:c,bankBranch:d,bankName:u,bankCode:h,branchCode:f,city:v,country:C,district:y,dob:A,email:D,firstName:F,identification:L,lastName:H,newPassword:se,password:Ce,phoneNumber:Ue,postalCode:re,province:ae,username:ve};return this.http.post(this.guidePrivateUrl,W,{headers:Me,responseType:"json"})}getBranchbyBankId(e){let r=new xe({"Content-Type":"application/json",path:"get-branch-by-bankcode","x-api-key":this.publicApiKey}),a={bank_code:e};return this.http.post(this.bankBranchUrl,a,{headers:r,responseType:"json"})}updateGuide(e,r,a,c,d,u,h,f,v,C,y,A,D,F,R,L,H,se,Ce,Ue,re,ae,ve){let Me=new xe({"Content-Type":"application/json",path:"user/guide/update"}),W={id:R,addressLine1:e,addressLine2:r,bankAccountName:a,bankAccountNumber:c,bankBranch:d,bankName:u,bankCode:h,branchCode:f,city:v,country:C,district:y,dob:A,email:D,firstName:F,identification:L,lastName:H,newPassword:se,password:Ce,phoneNumber:Ue,postalCode:re,province:ae,username:ve};return this.http.post(this.guidePrivateUrl,W,{headers:Me,responseType:"json"})}getGuideExpenseTransaction(e,r,a){let c=new xe({"Content-Type":"application/json",path:"get-guide-transactions-expense"}),d={guide_id:e,month:r,year:a};return this.http.post(this.guideExpenseApiUrl,d,{headers:c,responseType:"json"})}getUpdateStatus(e,r,a,c,d){let u=new xe({"Content-Type":"application/json",path:"update-guide-salary-status"}),h={guide_id:e,month:r,year:a,status:c,calculated_salary:d};return this.http.post(this.guideExpenseApiUrl,h,{headers:u,responseType:"json"})}getAllBanks(){let e=new xe({"Content-Type":"application/json",path:"bank-detail
39s/get","x-api-key":this.publicApiKey}),r={};return this.http.post(this.bankBranchUrl,r,{headers:e,responseType:"json"})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var $Q=i=>({collapsed:i}),On=i=>({"is-invalid":i});function zQ(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function YQ(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function qQ(i,n){if(i&1){let t=he();s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td")(8,"div"),l(9),o()(),s(10,"td")(11,"div"),l(12),o()(),s(13,"td")(14,"div"),l(15),o()(),s(16,"td")(17,"div"),l(18),o()(),s(19,"td")(20,"div"),l(21),o()(),s(22,"td")(23,"div",117)(24,"button",118),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openEditModal(r))}),s(25,"span",119),l(26,"edit"),o()(),s(27,"button",120),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openViewModal(r))}),s(28,"span",119),l(29,"visibility"),o()()()()()}if(i&2){let t=n.$implicit,e=w();m(3),_("#",t.id),m(3),b(t.usercode),m(3),b(t.firstname),m(3),b(t.lastname),m(3),b(t.email),m(3),b(t.phonenumber),m(3),b(t.identification),m(3),p("disabled",e.isAccountant||e.isOfficeUser)}}function KQ(i,n){if(i&1){let t=he();s(0,"li",123)(1,"button",127),S("click",function(){let r=U(t).$implicit,a=w(2);return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w(2);Re("active",t===e.currentPage),m(2),_(" ",t," ")}}function XQ(i,n){if(i&1){let t=he();s(0,"nav",121)(1,"ul",122)(2,"li",123)(3,"button",124),S("click",function(){U(t);let r=w();return j(r.prevPage())}),s(4,"span",125),l(5,"\xAB"),o()()(),T(6,KQ,3,3,"li",126),s(7,"li",123)(8,"button",124),S("click",function(){U(t);let r=w();return j(r.nextPage())}),s(9,"span",125),l(10,"\xBB"),o()()()()()}if(i&2){let t=w();m(2),Re("disabled",t.currentPage===1),m(),p("disabled",t.currentPage===1),m(3),p("ngForOf",t.pages),m(),Re("disabled",t.currentPage===t.totalPages),m(),p("disabled",t.currentPage===t.totalPages)}}function JQ(i,n){i&1&&(s(0,"div",49),l(1," First Name is required "),o())}function ZQ(i,n){i&1&&(s(0,"span"),l(1,"Email is required"),o())}function QQ(i,n){i&1&&(s(0,"span"),l(1,"Please enter a valid email address"),o())}function eee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function tee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function iee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function nee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.branch_code),m(),_(" ",t.branch_name," ")}}function ree(i,n){i&1&&(s(0,"span"),l(1,"Please enter a password."),o())}function aee(i,n){i&1&&(s(0,"span"),l(1,"Password must be at least 6 characters long."),o())}function oee(i,n){if(i&1&&(s(0,"div",128),T(1,ree,2,0,"span",52)(2,aee,2,0,"span",52),o()),i&2){let t,e,r=w();m(),p("ngIf",(t=r.guideForm.get("password"))==null||t.errors==null?null:t.errors.required),m(),p("ngIf",(e=r.guideForm.get("password"))==null||e.errors==null?null:e.errors.minlength)}}function see(i,n){i&1&&(s(0,"span"),l(1,"Please confirm your password."),o())}function lee(i,n){i&1&&(s(0,"span"),l(1,"Passwords must match."),o())}
39function cee(i,n){if(i&1&&(s(0,"div",128),T(1,see,2,0,"span",52)(2,lee,2,0,"span",52),o()),i&2){let t,e,r=w();m(),p("ngIf",(t=r.guideForm.get("confirmPassword"))==null||t.errors==null?null:t.errors.required),m(),p("ngIf",(e=r.guideForm.get("confirmPassword"))==null||e.errors==null?null:e.errors.passwordMismatch)}}function dee(i,n){i&1&&(s(0,"div",49),l(1," First Name is required "),o())}function mee(i,n){i&1&&(s(0,"div",49),l(1," Last Name is required "),o())}function uee(i,n){i&1&&(s(0,"span"),l(1,"Email is required"),o())}function pee(i,n){i&1&&(s(0,"span"),l(1,"Please enter a valid email"),o())}function hee(i,n){if(i&1&&(s(0,"div",49),T(1,uee,2,0,"span",52)(2,pee,2,0,"span",52),o()),i&2){let t,e,r=w();m(),p("ngIf",(t=r.editForm.get("email"))==null||t.errors==null?null:t.errors.required),m(),p("ngIf",(e=r.editForm.get("email"))==null||e.errors==null?null:e.errors.email)}}function fee(i,n){i&1&&(s(0,"div",49),l(1," Username is required "),o())}function gee(i,n){i&1&&(s(0,"div",49),l(1," Phone Number is required "),o())}function vee(i,n){i&1&&(s(0,"div",49),l(1," NIC/Passport Number is required "),o())}function _ee(i,n){i&1&&(s(0,"div",49),l(1," Date of Birth is required "),o())}function yee(i,n){i&1&&(s(0,"div",49),l(1," Street Address is required "),o())}function See(i,n){i&1&&(s(0,"div",49),l(1," City is required "),o())}function bee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function xee(i,n){i&1&&(s(0,"div",49),l(1," Province is required "),o())}
39function Cee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function Eee(i,n){i&1&&(s(0,"div",49),l(1," District is required "),o())}function wee(i,n){i&1&&(s(0,"div",49),l(1," Postal Code is required "),o())}function Tee(i,n){i&1&&(s(0,"div",49),l(1," Country is required "),o())}function Dee(i,n){i&1&&(s(0,"div",49),l(1," Account Name is required "),o())}function Iee(i,n){i&1&&(s(0,"div",49),l(1," Account Number is required "),o())}function kee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}function Mee(i,n){i&1&&(s(0,"div",49),l(1," Bank is required "),o())}function Aee(i,n){if(i&1&&(s(0,"option",116),l(1),o()),i&2){let t=n.$implicit;p("value",t.branch_code),m(),_(" ",t.branch_name," ")}}function Pee(i,n){i&1&&(s(0,"div",49),l(1," Branch is required "),o())}var JT=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.sidebarService=e,this.tourGuideServiceService=r,this.fb=a,this.spinner=c,this.toastr=d,this.cognitoService=u,this.passwordVisible=!1,this.confirmPasswordVisible=!1,this.guideList=[],this.searchTerm="",this.filteredGuideList=[],this.pages=[1,2,3,4,5],this.isCollapsed=!1,this.guideForm=new Wc({}),this.submitted=!1,this.PROVINCES=FF,this.DISTRICTS=$h,this.isAccountant=!1,this.isOfficeUser=!1,this.availableDistricts=[],this.branches=[],this.selectedGuide=null,this.editForm=this.fb.group({firstName:["",At.required],lastName:["",At.required],email:["",[At.required,At.email]],username:["",At.required],phoneNumber:["",At.required],nicPassport:["",At.required],dateOfBirth:["",At.required],streetAddress:["",At.required],streetAddress2:[""],city:["",At.required],province:["",At.required],district:["",At.required],postalCode:["",At.required],country:["",At.required],accountName:["",At.required],accountNumber:["",At.required],bankName:["",At.required],branchName:["",At.required],password:["",[At.required,At.minLength(6)]],confirmPassword:["",At.required]},{validator:this.passwordMatchValidator}),this.currentPage=1,this.itemsPerPage=20,this.totalItems=0,this.totalPages=0,this.selectedProvince="",this.selectedDistrict="",this.filterDistricts=[],this.selectedDate=null,this.formattedDate="",this.showReviewModal=!1,this.showConfirmCloseModal=!1,this.formDataForReview=null,this.isDirtyForm=!1,this.BANKS=[],this.isLoadingBanks=!1,this.skipFormReset=!1,this.createForm(),this.guideForm.get("bankName")?.valueChanges.subscribe(h=>{h?this.loadBranches(h):(this.branches=[],this.guideForm.patchValue({branchName:""}))}),this.editForm.get("bankName")?.valueChanges.subscribe(h=>{h?this.loadBranches(h):(this.branches=[],this.editForm.patchValue({branchName:""}))})}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(c=>{this.isCollapsed=c,this.getGuideList(1)}),setTimeout(()=>{let c=document.getElementById("registerGuideModal");c&&(this.registerModal=new bootstrap.Modal(c))}),this.guideForm.valueChanges.subscribe(()=>{this.isDirtyForm=!0}),this.guideForm.get("province")?.valueChanges.subscribe(c=>{c&&this.updateDistricts(c)}),this.editForm.get("province")?.valueChanges.subscribe(c=>{c?this.updateDistricts(c):this.availableDistricts=[]});let r=document.getElementById("registerGuideModal");r&&r.addEventListener("hidden.bs.modal",()=>{this.skipFormReset||(this.guideForm.reset(),this.submitted=!1),this.skipFormReset=!1});let a=document.getElementById("editGuideModal");a&&a.addEventListener("hidden.bs.modal",()=>{this.editForm.reset(),this.submitted=!1}),this.loadBanks(),this.checkUserRole()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}createForm(){this.guideForm=this.fb.group({firstName:["",At.required],lastName:["",At.required],email:["",[At.required,At.email]],username:["",At.required],phoneNumber:["",At.required],nicPassport:["",At.required],dateOfBirth:["",At.required],streetAddress:["",At.required],streetAddress2:[""],city:["",At.required],province:["",At.required],district:["",At.required],postalCode:["",At.required],country:["",At.required],accountName:["",At.required],accountNumber:["",At.required],bankName:["",At.required],branchName:["",At.required],password:["",[At.required,At.minLength(6)]],confirmPassword:["",At.required]},{validator:this.passwordMatchValidator})}togglePasswordVisibility(e){if(e==="passwordField"){this.passwordVisible=!this.passwordVisible;let r=document.getElementById(e);r.type=this.passwordVisible?"text":"password"}else if(e==="confirmPasswordField"){this.confirmPasswordVisible=!this.confirmPasswordVisible;let r=document.getElementById(e);r.type=this.confirmPasswordVisible?"text":"password"}}
39passwordMatchValidator(e){let r=e.get("password"),a=e.get("confirmPassword");return r&&a&&r.value!==a.value?(a.setErrors({passwordMismatch:!0}),{passwordMismatch:!0}):(a?.hasError("passwordMismatch")&&a.setErrors(null),null)}getGuideList(e,r={}){try{let a=this.PROVINCES.find(u=>u.id===Number(this.selectedProvince));this.updateDistricts(this.selectedProvince);let c=this.availableDistricts.find(u=>u.id===Number(this.selectedDistrict)),d={province:a?.name,district:c?c.name:""};this.spinner.show(),this.tourGuideServiceService.getGuideList(e,d).subscribe({next:u=>{this.guideList=u.data,this.filteredGuideList=this.guideList,this.currentPage=e,this.totalItems=this.guideList.length,this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage),this.updatePagination(),this.updateDisplayedData(),this.spinner.hide()},error:u=>{console.error("Error fetching guide list:",u),this.spinner.hide(),navigator.onLine?u.status===0?this.toastr.error("Unable to connect to the server. Please try again later.","Connection Error"):u.status===500?this.toastr.error("The server encountered an internal error. Please try again later.","Server Error"):this.toastr.error("Failed to fetch guide list"):this.toastr.error("No internet connection. Please check your network and try again.","Network Error")}})}catch(a){this.spinner.hide(),console.log(a),this.toastr.error("An unexpected error occurred while fetching guide list")}}searchGuides(){let e=this.searchTerm?.toLowerCase().trim()||"";e?(this.filteredGuideList=this.guideList.filter(r=>{let a=r.usercode?.toLowerCase().includes(e),d=`${r.firstname||""} ${r.lastname||""}`.toLowerCase().includes(e),u=r.firstname?.toLowerCase().includes(e),h=r.lastname?.toLowerCase().includes(e);return a||d||u||h}),this.currentPage=1,this.updatePagination(),this.updateDisplayedData()):(this.currentPage=1,this.filteredGuideList=[...this.guideList],this.updatePagination(),this.updateDisplayedData())}goToPage(e){e!==this.currentPage&&this.getGuideList(e)}prevPage(){this.currentPage>1&&this.getGuideList(this.currentPage-1)}nextPage(){this.currentPage<this.totalPages&&this.getGuideList(this.currentPage+1)}updateDisplayedData(){let e=(this.currentPage-1)*this.itemsPerPage,r=e+this.itemsPerPage;this.filteredGuideList=this.filteredGuideList.slice(e,r)}onSubmit(){if(this.submitted=!0,this.guideForm.valid){let e=this.guideForm.value;console.log("Form value:",e);let r=this.BANKS.find(h=>h.id===e.bankName),a=this.PROVINCES.find(h=>h.id===Number(e.province)),c=this.availableDistricts.find(h=>h.id===Number(e.district)),d=this.branches.find(h=>h.branch_code===e.branchName);this.formDataForReview={personalDetails:{firstName:e.firstName,lastName:e.lastName,email:e.email,username:e.username,phoneNumber:e.phoneNumber,nicPassport:e.nicPassport,dateOfBirth:e.dateOfBirth},residentialDetails:{streetAddress:e.streetAddress,streetAddress2:e.streetAddress2,city:e.city,province:a?.name,district:c?.name,postalCode:e.postalCode,country:e.country},bankDetails:{accountName:e.accountName,accountNumber:e.accountNumber,bankName:r?.name,bankCode:r?.id,branchName:d?.branch_name,branchCode:d?.branch_code},password:e.password,confirmPassword:e.confirmPassword},console.log("Data for review:",this.formDataForReview),this.showReviewModal=!0,this.skipFormReset=!0;let u=document.getElementById("registerGuideModal");u&&bootstrap.Modal.getInstance(u)?.hide()}else Object.keys(this.guideForm.controls).forEach(e=>{this.guideForm.get(e)?.markAsTouched()})}confirmSubmit(){this.spinner.show();let e=this.guideForm.value,r=this.BANKS.find(h=>h.id===e.bankName),a=this.PROVINCES.find(h=>h.id===Number(e.province)),c=this.availableDistricts.find(h=>h.id===Number(e.district)),d=this.branches.find(h=>h.branch_code===e.branchName),u={addressLine1:this.formDataForReview.residentialDetails.streetAddress,addressLine2:this.formDataForReview.residentialDetails.streetAddress2,bankAccountName:this.formDataForReview.bankDetails.accountName,bankAccountNumber:this.formDataForReview.bankDetails.accountNumber,bankBranch:this.formDataForReview.bankDetails.branchName,bankName:this.formDataForReview.bankDetail
39s.bankName,bankCode:this.formDataForReview.bankDetails.bankCode,branchCode:this.formDataForReview.bankDetails.branchCode,city:this.formDataForReview.residentialDetails.city,country:this.formDataForReview.residentialDetails.country,district:this.formDataForReview.residentialDetails.district,dob:this.formDataForReview.personalDetails.dateOfBirth,email:this.formDataForReview.personalDetails.email,firstName:this.formDataForReview.personalDetails.firstName,id:"",identification:this.formDataForReview.personalDetails.nicPassport,lastName:this.formDataForReview.personalDetails.lastName,newPassword:this.formDataForReview.confirmPassword,password:this.formDataForReview.password,phoneNumber:this.formDataForReview.personalDetails.phoneNumber,postalCode:this.formDataForReview.residentialDetails.postalCode,province:this.formDataForReview.residentialDetails.province,username:this.formDataForReview.personalDetails.username};this.tourGuideServiceService.createGuide(u.addressLine1,u.addressLine2,u.bankAccountName,u.bankAccountNumber,u.bankBranch,u.bankName,u.bankCode,u.branchCode,u.city,u.country,u.district,u.dob,u.email,u.firstName,u.id,u.identification,u.lastName,u.newPassword,u.password,u.phoneNumber,u.postalCode,u.province,u.username).subscribe({next:h=>{h.status==="success"?(console.log("Guide registration successful:",h),this.getGuideList(1),this.toastr.success("Guide created successfully"),this.spinner.hide(),this.showReviewModal=!1,this.guideForm.reset(),this.submitted=!1,this.skipFormReset=!1):h.status==="warning"&&(this.spinner.hide(),this.toastr.warning(h.message))},error:h=>{if(console.error("Guide registration failed:",h),this.spinner.hide(),!navigator.onLine)this.toastr.error("No internet connection. Please check your network and try again.","Network Error");else if(h.status===0)this.toastr.error("Unable to connect to the server. Please try again later.","Connection Error");else if(h.status===500)h.error&&typeof h.error=="object"&&h.error.status==="error"&&h.error.error?this.toastr.error(h.error.error,"Error"):this.toastr.error("The server encountered an internal error. Please try again later.","Server Error");else if(h.status===400){let f=typeof h.error=="string"?h.error:h?.error?.message||"Invalid request data. Please review your information.";this.toastr.error(f,"Validation Error")}else if(h.status===401||h.status===403)this.toastr.error("You are not authorized to perform this action. Please log in again.","Authentication Error");else{let f="An unknown error occurred";h.error&&typeof h.error=="object"?h.error.status==="error"&&h.error.error?f=h.error.error:h.error.message?f=h.error.message:h.error.error&&(f=h.error.error):typeof h.error=="string"&&(f=h.error),this.toastr.error(f,"Error")}}})}cancelReview(){this.showReviewModal=!1;let e=document.getElementById("registerGuideModal");e&&new bootstrap.Modal(e).show()}returnToEditAfterError(){this.showReviewModal=!1;let e=document.getElementById("registerGuideModal");e&&new bootstrap.Modal(e).show()}handleModalClose(){this.isDirtyForm?this.showConfirmCloseModal=!0:this.closeModal()}confirmClose(){this.showConfirmCloseModal=!1,this.closeModal()}cancelClose(){this.showConfirmCloseModal=!1}closeModal(){let e=document.getElementById("registerGuideModal");e&&bootstrap.Modal.getInstance(e)?.hide(),this.resetForm(),this.isDirtyForm=!1}isFieldInvalid(e){let r=this.guideForm.get(e);return!!(r&&this.submitted&&r.invalid)}resetForm(){this.submitted=!1,this.guideForm.reset(),this.skipFormReset=!1}openRegisterModal(){this.registerModal&&this.registerModal.show()}updateDistricts(e){let r=Number(e);this.availableDistricts=this.availableDistricts=$h[Number(e)]||[]}onClickGenerate(){this.getGuideList(1)}createGuide(){let e=this.guideForm.value;try{this.spinner.show();let r=this.BANKS.find(h=>h.id===e.bankName),a=this.PROVINCES.find(h=>h.id===Number(e.province)),c=this.availableDistricts.find(h=>h.id===Number(e.district)),d=this.branches.find(h=>h.branch_code===e.branchName),u={addressLine1:this.formDataForReview.residentialDetails.streetAddress,addressLine2:this.formDataForReview.streetAddress2,bankAccountName:this.formDataForReview.bankDetail
39s.accountName,bankAccountNumber:this.formDataForReview.bankDetails.accountNumber,bankBranch:this.formDataForReview.bankDetails.branchName,bankName:this.formDataForReview.bankDetails.bankName,bankCode:this.formDataForReview.bankDetails.bankCode,branchCode:this.formDataForReview.bankDetails.branchCode,city:this.formDataForReview.residentialDetails.city,country:this.formDataForReview.residentialDetails.country,district:this.formDataForReview.residentialDetails.district,dob:this.formDataForReview.personalDetails.dateOfBirth,email:this.formDataForReview.personalDetails.email,firstName:this.formDataForReview.personalDetails.firstName,id:"",identification:this.formDataForReview.personalDetails.nicPassport,lastName:this.formDataForReview.personalDetails.lastName,newPassword:this.formDataForReview.confirmPassword,password:this.formDataForReview.password,phoneNumber:this.formDataForReview.personalDetails.phoneNumber,postalCode:this.formDataForReview.residentialDetails.postalCode,province:this.formDataForReview.residentialDetails.province,username:this.formDataForReview.personalDetails.username};this.tourGuideServiceService.createGuide(u.addressLine1,u.addressLine2,u.bankAccountName,u.bankAccountNumber,u.bankBranch,u.bankName,u.bankCode,u.branchCode,u.city,u.country,u.district,u.dob,u.email,u.firstName,u.id,u.identification,u.lastName,u.newPassword,u.password,u.phoneNumber,u.postalCode,u.province,u.username).subscribe({next:h=>{if(h.status==="success"){console.log("Guide registration successful:",h),this.getGuideList(1),this.toastr.success("Guide created successfully"),this.spinner.hide(),this.guideForm.reset(),this.submitted=!1;let f=document.getElementById("registerGuideModal");f&&bootstrap.Modal.getInstance(f)?.hide()}else h.status==="warning"&&(this.spinner.hide(),this.toastr.warning(h.message))},error:h=>{console.error("Guide registration failed:",h);let f=typeof h.error=="string"?h.error:h?.error?.error||"An unknown error occurred";this.toastr.error(f,"Error"),this.spinner.hide()}})}catch(r){console.error("Exception during guide registration:",r),this.toastr.error("Failed to create guide"),this.spinner.hide()}}loadBranches(e){console.log("Loading branches for bank ID:",e),this.spinner.show(),this.tourGuideServiceService.getBranchbyBankId(e).subscribe({next:r=>{this.branches=r.data||[],this.spinner.hide()},error:r=>{console.error("Error loading branches:",r),this.branches=[],this.spinner.hide(),navigator.onLine?r.status===0?this.toastr.error("Unable to connect to the server. Please try again later.","Connection Error"):r.status===500?this.toastr.error("The server encountered an internal error. Please try again later.","Server Error"):this.toastr.error("Failed to load bank branches"):this.toastr.error("No internet connection. Please check your network and try again.","Network Error")}})}openViewModal(e){this.selectedGuide=e;let r=document.getElementById("viewGuideModal");r&&new bootstrap.Modal(r).show()}openEditModal(e){this.selectedGuide=e,this.setupEditForm(e);let r=document.getElementById("editGuideModal");r&&new bootstrap.Modal(r).show()}setupEditForm(e){this.editForm.patchValue({firstName:e.firstname,lastName:e.lastname,email:e.email,username:e.email,phoneNumber:e.phonenumber,nicPassport:e.identification,dateOfBirth:e.dob,streetAddress:e.addressline1,streetAddress2:e.addressline2,city:e.city,postalCode:e.postalcode,country:e.country,accountName:e.bankaccountname,accountNumber:e.bankaccountnumber});let r=this.PROVINCES.find(c=>c.name===e.province);r&&(this.editForm.patchValue({province:r.id}),this.updateDistricts(r.id.toString()),setTimeout(()=>{let c=this.availableDistricts.find(d=>d.name===e.district);c&&this.editForm.patchValue({district:c.id})},100));let a=this.BANKS.find(c=>c.name===e.bankname);a&&(this.editForm.patchValue({bankName:a.id}),this.tourGuideServiceService.getBranchbyBankId(Number(a.id)).subscribe({next:c=>{this.branches=c.data||[];let d=this.branches.find(u=>u.branch_name===e.bankbranch);d&&this.editForm.patchValue({branchName:d.branch_code})},error:c=>{console.error("Error loading branches:",c),this.toastr.error("Failed to load bank branches")}}))}onEditSubmit(){if(this.editForm.valid){this.spinner.show();let e=this.editForm.value,r=this.selectedGuide.id,a=this.BANKS.find(f=>f.id===e.bankName),c=this.PROVINCES.find(f=>f.id===Number(e.province)),d=this.availableDistricts.find(f=>f.id===Number(e.district)),u=this.branches.find(f=>f.branch_code===e.branchName),h={addressLine1:e.streetAddress,addressLine2:e.streetAddress2,bankAccountName:e.accountName,bankAccountNumber:e.accountNumber,bankBranch:u?u.branch_name:"",bankName:a?a.name:"",bankCode:a?a.id:"",branchCode:u?u.branch_code:"",city:e.city,country:e.country,district:d?d.name:"",dob:e.dateOfBirth,email:e.email,firstName:e.firstName,id:r,identification:e.nicPassport,lastName:e.lastName,newPassword:e.confirmPassword,password:e.password,phoneNumber:e.phoneNumber,postalCode:e.postalCode,province:c?c.name:"",username:e.email};this.tourGuideServiceService.updateGuide(h.addressLine1,h.addressLine2,h.bankAccountName,h.bankAccountNumber,h.bankBranch,h.bankName,h.bankCode,h.branchCode,h.city,h.country,h.district,h.dob,h.email,h.firstName,h.id,h.identification,h.lastName,h.newPassword,h.password,h.phoneNumber,h.postalCode,h.province,h.username).subscribe({next:f=>{this.spinner.hide(),this.toastr.success("Guide updated successfully"),this.getGuideList(1);
39let v=document.getElementById("editGuideModal");v&&bootstrap.Modal.getInstance(v)?.hide(),this.editForm.reset(),this.submitted=!1},error:f=>{if(console.error("Guide update failed:",f),this.spinner.hide(),!navigator.onLine)this.toastr.error("No internet connection. Please check your network and try again.","Network Error");else if(f.status===0)this.toastr.error("Unable to connect to the server. Please try again later.","Connection Error");else if(f.status===500)f.error&&typeof f.error=="object"&&f.error.status==="error"&&f.error.error?this.toastr.error(f.error.error,"Error"):this.toastr.error("The server encountered an internal error. Please try again later.","Server Error");else if(f.status===400){let v=typeof f.error=="string"?f.error:f?.error?.message||"Invalid request data. Please review your information.";this.toastr.error(v,"Validation Error")}else if(f.status===401||f.status===403)this.toastr.error("You are not authorized to perform this action. Please log in again.","Authentication Error");else{let v="Failed to update guide";f.error&&typeof f.error=="object"?f.error.status==="error"&&f.error.error?v=f.error.error:f.error.message?v=f.error.message:f.error.error&&(v=f.error.error):typeof f.error=="string"&&(v=f.error),this.toastr.error(v,"Error")}}})}else Object.keys(this.editForm.controls).forEach(e=>{let r=this.editForm.get(e);r?.invalid&&r.markAsTouched()})}FieldInvalid(e){let r=this.editForm.get(e);return!!(r&&r.invalid&&(r.dirty||r.touched))}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}onProvinceChange(){this.selectedDistrict="",this.selectedProvince?this.filterDistricts=$h[Number(this.selectedProvince)]||[]:this.filterDistricts=[]}loadBanks(){this.isLoadingBanks=!0,this.spinner.show(),this.tourGuideServiceService.getAllBanks().subscribe({next:e=>{e.status==="success"&&Array.isArray(e.data)?this.BANKS=e.data.map(r=>({id:r.bank_code,name:r.bank_name})):this.toastr.error("Invalid bank data received"),this.isLoadingBanks=!1,this.spinner.hide()},error:e=>{console.error("Error loading banks:",e),this.isLoadingBanks=!1,this.spinner.hide(),navigator.onLine?e.status===0?this.toastr.error("Unable to connect to the server. Please try again later.","Connection Error"):e.status===500?this.toastr.error("The server encountered an internal error. Please try again later.","Server Error"):this.toastr.error("Failed to load banks"):this.toastr.error("No internet connection. Please check your network and try again.","Network Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(c2),x(Qr),x(pe),x(me),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-manageguides"]],standalone:!1,decls:610,vars:191,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#fff","type","ball-pulse"],[2,"font-size","20px","color","white"],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"action-section"],[1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"search-container"],[1,"search-box"],["type","text","placeholder","Search by User ID or Name...",1,"form-control","search-input",3,"ngModelChange","input","ngModel"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["aria-label","Page navigation",4,"ngIf"],["id","registerGuideModal","tabindex","-1","aria-labelledby","registerGuideModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
39-lg"],[1,"modal-content"],[1,"modal-header"],["id","registerGuideModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close",3,"click"],[1,"modal-body"],[3,"ngSubmit","formGroup"],[1,"card","mb-3"],[1,"card-body"],[1,"card-title"],[1,"row","g-3"],[1,"col-md-6"],["for","firstName"],[1,"text-danger"],["type","text","formControlName","firstName","placeholder","First Name",1,"form-control",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],["for","lastName"],["type","text","formControlName","lastName","placeholder","Last Name",1,"form-control",3,"ngClass"],[1,"invalid-feedback"],["for","email"],["type","email","formControlName","email","placeholder","Email Address",1,"form-control",3,"ngClass"],[4,"ngIf"],["for","username"],["type","text","formControlName","username","placeholder","Username",1,"form-control",3,"ngClass"],["for","phoneNumber"],["type","number","formControlName","phoneNumber","placeholder","Phone Number",1,"form-control",3,"ngClass"],["for","nicPassport"],["type","text","formControlName","nicPassport","placeholder","NIC or Passport Number",1,"form-control",3,"ngClass"],["for","dateOfBirth"],["type","date","formControlName","dateOfBirth","placeholder","Date of Birth",1,"form-control",3,"ngClass"],[1,"col-12"],["for","streetAddress"],["type","text","formControlName","streetAddress","placeholder","Street Address",1,"form-control",3,"ngClass"],["for","streetAddress2"],["type","text","formControlName","streetAddress2","placeholder","Street Address Line 2",1,"form-control"],["for","city"],["type","text","formControlName","city","placeholder","City",1,"form-control",3,"ngClass"],["for","province"],["formControlName","province",1,"form-select",3,"ngClass"],["value","","disabled","","selected",""],["for","district"],["formControlName","district",1,"form-select",3,"ngClass"],["for","postalCode"],["type","number","formControlName","postalCode","placeholder","Postal Code",1,"form-control",3,"ngClass"],["for","country"],["formControlName","country",1,"form-select",3,"ngClass"],["value","Sri Lanka"],["for","accountName"],["type","text","formControlName","accountName","placeholder","Bank Account Holder Name",1,"form-control",3,"ngClass"],["for","accountNumber"],["type","number","formControlName","accountNumber","placeholder","Bank Account Number",1,"form-control",3,"ngClass"],["for","bankName"],["formControlName","bankName",1,"form-select",3,"ngClass"],["for","branchName"],["formControlName","branchName",1,"form-select",3,"ngClass"],["for","password"],[1,"position-relative"],["aria-hidden","true",1,"eye-icon",3,"click","ngClass"],["type","password","formControlName","password","placeholder","New Password","id","passwordField",1,"form-control","ps-5"],["class","text-danger small mt-1",4,"ngIf"],["for","confirmPassword"],["type","password","formControlName","confirmPassword","placeholder","Confirm Password","id","confirmPasswordField",1,"form-control","ps-5"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","submit",1,"btn","btn-primary"],["tabindex","-1",1,"modal","fade"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],[1,"form-label"],[1,"form-control-plaintext"],["type","button",1,"btn","btn-primary",3,"click"],[1,"modal-dialog"],["id","viewGuideModal","tabindex","-1",1,"modal","fade"],["type","button","data-bs-dismiss","modal",1,"btn-close"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["id","editGuideModal","tabindex","-1",1,"modal","fade"],["type","text","formControlName","username","placeholder","Username","readonly","",1,"form-control",3,"ngClass"],["type","tel","formControlName","phoneNumber","placeholder","Phone Number",1,"form-control",3,"ngClass"],["type","text","formControlName","nicPassport","placeholder","NIC/Passport Number","readonly","",1,"form-control",3,"ngClass"],["type","text","formControlName","postalCode","placeholder","Postal Code",1,"form-control",3,"ngClass"],["type","text","formControlName","accountName","placeholder","Name as in Bank Account",1,"form-control",3,"ngClass"],["type","text","formControlName","accountNumber","placeholder","Bank Account Number",1,"form-control",3,"ngClass"],["formControlName","password","placeholder","New Password",1,"form-control",3,"type"],[1,"eye-icon","fa",3,"click","ngClass"],["formControlName","confirmPassword","placeholder","Confirm Password",1,"form-control",3,"type"],[3,"value"],[1,"action-buttons"],[1,"btn","btn-link","p-0","me-2",3,"click","disabled"],[1,"material-icons-outlined",2,"color","#646361"],[1,"btn","btn-link","p-0",3,"click"],["aria-label","Page navigation"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"page-link",3,"click"],[1,"text-danger","small","mt-1"]],template:function(r,a){
39if(r&1&&(s(0,"ngx-spinner",0)(1,"p",1),l(2,"Loading..."),o()(),s(3,"div",2)(4,"div",3)(5,"div")(6,"div",4),l(7,"Tour Guides"),o()()(),s(8,"div",5)(9,"div",6)(10,"div",7)(11,"label",8),l(12,"Province"),o(),s(13,"select",9),X("ngModelChange",function(d){return K(a.selectedProvince,d)||(a.selectedProvince=d),d}),S("change",function(){return a.onProvinceChange()}),s(14,"option",10),l(15,"All Provinces"),o(),T(16,zQ,2,2,"option",11),o()(),s(17,"div",7)(18,"label",8),l(19,"District"),o(),s(20,"select",12),X("ngModelChange",function(d){return K(a.selectedDistrict,d)||(a.selectedDistrict=d),d}),s(21,"option",10),l(22,"All Districts"),o(),T(23,YQ,2,2,"option",11),o()(),s(24,"div",13)(25,"button",14),S("click",function(){return a.onClickGenerate()}),s(26,"span",15),l(27,"search"),o(),l(28," Generate "),o()()(),s(29,"div",16)(30,"button",17),S("click",function(){return a.openRegisterModal()}),l(31," > "),s(32,"span",15),l(33,"description"),o(),l(34,"Register Guide "),o()()(),s(35,"div",18)(36,"div",19)(37,"input",20),X("ngModelChange",function(d){return K(a.searchTerm,d)||(a.searchTerm=d),d}),S("input",function(){return a.searchGuides()}),o()()(),s(38,"div",21)(39,"div",22)(40,"div",23)(41,"div",24)(42,"table",25)(43,"thead",26)(44,"tr")(45,"th"),l(46,"#ID"),o(),s(47,"th"),l(48,"Usercode"),o(),s(49,"th"),l(50,"First Name"),o(),s(51,"th"),l(52,"Last Name"),o(),s(53,"th"),l(54,"Email"),o(),s(55,"th"),l(56,"Phone Number"),o(),s(57,"th"),l(58,"Identification ( NIC / Passport no. )"),o(),s(59,"th"),l(60,"Action"),o()()(),s(61,"tbody",27),T(62,qQ,30,8,"tr",28),o()()()(),T(63,XQ,11,7,"nav",29),o()()(),s(64,"div",30)(65,"div",31)(66,"div",32)(67,"div",33)(68,"h5",34),l(69," Register New Tour Guide "),o(),s(70,"button",35),S("click",function(){return a.handleModalClose()}),o()(),s(71,"div",36)(72,"form",37),S("ngSubmit",function(){return a.onSubmit()}),s(73,"div",38)(74,"div",39)(75,"h6",40),l(76,"Personal Details"),o(),s(77,"div",41)(78,"div",42)(79,"label",43),l(80,"First Name"),s(81,"span",44),l(82,"*"),o()(),B(83,"input",45),T(84,JQ,2,0,"div",46),o(),s(85,"div",42)(86,"label",47),l(87,"Last Name"),s(88,"span",44),l(89,"*"),o()(),B(90,"input",48),s(91,"div",49),l(92,"Last Name is required"),o()(),s(93,"div",42)(94,"label",50),l(95,"Email"),s(96,"span",44),l(97,"*"),o()(),B(98,"input",51),s(99,"div",49),T(100,ZQ,2,0,"span",52)(101,QQ,2,0,"span",52),o()(),s(102,"div",42)(103,"label",53),l(104,"Username"),s(105,"span",44),l(106,"*"),o()(),B(107,"input",54),s(108,"div",49),l(109,"Username is required"),o()(),s(110,"div",42)(111,"label",55),l(112,"Phone Number"),s(113,"span",44),l(114,"*"),o()(),B(115,"input",56),s(116,"div",49),l(117,"Phone Number is required"),o()(),s(118,"div",42)(119,"label",57),l(120,"NIC or Passport Number"),s(121,"span",44),l(122,"*"),o()(),B(123,"input",58),s(124,"div",49),l(125," NIC or Passport Number is required "),o()(),s(126,"div",42)(127,"label",59),l(128,"Date of Birth"),s(129,"span",44),l(130,"*"),o()(),B(131,"input",60),s(132,"div",49),l(133,"Date of Birth is required"),o()()()()(),s(134,"div",38)(135,"div",39)(136,"h6",40),l(137,"Residential Details"),o(),s(138,"div",41)(139,"div",61)(140,"label",62),l(141,"Street Address 1"),s(142,"span",44),l(143,"*"),o()(),B(144,"input",63),s(145,"div",49),l(146,"Street Address 1 is required"),o()(),s(147,"div",61)(148,"label",64),l(149,"Street Address 2"),o(),B(150,"input",65),o(),s(151,"div",42)(152,"label",66),l(153,"City"),s(154,"span",44),l(155,"*"),o()(),B(156,"input",67),s(157,"div",49),l(158,"City is required"),o()(),s(159,"div",42)(160,"label",68),l(161,"Province"),s(162,"span",44),l(163,"*"),o()(),s(164,"select",69)(165,"option",70),l(166,"Select Province"),o(),T(167,eee,2,2,"option",11),o(),s(168,"div",49),l(169,"Province is required"),o()(),s(170,"div",42)(171,"label",71),l(172,"District"),s(173,"span",44),l(174,"*"),o()(),s(175,"select",72)(176,"option",70),l(177,"Select District"),o(),T(178,tee,2,2,"option",11),o(),s(179,"div",49),l(180,"District is required"),o()(),s(181,"div",42)(182,"label",73),l(183,"Postal Code"),s(184,"span",44),l(185,"*"),o()(),B(186,"input",74),s(187,"div",49),l(188,"Postal Code is required"),o()(),s(189,"div",42)(190,"label",75),l(191,"Country"),s(192,"span",44),l(193,"*"),o()(),s(194,"select",76)(195,"option",70),l(196,"Select Country"),o(),s(197,"option",77),l(198,"Sri Lanka"),o()(),s(199,"div",49),l(200,"Country is required"),o()()()()(),s(201,"div",38)(202,"div",39)(203,"h6",40),l(204,"Bank Details"),o(),s(205,"div",41)(206,"div",61)(207,"label",78),l(208,"Account Name"),s(209,"span",44),l(210,"*"),o()(),B(211,"input",79),s(212,"div",49),l(213,"Account Name is required"),o()(),s(214,"div",42)(215,"label",80),l(216,"Account Number"),s(217,"span",44),l(218,"*"),o()(),B(219,"input",81),s(220,"div",49),l(221,"Account Number is required"),o()(),s(222,"div",42)(223,"label",82),l(224,"Bank Name"),s(225,"span",44),l(226,"*"),o()(),s(227,"select",83)(228,"option",70),l(229,"Select Bank"),o(),T(230,iee,2,2,"option",11),o(),s(231,"div",49),l(232,"Bank is required"),o()(),s(233,"div",42)(234,"label",84),l(235,"Branch Name"),s(236,"span",44),l(237,"*"),o()(),s(238,"select",85)(239,"option",70),l(240,"Select Branch"),o(),T(241,nee,2,2,"option",11),o(),s(242,"div",49),l(243,"Branch is required"),o()()()()(),s(244,"div",38)(245,"div",39)(246,"h6",40),l(247,"Set Password"),o(),s(248,"div",41)(249,"div",42)(250,"label",86),l(251,"Password"),s(252,"span",44),l(253,"*"),o()(),s(254,"div",87)(255,"i",88),S("click",function(){return a.togglePasswordVisibility("passwordField")}),o(),B(256,"input",89),o(),T(257,oee,3,2,"div",90),o(),s(258,"div",42)(259,"label",91),l(260,"Confirm Password"),s(261,"span",44),l(262,"*"),o()(),s(263,"div",87),B(264,"input",92),s(265,"i",88),S("click",function(){return a.togglePasswordVisibility("confirmPasswordField")}),o()(),T(266,cee,3,2,"div",90),o()()()(),s(267,"div",93)(268,"button",94),S("click",function(){return a.handleModalClose()}),l(269," Close "),o(),s(270,"button",95),l(271," Review Details "),o()()()()()()(),s(272,"div",96)(273,"div",31)(274,"div",32)(275,"div",33)(276,"h5",97),l(277,"Review Tour Guide Details"),o(),s(278,"button",98),S("click",function(){return a.cancelReview()}),o()(),s(279,"div",36)(280,"div",38)(281,"div",39)(282,"h6",40),l(283,"Personal Details"),o(),s(284,"div",41)(285,"div",42)(286,"label",99),l(287,"First Name"),o(),s(288,"div",100),l(289),o()(),s(290,"div",42)(291,"label",99),l(292,"Last Name"),o(),s(293,"div",100),l(294),o()(),s(295,"div",42)(296,"label",99),l(297,"Email"),o(),s(298,"div",100),l(299),o()(),s(300,"div",42)(301,"label",99),l(302,"Phone Number"),o(),s(303,"div",100),l(304),o()(),s(305,"div",42)(306,"label",99),l(307,"NIC/Passport"),o(),s(308,"div",100),l(309),o()(),s(310,"div",42)(311,"label",99),l(312,"Date of Birth"),o(),s(313,"div",100),l(314),o()()()()(),s(315,"div",38)(316,"div",39)(317,"h6",40),l(318,"Residential Details"),o(),s(319,"div",41)(320,"div",61)(321,"label",99),l(322,"Street Address"),o(),s(323,"div",100),l(324),o()(),s(325,"div",61)(326,"label",99),l(327,"Street Address Line 2"),o(),s(328,"div",100),l(329),o()(),s(330,"div",42)(331,"label",99),l(332,"City"),o(),s(333,"div",100),l(334),o()(),s(335,"div",42)(336,"label",99),l(337,"Province"),o(),s(338,"div",100),l(339),o()(),s(340,"div",42)(341,"label",99),l(342,"District"),o(),s(343,"div",100),l(344),o()(),s(345,"div",42)(346,"label",99),l(347,"Postal Code"),o(),s(348,"div",100),l(349),o()()()()(),s(350,"div",38)(351,"div",39)(352,"h6",40),l(353,"Bank Details"),o(),s(354,"div",41)(355,"div",61)(356,"label",99),l(357,"Account Name"),o(),s(358,"div",100),l(359),o()(),s(360,"div",42)(361,"label",99),l(362,"Account Number"),o(),s(363,"div",100),l(364),o()(),s(365,"div",42)(366,"label",99),l(367,"Bank Name"),o(),s(368,"div",100),l(369),o()(),s(370,"div",42)(371,"label",99),l(372,"Branch"),o(),s(373,"div",100),l(374),o()()()()()(),s(375,"div",93)(376,"button",94),S("click",function(){return a.cancelReview()}),l(377," Back to Edit "),o(),s(378,"button",101),S("click",function(){return a.confirmSubmit()}
39),l(379," Confirm & Save "),o()()()()(),s(380,"div",96)(381,"div",102)(382,"div",32)(383,"div",33)(384,"h5",97),l(385,"Confirm Close"),o(),s(386,"button",98),S("click",function(){return a.cancelClose()}),o()(),s(387,"div",36)(388,"p"),l(389,"Are you sure you want to close? All unsaved changes will be lost."),o()(),s(390,"div",93)(391,"button",94),S("click",function(){return a.cancelClose()}),l(392," Cancel "),o(),s(393,"button",101),S("click",function(){return a.confirmClose()}),l(394," Yes, Close "),o()()()()(),s(395,"div",103)(396,"div",31)(397,"div",32)(398,"div",33)(399,"h5",97),l(400,"View Tour Guide Details"),o(),B(401,"button",104),o(),s(402,"div",36)(403,"div",38)(404,"div",39)(405,"h6",40),l(406,"Personal Details"),o(),s(407,"div",41)(408,"div",42)(409,"label",99),l(410,"First Name"),o(),s(411,"div",100),l(412),o()(),s(413,"div",42)(414,"label",99),l(415,"Last Name"),o(),s(416,"div",100),l(417),o()(),s(418,"div",42)(419,"label",99),l(420,"Email"),o(),s(421,"div",100),l(422),o()(),s(423,"div",42)(424,"label",99),l(425,"Username"),o(),s(426,"div",100),l(427),o()(),s(428,"div",42)(429,"label",99),l(430,"Phone Number"),o(),s(431,"div",100),l(432),o()(),s(433,"div",42)(434,"label",99),l(435,"NIC/Passport"),o(),s(436,"div",100),l(437),o()()()()(),s(438,"div",38)(439,"div",39)(440,"h6",40),l(441,"Residential Details"),o(),s(442,"div",41)(443,"div",61)(444,"label",99),l(445,"Street Address"),o(),s(446,"div",100),l(447),o()(),s(448,"div",61)(449,"label",99),l(450,"Street Address Line 2"),o(),s(451,"div",100),l(452),o()(),s(453,"div",42)(454,"label",99),l(455,"City"),o(),s(456,"div",100),l(457),o()(),s(458,"div",42)(459,"label",99),l(460,"Province"),o(),s(461,"div",100),l(462),o()(),s(463,"div",42)(464,"label",99),l(465,"District"),o(),s(466,"div",100),l(467),o()(),s(468,"div",42)(469,"label",99),l(470,"Postal Code"),o(),s(471,"div",100),l(472),o()()()()(),s(473,"div",38)(474,"div",39)(475,"h6",40),l(476,"Bank Details"),o(),s(477,"div",41)(478,"div",61)(479,"label",99),l(480,"Account Name"),o(),s(481,"div",100),l(482),o()(),s(483,"div",42)(484,"label",99),l(485,"Account Number"),o(),s(486,"div",100),l(487),o()(),s(488,"div",42)(489,"label",99),l(490,"Bank Name"),o(),s(491,"div",100),l(492),o()(),s(493,"div",42)(494,"label",99),l(495,"Branch"),o(),s(496,"div",100),l(497),o()()()()()(),s(498,"div",93)(499,"button",105),l(500," Close "),o()()()()(),s(501,"div",106)(502,"div",31)(503,"div",32)(504,"div",33)(505,"h5",97),l(506,"Edit Tour Guide Details"),o(),B(507,"button",104),o(),s(508,"div",36)(509,"form",37),S("ngSubmit",function(){return a.onEditSubmit()}),s(510,"div",38)(511,"div",39)(512,"h6",40),l(513,"Personal Details"),o(),s(514,"div",41)(515,"div",42),B(516,"input",45),T(517,dee,2,0,"div",46),o(),s(518,"div",42),B(519,"input",48),T(520,mee,2,0,"div",46),o(),s(521,"div",42),B(522,"input",51),T(523,hee,3,2,"div",46),o(),s(524,"div",42),B(525,"input",107),T(526,fee,2,0,"div",46),o(),s(527,"div",42),B(528,"input",108),T(529,gee,2,0,"div",46),o(),s(530,"div",42),B(531,"input",109),T(532,vee,2,0,"div",46),o(),s(533,"div",42),B(534,"input",60),T(535,_ee,2,0,"div",46),o()()()(),s(536,"div",38)(537,"div",39)(538,"h6",40),l(539,"Residential Details"),o(),s(540,"div",41)(541,"div",61),B(542,"input",63),T(543,yee,2,0,"div",46),o(),s(544,"div",61),B(545,"input",65),o(),s(546,"div",42),B(547,"input",67),T(548,See,2,0,"div",46),o(),s(549,"div",42)(550,"select",69)(551,"option",10),l(552,"Select Province"),o(),T(553,bee,2,2,"option",11),o(),T(554,xee,2,0,"div",46),o(),s(555,"div",42)(556,"select",72)(557,"option",10),l(558,"Select District"),o(),T(559,Cee,2,2,"option",11),o(),T(560,Eee,2,0,"div",46),o(),s(561,"div",42),B(562,"input",110),T(563,wee,2,0,"div",46),o(),s(564,"div",42)(565,"select",76)(566,"option",77),l(567,"Sri Lanka"),o()(),T(568,Tee,2,0,"div",46),o()()()(),s(569,"div",38)(570,"div",39)(571,"h6",40),l(572,"Bank Details"),o(),s(573,"div",41)(574,"div",61),B(575,"input",111),T(576,Dee,2,0,"div",46),o(),s(577,"div",42),B(578,"input",112),T(579,Iee,2,0,"div",46),o(),s(580,"div",42)(581,"select",83)(582,"option",10),l(583,"Select Bank"),o(),T(584,kee,2,2,"option",11),o(),T(585,Mee,2,0,"div",46),o(),s(586,"div",42)(587,"select",85)(588,"option",10),l(589,"Select Branch"),o(),T(590,Aee,2,2,"option",11),o(),T(591,Pee,2,0,"div",46),o()()()(),s(592,"div",38)(593,"div",39)(594,"h6",40),l(595,"Set Password"),o(),s(596,"div",41)(597,"div",42)(598,"div",87),B(599,"input",113),s(600,"i",114),S("click",function(){return a.togglePasswordVisibility("password")}),o()()(),s(601,"div",42)(602,"div",87),B(603,"input",115),s(604,"i",114),S("click",function(){return a.togglePasswordVisibility("confirmPassword")}),o()()()()()(),s(605,"div",93)(606,"button",105),l(607," Close "),o(),s(608,"button",95),l(609,"Save Changes"),o()()()()()()()),r&2){let c,d,u,h,f,v,C,y,A,D,F,R,L,H,se,Ce,Ue,re,ae,ve;m(3),p("ngClass",Z(121,$Q,a.isCollapsed)),m(10),q("ngModel",a.selectedProvince),m(3),p("ngForOf",a.PROVINCES),m(4),q("ngModel",a.selectedDistrict),m(3),p("ngForOf",a.filterDistricts),m(7),p("disabled",a.isAccountant||a.isOfficeUser),m(7),q("ngModel",a.searchTerm),m(25),p("ngForOf",a.filteredGuideList),m(),p("ngIf",!a.searchTerm),m(9),p("formGroup",a.guideForm),m(11),p("ngClass",Z(123,On,a.submitted&&((c=a.guideForm.get("firstName"))==null?null:c.invalid))),m(),p("ngIf",a.submitted&&((d=a.guideForm.get("firstName"))==null?null:d.invalid)),m(6),p("ngClass",Z(125,On,((u=a.guideForm.get("lastName"))==null?null:u.invalid)&&
39(((u=a.guideForm.get("lastName"))==null?null:u.dirty)||((u=a.guideForm.get("lastName"))==null?null:u.touched)))),m(8),p("ngClass",Z(127,On,((h=a.guideForm.get("email"))==null?null:h.invalid)&&(((h=a.guideForm.get("email"))==null?null:h.dirty)||((h=a.guideForm.get("email"))==null?null:h.touched)))),m(2),p("ngIf",(f=a.guideForm.get("email"))==null||f.errors==null?null:f.errors.required),m(),p("ngIf",(v=a.guideForm.get("email"))==null||v.errors==null?null:v.errors.email),m(6),p("ngClass",Z(129,On,((C=a.guideForm.get("username"))==null?null:C.invalid)&&(((C=a.guideForm.get("username"))==null?null:C.dirty)||((C=a.guideForm.get("username"))==null?null:C.touched)))),m(8),p("ngClass",Z(131,On,((y=a.guideForm.get("phoneNumber"))==null?null:y.invalid)&&(((y=a.guideForm.get("phoneNumber"))==null?null:y.dirty)||((y=a.guideForm.get("phoneNumber"))==null?null:y.touched)))),m(8),p("ngClass",Z(133,On,((A=a.guideForm.get("nicPassport"))==null?null:A.invalid)&&(((A=a.guideForm.get("nicPassport"))==null?null:A.dirty)||((A=a.guideForm.get("nicPassport"))==null?null:A.touched)))),m(8),p("ngClass",Z(135,On,((D=a.guideForm.get("dateOfBirth"))==null?null:D.invalid)&&(((D=a.guideForm.get("dateOfBirth"))==null?null:D.dirty)||((D=a.guideForm.get("dateOfBirth"))==null?null:D.touched)))),m(13),p("ngClass",Z(137,On,((F=a.guideForm.get("streetAddress"))==null?null:F.invalid)&&(((F=a.guideForm.get("streetAddress"))==null?null:F.dirty)||((F=a.guideForm.get("streetAddress"))==null?null:F.touched)))),m(12),p("ngClass",Z(139,On,((R=a.guideForm.get("city"))==null?null:R.invalid)&&(((R=a.guideForm.get("city"))==null?null:R.dirty)||((R=a.guideForm.get("city"))==null?null:R.touched)))),m(8),p("ngClass",Z(141,On,a.submitted&&((L=a.guideForm.get("province"))==null?null:L.invalid))),m(3),p("ngForOf",a.PROVINCES),m(8),p("ngClass",Z(143,On,a.submitted&&((H=a.guideForm.get("district"))==null?null:H.invalid))),m(3),p("ngForOf",a.availableDistricts),m(8),p("ngClass",Z(145,On,((se=a.guideForm.get("postalCode"))==null?null:se.invalid)&&(((se=a.guideForm.get("postalCode"))==null?null:se.dirty)||((se=a.guideForm.get("postalCode"))==null?null:se.touched)))),m(8),p("ngClass",Z(147,On,((Ce=a.guideForm.get("country"))==null?null:Ce.invalid)&&(((Ce=a.guideForm.get("country"))==null?null:Ce.dirty)||((Ce=a.guideForm.get("country"))==null?null:Ce.touched)))),m(17),p("ngClass",Z(149,On,((Ue=a.guideForm.get("accountName"))==null?null:Ue.invalid)&&(((Ue=a.guideForm.get("accountName"))==null?null:Ue.dirty)||((Ue=a.guideForm.get("accountName"))==null?null:Ue.touched)))),m(8),p("ngClass",Z(151,On,((re=a.guideForm.get("accountNumber"))==null?null:re.invalid)&&(((re=a.guideForm.get("accountNumber"))==null?null:re.dirty)||((re=a.guideForm.get("accountNumber"))==null?null:re.touched)))),m(8),p("ngClass",Z(153,On,a.submitted&&((ae=a.guideForm.get("bankName"))==null?null:ae.invalid))),m(3),p("ngForOf",a.BANKS),m(8),p("ngClass",Z(155,On,a.submitted&&((ve=a.guideForm.get("branchName"))==null?null:ve.invalid))),m(3),p("ngForOf",a.branches),m(14),p("ngClass",a.passwordVisible?"fa fa-eye":"fa fa-eye-slash"),m(2),p("ngIf",a.isFieldInvalid("password")),m(8),p("ngClass",a.confirmPasswordVisible?"fa fa-eye":"fa fa-eye-slash"),m(),p("ngIf",a.isFieldInvalid("confirmPassword")),m(6),gi("display",a.showReviewModal?"block":"none"),Re("show",a.showReviewModal),m(17),_(" ",a.formDataForReview==null?null:a.formDataForReview.personalDetails.firstName," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.personalDetails.lastName," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.personalDetails.email," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.personalDetails.phoneNumber," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.personalDetails.nicPassport," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.personalDetails.dateOfBirth," "),m(10),_(" ",a.formDataForReview==null?null:a.formDataForReview.residentialDetails.streetAddress," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.residentialDetails.streetAddress2," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.residentialDetails.city," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.residentialDetails.province," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.residentialDetails.district," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.residentialDetails.postalCode," "),m(10),_(" ",a.formDataForReview==null?null:a.formDataForReview.bankDetail
39s.accountName," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.bankDetails.accountNumber," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.bankDetails.bankName," "),m(5),_(" ",a.formDataForReview==null?null:a.formDataForReview.bankDetails.branchName," "),m(6),gi("display",a.showConfirmCloseModal?"block":"none"),Re("show",a.showConfirmCloseModal),m(32),_(" ",a.selectedGuide==null?null:a.selectedGuide.firstname," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.lastname," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.email," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.usercode," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.phonenumber," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.identification," "),m(10),_(" ",a.selectedGuide==null?null:a.selectedGuide.addressline1," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.addressline2," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.city," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.province," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.district," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.postalcode," "),m(10),_(" ",a.selectedGuide==null?null:a.selectedGuide.bankaccountname," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.bankaccountnumber," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.bankname," "),m(5),_(" ",a.selectedGuide==null?null:a.selectedGuide.bankbranch," "),m(12),p("formGroup",a.editForm),m(7),p("ngClass",Z(157,On,a.FieldInvalid("firstName"))),m(),p("ngIf",a.FieldInvalid("firstName")),m(2),p("ngClass",Z(159,On,a.FieldInvalid("lastName"))),m(),p("ngIf",a.FieldInvalid("lastName")),m(2),p("ngClass",Z(161,On,a.FieldInvalid("email"))),m(),p("ngIf",a.FieldInvalid("email")),m(2),p("ngClass",Z(163,On,a.FieldInvalid("username"))),m(),p("ngIf",a.FieldInvalid("username")),m(2),p("ngClass",Z(165,On,a.FieldInvalid("phoneNumber"))),m(),p("ngIf",a.FieldInvalid("phoneNumber")),m(2),p("ngClass",Z(167,On,a.FieldInvalid("nicPassport"))),m(),p("ngIf",a.FieldInvalid("nicPassport")),m(2),p("ngClass",Z(169,On,a.FieldInvalid("dateOfBirth"))),m(),p("ngIf",a.FieldInvalid("dateOfBirth")),m(7),p("ngClass",Z(171,On,a.FieldInvalid("streetAddress"))),m(),p("ngIf",a.FieldInvalid("streetAddress")),m(4),p("ngClass",Z(173,On,a.FieldInvalid("city"))),m(),p("ngIf",a.FieldInvalid("city")),m(2),p("ngClass",Z(175,On,a.FieldInvalid("province"))),m(3),p("ngForOf",a.PROVINCES),m(),p("ngIf",a.FieldInvalid("province")),m(2),p("ngClass",Z(177,On,a.FieldInvalid("district"))),m(3),p("ngForOf",a.availableDistricts),m(),p("ngIf",a.FieldInvalid("district")),m(2),p("ngClass",Z(179,On,a.FieldInvalid("postalCode"))),m(),p("ngIf",a.FieldInvalid("postalCode")),m(2),p("ngClass",Z(181,On,a.FieldInvalid("country"))),m(3),p("ngIf",a.FieldInvalid("country")),m(7),p("ngClass",Z(183,On,a.FieldInvalid("accountName"))),m(),p("ngIf",a.FieldInvalid("accountName")),m(2),p("ngClass",Z(185,On,a.FieldInvalid("accountNumber"))),m(),p("ngIf",a.FieldInvalid("accountNumber")),m(2),p("ngClass",Z(187,On,a.FieldInvalid("bankName"))),m(3),p("ngForOf",a.BANKS),m(),p("ngIf",a.FieldInvalid("bankName")),m(2),p("ngClass",Z(189,On,a.FieldInvalid("branchName"))),m(3),p("ngForOf",a.branches),m(),p("ngIf",a.FieldInvalid("branchName")),m(8),p("type",a.passwordVisible?"text":"password"),m(),p("ngClass",a.passwordVisible?"fa fa-eye":"fa fa-eye-slash"),m(3),p("type",a.confirmPasswordVisible?"text":"password"),m(),p("ngClass",a.confirmPasswordVisible?"fa fa-eye":"fa fa-eye-slash")}},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,Le,wr,$r,wo],styles:[`.search-container[_ngcontent-%COMP%]{margin-left:1.3rem;margin-right:1.3rem}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{max-width:100%;width:100%}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{width:100%;border:1px solid #ddd;border-radius:4px;font-family:Roboto,Helvetica Neue,sans-serif;font-size:small;color:#333}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 2px #007bff40}.filter-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:1rem}.filter-wrapper[_ngcontent-%COMP%] .filter-section[_ngcontent-%COMP%]{display:flex;align-items:flex-end;
39gap:1rem}.filter-wrapper[_ngcontent-%COMP%] .action-section[_ngcontent-%COMP%]{margin-left:auto}.exportBtns[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.material-icons-outlined[_ngcontent-%COMP%]{font-size:20px}.modal-dialog[_ngcontent-%COMP%]{max-width:800px}.card[_ngcontent-%COMP%]{border-radius:8px}.card[_ngcontent-%COMP%] .card-title[_ngcontent-%COMP%]{color:#333;font-weight:500;margin-bottom:1.25rem}.form-control[_ngcontent-%COMP%], .form-select[_ngcontent-%COMP%]{padding:.5rem 1rem;border-radius:4px;border:1px solid #ddd}.form-control[_ngcontent-%COMP%]:focus, .form-select[_ngcontent-%COMP%]:focus{border-color:#007bff;box-shadow:0 0 0 .2rem #007bff40}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #eee;padding:1rem}.form-control.is-invalid[_ngcontent-%COMP%]{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.invalid-feedback[_ngcontent-%COMP%]{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#dc3545}.form-control.is-invalid[_ngcontent-%COMP%] ~ .invalid-feedback[_ngcontent-%COMP%]{display:block}.form-select.is-invalid[_ngcontent-%COMP%]{border-color:#dc3545}.action-buttons[_ngcontent-%COMP%]{display:flex;align-items:center}.action-buttons[_ngcontent-%COMP%] .material-icons-outlined[_ngcontent-%COMP%]{font-size:20px;cursor:pointer;color:#555453}.action-buttons[_ngcontent-%COMP%] .material-icons-outlined[_ngcontent-%COMP%]:hover{opacity:.8}.form-control-plaintext[_ngcontent-%COMP%]{padding:.375rem 0;border-bottom:1px solid #dee2e6}.modal-body[_ngcontent-%COMP%] .card-title[_ngcontent-%COMP%]{color:#000;font-weight:600;margin-bottom:1.5rem}.modal-body[_ngcontent-%COMP%] .form-label[_ngcontent-%COMP%]{color:#666;font-weight:500;margin-bottom:.25rem}.modal-body[_ngcontent-%COMP%] .form-control-plaintext[_ngcontent-%COMP%]{padding:.5rem;background-color:#f8f9fa;border-radius:4px;min-height:38px;display:flex;align-items:center}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.eye-btn[_ngcontent-%COMP%]{position:absolute;right:10px;top:50%;transform:translateY(-50%);border:none;cursor:pointer;padding:5px;z-index:10}.eye-icon[_ngcontent-%COMP%]{position:absolute;right:30px;top:60%;transform:translateY(-50%);cursor:pointer}.eye-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.2rem;color:#01080f}.text-danger[_ngcontent-%COMP%]{color:#dc3545}`]});let i=n;return i})();var Io=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.AMBER_SWING,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r,{headers:new xe({"Content-Type":"application/json"})})}getDailySalesPDF(e){let r={entity_id:Se.AMBER_SWING,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.AMBER_SWING,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a,{headers:new xe({"Content-Type":"application/json"})})}getGuideExpenseReport(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions",a,{headers:new xe({"Content-Type":"application/json"})})}getRevenueExpenseSales(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};
39return this.http.post(this.apiUrl+"/get-revenue-expense",a,{headers:new xe({"Content-Type":"application/json"})})}getMostPopularActivity(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a,{headers:new xe({"Content-Type":"application/json"})})}getVisitorCount(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a,{headers:new xe({"Content-Type":"application/json"})})}getItemWiseSalesPDF(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideExpenseReportPDF(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideExpenseReportExcel(e,r){let a={entity_id:Se.AMBER_SWING,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.AMBER_SWING,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r,{headers:new xe({"Content-Type":"application/json"})})}getItemPrice(){let e={entity_id:Se.AMBER_SWING};return this.http.post(this.apiUrl+"/entity-item-price",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.AMBER_SWING};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.AMBER_SWING,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.AMBER_SWING,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.AMBER_SWING,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.AMBER_SWING,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}getPOSUnitID(){let e={entity_id:Se.AMBER_SWING};return this.http.post(this.apiUrl+"/get-pos-by-entity",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Fee=i=>({collapsed:i}),Ree=(i,n)=>({completed:i,void:n});function Oee(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div",18),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",19),l(11),o(),s(12,"td")(13,"span",20),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),_(" ",Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")," "),m(3),b(t.details),m(2),p("ngClass",Et(12,Ree,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function Nee(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var _O=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.amberSwingService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.amberSwingService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}};n.\u0275fac=function(r){return new(r||n)(x(Io),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-swing-ticket-sales"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Amber Swing Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
397,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Oee,19,15,"tr",12),o()()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,Nee,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,Fee,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var ZT=Di(Ti());var Lee=i=>({collapsed:i});function Bee(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var yO=(()=>{let n=class n{constructor(e,r,a,c){this.amberSwingService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedDate=null,this.isCollapsed=!1,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.amberSwingService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.amberSwingService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Swing Daily Sales ${this.selectedDate}.pdf`;(0,ZT.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.amberSwingService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Swing Daily Sales ${this.selectedDate}.xlsx`;(0,ZT.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}};n.\u0275fac=function(r){return new(r||n)(x(Io),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report"]],standalone:!1,decls:77,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","date-picker","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"tbody"],[4,"ngFor","ngForOf"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Amber Swing \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select day"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,Bee,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td"),l(59,"Totals:"),o(),s(60,"td"),l(61),I(62,"currencyFormat"),o(),s(63,"td"),l(64),I(65,"currencyFormat"),o(),s(66,"td"),l(67),I(68,"currencyFormat"),o(),s(69,"td"),l(70),I(71,"currencyFormat"),o(),s(72,"td"),l(73),I(74,"currencyFormat"),o(),B(75,"td")(76,"td"),o()()()()()()()()),r&2&&(p("ngClass",Z(20,Lee,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(6),b(M(62,10,a.total.Amount)),m(3),b(M(65,12,a.total.Discount)),m(3),b(M(68,14,a.total.Total)),m(3),b(M(71,16,a.total.Cash)),m(3),b(M(74,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var QT=Di(Ti());var Qa=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r=new xe({"Content-Type":"application/json"}
39),a={entity_id:Se.PADDLE_BOAT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",a,{headers:r})}getDailyFoodSalesSummary(e){let r=new xe({"Content-Type":"application/json"}),a={entity_id:Se.PADDLE_BOAT,start_date:e};return this.http.post(this.apiUrl+"/fish-food-daily-sales",a,{headers:r})}getDailyFoodSalesSummaryPDF(e){let r=new xe({"Content-Type":"application/json"}),a={entity_id:Se.PADDLE_BOAT,start_date:e};return this.http.post(this.apiUrl+"/fish-food-daily-sales-pdf",a,{headers:r,responseType:"blob"})}getDailyFoodSalesSummaryExcel(e){let r=new xe({"Content-Type":"application/json"}),a={entity_id:Se.PADDLE_BOAT,start_date:e};return this.http.post(this.apiUrl+"/fish-food-daily-sales-excel",a,{headers:r,responseType:"blob"})}getDailySalesPDF(e){let r=new xe({"Content-Type":"application/json"}),a={entity_id:Se.PADDLE_BOAT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",a,{headers:r,responseType:"blob"})}getDailySalesExcel(e){let r=new xe({"Content-Type":"application/json"}),a={entity_id:Se.PADDLE_BOAT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",a,{headers:r,responseType:"blob"})}getItemWiseSales(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",c,{headers:a})}getItemWiseSalesPDF(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",c,{headers:a,responseType:"blob"})}getItemWiseSalesExcel(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",c,{headers:a,responseType:"blob"})}getTicketSales(e){let r=new xe({"Content-Type":"application/json"}),a={entity_id:Se.PADDLE_BOAT,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",a,{headers:r})}getMostPopularActivity(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",c,{headers:a})}getVisitorCount(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",c,{headers:a})}getrevenueexpenseSales(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",c,{headers:a})}getItemPrice(){let e={entity_id:Se.PADDLE_BOAT};return this.http.post(this.apiUrl+"/entity-item-price",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.PADDLE_BOAT};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlyFoodSalesSummary(e,r){let a={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/fish-food-monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlyFoodSalesSummaryPDF(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/fish-food-monthly-report-pdf",c,{headers:a,responseType:"blob"})}getMonthlyFoodSalesSummaryExcel(e,r){let a=new xe({"Content-Type":"application/json"}),c={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/fish-food-monthly-report-excel",c,{headers:a,responseType:"blob"})}getMonthlySalesPDF(e,r){let a={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.PADDLE_BOAT,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}getPOSUnitID(){let e={entity_id:Se.PADDLE_BOAT};return this.http.post(this.apiUrl+"/get-pos-by-entity",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Vee=i=>({collapsed:i});
39function Uee(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),I(5,"currencyFormat"),o(),s(6,"td"),l(7),I(8,"currencyFormat"),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),o(),s(20,"td"),l(21),o()()),i&2){let t=n.$implicit;m(2),_("#",t.ticket_id),m(2),b(M(5,8,t.amount)),m(3),b(M(8,10,t.discount)),m(3),b(M(11,12,t.total)),m(3),b(M(14,14,t.cash_amount)),m(3),b(M(17,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var SO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.paddleBoatService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.paddleBoatService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.paddleBoatService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Paddle Boat Daily Sales ${this.selectedDate}.pdf`;(0,QT.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.paddleBoatService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Paddle Boat Daily Sales ${this.selectedDate}.xlsx`;(0,QT.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Qa),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-reports"]],standalone:!1,decls:81,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","3"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Paddle Boat \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,Uee,22,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td",21)(78,"strong"),l(79),I(80,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(20,Vee,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var eD=Di(Ti());var jee=i=>({collapsed:i});
39function Wee(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),I(21,"currencyFormat"),o(),s(22,"td",19)(23,"strong"),l(24),I(25,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,9,t.average_unit_price)),m(3),b(M(12,11,t.item_subtotal)),m(3),b(M(15,13,t.discount_subtotal)),m(3),b(M(18,15,t.complimentary_subtotal)),m(3),b(M(21,17,t.voided_subtotal)),m(4),b(M(25,19,t.item_total))}}var bO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.amberSwingService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.isCollapsed=!1,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0}}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Swing Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,eD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Swing Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,eD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Io),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-summary"]],standalone:!1,decls:118,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","4"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Amber Swing \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
39),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Item"),o(),s(44,"th"),l(45,"Quantity"),o(),s(46,"th"),l(47,"Voided Ticket Count"),o(),s(48,"th"),l(49,"Average Unit Price"),o(),s(50,"th"),l(51,"Item Subtotal"),o(),s(52,"th"),l(53,"Discount Subtotal"),o(),s(54,"th"),l(55,"Complimentary Subtotal"),o(),s(56,"th"),l(57,"Voided Subtotal"),o(),s(58,"th",19),l(59,"Item Total(Without Void)"),o()()(),s(60,"tbody",20),T(61,Wee,26,21,"tr",21),o(),s(62,"tfoot")(63,"tr")(64,"td",22),l(65,"All Activities"),o(),s(66,"td"),l(67),I(68,"currencyFormat"),o(),s(69,"td"),l(70),I(71,"currencyFormat"),o(),s(72,"td"),l(73),I(74,"currencyFormat"),o(),s(75,"td"),l(76),I(77,"currencyFormat"),o(),s(78,"td",19),l(79),I(80,"currencyFormat"),o()()()(),s(81,"div",23)(82,"div",24)(83,"div",25)(84,"div",26)(85,"span",27),l(86,"Subtotal:"),o(),s(87,"span"),l(88),I(89,"currencyFormat"),o()()(),s(90,"div",25)(91,"div",26)(92,"span",27),l(93,"Complimentary:"),o(),s(94,"span",28),l(95),I(96,"currencyFormat"),o()()(),s(97,"div",25)(98,"div",26)(99,"span",27),l(100,"Discounts:"),o(),s(101,"span",28),l(102),I(103,"currencyFormat"),o()()(),s(104,"div",25)(105,"div",26)(106,"span",27),l(107,"Voids:"),o(),s(108,"span",28),l(109),I(110,"currencyFormat"),o()()(),s(111,"div",25)(112,"div",29)(113,"span"),l(114,"Total Revenue:"),o(),s(115,"span"),l(116),I(117,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,jee,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(45),p("ngForOf",a.items),m(6),b(M(68,18,a.total.item_subtotal)),m(3),b(M(71,20,a.total.discount_subtotal)),m(3),b(M(74,22,a.total.complimentary_subtotal)),m(3),b(M(77,24,a.total.voided_subtotal)),m(3),_(" ",M(80,26,a.total.item_total)," "),m(9),b(M(89,28,a.total.item_subtotal)),m(7),b(M(96,30,a.total.complimentary_subtotal)),m(7),b(M(103,32,a.total.discount_subtotal)),m(7),b(M(110,34,a.total.voided_subtotal)),m(7),b(M(117,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Hee=i=>({collapsed:i}),Gee=(i,n)=>({completed:i,void:n});function $ee(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td",19)(13,"span",20),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,Gee,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function zee(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var xO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.paddleBoatService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.paddleBoatService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Qa),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-paddle-boat-tickets-sales"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"payment-status"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Paddle Boat Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
397,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,$ee,19,15,"tr",12),o()()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,zee,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,Hee,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var tD=Di(Ti());var Yee=i=>({collapsed:i});function qee(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td",19),l(11),I(12,"currencyFormat"),o(),s(13,"td",19),l(14),I(15,"currencyFormat"),o(),s(16,"td",19),l(17),I(18,"currencyFormat"),o(),s(19,"td",19),l(20),I(21,"currencyFormat"),o(),s(22,"td",19)(23,"strong"),l(24),I(25,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,9,t.average_unit_price)),m(3),_(" ",M(12,11,t.item_subtotal)," "),m(3),_(" ",M(15,13,t.discount_subtotal)," "),m(3),_(" ",M(18,15,t.complimentary_subtotal)," "),m(3),_(" ",M(21,17,t.voided_subtotal)," "),m(4),b(M(25,19,t.item_total))}}var CO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.paddleBoatService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.paddleBoatService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.paddleBoatService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Paddle Boat Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,tD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.paddleBoatService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Paddle Boat Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,tD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Qa),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-pad
39dle-boat"]],standalone:!1,decls:118,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","4"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Paddle Boat \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Item"),o(),s(44,"th"),l(45,"Quantity"),o(),s(46,"th"),l(47,"Voided Ticket Count"),o(),s(48,"th"),l(49,"Average Unit Price"),o(),s(50,"th",19),l(51,"Item Subtotal"),o(),s(52,"th",19),l(53,"Discount Subtotal"),o(),s(54,"th",19),l(55,"Complimentary Subtotal"),o(),s(56,"th",19),l(57,"Voided Subtotal"),o(),s(58,"th",19),l(59,"Item Total"),o()()(),s(60,"tbody",20),T(61,qee,26,21,"tr",21),o(),s(62,"tfoot")(63,"tr")(64,"td",22),l(65,"All Activities"),o(),s(66,"td",19),l(67),I(68,"currencyFormat"),o(),s(69,"td",19),l(70),I(71,"currencyFormat"),o(),s(72,"td",19),l(73),I(74,"currencyFormat"),o(),s(75,"td",19),l(76),I(77,"currencyFormat"),o(),s(78,"td",19),l(79),I(80,"currencyFormat"),o()()()(),s(81,"div",23)(82,"div",24)(83,"div",25)(84,"div",26)(85,"span",27),l(86,"Subtotal:"),o(),s(87,"span"),l(88),I(89,"currencyFormat"),o()()(),s(90,"div",25)(91,"div",26)(92,"span",27),l(93,"Complimentary:"),o(),s(94,"span",28),l(95),I(96,"currencyFormat"),o()()(),s(97,"div",25)(98,"div",26)(99,"span",27),l(100,"Discounts:"),o(),s(101,"span",28),l(102),I(103,"currencyFormat"),o()()(),s(104,"div",25)(105,"div",26)(106,"span",27),l(107,"Voids:"),o(),s(108,"span",28),l(109),I(110,"currencyFormat"),o()()(),s(111,"div",25)(112,"div",29)(113,"span"),l(114,"Total Revenue:"),o(),s(115,"span"),l(116),I(117,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,Yee,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(45),p("ngForOf",a.items),m(6),_(" ",M(68,18,a.total.item_subtotal)," "),m(3),_(" ",M(71,20,a.total.discount_subtotal)," "),m(3),_(" ",M(74,22,a.total.complimentary_subtotal)," "),m(3),_(" ",M(77,24,a.total.voided_subtotal)," "),m(3),_(" ",M(80,26,a.total.item_total)," "),m(9),b(M(89,28,a.total.item_subtotal)),m(7),b(M(96,30,a.total.complimentary_subtotal)),m(7),b(M(103,32,a.total.discount_subtotal)),m(7),b(M(110,34,a.total.voided_subtotal)),m(7),b(M(117,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var iD=Di(Ti());var Es=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.HORSE_RIDE,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.HORSE_RIDE,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.HORSE_RIDE,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.HORSE_RIDE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.HORSE_RIDE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.HORSE_RIDE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.HORSE_RIDE,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getMostPopularActivity(e,r){let a={entity_id:Se.HORSE_RIDE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getVisitorCount(e,r){let a={entity_id:Se.HORSE_RIDE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getrevenueexpenseSales(e,r){let a={entity_id:Se.HORSE_RIDE,start_date:e,end_date:r};
39return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getItemPrice(){let e={entity_id:Se.HORSE_RIDE};return this.http.post(this.apiUrl+"/entity-item-price",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.HORSE_RIDE};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.HORSE_RIDE,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.HORSE_RIDE,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.HORSE_RIDE,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.HORSE_RIDE,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Kee=i=>({collapsed:i});
39function Xee(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td",19),l(5),I(6,"currencyFormat"),o(),s(7,"td",19),l(8),I(9,"currencyFormat"),o(),s(10,"td",19),l(11),I(12,"currencyFormat"),o(),s(13,"td",19),l(14),I(15,"currencyFormat"),o(),s(16,"td",19),l(17),I(18,"currencyFormat"),o(),s(19,"td",19),l(20),o(),s(21,"td",19),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),_(" ",M(15,14,t.cash_amount)," "),m(3),_(" ",M(18,16,t.card_amount)," "),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var EO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.horseRideService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.horseRideService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.horseRideService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Horse Ride Daily Sales ${this.selectedDate}.pdf`;(0,iD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.horseRideService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Horse Ride Daily Sales ${this.selectedDate}.xlsx`;(0,iD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Es),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-horse-ride"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2",1,"text-end"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Horse Riding \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th",19),l(41,"Amount"),o(),s(42,"th",19),l(43,"Discount"),o(),s(44,"th",19),l(45,"Total"),o(),s(46,"th",19),l(47,"Cash"),o(),s(48,"th",19),l(49,"Card"),o(),s(50,"th",19),l(51,"Card Last4"),o(),s(52,"th",19),l(53,"Remark"),o()()(),s(54,"tbody",20),T(55,Xee,23,18,"tr",21),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td",19)(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td",19)(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td",19)(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td",19)(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td",19)(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",22),o()()()()()()()()),r&2&&(p("ngClass",Z(20,Kee,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var nD=Di(Ti());var Jee=i=>({collapsed:i});
39function Zee(i,n){if(i&1&&(s(0,"tr",30)(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td",19),l(11),I(12,"currencyFormat"),o(),s(13,"td",19),l(14),I(15,"currencyFormat"),o(),s(16,"td",19),l(17),I(18,"currencyFormat"),o(),s(19,"td",19),l(20),I(21,"currencyFormat"),o(),s(22,"td",19)(23,"strong"),l(24),I(25,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,9,t.average_unit_price)),m(3),_(" ",M(12,11,t.item_subtotal)," "),m(3),_(" ",M(15,13,t.discount_subtotal)," "),m(3),_(" ",M(18,15,t.complimentary_subtotal)," "),m(3),_(" ",M(21,17,t.voided_subtotal)," "),m(4),b(M(25,19,t.item_total))}}var wO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.horseRideService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.horseRideService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.horseRideService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Horse Ride Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,nD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.horseRideService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Horse Ride Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,nD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Es),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-horse-ride"]],standalone:!1,decls:118,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],["class","centered-row",4,"ngFor","ngForOf"],["colspan","4"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"],[1,"centered-row"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Horse Riding \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
39),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Item"),o(),s(44,"th"),l(45,"Quantity"),o(),s(46,"th"),l(47,"Voided Ticket Count"),o(),s(48,"th"),l(49,"Average Unit Price"),o(),s(50,"th",19),l(51,"Item Subtotal"),o(),s(52,"th",19),l(53,"Discount Subtotal"),o(),s(54,"th",19),l(55,"Complimentary Subtotal"),o(),s(56,"th",19),l(57,"Voided Subtotal"),o(),s(58,"th",19),l(59,"Item Total"),o()()(),s(60,"tbody",20),T(61,Zee,26,21,"tr",21),o(),s(62,"tfoot")(63,"tr")(64,"td",22),l(65,"All Activities"),o(),s(66,"td",19),l(67),I(68,"currencyFormat"),o(),s(69,"td",19),l(70),I(71,"currencyFormat"),o(),s(72,"td",19),l(73),I(74,"currencyFormat"),o(),s(75,"td",19),l(76),I(77,"currencyFormat"),o(),s(78,"td",19),l(79),I(80,"currencyFormat"),o()()()(),s(81,"div",23)(82,"div",24)(83,"div",25)(84,"div",26)(85,"span",27),l(86,"Subtotal:"),o(),s(87,"span"),l(88),I(89,"currencyFormat"),o()()(),s(90,"div",25)(91,"div",26)(92,"span",27),l(93,"Complimentary:"),o(),s(94,"span",28),l(95),I(96,"currencyFormat"),o()()(),s(97,"div",25)(98,"div",26)(99,"span",27),l(100,"Discounts:"),o(),s(101,"span",28),l(102),I(103,"currencyFormat"),o()()(),s(104,"div",25)(105,"div",26)(106,"span",27),l(107,"Voids:"),o(),s(108,"span",28),l(109),I(110,"currencyFormat"),o()()(),s(111,"div",25)(112,"div",29)(113,"span"),l(114,"Total Revenue:"),o(),s(115,"span"),l(116),I(117,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,Jee,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(45),p("ngForOf",a.items),m(6),_(" ",M(68,18,a.total.item_subtotal)," "),m(3),_(" ",M(71,20,a.total.discount_subtotal)," "),m(3),_(" ",M(74,22,a.total.complimentary_subtotal)," "),m(3),_(" ",M(77,24,a.total.voided_subtotal)," "),m(3),_(" ",M(80,26,a.total.item_total)," "),m(9),b(M(89,28,a.total.item_subtotal)),m(7),b(M(96,30,a.total.complimentary_subtotal)),m(7),b(M(103,32,a.total.discount_subtotal)),m(7),b(M(110,34,a.total.voided_subtotal)),m(7),b(M(117,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Qee=i=>({collapsed:i}),ete=(i,n)=>({completed:i,void:n});function tte(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td",19)(13,"span",20),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,ete,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function ite(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var TO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.horseRideService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.horseRideService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Es),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-horse-ride"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"payment-status"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Horse Riding Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
397,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,tte,19,15,"tr",12),o()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,ite,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()()),r&2&&(p("ngClass",Z(9,Qee,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var rD=Di(Ti());var ws=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl,this.headers=new xe({"Content-Type":"application/json"})}getDailySales(e){let r={entity_id:Se.HERBAL_SHOP,start_date:e};return console.log("API Payload:",r),this.http.post(this.apiUrl+"/get-daily-sales",r,{headers:this.headers})}getDailySalesPDF(e){let r={entity_id:Se.HERBAL_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{headers:this.headers,responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.HERBAL_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{headers:this.headers,responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.HERBAL_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a,{headers:this.headers})}getItemWiseSalesPDF(e,r){let a={entity_id:Se.HERBAL_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{headers:this.headers,responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.HERBAL_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{headers:this.headers,responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.HERBAL_SHOP,current_page:e};return console.log("API Payload:",r),this.http.post(this.apiUrl+"/ticket-sales",r,{headers:this.headers})}getrevenueexpenseSales(e,r){let a={entity_id:Se.HERBAL_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a,{headers:this.headers})}getMostPopularActivity(e,r){let a={entity_id:Se.HERBAL_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a,{headers:this.headers})}getVisitorCount(e,r){let a={entity_id:Se.HERBAL_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a,{headers:this.headers})}getItemPrice(){let e={entity_id:Se.HERBAL_SHOP};return this.http.post(this.apiUrl+"/entity-item-price",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.HERBAL_SHOP};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.HERBAL_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.HERBAL_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.HERBAL_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.HERBAL_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var nte=i=>({collapsed:i});
39function rte(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var DO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.herbalShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.herbalShopService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.herbalShopService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Herbal Shop Daily Sales ${this.selectedDate}.pdf`;(0,rD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.herbalShopService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Herbal Shop Daily Sales ${this.selectedDate}.xlsx`;(0,rD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ws),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-herbal-shop"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Herbal Shop \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,rte,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,nte,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var aD=Di(Ti());var ate=i=>({collapsed:i});
39function ote(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),I(21,"currencyFormat"),o(),s(22,"td",19)(23,"strong"),l(24),I(25,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,9,t.average_unit_price)),m(3),b(M(12,11,t.item_subtotal)),m(3),b(M(15,13,t.discount_subtotal)),m(3),b(M(18,15,t.complimentary_subtotal)),m(3),b(M(21,17,t.voided_subtotal)),m(4),b(M(25,19,t.item_total))}}var IO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.herbalShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.herbalShopService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.herbalShopService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Herbal Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,aD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.herbalShopService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Herbal Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,aD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ws),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-herbal-shop"]],standalone:!1,decls:99,vars:25,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Herbal Shop \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
39),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Item"),o(),s(44,"th"),l(45,"Quantity"),o(),s(46,"th"),l(47,"Voided Ticket Count"),o(),s(48,"th"),l(49,"Average Unit Price"),o(),s(50,"th"),l(51,"Item Subtotal"),o(),s(52,"th"),l(53,"Discount Subtotal"),o(),s(54,"th"),l(55,"Complimentary Subtotal"),o(),s(56,"th"),l(57,"Voided Subtotal"),o(),s(58,"th",19),l(59,"Item Total"),o()()(),s(60,"tbody",20),T(61,ote,26,21,"tr",21),o()(),s(62,"div",22)(63,"div",23)(64,"div",24)(65,"div",25)(66,"span",26),l(67,"Subtotal:"),o(),s(68,"span"),l(69),I(70,"currencyFormat"),o()()(),s(71,"div",24)(72,"div",25)(73,"span",26),l(74,"Complimentary:"),o(),s(75,"span",27),l(76),I(77,"currencyFormat"),o()()(),s(78,"div",24)(79,"div",25)(80,"span",26),l(81,"Discounts:"),o(),s(82,"span",27),l(83),I(84,"currencyFormat"),o()()(),s(85,"div",24)(86,"div",25)(87,"span",26),l(88,"Voids:"),o(),s(89,"span",27),l(90),I(91,"currencyFormat"),o()()(),s(92,"div",24)(93,"div",28)(94,"span"),l(95,"Total Revenue:"),o(),s(96,"span"),l(97),I(98,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(23,ate,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(45),p("ngForOf",a.items),m(8),b(M(70,13,a.total.item_subtotal)),m(7),b(M(77,15,a.total.complimentary_subtotal)),m(7),b(M(84,17,a.total.discount_subtotal)),m(7),b(M(91,19,a.total.voided_subtotal)),m(7),b(M(98,21,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var ste=i=>({collapsed:i}),lte=(i,n)=>({completed:i,void:n});function cte(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td",19)(13,"span",20),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,lte,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function dte(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var kO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.herbalShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.herbalShopService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ws),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-herbal-shop"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"payment-status"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Herbal Shop Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
397,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,cte,19,15,"tr",12),o()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,dte,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()()),r&2&&(p("ngClass",Z(9,ste,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var ht=(()=>{let n=class n{constructor(e,r,a){this.cognitoService=e,this.router=r,this.toastr=a}canActivate(e,r){return ye(this,null,function*(){if(!(yield this.cognitoService.isAuthenticated()))return this.router.navigate(["login"]),!1;let c=yield this.cognitoService.getUserRole();if(!c||!c.trim())return this.toastr.error("Unable to verify user role","Access Denied"),this.router.navigate(["login"]),!1;let d=K1(c),u=e.routeConfig?.path??"";if(d===IF)return!0;if(kF.includes(d))return u===q1?!0:(this.toastr.error("You do not have permission to access this page","Access Denied"),this.router.navigate([q1]),!1);if(Rb(d,u))return this.toastr.error("You do not have permission to access this page","Access Denied"),this.router.navigate([q1]),!1;let h=e.data.roles;return!h||h.includes(d)?!0:(this.toastr.error("You do not have permission to access this page","Access Denied"),this.router.navigate([q1]),!1)})}};n.\u0275fac=function(r){return new(r||n)(kt(ze),kt(_t),kt(me))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var mte=i=>({collapsed:i}),MO=(()=>{let n=class n{constructor(e){this.sidebarService=e,this.isCollapsed=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}};n.\u0275fac=function(r){return new(r||n)(x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-maintenance"]],standalone:!1,decls:12,vars:3,consts:[[1,"mainContainer",3,"ngClass"],[1,"maintenance-wrapper"],[1,"maintenance-card"],[1,"maintenance-icon"],[1,"material-icons"],[1,"maintenance-title"],[1,"maintenance-message"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"i",4),l(5,"build"),o()(),s(6,"h2",5),l(7,"Page Temporarily Unavailable"),o(),s(8,"p",6),l(9," This page is temporarily unavailable while we perform necessary system upgrades. Our team is working to complete this maintenance as quickly as possible. "),o(),s(10,"p",6),l(11," The page will be available again soon. We apologize for any inconvenience this may cause and appreciate your understanding. "),o()()()()),r&2&&p("ngClass",Z(1,mte,a.isCollapsed))},dependencies:[ue],styles:[".maintenance-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:calc(100vh - 80px);padding:24px}.maintenance-card[_ngcontent-%COMP%]{max-width:560px;width:100%;text-align:center;background-color:var(--white);border-radius:12px;padding:48px 40px;box-shadow:0 4px 24px #00000014}.maintenance-card[_ngcontent-%COMP%] .maintenance-icon[_ngcontent-%COMP%]{width:88px;height:88px;margin:0 auto 24px;display:flex;align-items:center;justify-content:center;border-radius:50%;background-color:#4e9df71f}.maintenance-card[_ngcontent-%COMP%] .maintenance-icon[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:44px;color:#4e9df7}.maintenance-card[_ngcontent-%COMP%] .maintenance-title[_ngcontent-%COMP%]{font-size:22px;font-weight:700;color:var(--black);margin-bottom:16px}.maintenance-card[_ngcontent-%COMP%] .maintenance-message[_ngcontent-%COMP%]{font-size:15px;line-height:1.6;color:#555;margin-bottom:12px}.maintenance-card[_ngcontent-%COMP%] .maintenance-message[_ngcontent-%COMP%]:last-child{margin-bottom:0}"]});let i=n;return i})();var oD=Di(Ti());var ko=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.COFFEE_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.COFFEE_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.COFFEE_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getCategoryWiseSales(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getMonthlySales(e,r){let a={entity_id:Se.COFFEE_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.COFFEE_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.COFFEE_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getrevenueexpenseSales(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};
39return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getVisitorCount(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getMostPopularActivity(e,r){let a={entity_id:Se.COFFEE_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getTicketSales(e){let r={entity_id:Se.COFFEE_SHOP,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.COFFEE_SHOP};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.COFFEE_SHOP};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.COFFEE_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ute=i=>({collapsed:i});function pte(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var AO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.coffeeShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.coffeeShopService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.coffeeShopService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Coffee Shop Daily Sales ${this.selectedDate}.pdf`;(0,oD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.coffeeShopService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Coffee Shop Daily Sales ${this.selectedDate}.xlsx`;(0,oD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ko),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-coffee-shop"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"View Cafe \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,pte,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,ute,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var sD=Di(Ti());var hte=i=>({collapsed:i});
39function fte(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var PO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.coffeeShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.coffeeShopService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.coffeeShopService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Coffee Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,sD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.coffeeShopService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Coffee Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,sD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ko),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-coffee-shop"]],standalone:!1,decls:121,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"View Cafe \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
39),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,fte,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19)(81,"strong"),l(82),I(83,"currencyFormat"),o()()()()(),s(84,"div",23)(85,"div",24)(86,"div",25)(87,"div",26)(88,"span",27),l(89,"Subtotal:"),o(),s(90,"span"),l(91),I(92,"currencyFormat"),o()()(),s(93,"div",25)(94,"div",26)(95,"span",27),l(96,"Complimentary:"),o(),s(97,"span",28),l(98),I(99,"currencyFormat"),o()()(),s(100,"div",25)(101,"div",26)(102,"span",27),l(103,"Discounts:"),o(),s(104,"span",28),l(105),I(106,"currencyFormat"),o()()(),s(107,"div",25)(108,"div",26)(109,"span",27),l(110,"Voids:"),o(),s(111,"span",28),l(112),I(113,"currencyFormat"),o()()(),s(114,"div",25)(115,"div",29)(116,"span"),l(117,"Total Revenue:"),o(),s(118,"span"),l(119),I(120,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,hte,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(4),b(M(83,26,a.total.item_total)),m(9),b(M(92,28,a.total.item_subtotal)),m(7),b(M(99,30,a.total.complimentary_subtotal)),m(7),b(M(106,32,a.total.discount_subtotal)),m(7),b(M(113,34,a.total.voided_subtotal)),m(7),b(M(120,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var gte=i=>({collapsed:i}),vte=(i,n)=>({completed:i,void:n});
39function _te(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm a")),m(3),b(t.details),m(2),p("ngClass",Et(12,vte,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function yte(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var FO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.coffeeShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.coffeeShopService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ko),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-coffee-shop"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"View Cafe Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(17,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,_te,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,yte,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,gte,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var Ste=["echartContainer"];kk([Fk,Pk,Ak,Ok,Rk,Mk,Nk]);var Jn=(()=>{let n=class n{constructor(){this.title="Popular Activities"}ngOnInit(){}ngAfterViewInit(){setTimeout(()=>{this.initChart()}
39,0)}ngOnChanges(e){e.popularActivity&&e.popularActivity.currentValue&&e.popularActivity.currentValue.length>0&&(this.chart?this.updateChartData():this.initChart())}initChart(){if(!this.echartContainer||!this.echartContainer.nativeElement)return;let e={color:["#5FC198","#ED70AC","#D4A266","#8B694F"],dataset:{source:[]},legend:{left:"right",itemWidth:10,itemHeight:10,borderRadius:0,icon:"circle",textStyle:{color:"#777"}},xAxis:{type:"category",axisLabel:{color:"#aaa",padding:[0,0,10,0],rotate:45},axisLine:{lineStyle:{color:"#ccc"}},splitLine:{lineStyle:{color:"#eee"}}},yAxis:{type:"value",axisLabel:{color:"#aaa",formatter:r=>r.toString(),padding:[0,10,0,0]},min:0,max:150,interval:30,splitLine:{lineStyle:{color:"#eee"}}},series:[],grid:{right:"18px",left:"60px",bottom:"15%",top:"15%"},graphic:[{type:"text",left:"center",bottom:"10",style:{text:"Date",fontSize:14,fill:"#000",fontWeight:"bold"}},{type:"text",left:"-2px",top:"40%",style:{text:"User Count",fontSize:14,fill:"#000",fontWeight:"bold"},rotation:190.1}]};this.chart=Qi(this.echartContainer.nativeElement),this.chart.setOption(e),this.popularActivity&&this.popularActivity.length>0&&this.updateChartData()}updateChartData(){if(!this.chart||!this.popularActivity||this.popularActivity.length===0)return;let e={},r=new Set,a=new Set;this.popularActivity.forEach(y=>{let A=y.transaction_date;a.add(A),y.transactions.forEach(D=>{let F=D.item_name;r.add(F),e[F]||(e[F]={}),e[F][A]=(e[F][A]||0)+parseInt(D.total_quantity,10)})});let c=[["Transaction Date",...Array.from(r)]];Array.from(a).forEach(y=>{let A=[y];r.forEach(D=>{A.push(e[D][y]||0)}),c.push(A)});let d=Object.values(e).flatMap(y=>Object.values(y)),u=Math.max(...d),h=Math.min(...d),f=Math.floor(h/10)*10,v=Math.ceil(u/10)*10,C=Math.ceil((v-f)/5);this.chart.setOption({tooltip:{trigger:"item",formatter:y=>{let A=y.seriesName,D=y.value[y.seriesIndex+1];return`${A}: ${D}`}},dataset:{source:c},xAxis:{type:"category",axisLabel:{color:"#aaa",rotate:45},boundaryGap:!0},series:Array.from(r).map(y=>({name:y,type:"bar",barWidth:"15%",itemStyle:{borderRadius:[5,5,0,0]}})),yAxis:{type:"value",axisLabel:{color:"#aaa",formatter:y=>y.toString(),padding:[0,10,0,0]},min:f,max:v,interval:C,splitLine:{lineStyle:{color:"#eee"}}}})}onResize(){this.chart&&this.chart.resize()}ngOnDestroy(){this.chart&&this.chart.dispose()}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=te({type:n,selectors:[["app-most-popular-activity"]],viewQuery:function(r,a){if(r&1&&An(Ste,7),r&2){let c;on(c=sn())&&(a.echartContainer=c.first)}},hostBindings:function(r,a){r&1&&S("resize",function(){return a.onResize()},Hp)},inputs:{popularActivity:"popularActivity",title:"title"},standalone:!1,features:[kn],decls:7,vars:1,consts:[["echartContainer",""],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["data-echart-responsive","true",1,"echart-bar-course-enrollments"]],template:function(r,a){r&1&&(s(0,"div",1)(1,"div",2)(2,"div",3),l(3),o()(),s(4,"div",4),B(5,"div",5,0),o()()),r&2&&(m(3),b(a.title))},styles:[".card[_ngcontent-%COMP%]{background-color:#fff;border-radius:8px;padding:20px;flex:1;text-align:center}.echart-bar-course-enrollments[_ngcontent-%COMP%]{height:400px;width:100%}h3[_ngcontent-%COMP%]{text-align:left}hr[_ngcontent-%COMP%]{border:none;border-bottom:2px solid #f0f0f0;margin-bottom:20px}"]});let i=n;return i})();var Zn=(()=>{let n=class n{constructor(e){this.elementRef=e,this.transactionDates=[],this.revenues=[],this.expense=[],this.revenueItems=[],this.showExpense=!0}ngOnInit(){}ngAfterViewInit(){let e=this.elementRef.nativeElement.querySelector(".echart-line-revenue-sales-ecommerce");e&&(this.chartInstance=Qi(e),this.updateChart())}ngOnChanges(e){e.revenueItems&&e.revenueItems.currentValue&&this.updateChart(),e.showExpense&&this.updateChart()}updateChart(){if(this.chartInstance){this.transactionDates=this.revenueItems.map(r=>r.transaction_date),this.revenues=this.revenueItems.map(r=>parseFloat(r.revenue)),this.expense=this.revenueItems.map(r=>parseFloat(r.total_expense));let e=this.getChartOptions(this.transactionDates,this.revenues,this.expense);this.chartInstance.setOption(e)}}getFormatter(e){return e.map((r,a)=>{let c=r.value;return`<span class="fas fa-circle" style="color: ${r.color}"></span>
40 <span class='text-600'>${a===0?"Revenue":"Expense"}: ${c}</span>`}).join("<br/>")}getChartOptions(e,r,a){let c=r.map((u,h)=>u-a[h]);return{tooltip:{trigger:"axis",padding:[10,15],backgroundColor:"#fff",borderColor:"#8E2323",borderWidth:1,textStyle:{color:"#000",fontFamily:"Arial, sans-serif"},formatter:u=>{let f=` 41 <div style="font-weight: bold; font-size: 16px; color: #000; margin-bottom: 10px; text-align: left;">${u[0]?.axisValue||"No Date"}</div> 42 `;u.forEach(C=>{f+=` 43 <div style="display: flex; justify-content: space-between; align-items: center; margin-top: 4px;"> 44 <div style="display: flex; align-items: center; text-align: left;"> 45 <span style="width: 12px; height: 12px; background-color: ${C.color}; border-radius: 50%; margin-right: 8px;"></span> 46 <span style="font-size: 13px; color: #000;">${C.seriesName}:</span> 47 </div> 48 <span style="font-size: 13px; font-weight: bold; color: #000; text-align: right;">${C.data.toLocaleString()}</span> 49 </div> 50 `});var v=0;return u.forEach(C=>{v+=C.data}),f+=`<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 4px;"> 51 <div style="display: flex; align-items: center; text-align: left;"> 52 <span style="font-size: 13px; color: #000;">Total:</span> 53 </div> 54 <span style="font-size: 13px; font-weight: bold; color: #000; text-align: right;">${v.toLocaleString()}</span> 55 </div>`,f}},legend:{data:["Expense","Revenue"],top:"10px",textStyle:{color:"#000"},itemWidth:10,itemHeight:10,orient:"horizontal",left:"right"},xAxis:{type:"category",data:e,boundaryGap:!0,axisPointer:{lineStyle:{color:"#B6C1D2",type:"solid"}},axisLine:{lineStyle:{color:"#ccc",type:"solid"}},axisLabel:{color:"#B6C1D2",margin:15,interval:0,rotate:45},axisTick:{alignWithLabel:!0},minInterval:1},yAxis:{type:"value",splitLine:{lineStyle:{color:"#B6C1D2",type:"solid"}},axisLabel:{color:"#666",margin:15},axisLine:{show:!1}},series:[{name:"Expense",type:"bar",stack:"total",data:a,itemStyle:{color:"#548CF5"},barWidth:"35%"},{name:"Revenue",type:"bar",stack:"total",data:c,itemStyle:{color:"#F9A072"},barWidth:"35%"}],grid:{right:"18px",left:"80px",bottom:"15%",top:"15%"}}}};n.\u0275fac=function(r){return new(r||n)(x(Ai))},n.\u0275cmp=te({type:n,selectors:[["app-revenue-and-expense"]],inputs:{revenueItems:"revenueItems",showExpense:"showExpense"},standalone:!1,features:[kn],decls:6,vars:0,consts:[[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["data-echart-responsive","true",1,"echart-line-revenue-sales-ecommerce"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),l(3,"Revenue"),o()(),s(4,"div",3),B(5,"div",4),o()())},styles:[".echart-line-revenue-sales-ecommerce[_ngcontent-%COMP%]{height:400px;width:100%}"]});let i=n;return i})();var Qn=(()=>{let n=class n{constructor(e,r){this.elementRef=e,this.datePipe=r,this.DatewiseVisitorCount=[]}ngOnInit(){}ngAfterViewInit(){let e=this.elementRef.nativeElement.querySelector(".echart-line-total-sales-ecommerce");e&&(this.chart=Qi(e),this.setChartOptions())}ngOnChanges(e){e.DatewiseVisitorCount&&!e.DatewiseVisitorCount.isFirstChange()&&this.setChartOptions()}getOrdinalSuffix(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}setChartOptions(){if(this.chart&&this.DatewiseVisitorCount.length>0){let e=this.DatewiseVisitorCount.map(d=>{let u=this.datePipe.transform(d.ticket_date,"d"),h=this.datePipe.transform(d.ticket_date,"MMM");return`${u+this.getOrdinalSuffix(+u)} ${h}`}),r=this.DatewiseVisitorCount.map(d=>parseInt(d.local_visitors)),a=this.DatewiseVisitorCount.map(d=>parseInt(d.foreign_visitors)),c={tooltip:{trigger:"axis",padding:[10,15],backgroundColor:"#fff",borderColor:"#8E2323",borderWidth:1,textStyle:{color:"#000",fontFamily:"Arial, sans-serif"},formatter:d=>{let u=` 56 <div style="font-weight: bold; font-size: 16px; color: #000; margin-bottom: 10px; text-align: left;">Visitors</div> 57 <div style="font-size: 14px; color: #000; margin-bottom: 8px; text-align: left;">${d[0].axisValue}</div> 58 `;d.forEach(f=>{u+=` 59 <div style="display: flex; justify-content: space-between; align-items: center; margin-top: 4px;"> 60 <div style="display: flex; align-items: center; text-align: left;">
61 <span style="width: 12px; height: 12px; background-color: ${f.color}; border-radius: 50%; margin-right: 8px;"></span> 62 <span style="font-size: 13px; color: #000;">${f.seriesName}:</span> 63 </div> 64 <span style="font-size: 13px; font-weight: bold; color: #000; text-align: right;">${f.data.toLocaleString()}</span> 65 </div> 66 `});var h=0;return d.forEach(f=>{h+=f.data}),u+=`<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 4px;"> 67 <div style="display: flex; align-items: center; text-align: left;"> 68 <span style="font-size: 13px; color: #000;">Total:</span> 69 </div> 70 <span style="font-size: 13px; font-weight: bold; color: #000; text-align: right;">${h.toLocaleString()}</span> 71 </div>`,u}},legend:{data:["Local","Foreign"],top:"10px",textStyle:{color:"#000"},itemWidth:10,itemHeight:10,orient:"horizontal",left:"right"},xAxis:{type:"category",data:e,boundaryGap:!0,name:"Date",nameLocation:"middle",nameTextStyle:{fontWeight:"bold",color:"#666",fontSize:14,padding:20},axisPointer:{lineStyle:{color:"#B6C1D2",type:"solid"}},axisLine:{lineStyle:{color:"#ccc",type:"solid"}},axisLabel:{color:"#B6C1D2",margin:15,interval:0,rotate:45},axisTick:{alignWithLabel:!0},minInterval:1},yAxis:{type:"value",name:"Count",nameLocation:"middle",nameTextStyle:{fontWeight:"bold",color:"#666",fontSize:14,padding:40},splitLine:{lineStyle:{color:"#B6C1D2",type:"solid"}},axisLabel:{color:"#666",margin:15,formatter:d=>d.toString()},axisLine:{show:!1},min:0},series:[{name:"Local",type:"bar",data:r,stack:"visitors",itemStyle:{color:"#29BCFD"},barWidth:"40%"},{name:"Foreign",type:"bar",data:a,stack:"visitors",itemStyle:{color:"#A11EE8"},barWidth:"40%"}],grid:{right:"18px",left:"80px",bottom:"15%",top:"15%",containLabel:!0}};this.chart.setOption(c)}}};n.\u0275fac=function(r){return new(r||n)(x(Ai),x(St))},n.\u0275cmp=te({type:n,selectors:[["app-visited-foreign-and-local-guest-counts"]],inputs:{DatewiseVisitorCount:"DatewiseVisitorCount"},standalone:!1,features:[kn],decls:6,vars:0,consts:[[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["data-echart-responsive","true",1,"echart-line-total-sales-ecommerce"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),l(3,"Visitors"),o()(),s(4,"div",3),B(5,"div",4),o()())},styles:[".echart-line-total-sales-ecommerce[_ngcontent-%COMP%]{height:400px;width:100%}"]});let i=n;return i})();var bte=["chartContainer"],xte=i=>({"background-color":i});function Cte(i,n){if(i&1&&(s(0,"div",8),B(1,"div",9),s(2,"div",10)(3,"div",11),l(4),o(),s(5,"div",12),l(6),I(7,"number"),o()()()),i&2){let t=n.$implicit,e=n.index,r=w();m(),p("ngStyle",Z(5,xte,r.colors[e%r.colors.length])),m(3),b(t.category),m(2),b(M(7,3,t.item_total))}}var Ta=(()=>{let n=class n{constructor(e){this.sidebarService=e,this.categories=[],this.data=[],this.items=[],this.isCollapsed=!1,this.colors=["#5FC198","#EF91BE","#D4A266","#8B694F","#6A9FB5","#F28C28","#B08EA2","#FFC857","#457B9D","#2A9D8F"]}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e,this.updateChart(),console.log("items "+this.items)})}ngAfterViewInit(){this.initChart()}ngOnChanges(e){e.items&&e.items.currentValue&&this.updateChart(),e.isCollapsed&&!e.isCollapsed.firstChange&&setTimeout(()=>{this.resizeChart()},300)}initChart(){let e=this.chartContainer.nativeElement;e&&(this.chartInstance=Qi(e),this.updateChart())}updateChart(){if(!this.items||!this.chartInstance)return;this.categories=this.items.map(r=>r.category),this.data=this.items.map(r=>Number(r.item_total));let e=this.getDefaultOptions(this.categories,this.data);this.chartInstance.setOption(e)}getDefaultOptions(e,r){let a=this.isCollapsed?{left:"5%",right:"5%"}:{left:"10%",right:"10%"};return{tooltip:{trigger:"item",formatter:c=>`${c.name}: LKR ${c.value.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`},xAxis:{type:"value",name:"LKR",nameLocation:"middle",nameGap:25,boundaryGap:[0,.1],axisLine
71:{lineStyle:{color:"#ccc"}},splitLine:{lineStyle:{color:"#e0e0e0"}},axisLabel:{formatter:c=>c.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}},yAxis:{type:"category",name:"Category",data:e,axisLabel:{color:"#666",fontSize:12,formatter:c=>c.length>20?c.slice(0,20)+"...":c},axisLine:{lineStyle:{color:"#ccc"}}},series:[{type:"bar",name:"Revenue",data:r,barWidth:"30%",itemStyle:{color:c=>this.colors[c.dataIndex%this.colors.length],barBorderRadius:[5,5,5,0]},showSymbol:!1}],grid:tt(le({},a),{bottom:"10%",top:"10%",containLabel:!0})}}onWindowResize(){this.resizeChart()}resizeChart(){this.chartInstance&&setTimeout(()=>{this.chartInstance.resize()},200)}};n.\u0275fac=function(r){return new(r||n)(x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-category-wise-revenue"]],viewQuery:function(r,a){if(r&1&&An(bte,7),r&2){let c;on(c=sn())&&(a.chartContainer=c.first)}},hostBindings:function(r,a){r&1&&S("resize",function(){return a.onWindowResize()},Hp)},inputs:{items:"items",isCollapsed:"isCollapsed"},standalone:!1,features:[kn],decls:9,vars:1,consts:[["chartContainer",""],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],[1,"tabs-container"],["class","tab",4,"ngFor","ngForOf"],["data-echart-responsive","true",1,"echart-horizontal-bar-chart-example"],[1,"tab"],[1,"color-bar",3,"ngStyle"],[1,"tab-content"],[1,"tab-title"],[1,"tab-value"]],template:function(r,a){r&1&&(s(0,"div",1)(1,"div",2)(2,"div",3),l(3,"Category wise revenue (LKR)"),o()(),s(4,"div",4)(5,"div",5),T(6,Cte,8,7,"div",6),o(),B(7,"div",7,0),o()()),r&2&&(m(6),p("ngForOf",a.items))},dependencies:[_e,Ig,Dn],styles:[".echart-horizontal-bar-chart-example[_ngcontent-%COMP%]{height:300px;display:block}"]});let i=n;return i})();var Ete=i=>({collapsed:i});function wte(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var RO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.coffeeShopService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.coffeeShopService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.coffeeShopService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.coffeeShopService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.coffeeShopService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ko),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-coffee-shop-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
71date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"View Cafe Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,wte,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,Ete,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var lD=Di(Ti());var Ts=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.ADVENTURE_PARK,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.ADVENTURE_PARK,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.ADVENTURE_PARK,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getCategoryWiseSales(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getrevenueexpenseSales(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getMostPopularActivity(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getVisitorCount(e,r){let a={entity_id:Se.ADVENTURE_PARK,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getTicketSales(e){let r={entity_id:Se.ADVENTURE_PARK,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.ADVENTURE_PARK};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.ADVENTURE_PARK};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.ADVENTURE_PARK,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.ADVENTURE_PARK,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.ADVENTURE_PARK,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.ADVENTURE_PARK,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}getPOSUnitID(){let e={entity_id:Se.ADVENTURE_PARK};return this.http.post(this.apiUrl+"/get-pos-by-entity",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Tte=i=>({collapsed:i});
71function Dte(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var OO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.adventureParkService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.adventureParkService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.adventureParkService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Adventure Park Daily Sales ${this.selectedDate}.pdf`;(0,lD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.adventureParkService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Adventure Park Daily Sales ${this.selectedDate}.xlsx`;(0,lD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ts),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-adventure-park"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Adventure Park \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,Dte,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,Tte,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var cD=Di(Ti());var Ite=i=>({collapsed:i});
71function kte(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var NO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.adventureParkService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.adventureParkService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.adventureParkService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Adventure Park Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,cD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.adventureParkService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Adventure Park Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,cD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ts),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-adventure-park"]],standalone:!1,decls:120,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Adventure Park \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
71),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,kte,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19),l(81),I(82,"currencyFormat"),o()()()(),s(83,"div",23)(84,"div",24)(85,"div",25)(86,"div",26)(87,"span",27),l(88,"Subtotal:"),o(),s(89,"span"),l(90),I(91,"currencyFormat"),o()()(),s(92,"div",25)(93,"div",26)(94,"span",27),l(95,"Complimentary:"),o(),s(96,"span",28),l(97),I(98,"currencyFormat"),o()()(),s(99,"div",25)(100,"div",26)(101,"span",27),l(102,"Discounts:"),o(),s(103,"span",28),l(104),I(105,"currencyFormat"),o()()(),s(106,"div",25)(107,"div",26)(108,"span",27),l(109,"Voids:"),o(),s(110,"span",28),l(111),I(112,"currencyFormat"),o()()(),s(113,"div",25)(114,"div",29)(115,"span"),l(116,"Total Revenue:"),o(),s(117,"span"),l(118),I(119,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,Ite,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(3),_(" ",M(82,26,a.total.item_total)," "),m(9),b(M(91,28,a.total.item_subtotal)),m(7),b(M(98,30,a.total.complimentary_subtotal)),m(7),b(M(105,32,a.total.discount_subtotal)),m(7),b(M(112,34,a.total.voided_subtotal)),m(7),b(M(119,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Mte=i=>({collapsed:i}),Ate=(i,n)=>({completed:i,void:n});function Pte(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,Ate,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function Fte(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var LO=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.adventureParkService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.adventureParkService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ts),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-adventure-park"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Adventure Park Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
717,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Pte,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,Fte,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,Mte,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var Rte=i=>({collapsed:i});function Ote(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var BO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.adventureParkService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.adventureParkService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.adventureParkService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response in getRevenueExpenseSales:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.adventureParkService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.adventureParkService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ts),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-adventure-park-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
71date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Adventure Park Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,Ote,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,Rte,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var Nte=i=>({collapsed:i}),Lte=i=>({show:i}),Bte=(i,n,t,e)=>({"bg-primary":i,"bg-secondary":n,"bg-success":t,"bg-warning":e});function Vte(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function Ute(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o(),s(5,"div")(6,"span",30),l(7),o()()(),s(8,"div",31)(9,"div",32)(10,"div",33)(11,"div",34)(12,"span",35),l(13,"LKR"),o(),s(14,"input",36),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(15,"div",37)(16,"button",38),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(17,"span",39),l(18,"save"),o(),l(19," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(2),p("ngClass",El(6,Bte,t.visitor_type==="Foreign-Adults",t.visitor_type==="Foreign-Kids",t.visitor_type==="Local-Adults",t.visitor_type==="Local-Kids")),m(),_(" ",t.visitor_type," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function jte(i,n){if(i&1&&(s(0,"div",23)(1,"div",40)(2,"p",41),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",42)(5,"p",43)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",43)(10,"strong"),l(11,"Visitor Type:"),o(),l(12),o(),s(13,"p",43)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",44)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedItem.visitor_type," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function Wte(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.showConfirmModal=!1)}),o()}}
71function Hte(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var VO=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.adventureParkService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.adventureParkService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({},c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.adventureParkService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
71r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ts),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-pricing-adventure-park"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Adventure Park \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,Vte,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,Ute,20,11,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.showConfirmModal=!1}),o()(),T(21,jte,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,Wte,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,Hte,1,0,"div",21)),r&2&&(p("ngClass",Z(14,Nte,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,Lte,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var Gte=["chartContainer"],$te=i=>({"background-color":i});function zte(i,n){if(i&1&&(s(0,"div",8),B(1,"div",9),s(2,"div",10)(3,"div",11),l(4),o(),s(5,"div",12),l(6),I(7,"number"),o()()()),i&2){let t=n.$implicit,e=n.index,r=w();m(),p("ngStyle",Z(5,$te,r.colors[e%r.colors.length])),m(3),b(t.item_name),m(2),b(M(7,3,t.item_total))}}var uo=(()=>{let n=class n{constructor(e){this.sidebarService=e,this.categories=[],this.data=[],this.items=[],this.isCollapsed=!1,this.revenueType="Activity Wise Revenue",this.colors=["#5FC198","#EF91BE","#D4A266","#8B694F","#6A9FB5","#F28C28","#B08EA2","#FFC857","#457B9D","#2A9D8F"]}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e,this.updateChart()})}ngAfterViewInit(){this.initChart()}ngOnChanges(e){e.items&&e.items.currentValue&&this.updateChart(),e.isCollapsed&&!e.isCollapsed.firstChange&&setTimeout(()=>{this.resizeChart()},300)}initChart(){let e=this.chartContainer.nativeElement;e&&(this.chartInstance=Qi(e),this.updateChart())}updateChart(){if(!this.items||!this.chartInstance)return;this.categories=this.items.map(r=>r.item_name),this.data=this.items.map(r=>r.item_total);let e=this.getDefaultOptions(this.categories,this.data);this.chartInstance.setOption(e)}getDefaultOptions(e,r){let a=this.isCollapsed?{left:"5%",right:"5%"}:{left:"10%",right:"10%"};return{tooltip:{trigger:"axis",padding:[10,15],backgroundColor:"#fff",borderColor:"#8E2323",borderWidth:1,textStyle:{color:"#000",fontFamily:"Arial, sans-serif"},formatter:c=>{let u=` 72 <div style="font-weight: bold; font-size: 16px; color: #000; margin-bottom: 10px; text-align: left;">${c[0]?.axisValue||"No Date"}</div> 73 `;
73return c.forEach(h=>{u+=` 74 <div style="display: flex; justify-content: space-between; align-items: center; margin-top: 4px;"> 75 <div style="display: flex; align-items: center; text-align: left;"> 76 <span style="width: 12px; height: 12px; background-color: ${h.color}; border-radius: 50%; margin-right: 8px;"></span> 77 <span style="font-size: 13px; color: #000;">${h.seriesName}:</span> 78 </div> 79 <span style="font-size: 13px; font-weight: bold; color: #000; text-align: right;">LKR ${h.data.toLocaleString()}</span> 80 </div> 81 `}),u}},xAxis:{type:"value",name:"LKR",nameLocation:"middle",nameGap:25,boundaryGap:[0,.1],axisLine:{lineStyle:{color:"#ccc"}},splitLine:{lineStyle:{color:"#e0e0e0"}}},yAxis:{type:"category",name:"Activities",data:e,axisLabel:{color:"#666",fontSize:12,formatter:c=>c.length>20?c.slice(0,20)+"...":c},axisLine:{lineStyle:{color:"#ccc"}}},series:[{type:"bar",name:"Revenue",data:r,barWidth:"30%",itemStyle:{color:c=>this.colors[c.dataIndex%this.colors.length],barBorderRadius:[5,5,5,0]},showSymbol:!1}],grid:tt(le({},a),{bottom:"10%",top:"10%",containLabel:!0})}}onWindowResize(){this.resizeChart()}resizeChart(){this.chartInstance&&setTimeout(()=>{this.chartInstance.resize()},200)}};n.\u0275fac=function(r){return new(r||n)(x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-activity-wise-revenue"]],viewQuery:function(r,a){if(r&1&&An(Gte,7),r&2){let c;on(c=sn())&&(a.chartContainer=c.first)}},hostBindings:function(r,a){r&1&&S("resize",function(){return a.onWindowResize()},Hp)},inputs:{items:"items",isCollapsed:"isCollapsed",revenueType:"revenueType"},standalone:!1,features:[kn],decls:9,vars:2,consts:[["chartContainer",""],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],[1,"tabs-container"],["class","tab",4,"ngFor","ngForOf"],["data-echart-responsive","true",1,"echart-horizontal-bar-chart-example"],[1,"tab"],[1,"color-bar",3,"ngStyle"],[1,"tab-content"],[1,"tab-title"],[1,"tab-value"]],template:function(r,a){r&1&&(s(0,"div",1)(1,"div",2)(2,"div",3),l(3),o()(),s(4,"div",4)(5,"div",5),T(6,zte,8,7,"div",6),o(),B(7,"div",7,0),o()()),r&2&&(m(3),_("",a.revenueType," (LKR)"),m(3),p("ngForOf",a.items))},dependencies:[_e,Ig,Dn],styles:[".echart-horizontal-bar-chart-example[_ngcontent-%COMP%]{height:300px;display:block}"]});let i=n;return i})();var Yte=i=>({collapsed:i});function qte(i,n){if(i&1&&(s(0,"div",27)(1,"h3"),l(2),o(),s(3,"div",28),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var UO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.amberSwingService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}
81setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.total_revenue=e.data.totals.item_total,console.log("Total Revenue:",this.total_revenue),this.items=e.data.items,this.total=e.data.totals,this.updateSummaryData(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_guide_expense=0,this.amberSwingService.getRevenueExpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Io),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-ambar-swing-analytics"]],standalone:!1,decls:38,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
81date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,""],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems"],[3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Amber Swing Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,qte,7,8,"div",18),o()(),s(28,"div",19)(29,"div",20)(30,"div",21),B(31,"app-activity-wise-revenue",22),o(),s(32,"div",23),B(33,"app-visited-foreign-and-local-guest-counts",24),o(),s(34,"div",23),B(35,"app-revenue-and-expense",25),o(),s(36,"div",21),B(37,"app-most-popular-activity",26),o()()()()()()()),r&2&&(p("ngClass",Z(10,Yte,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,uo,Jn,Zn,Qn,Dn,Be],encapsulation:2});let i=n;return i})();var dD=Di(Ti());var Kte=i=>({collapsed:i}),Xte=(i,n)=>({completed:i,void:n});
81function Jte(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td"),l(5),o(),s(6,"td"),l(7),o(),s(8,"td"),l(9),o(),s(10,"td"),l(11),o(),s(12,"td"),l(13),o(),s(14,"td")(15,"span",22),l(16),o()(),s(17,"td"),l(18),o()()),i&2){let t=n.$implicit;m(2),b(t!=null&&t.date?M(3,9,t.date):"-"),m(3),b((t==null?null:t.invoice_no)||"-"),m(2),b((t==null?null:t.guide_id)||"-"),m(2),b((t==null||t.total_quantity==null?null:t.total_quantity.toLocaleString())||"-"),m(2),b((t==null||t.amount==null?null:t.amount.toLocaleString())||"-"),m(2),b((t==null||t.guide_expense==null?null:t.guide_expense.toLocaleString())||"-"),m(2),p("ngClass",Et(11,Xte,t.payment_status.trim().toLowerCase()==="completed",t.payment_status.trim().toLowerCase()==="voided")),m(),_(" ",t.payment_status," "),m(2),b((t==null?null:t.remark)||"-")}}var jO=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.amberSwingService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.isCollapsed=!1,this.items=[],this.total={Amount:0,expense:0}}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onClickGenerateGuideExpenseReport(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getGuideExpenseReport()}}getGuideExpenseReport(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getGuideExpenseReport(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}exportToPDF(){this.getGuideExpenseReportPDF()}getGuideExpenseReportPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getGuideExpenseReportPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Swing Guide expense Report ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,dD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getGuideExpenseReportExcel()}getGuideExpenseReportExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.amberSwingService.getGuideExpenseReportExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Swing Guide expense Report ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,dD.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Io),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-guide-expense-report"]],standalone:!1,decls:70,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","7"],[1,"status",2,"text-transform","capitalize",3,"ngClass"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Amber Swing \u2014 Guide expense Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateGuideExpenseReport()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
81),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th"),l(45,"Invoice No."),o(),s(46,"th"),l(47,"Guide id"),o(),s(48,"th"),l(49,"Quantity"),o(),s(50,"th"),l(51,"Amount(LKR)"),o(),s(52,"th"),l(53,"Guide expense(LKR)"),o(),s(54,"th"),l(55,"Payment Status"),o(),s(56,"th"),l(57,"Remark"),o()()(),s(58,"tbody",19),T(59,Jte,19,14,"tr",20),o(),s(60,"tfoot")(61,"tr")(62,"td",21),l(63," expense: "),s(64,"strong"),l(65),o()(),s(66,"td"),l(67," Total : "),s(68,"strong"),l(69),o()()()()()()()()()()),r&2&&(p("ngClass",Z(10,Kte,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(43),p("ngForOf",a.items),m(6),b(a.total.expense.toLocaleString()),m(4),b(a.total.Amount.toLocaleString()))},dependencies:[ue,_e,Ke,Ne,Le,St],encapsulation:2});let i=n;return i})();var MN=Di(Ti());var Fo=Uint8Array,ol=Uint16Array,_D=Int32Array,d2=new Fo([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,0,0,0]),m2=new Fo([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,0,0]),hD=new Fo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$O=function(i,n){for(var t=new ol(31),e=0;e<31;++e)t[e]=n+=1<<i[e-1];for(var r=new _D(t[30]),e=1;e<30;++e)for(var a=t[e];a<t[e+1];++a)r[a]=a-t[e]<<5|e;return{b:t,r}},zO=$O(d2,2),YO=zO.b,fD=zO.r;YO[28]=258,fD[258]=28;var qO=$O(m2,0),Zte=qO.b,WO=qO.r,gD=new ol(32768);for(er=0;er<32768;++er)Jd=(er&43690)>>1|(er&21845)<<1,Jd=(Jd&52428)>>2|(Jd&13107)<<2,Jd=(Jd&61680)>>4|(Jd&3855)<<4,gD[er]=((Jd&65280)>>8|(Jd&255)<<8)>>1;var Jd,er,td=function(i,n,t){for(var e=i.length,r=0,a=new ol(n);r<e;++r)i[r]&&++a[i[r]-1];var c=new ol(n);for(r=1;r<n;++r)c[r]=c[r-1]+a[r-1]<<1;var d;if(t){d=new ol(1<<n);var u=15-n;for(r=0;r<e;++r)if(i[r])for(var h=r<<4|i[r],f=n-i[r],v=c[i[r]-1]++<<f,C=v|(1<<f)-1;v<=C;++v)d[gD[v]>>u]=h}else for(d=new ol(e),r=0;r<e;++r)i[r]&&(d[r]=gD[c[i[r]-1]++]>>15-i[r]);return d},su=new Fo(288);for(er=0;er<144;++er)su[er]=8;var er;for(er=144;er<256;++er)su[er]=9;var er;for(er=256;er<280;++er)su[er]=7;var er;for(er=280;er<288;++er)su[er]=8;var er,_v=new Fo(32);for(er=0;er<32;++er)_v[er]=5;var er,Qte=td(su,9,0),eie=td(su,9,1),tie=td(_v,5,0),iie=td(_v,5,1),mD=function(i){for(var n=i[0],t=1;t<i.length;++t)i[t]>n&&(n=i[t]);return n},hc=function(i,n,t){var e=n/8|0;return(i[e]|i[e+1]<<8)>>(n&7)&t},uD=function(i,n){var t=n/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(n&7)},yD=function(i){return(i+7)/8|0},KO=function(i,n,t){return(n==null||n<0)&&(n=0),(t==null||t>i.length)&&(t=i.length),new Fo(i.subarray(n,t))};
vendor: 4,670 bytes, line 81
81var nie=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],fc=function(i,n,t){var e=new Error(n||nie[i]);if(e.code=i,Error.captureStackTrace&&Error.captureStackTrace(e,fc),!t)throw e;return e},rie=function(i,n,t,e){var r=i.length,a=e?e.length:0;if(!r||n.f&&!n.l)return t||new Fo(0);var c=!t,d=c||n.i!=2,u=n.i;c&&(t=new Fo(r*3));var h=function(It){var Nt=t.length;if(It>Nt){var qt=new Fo(Math.max(Nt*2,It));qt.set(t),t=qt}},f=n.f||0,v=n.p||0,C=n.b||0,y=n.l,A=n.d,D=n.m,F=n.n,R=r*8;do{if(!y){f=hc(i,v,1);var L=hc(i,v+1,3);if(v+=3,L)if(L==1)y=eie,A=iie,D=9,F=5;else if(L==2){var Ue=hc(i,v,31)+257,re=hc(i,v+10,15)+4,ae=Ue+hc(i,v+5,31)+1;v+=14;for(var ve=new Fo(ae),Me=new Fo(19),W=0;W<re;++W)Me[hD[W]]=hc(i,v+W*3,7);v+=re*3;for(var J=mD(Me),Ee=(1<<J)-1,Fe=td(Me,J,1),W=0;W<ae;){var $e=Fe[hc(i,v,Ee)];v+=$e&15;var H=$e>>4;if(H<16)ve[W++]=H;else{var Qe=0,ot=0;for(H==16?(ot=3+hc(i,v,3),v+=2,Qe=ve[W-1]):H==17?(ot=3+hc(i,v,7),v+=3):H==18&&(ot=11+hc(i,v,127),v+=7);ot--;)ve[W++]=Qe}}var et=ve.subarray(0,Ue),gt=ve.subarray(Ue);D=mD(et),F=mD(gt),y=td(et,D,1),A=td(gt,F,1)}else fc(1);else{var H=yD(v)+4,se=i[H-4]|i[H-3]<<8,Ce=H+se;if(Ce>r){u&&fc(0);break}d&&h(C+se),t.set(i.subarray(H,Ce),C),n.b=C+=se,n.p=v=Ce*8,n.f=f;continue}if(v>R){u&&fc(0);break}}d&&h(C+131072);for(var vt=(1<<D)-1,Kt=(1<<F)-1,O=v;;O=v){var Qe=y[uD(i,v)&vt],Q=Qe>>4;if(v+=Qe&15,v>R){u&&fc(0);break}if(Qe||fc(2),Q<256)t[C++]=Q;else if(Q==256){O=v,y=null;break}else{var V=Q-254;if(Q>264){var W=Q-257,Y=d2[W];V=hc(i,v,(1<<Y)-1)+YO[W],v+=Y}var we=A[uD(i,v)&Kt],Ve=we>>4;we||fc(3),v+=we&15;var gt=Zte[Ve];if(Ve>3){var Y=m2[Ve];gt+=uD(i,v)&(1<<Y)-1,v+=Y}if(v>R){u&&fc(0);break}d&&h(C+131072);var Ge=C+V;if(C<gt){var je=a-gt,it=Math.min(gt,Ge);for(je+C<0&&fc(3);C<it;++C)t[C]=e[je+C]}for(;C<Ge;++C)t[C]=t[C-gt]}}n.l=y,n.p=O,n.b=C,n.f=f,y&&(f=1,n.m=D,n.d=A,n.n=F)}while(!f);return C!=t.length&&c?KO(t,0,C):t.subarray(0,C)},Zd=function(i,n,t){t<<=n&7;var e=n/8|0;i[e]|=t,i[e+1]|=t>>8},gv=function(i,n,t){t<<=n&7;var e=n/8|0;i[e]|=t,i[e+1]|=t>>8,i[e+2]|=t>>16},pD=function(i,n){for(var t=[],e=0;e<i.length;++e)i[e]&&t.push({s:e,f:i[e]});var r=t.length,a=t.slice();if(!r)return{t:JO,l:0};if(r==1){var c=new Fo(t[0].s+1);return c[t[0].s]=1,{t:c,l:1}}t.sort(function(Ce,Ue){return Ce.f-Ue.f}),t.push({s:-1,f:25001});var d=t[0],u=t[1],h=0,f=1,v=2;for(t[0]={s:-1,f:d.f+u.f,l:d,r:u};f!=r-1;)d=t[t[h].f<t[v].f?h++:v++],u=t[h!=f&&t[h].f<t[v].f?h++:v++],t[f++]={s:-1,f:d.f+u.f,l:d,r:u};for(var C=a[0].s,e=1;e<r;++e)a[e].s>C&&(C=a[e].s);var y=new ol(C+1),A=vD(t[f-1],y,0);if(A>n){var e=0,D=0,F=A-n,R=1<<F;for(a.sort(function(Ue,re){return y[re.s]-y[Ue.s]||Ue.f-re.f});e<r;++e){var L=a[e].s;if(y[L]>n)D+=R-(1<<A-y[L]),y[L]=n;else break}for(D>>=F;D>0;){var H=a[e].s;y[H]<n?D-=1<<n-y[H]++-1:++e}for(;e>=0&&D;--e){var se=a[e].s;y[se]==n&&(--y[se],++D)}A=n}return{t:new Fo(y),l:A}},vD=function(i,n,t){return i.s==-1?Math.max(vD(i.l,n,t+1),vD(i.r,n,t+1)):n[i.s]=t},HO=function(i){for(var n=i.length;n&&!i[--n];);for(var t=new ol(++n),e=0,r=i[0],a=1,c=function(u){t[e++]=u},d=1;d<=n;++d)if(i[d]==r&&d!=n)++a;else{if(!r&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(r),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(r);a=1,r=i[d]}return{c:t.subarray(0,e),n}},vv=function(i,n){for(var t=0,e=0;e<n.length;++e)t+=i[e]*n[e];return t},XO=function(i,n,t){var e=t.length,r=yD(n+2);i[r]=e&255,i[r+1]=e>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var a=0;a<e;++a)i[r+a+4]=t[a];return(r+4+e)*8},GO=function(i,n,t,e,r,a,c,d,u,h,f){Zd(n,f++,t),++r[256];for(var v=pD(r,15),C=v.t,y=v.l,A=pD(a,15),D=A.t,F=A.l,R=HO(C),L=R.c,H=R.n,se=HO(D),Ce=se.c,Ue=se.n,re=new ol(19),ae=0;ae<L.length;++ae)++re[L[ae]&31];for(var ae=0;ae<Ce.length;++ae)++re[Ce[ae]&31];for(var ve=pD(re,7),Me=ve.t,W=ve.l,J=19;J>4&&!Me[hD[J-1]];--J);var Ee=h+5<<3,Fe=vv(r,su)+vv(a,_v)+c,$e=vv(r,C)+vv(a,D)+c+14+3*J+vv(re,Me)+2*re[16]+3*re[17]+7*re[18];if(u>=0&&Ee<=Fe&&Ee<=$e)return XO(n,f,i.subarray(u,u+h));var Qe,ot,et,gt;if(Zd(n,f,1+($e<Fe)),f+=2,$e<Fe){Qe=td(C,y,0),ot=C,et=td(D,F,0),gt=D;var vt=td(Me,W,0);Zd(n,f,H-257),Zd(n,f+5,Ue-1),Zd(n,f+10,J-4),f+=14;for(var ae=0;ae<J;++ae)Zd(n,f+3*ae,Me[hD[ae]]);f+=3*J;for(var Kt=[L,Ce],O=0;O<2;++O)for(var Q=Kt[O],ae=0;ae<Q.length;++ae){var V=Q[ae]&31;Zd(n,f,vt[V]),f+=Me[V],V>15&&(Zd(n,f,Q[ae]>>5&127),f+=Q[ae]>>12)}}else Qe=Qte,ot=su,et=tie,gt=_v;for(var ae=0;ae<d;++ae){var Y=e[ae];if(Y>255){var V=Y>>18&31;gv(n,f,Qe[V+257]),f+=ot[V+257],V>7&&(Zd(n,f,Y>>
8123&31),f+=d2[V]);var we=Y&31;gv(n,f,et[we]),f+=gt[we],we>3&&(gv(n,f,Y>>5&8191),f+=m2[we])}else gv(n,f,Qe[Y]),f+=ot[Y]}return gv(n,f,Qe[256]),f+ot[256]},aie=new _D([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),JO=new Fo(0),oie=function(i,n,t,e,r,a){var c=a.z||i.length,d=new Fo(e+c+5*(1+Math.ceil(c/7e3))+r),u=d.subarray(e,d.length-r),h=a.l,f=(a.r||0)&7;if(n){f&&(u[0]=a.r>>3);for(var v=aie[n-1],C=v>>13,y=v&8191,A=(1<<t)-1,D=a.p||new ol(32768),F=a.h||new ol(A+1),R=Math.ceil(t/3),L=2*R,H=function(ni){return(i[ni]^i[ni+1]<<R^i[ni+2]<<L)&A},se=new _D(25e3),Ce=new ol(288),Ue=new ol(32),re=0,ae=0,ve=a.i||0,Me=0,W=a.w||0,J=0;ve+2<c;++ve){var Ee=H(ve),Fe=ve&32767,$e=F[Ee];if(D[Fe]=$e,F[Ee]=Fe,W<=ve){var Qe=c-ve;if((re>7e3||Me>24576)&&(Qe>423||!h)){f=GO(i,u,0,se,Ce,Ue,ae,Me,J,ve-J,f),Me=re=ae=0,J=ve;for(var ot=0;ot<286;++ot)Ce[ot]=0;for(var ot=0;ot<30;++ot)Ue[ot]=0}var et=2,gt=0,vt=y,Kt=Fe-$e&32767;if(Qe>2&&Ee==H(ve-Kt))for(var O=Math.min(C,Qe)-1,Q=Math.min(32767,ve),V=Math.min(258,Qe);Kt<=Q&&--vt&&Fe!=$e;){if(i[ve+et]==i[ve+et-Kt]){for(var Y=0;Y<V&&i[ve+Y]==i[ve+Y-Kt];++Y);if(Y>et){if(et=Y,gt=Kt,Y>O)break;for(var we=Math.min(Kt,Y-2),Ve=0,ot=0;ot<we;++ot){var Ge=ve-Kt+ot&32767,je=D[Ge],it=Ge-je&32767;it>Ve&&(Ve=it,$e=Ge)}}}Fe=$e,$e=D[Fe],Kt+=Fe-$e&32767}if(gt){se[Me++]=268435456|fD[et]<<18|WO[gt];var It=fD[et]&31,Nt=WO[gt]&31;ae+=d2[It]+m2[Nt],++Ce[257+It],++Ue[Nt],W=ve+et,++re}else se[Me++]=i[ve],++Ce[i[ve]]}}for(ve=Math.max(ve,W);ve<c;++ve)se[Me++]=i[ve],++Ce[i[ve]];f=GO(i,u,h,se,Ce,Ue,ae,Me,J,ve-J,f),h||(a.r=f&7|u[f/8|0]<<3,f-=7,a.h=F,a.p=D,a.i=ve,a.w=W)}else{for(var ve=a.w||0;ve<c+h;ve+=65535){var qt=ve+65535;qt>=c&&(u[f/8|0]=h,qt=c),f=XO(u,f+1,i.subarray(ve,qt))}a.i=c}return KO(d,0,e+yD(f)+r)};var ZO=function(){var i=1,n=0;return{p:function(t){for(var e=i,r=n,a=t.length|0,c=0;c!=a;){for(var d=Math.min(c+2655,a);c<d;++c)r+=e+=t[c];e=(e&65535)+15*(e>>16),r=(r&65535)+15*(r>>16)}i=e,n=r},d:function(){return i%=65521,n%=65521,(i&255)<<24|(i&65280)<<8|(n&255)<<8|n>>8}}},sie=function(i,n,t,e,r){if(!r&&(r={l:1},n.dictionary)){var a=n.dictionary.subarray(-32768),c=new Fo(a.length+i.length);c.set(a),c.set(i,a.length),i=c,r.w=a.length}return oie(i,n.level==null?6:n.level,n.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+n.mem,t,e,r)};var QO=function(i,n,t){for(;t;++n)i[n]=t,t>>>=8};var lie=function(i,n){var t=n.level,e=t==0?0:t<6?1:t==9?3:2;if(i[0]=120,i[1]=e<<6|(n.dictionary&&32),i[1]|=31-(i[0]<<8|i[1])%31,n.dictionary){var r=ZO();r.p(n.dictionary),QO(i,2,r.d())}},cie=function(i,n){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&fc(6,"invalid zlib data"),(i[1]>>5&1)==+!n&&fc(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function u2(i,n){n||(n={});var t=ZO();t.p(i);var e=sie(i,n,n.dictionary?6:2,4);return lie(e,n),QO(e,e.length-4,t.d()),e}function eN(i,n){return rie(i.subarray(cie(i,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}var die=typeof TextDecoder<"u"&&new TextDecoder,mie=0;try{die.decode(JO,{stream:!0}),mie=1}catch{}var tn=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function SD(){tn.console&&typeof tn.console.log=="function"&&tn.console.log.apply(tn.console,arguments)}var Dr={log:SD,warn:function(i){tn.console&&(typeof tn.console.warn=="function"?tn.console.warn.apply(tn.console,arguments):SD.call(null,arguments))},error:function(i){tn.console&&(typeof tn.console.error=="function"?tn.console.error.apply(tn.console,arguments):SD(i))}};function bD(i,n,t){var e=new XMLHttpRequest;e.open("GET",i),e.responseType="blob",e.onload=function(){$0(e.response,n,t)},e.onerror=function(){Dr.error("could not download file")},e.send()}function tN(i){var n=new XMLHttpRequest;n.open("HEAD",i,!1);try{n.send()}catch{}return n.status>=200&&n.status<=299}function p2(i){try{i.dispatchEvent(new MouseEvent("click"))}catch{var n=document.createEvent("MouseEvents");
81n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),i.dispatchEvent(n)}}var yv,TD,$0=tn.saveAs||((typeof window>"u"?"undefined":_r(window))!=="object"||window!==tn?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(i,n,t){var e=tn.URL||tn.webkitURL,r=document.createElement("a");n=n||i.name||"download",r.download=n,r.rel="noopener",typeof i=="string"?(r.href=i,r.origin!==location.origin?tN(r.href)?bD(i,n,t):p2(r,r.target="_blank"):p2(r)):(r.href=e.createObjectURL(i),setTimeout(function(){e.revokeObjectURL(r.href)},4e4),setTimeout(function(){p2(r)},0))}:"msSaveOrOpenBlob"in navigator?function(i,n,t){if(n=n||i.name||"download",typeof i=="string")if(tN(i))bD(i,n,t);else{var e=document.createElement("a");e.href=i,e.target="_blank",setTimeout(function(){p2(e)})}else navigator.msSaveOrOpenBlob(function(r,a){return a===void 0?a={autoBom:!1}:_r(a)!=="object"&&(Dr.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}(i,t),n)}:function(i,n,t,e){if((e=e||open("","_blank"))&&(e.document.title=e.document.body.innerText="downloading..."),typeof i=="string")return bD(i,n,t);var r=i.type==="application/octet-stream",a=/constructor/i.test(tn.HTMLElement)||tn.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||r&&a)&&(typeof FileReader>"u"?"undefined":_r(FileReader))==="object"){var d=new FileReader;d.onloadend=function(){var f=d.result;f=c?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=f:location=f,e=null},d.readAsDataURL(i)}else{var u=tn.URL||tn.webkitURL,h=u.createObjectURL(i);e?e.location=h:location.href=h,e=null,setTimeout(function(){u.revokeObjectURL(h)},4e4)}});function _N(i){var n;i=i||"",this.ok=!1,i.charAt(0)=="#"&&(i=i.substr(1,6)),i={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee9
810",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[i=(i=i.replace(/ /g,"")).toLowerCase()]||i;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(d){return[parseInt(d[1]),parseInt(d[2]),parseInt(d[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(d){return[parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(d){return[parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16)]}}],e=0;e<t.length;e++){var r=t[e].re,a=t[e].process,c=r.exec(i);c&&(n=a(c),this.r=n[0],this.g=n[1],this.b=n[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var d=this.r.toString(16),u=this.g.toString(16),h=this.b.toString(16);return d.length==1&&(d="0"+d),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+d+u+h}}function xD(i,n){var t=i[0],e=i[1],r=i[2],a=i[3];t=Ro(t,e,r,a,n[0],7,-680876936),a=Ro(a,t,e,r,n[1],12,-389564586),r=Ro(r,a,t,e,n[2],17,606105819),e=Ro(e,r,a,t,n[3],22,-1044525330),t=Ro(t,e,r,a,n[4],7,-176418897),a=Ro(a,t,e,r,n[5],12,1200080426),r=Ro(r,a,t,e,n[6],17,-1473231341),e=Ro(e,r,a,t,n[7],22,-45705983),t=Ro(t,e,r,a,n[8],7,1770035416),a=Ro(a,t,e,r,n[9],12,-1958414417),r=Ro(r,a,t,e,n[10],17,-42063),e=Ro(e,r,a,t,n[11],22,-1990404162),t=Ro(t,e,r,a,n[12],7,1804603682),a=Ro(a,t,e,r,n[13],12,-40341101),r=Ro(r,a,t,e,n[14],17,-1502002290),t=Oo(t,e=Ro(e,r,a,t,n[15],22,1236535329),r,a,n[1],5,-165796510),a=Oo(a,t,e,r,n[6],9,-1069501632),r=Oo(r,a,t,e,n[11],14,643717713),e=Oo(e,r,a,t,n[0],20,-373897302),t=Oo(t,e,r,a,n[5],5,-701558691),a=Oo(a,t,e,r,n[10],9,38016083),r=Oo(r,a,t,e,n[15],14,-660478335),e=Oo(e,r,a,t,n[4],20,-405537848),t=Oo(t,e,r,a,n[9],5,568446438),a=Oo(a,t,e,r,n[14],9,-1019803690),r=Oo(r,a,t,e,n[3],14,-187363961),e=Oo(e,r,a,t,n[8],20,1163531501),t=Oo(t,e,r,a,n[13],5,-1444681467),a=Oo(a,t,e,r,n[2],9,-51403784),r=Oo(r,a,t,e,n[7],14,1735328473),t=No(t,e=Oo(e,r,a,t,n[12],20,-1926607734),r,a,n[5],4,-378558),a=No(a,t,e,r,n[8],11,-2022574463),r=No(r,a,t,e,n[11],16,1839030562),e=No(e,r,a,t,n[14],23,-35309556),t=No(t,e,r,a,n[1],4,-1530992060),a=No(a,t,e,r,n[4],11,1272893353),r=No(r,a,t,e,n[7],16,-155497632),e=No(e,r,a,t,n[10],23,-1094730640),t=No(t,e,r,a,n[13],4,681279174),a=No(a,t,e,r,n[0],11,-358537222),r=No(r,a,t,e,n[3],16,-722521979),e=No(e,r,a,t,n[6],23,76029189),t=No(t,e,r,a,n[9],4,-640364487),a=No(a,t,e,r,n[12],11,-421815835),r=No(r,a,t,e,n[15],16,530742520),t=Lo(t,e=No(e,r,a,t,n[2],23,-995338651),r,a,n[0],6,-198630844),a=Lo(a,t,e,r,n[7],10,1126891415),r=Lo(r,a,t,e,n[14],15,-1416354905),e=Lo(e,r,a,t,n[5],21,-57434055),t=Lo(t,e,r,a,n[12],6,1700485571),a=Lo(a,t,e,r,n[3],10,-1894986606),r=Lo(r,a,t,e,n[10],15,-1051523),e=Lo(e,r,a,t,n[1],21,-2054922799),t=Lo(t,e,r,a,n[8],6,1873313359),a=Lo(a,t,e,r,n[15],10,-30611744),r=Lo(r,a,t,e,n[6],15,-1560198380),e=Lo(e,r,a,t,n[13],21,1309151649),t=Lo(t,e,r,a,n[4],6,-145523070),a=Lo(a,t,e,r,n[11],10,-1120210379),r=Lo(r,a,t,e,n[2],15,718787259),e=Lo(e,r,a,t,n[9],21,-343485551),i[0]=cu(t,i[0]),i[1]=cu(e,i[1]),i[2]=cu(r,i[2]),i[3]=cu(a,i[3])}function C2(i,n,t,e,r,a){return n=cu(cu(n,i),cu(e,a)),cu(n<<r|n>>>32-r,t)}function Ro(i,n,t,e,r,a,c){return C2(n&t|~n&e,i,n,r,a,c)}function Oo(i,n,t,e,r,a,c){return C2(n&e|t&~e,i,n,r,a,c)}function No(i,n,t,e,r,a,c){return C2(n^t^e,i,n,r,a,c)}function Lo(i,n,t,e,r,a,c){return C2(t^(n|~e),i,n,r,a,c)}function yN(i){var n,t=i.length,e=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=i.length;n+=64)xD(e,uie(i.substring(n-64,n)));i=i.substring(n-64);var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n<i.length;n++)r[n>>2]|=i.charCodeAt(n)<<(n%4<<3);if(r[n>>2]|=128<<(n%4<<3),n>55)for(xD(e,r),n=0;n<16;n++)r[n]=0;return r[14]=8*t,xD(e,r),e}function uie(i){var n,t=[];for(n=0;n<64;n+=4)t[n>>2]=i.charCodeAt(n)+(i.charCodeAt(n+1)<<8)+(i.charCodeAt(n+2)<<16)+(i.charCodeAt(n+3)<<24);return t}yv=tn.atob.bind(tn),TD=tn.btoa.bind(tn);var iN="0123456789abcdef".split("");function pie(i){for(var n="",t=0;t<4;t++)n+=iN[i>>8*t+4&15]+iN[i>>8*t&15];return n}function hie(i){return String.fromCharCode((255&i)>>
810,(65280&i)>>8,(16711680&i)>>16,(4278190080&i)>>24)}function DD(i){return yN(i).map(hie).join("")}var fie=function(i){for(var n=0;n<i.length;n++)i[n]=pie(i[n]);return i.join("")}(yN("hello"))!="5d41402abc4b2a76b9719d911017c592";function cu(i,n){if(fie){var t=(65535&i)+(65535&n);return(i>>16)+(n>>16)+(t>>16)<<16|65535&t}return i+n&4294967295}function ID(i,n){var t,e,r,a;if(i!==t){for(var c=(r=i,a=1+(256/i.length>>0),new Array(a+1).join(r)),d=[],u=0;u<256;u++)d[u]=u;var h=0;for(u=0;u<256;u++){var f=d[u];h=(h+f+c.charCodeAt(u))%256,d[u]=d[h],d[h]=f}t=i,e=d}else d=e;var v=n.length,C=0,y=0,A="";for(u=0;u<v;u++)y=(y+(f=d[C=(C+1)%256]))%256,d[C]=d[y],d[y]=f,c=d[(d[C]+d[y])%256],A+=String.fromCharCode(n.charCodeAt(u)^c);return A}var nN={print:4,modify:8,copy:16,"annot-forms":32};function lf(i,n,t,e){this.v=1,this.r=2;var r=192;i.forEach(function(d){if(nN.perm!==void 0)throw new Error("Invalid permission: "+d);r+=nN[d]}),this.padding="(\xBFN^Nu\x8AAd\0NV\xFF\xFA�\b..\0\xB6\xD0h>\x80/\f\xA9\xFEdSiz";var a=(n+this.padding).substr(0,32),c=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,c),this.P=-(1+(255^r)),this.encryptionKey=DD(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(e)).substr(0,5),this.U=ID(this.encryptionKey,this.padding)}function cf(i){if(/[^\u0000-\u00ff]/.test(i))throw new Error("Invalid PDF Name Object: "+i+", Only accept ASCII characters.");for(var n="",t=i.length,e=0;e<t;e++){var r=i.charCodeAt(e);r<33||r===35||r===37||r===40||r===41||r===47||r===60||r===62||r===91||r===93||r===123||r===125||r>126?n+="#"+("0"+r.toString(16)).slice(-2):n+=i[e]}return n}function rN(i){if(_r(i)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var n={};this.subscribe=function(t,e,r){if(r=r||!1,typeof t!="string"||typeof e!="function"||typeof r!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");n.hasOwnProperty(t)||(n[t]={});var a=Math.random().toString(35);return n[t][a]=[e,!!r],a},this.unsubscribe=function(t){for(var e in n)if(n[e][t])return delete n[e][t],Object.keys(n[e]).length===0&&delete n[e],!0;return!1},this.publish=function(t){if(n.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1),r=[];for(var a in n[t]){var c=n[t][a];try{c[0].apply(i,e)}catch(d){tn.console&&Dr.error("jsPDF PubSub Error",d.message,d)}c[1]&&r.push(a)}r.length&&r.forEach(this.unsubscribe)}},this.getTopics=function(){return n}}function b2(i){if(!(this instanceof b2))return new b2(i);var n="opacity,stroke-opacity".split(",");for(var t in i)i.hasOwnProperty(t)&&n.indexOf(t)>=0&&(this[t]=i[t]);this.id="",this.objectNumber=-1}function SN(i,n){this.gState=i,this.matrix=n,this.id="",this.objectNumber=-1}function z0(i,n,t,e,r){if(!(this instanceof z0))return new z0(i,n,t,e,r);this.type=i==="axial"?2:3,this.coords=n,this.colors=t,SN.call(this,e,r)}function df(i,n,t,e,r){if(!(this instanceof df))return new df(i,n,t,e,r);this.boundingBox=i,this.xStep=n,this.yStep=t,this.stream="",this.cloneIndex=0,SN.call(this,e,r)}function $i(i){var n,t=typeof arguments[0]=="string"?arguments[0]:"p",e=arguments[1],r=arguments[2],a=arguments[3],c=[],d=1,u=16,h="S",f=null;_r(i=i||{})==="object"&&(t=i.orientation,e=i.unit||e,r=i.format||r,a=i.compress||i.compressPdf||a,(f=i.encryption||null)!==null&&(f.userPassword=f.userPassword||"",f.ownerPassword=f.ownerPassword||"",f.userPermissions=f.userPermissions||[]),d=typeof i.userUnit=="number"?Math.abs(i.userUnit):1,i.precision!==void 0&&(n=i.precision),i.floatPrecision!==void 0&&(u=i.floatPrecision),h=i.defaultPathOperation||"S"),c=i.filters||(a===!0?["FlateEncode"]:c),e=e||"mm",t=(""+(t||"P")).toLowerCase();var v=i.putOnlyUsedFonts||!1,C={},y={internal:{},__private__:{}};y.__private__.PubSub=rN;var A="1.3",D=y.__private__.getPdfVersion=function(){return A};y.__private__.setPdfVersion=function(k){A=k};var F={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};y.__private__.getPageFormats=function(){return F};var R=y.__private__.getPageFormat=function(k){return F[k]};r=r||"a4";var L={COMPAT:"compat",ADVANCED:"advanced"},H=L.COMPAT;function se(){this.saveGraphicsState(),Ae(new zi(fi,0,0,-fi,0,cm()*fi).toString()+" cm"),this.setFontSize(this.getFontSize()/fi),h="n",H=L.ADVANCED}function Ce(){this.restoreGraphicsState(),h="S",H=L.COMPAT}var Ue=y.__private__.combineFontStyleAndFontWeight=function(k,z){if(k=="bold"&&z=="normal"||k=="bold"&&z==400||k=="normal"&&z=="italic"||k=="bold"&&z=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return z&&(k=z==400||z==="normal"?k==="italic"?"italic":"normal":z!=700&&z!=="bold"||k!=="normal"?(z==700?"bold":z)+""+k:"bold"),k};y.advancedAPI=function(k){var z=H===L.COMPAT;return z&&se.call(this),typeof k!="function"||(k(this),z&&Ce.call(this)),this}
81,y.compatAPI=function(k){var z=H===L.ADVANCED;return z&&Ce.call(this),typeof k!="function"||(k(this),z&&se.call(this)),this},y.isAdvancedAPI=function(){return H===L.ADVANCED};var re,ae=function(k){if(H!==L.ADVANCED)throw new Error(k+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},ve=y.roundToPrecision=y.__private__.roundToPrecision=function(k,z){var Pe=n||z;if(isNaN(k)||isNaN(Pe))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return k.toFixed(Pe).replace(/0+$/,"")};re=y.hpf=y.__private__.hpf=typeof u=="number"?function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.hpf");return ve(k,u)}:u==="smart"?function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.hpf");return ve(k,k>-1&&k<1?16:5)}:function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.hpf");return ve(k,16)};var Me=y.f2=y.__private__.f2=function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.f2");return ve(k,2)},W=y.__private__.f3=function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.f3");return ve(k,3)},J=y.scale=y.__private__.scale=function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.scale");return H===L.COMPAT?k*fi:H===L.ADVANCED?k:void 0},Ee=function(k){return H===L.COMPAT?cm()-k:H===L.ADVANCED?k:void 0},Fe=function(k){return J(Ee(k))};y.__private__.setPrecision=y.setPrecision=function(k){typeof parseInt(k,10)=="number"&&(n=parseInt(k,10))};var $e,Qe="00000000000000000000000000000000",ot=y.__private__.getFileId=function(){return Qe},et=y.__private__.setFileId=function(k){return Qe=k!==void 0&&/^[a-fA-F0-9]{32}$/.test(k)?k.toUpperCase():Qe.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),f!==null&&(So=new lf(f.userPermissions,f.userPassword,f.ownerPassword,Qe)),Qe};y.setFileId=function(k){return et(k),this},y.getFileId=function(){return ot()};var gt=y.__private__.convertDateToPDFDate=function(k){var z=k.getTimezoneOffset(),Pe=z<0?"+":"-",We=Math.floor(Math.abs(z/60)),rt=Math.abs(z%60),wt=[Pe,V(We),"'",V(rt),"'"].join("");return["D:",k.getFullYear(),V(k.getMonth()+1),V(k.getDate()),V(k.getHours()),V(k.getMinutes()),V(k.getSeconds()),wt].join("")},vt=y.__private__.convertPDFDateToDate=function(k){var z=parseInt(k.substr(2,4),10),Pe=parseInt(k.substr(6,2),10)-1,We=parseInt(k.substr(8,2),10),rt=parseInt(k.substr(10,2),10),wt=parseInt(k.substr(12,2),10),$t=parseInt(k.substr(14,2),10);return new Date(z,Pe,We,rt,wt,$t,0)},Kt=y.__private__.setCreationDate=function(k){var z;if(k===void 0&&(k=new Date),k instanceof Date)z=gt(k);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(k))throw new Error("Invalid argument passed to jsPDF.setCreationDate");z=k}return $e=z},O=y.__private__.getCreationDate=function(k){var z=$e;return k==="jsDate"&&(z=vt($e)),z};y.setCreationDate=function(k){return Kt(k),this},y.getCreationDate=function(k){return O(k)};var Q,V=y.__private__.padd2=function(k){return("0"+parseInt(k)).slice(-2)},Y=y.__private__.padd2Hex=function(k){return("00"+(k=k.toString())).substr(k.length)},we=0,Ve=[],Ge=[],je=0,it=[],It=[],Nt=!1,qt=Ge,ni=function(){we=0,je=0,Ge=[],Ve=[],it=[],ge=Xr(),be=Xr()};y.__private__.setCustomOutputDestination=function(k){Nt=!0,qt=k};var bt=function(k){Nt||(qt=k)};y.__private__.resetCustomOutputDestination=function(){Nt=!1,qt=Ge};var Ae=y.__private__.out=function(k){return k=k.toString(),je+=k.length+1,qt.push(k),qt},Lt=y.__private__.write=function(k){return Ae(arguments.length===1?k.toString():Array.prototype.join.call(arguments," "))},hi=y.__private__.getArrayBuffer=function(k){for(var z=k.length,Pe=new ArrayBuffer(z),We=new Uint8Array(Pe);z--;)We[z]=k.charCodeAt(z);return Pe},Wt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];y.__private__.getStandardFonts=function(){return Wt};var Xt=i.fontSize||16;y.__private__.setFontSize=y.setFontSize=function(k){return Xt=H===L.ADVANCED?k/fi:k,this};var ri,di=y.__private__.getFontSize=y.getFontSize=function(){return H===L.COMPAT?Xt:Xt*fi},Mi=i.R2L||!1;y.__private__.setR2L=y.setR2L=function(k){return Mi=k,this},y.__private__.getR2L=y.getR2L=function(){return Mi};var Li,Ji=y.__private__.setZoomMode=function(k){var z=[void 0,null,"fullwidth","fullheight","fullpage","original"];
vendor: 5,933 bytes, line 81
81if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(k))ri=k;else if(isNaN(k)){if(z.indexOf(k)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+k+'" is not recognized.');ri=k}else ri=parseInt(k,10)};y.__private__.getZoomMode=function(){return ri};var ln,Sn=y.__private__.setPageMode=function(k){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(k)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+k+'" is not recognized.');Li=k};y.__private__.getPageMode=function(){return Li};var wn=y.__private__.setLayoutMode=function(k){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(k)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+k+'" is not recognized.');ln=k};y.__private__.getLayoutMode=function(){return ln},y.__private__.setDisplayMode=y.setDisplayMode=function(k,z,Pe){return Ji(k),wn(z),Sn(Pe),this};var Zi={title:"",subject:"",author:"",keywords:"",creator:""};y.__private__.getDocumentProperty=function(k){if(Object.keys(Zi).indexOf(k)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Zi[k]},y.__private__.getDocumentProperties=function(){return Zi},y.__private__.setDocumentProperties=y.setProperties=y.setDocumentProperties=function(k){for(var z in Zi)Zi.hasOwnProperty(z)&&k[z]&&(Zi[z]=k[z]);return this},y.__private__.setDocumentProperty=function(k,z){if(Object.keys(Zi).indexOf(k)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Zi[k]=z};var bn,fi,Aa,Pn,as,ir={},kr={},ul=[],Ln={},wc={},Fr={},Ws={},Hl=null,Cr=0,an=[],Hn=new rN(y),cd=i.hotfixes||[],Pa={},pl={},hl=[],zi=function k(z,Pe,We,rt,wt,$t){if(!(this instanceof k))return new k(z,Pe,We,rt,wt,$t);isNaN(z)&&(z=1),isNaN(Pe)&&(Pe=0),isNaN(We)&&(We=0),isNaN(rt)&&(rt=1),isNaN(wt)&&(wt=0),isNaN($t)&&($t=0),this._matrix=[z,Pe,We,rt,wt,$t]};Object.defineProperty(zi.prototype,"sx",{get:function(){return this._matrix[0]},set:function(k){this._matrix[0]=k}}),Object.defineProperty(zi.prototype,"shy",{get:function(){return this._matrix[1]},set:function(k){this._matrix[1]=k}}),Object.defineProperty(zi.prototype,"shx",{get:function(){return this._matrix[2]},set:function(k){this._matrix[2]=k}}),Object.defineProperty(zi.prototype,"sy",{get:function(){return this._matrix[3]},set:function(k){this._matrix[3]=k}}),Object.defineProperty(zi.prototype,"tx",{get:function(){return this._matrix[4]},set:function(k){this._matrix[4]=k}}),Object.defineProperty(zi.prototype,"ty",{get:function(){return this._matrix[5]},set:function(k){this._matrix[5]=k}}),Object.defineProperty(zi.prototype,"a",{get:function(){return this._matrix[0]},set:function(k){this._matrix[0]=k}}),Object.defineProperty(zi.prototype,"b",{get:function(){return this._matrix[1]},set:function(k){this._matrix[1]=k}}),Object.defineProperty(zi.prototype,"c",{get:function(){return this._matrix[2]},set:function(k){this._matrix[2]=k}}),Object.defineProperty(zi.prototype,"d",{get:function(){return this._matrix[3]},set:function(k){this._matrix[3]=k}}),Object.defineProperty(zi.prototype,"e",{get:function(){return this._matrix[4]},set:function(k){this._matrix[4]=k}}),Object.defineProperty(zi.prototype,"f",{get:function(){return this._matrix[5]},set:function(k){this._matrix[5]=k}}),Object.defineProperty(zi.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(zi.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(zi.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(zi.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),zi.prototype.join=function(k){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(re).join(k)},zi.prototype.multiply=function(k){var z=k.sx*this.sx+k.shy*this.shx,Pe=k.sx*this.shy+k.shy*this.sy,We=k.shx*this.sx+k.sy*this.shx,rt=k.shx*this.shy+k.sy*this.sy,wt=k.tx*this.sx+k.ty*this.shx+this.tx,$t=k.tx*this.shy+k.ty*this.sy+this.ty;return new zi(z,Pe,We,rt,wt,$t)},zi.prototype.decompose=function(){var k=this.sx,z=this.shy,Pe=this.shx,We=this.sy,rt=this.tx,wt=this.ty,$t=Math.sqrt(k*k+z*z),xi=(k/=$t)*Pe+(z/=$t)*We;Pe-=k*xi,We-=z*xi;var Wi=Math.sqrt(Pe*Pe+We*We);return xi/=Wi,k*(We/=Wi)<z*(Pe/=Wi)&&(k=-k,z=-z,xi=-xi,$t=-$t),{scale:new zi($t,0,0,Wi,0,0),translate:new zi(1,0,0,1,rt,wt),rotate:new zi(k,z,-z,k,0,0),skew:new zi(1,0,xi,1,0,0)}},zi.prototype.toString=function(k){return this.join(" ")},zi.prototype.inversed=function(){var k=this.sx,z=this.shy,Pe=this.shx,We=this.sy,rt=this.tx,wt=this.ty,$t=1/(k*We-z*Pe),xi=We*$t,Wi=-z*$t,hn=-Pe*$t,dn=k*$t;return new zi(xi,Wi,hn,dn,-xi*rt-hn*wt,-Wi*rt-dn*wt)},zi.prototype.applyToPoint=function(k){var z=k.x*this.sx+k.y*this.shx+this.tx,Pe=k.x*this.shy+k.y*this.sy+this.ty;return new Ep(z,Pe)},zi.prototype.applyToRectangle=function(k){var z=this.applyToPoint(k),Pe=this.applyToPoint(new Ep(k.x+k.w,k.y+k.h));return new $f(z.x,z.y,Pe.x-z.x,Pe.y-z.y)},zi.prototype.clone=function(){var k=this.sx,z=this.shy,Pe=this.shx,We=this.sy,rt=this.tx,wt=this.ty;return new zi(k,z,Pe,We,rt,wt)},y.Matrix=zi;var Hs=y.matrixMult=function(k,z){return z.multiply(k)},os=new zi(1,0,0,1,0,0);y.unitMatrix=y.identityMatrix=os;var yo=function(k,z){if(!wc[k]){var Pe=(z instanceof z0?"Sh":"P")+(Object.keys(Ln).length+1).toString(10);z.id=Pe,wc[k]=Pe,Ln[Pe]=z,Hn.publish("addPattern",z)}};y.ShadingPattern=z0,y.TilingPattern=df,y.addShadingPattern=function(k,z){return ae("addShadingPattern()"),yo(k,z),this},y.beginTilingPattern=function(k){ae("beginTilingPattern()"),r_(k.boundingBox[0],k.boundingBox[1],k.boundingBox[2]-k.boundingBox[0],k.boundingBox[3]-k.boundingBox[1],k.matrix)},y.endTilingPattern=function(k,z){ae("endTilingPattern()"),z.stream=It[Q].join(`
82`),yo(k,z),Hn.publish("endTilingPattern",z),hl.pop().restore()};var oa=y.__private__.newObject=function(){var k=Xr();return ie(k,!0),k},Xr=y.__private__.newObjectDeferred=function(){return we++,Ve[we]=function(){return je},we},ie=function(k,z){return z=typeof z=="boolean"&&z,Ve[k]=je,z&&Ae(k+" 0 obj"),k},Ie=y.__private__.newAdditionalObject=function(){var k={objId:Xr(),content:""};return it.push(k),k},ge=Xr(),be=Xr(),De=y.__private__.decodeColorString=function(k){var z=k.split(" ");if(z.length!==2||z[1]!=="g"&&z[1]!=="G")z.length===5&&(z[4]==="k"||z[4]==="K")&&(z=[(1-z[0])*(1-z[3]),(1-z[1])*(1-z[3]),(1-z[2])*(1-z[3]),"r"]);else{var Pe=parseFloat(z[0]);z=[Pe,Pe,Pe,"r"]}for(var We="#",rt=0;rt<3;rt++)We+=("0"+Math.floor(255*parseFloat(z[rt])).toString(16)).slice(-2);return We},ke=y.__private__.encodeColorString=function(k){var z;typeof k=="string"&&(k={ch1:k});var Pe=k.ch1,We=k.ch2,rt=k.ch3,wt=k.ch4,$t=k.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Pe=="string"&&Pe.charAt(0)!=="#"){var xi=new _N(Pe);if(xi.ok)Pe=xi.toHex();else if(!/^\d*\.?\d*$/.test(Pe))throw new Error('Invalid color "'+Pe+'" passed to jsPDF.encodeColorString.')}if(typeof Pe=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Pe)&&(Pe="#"+Pe[1]+Pe[1]+Pe[2]+Pe[2]+Pe[3]+Pe[3]),typeof Pe=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Pe)){var Wi=parseInt(Pe.substr(1),16);Pe=Wi>>16&255,We=Wi>>8&255,rt=255&Wi}if(We===void 0||wt===void 0&&Pe===We&&We===rt)if(typeof Pe=="string")z=Pe+" "+$t[0];else switch(k.precision){case 2:z=Me(Pe/255)+" "+$t[0];break;case 3:default:z=W(Pe/255)+" "+$t[0]}else if(wt===void 0||_r(wt)==="object"){if(wt&&!isNaN(wt.a)&&wt.a===0)return z=["1.","1.","1.",$t[1]].join(" ");if(typeof Pe=="string")z=[Pe,We,rt,$t[1]].join(" ");else switch(k.precision){case 2:z=[Me(Pe/255),Me(We/255),Me(rt/255),$t[1]].join(" ");break;default:case 3:z=[W(Pe/255),W(We/255),W(rt/255),$t[1]].join(" ")}}else if(typeof Pe=="string")z=[Pe,We,rt,wt,$t[2]].join(" ");else switch(k.precision){case 2:z=[Me(Pe),Me(We),Me(rt),Me(wt),$t[2]].join(" ");break;case 3:default:z=[W(Pe),W(We),W(rt),W(wt),$t[2]].join(" ")}return z},lt=y.__private__.getFilters=function(){return c},xt=y.__private__.putStream=function(k){var z=(k=k||{}).data||"",Pe=k.filters||lt(),We=k.alreadyAppliedFilters||[],rt=k.addLength1||!1,wt=z.length,$t=k.objectId,xi=function(bo){return bo};if(f!==null&&$t===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");f!==null&&(xi=So.encryptor($t,0));var Wi={};Pe===!0&&(Pe=["FlateEncode"]);var hn=k.additionalKeyValues||[],dn=(Wi=$i.API.processDataByFilters!==void 0?$i.API.processDataByFilters(z,Pe):{data:z,reverseChain:[]}).reverseChain+(Array.isArray(We)?We.join(" "):We.toString());if(Wi.data.length!==0&&(hn.push({key:"Length",value:Wi.data.length}),rt===!0&&hn.push({key:"Length1",value:wt})),dn.length!=0)if(dn.split("/").length-1==1)hn.push({key:"Filter",value:dn});else{hn.push({key:"Filter",value:"["+dn+"]"});for(var Rn=0;Rn<hn.length;Rn+=1)if(hn[Rn].key==="DecodeParms"){for(var Gr=[],Jr=0;Jr<Wi.reverseChain.split("/").length-1;Jr+=1)Gr.push("null");Gr.push(hn[Rn].value),hn[Rn].value="["+Gr.join(" ")+"]"}}Ae("<<");for(var va=0;va<hn.length;va++)Ae("/"+hn[va].key+" "+hn[va].value);Ae(">>"),Wi.data.length!==0&&(Ae("stream"),Ae(xi(Wi.data)),Ae("endstream"))},dt=y.__private__.putPage=function(k){var z=k.number,Pe=k.data,We=k.objId,rt=k.contentsObjId;ie(We,!0),Ae("<</Type /Page"),Ae("/Parent "+k.rootDictionaryObjId+" 0 R"),Ae("/Resources "+k.resourceDictionaryObjId+" 0 R"),Ae("/MediaBox ["+parseFloat(re(k.mediaBox.bottomLeftX))+" "+parseFloat(re(k.mediaBox.bottomLeftY))+" "+re(k.mediaBox.topRightX)+" "+re(k.mediaBox.topRightY)+"]"),k.cropBox!==null&&Ae("/CropBox ["+re(k.cropBox.bottomLeftX)+" "+re(k.cropBox.bottomLeftY)+" "+re(k.cropBox.topRightX)+" "+re(k.cropBox.topRightY)+"]"),k.bleedBox!==null&&Ae("/BleedBox ["+re(k.bleedBox.bottomLeftX)+" "+re(k.bleedBox.bottomLeftY)+" "+re(k.bleedBox.topRightX)+" "+re(k.bleedBox.topRightY)+"]"),k.trimBox!==null&&Ae("/TrimBox ["+re(k.trimBox.bottomLeftX)+" "+re(k.trimBox.bottomLeftY)+" "+re(k.trimBox.topRightX)+" "+re(k.trimBox.topRightY)+"]"),k.artBox!==null&&Ae("/ArtBox ["+re(k.artBox.bottomLeftX)+" "+re(k.artBox.bottomLeftY)+" "+re(k.artBox.topRightX)+" "+re(k.artBox.topRightY)+"]"),typeof k.userUnit=="number"&&k.userUnit!==1&&Ae("/UserUnit "+k.userUnit),Hn.publish("putPage",{objId:We,pageContext:an[z],pageNumber:z,page:Pe}),Ae("/Contents "+rt+" 0 R"),Ae(">>"),Ae("endobj");var wt=Pe.join(` 83`);return H===L.ADVANCED&&(wt+=` 84Q`),ie(rt,!0),xt({data:wt,filters:lt(),objectId:rt}),Ae("endobj"),We},ft=y.__private__.putPages=function(){var k,z,Pe=[];for(k=1;k<=Cr;
84k++)an[k].objId=Xr(),an[k].contentsObjId=Xr();for(k=1;k<=Cr;k++)Pe.push(dt({number:k,data:It[k],objId:an[k].objId,contentsObjId:an[k].contentsObjId,mediaBox:an[k].mediaBox,cropBox:an[k].cropBox,bleedBox:an[k].bleedBox,trimBox:an[k].trimBox,artBox:an[k].artBox,userUnit:an[k].userUnit,rootDictionaryObjId:ge,resourceDictionaryObjId:be}));ie(ge,!0),Ae("<</Type /Pages");var We="/Kids [";for(z=0;z<Cr;z++)We+=Pe[z]+" 0 R ";Ae(We+"]"),Ae("/Count "+Cr),Ae(">>"),Ae("endobj"),Hn.publish("postPutPages")},yt=function(k){Hn.publish("putFont",{font:k,out:Ae,newObject:oa,putStream:xt}),k.isAlreadyPutted!==!0&&(k.objectNumber=oa(),Ae("<<"),Ae("/Type /Font"),Ae("/BaseFont /"+cf(k.postScriptName)),Ae("/Subtype /Type1"),typeof k.encoding=="string"&&Ae("/Encoding /"+k.encoding),Ae("/FirstChar 32"),Ae("/LastChar 255"),Ae(">>"),Ae("endobj"))},zt=function(){for(var k in ir)ir.hasOwnProperty(k)&&(v===!1||v===!0&&C.hasOwnProperty(k))&&yt(ir[k])},ei=function(k){k.objectNumber=oa();var z=[];z.push({key:"Type",value:"/XObject"}),z.push({key:"Subtype",value:"/Form"}),z.push({key:"BBox",value:"["+[re(k.x),re(k.y),re(k.x+k.width),re(k.y+k.height)].join(" ")+"]"}),z.push({key:"Matrix",value:"["+k.matrix.toString()+"]"});var Pe=k.pages[1].join(` 85`);xt({data:Pe,additionalKeyValues:z,objectId:k.objectNumber}),Ae("endobj")},bi=function(){for(var k in Pa)Pa.hasOwnProperty(k)&&ei(Pa[k])},ti=function(k,z){var Pe,We=[],rt=1/(z-1);for(Pe=0;Pe<1;Pe+=rt)We.push(Pe);if(We.push(1),k[0].offset!=0){var wt={offset:0,color:k[0].color};k.unshift(wt)}if(k[k.length-1].offset!=1){var $t={offset:1,color:k[k.length-1].color};k.push($t)}for(var xi="",Wi=0,hn=0;hn<We.length;hn++){for(Pe=We[hn];Pe>k[Wi+1].offset;)Wi++;var dn=k[Wi].offset,Rn=(Pe-dn)/(k[Wi+1].offset-dn),Gr=k[Wi].color,Jr=k[Wi+1].color;xi+=Y(Math.round((1-Rn)*Gr[0]+Rn*Jr[0]).toString(16))+Y(Math.round((1-Rn)*Gr[1]+Rn*Jr[1]).toString(16))+Y(Math.round((1-Rn)*Gr[2]+Rn*Jr[2]).toString(16))}return xi.trim()},li=function(k,z){z||(z=21);var Pe=oa(),We=ti(k.colors,z),rt=[];rt.push({key:"FunctionType",value:"0"}),rt.push({key:"Domain",value:"[0.0 1.0]"}),rt.push({key:"Size",value:"["+z+"]"}),rt.push({key:"BitsPerSample",value:"8"}),rt.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),rt.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),xt({data:We,additionalKeyValues:rt,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Pe}),Ae("endobj"),k.objectNumber=oa(),Ae("<< /ShadingType "+k.type),Ae("/ColorSpace /DeviceRGB");var wt="/Coords ["+re(parseFloat(k.coords[0]))+" "+re(parseFloat(k.coords[1]))+" ";k.type===2?wt+=re(parseFloat(k.coords[2]))+" "+re(parseFloat(k.coords[3])):wt+=re(parseFloat(k.coords[2]))+" "+re(parseFloat(k.coords[3]))+" "+re(parseFloat(k.coords[4]))+" "+re(parseFloat(k.coords[5])),Ae(wt+="]"),k.matrix&&Ae("/Matrix ["+k.matrix.toString()+"]"),Ae("/Function "+Pe+" 0 R"),Ae("/Extend [true true]"),Ae(">>"),Ae("endobj")},nn=function(k,z){var Pe=Xr(),We=oa();z.push({resourcesOid:Pe,objectOid:We}),k.objectNumber=We;var rt=[];rt.push({key:"Type",value:"/Pattern"}),rt.push({key:"PatternType",value:"1"}),rt.push({key:"PaintType",value:"1"}),rt.push({key:"TilingType",value:"1"}),rt.push({key:"BBox",value:"["+k.boundingBox.map(re).join(" ")+"]"}),rt.push({key:"XStep",value:re(k.xStep)}),rt.push({key:"YStep",value:re(k.yStep)}),rt.push({key:"Resources",value:Pe+" 0 R"}),k.matrix&&rt.push({key:"Matrix",value:"["+k.matrix.toString()+"]"}),xt({data:k.stream,additionalKeyValues:rt,objectId:k.objectNumber}),Ae("endobj")},Gn=function(k){var z;for(z in Ln)Ln.hasOwnProperty(z)&&(Ln[z]instanceof z0?li(Ln[z]):Ln[z]instanceof df&&nn(Ln[z],k))},Fa=function(k){for(var z in k.objectNumber=oa(),Ae("<<"),k)switch(z){case"opacity":Ae("/ca "+Me(k[z]));break;case"stroke-opacity":Ae("/CA "+Me(k[z]))}Ae(">>"),Ae("endobj")},Br=function(){var k;for(k in Fr)Fr.hasOwnProperty(k)&&Fa(Fr[k])},Ra=function(){for(var k in Ae("/XObject <<"),Pa)Pa.hasOwnProperty(k)&&Pa[k].objectNumber>=0&&Ae("/"+k+" "+Pa[k].objectNumber+" 0 R");Hn.publish("putXobjectDict"),Ae(">>")},dd=function(){So.oid=oa(),Ae("<<"),Ae("/Filter /Standard"),Ae("/V "+So.v),Ae("/R "+So.r),Ae("/U <"+So.toHexString(So.U)+">"),Ae("/O <"+So.toHexString(So.O)+">"),Ae("/P "+So.P),Ae(">>"),Ae("endobj")},Tc=function(){for(var k in Ae("/Font <<"),ir)ir.hasOwnProperty(k)&&(v===!1||v===!0&&C.hasOwnProperty(k))&&Ae("/"+k+" "+ir[k].objectNumber+" 0 R");Ae(">>")},Gl=function(){if(Object.keys(Ln).length>
850){for(var k in Ae("/Shading <<"),Ln)Ln.hasOwnProperty(k)&&Ln[k]instanceof z0&&Ln[k].objectNumber>=0&&Ae("/"+k+" "+Ln[k].objectNumber+" 0 R");Hn.publish("putShadingPatternDict"),Ae(">>")}},Dc=function(k){if(Object.keys(Ln).length>0){for(var z in Ae("/Pattern <<"),Ln)Ln.hasOwnProperty(z)&&Ln[z]instanceof y.TilingPattern&&Ln[z].objectNumber>=0&&Ln[z].objectNumber<k&&Ae("/"+z+" "+Ln[z].objectNumber+" 0 R");Hn.publish("putTilingPatternDict"),Ae(">>")}},Gs=function(){if(Object.keys(Fr).length>0){var k;for(k in Ae("/ExtGState <<"),Fr)Fr.hasOwnProperty(k)&&Fr[k].objectNumber>=0&&Ae("/"+k+" "+Fr[k].objectNumber+" 0 R");Hn.publish("putGStateDict"),Ae(">>")}},sa=function(k){ie(k.resourcesOid,!0),Ae("<<"),Ae("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),Tc(),Gl(),Dc(k.objectOid),Gs(),Ra(),Ae(">>"),Ae("endobj")},Hv=function(){var k=[];zt(),Br(),bi(),Gn(k),Hn.publish("putResources"),k.forEach(sa),sa({resourcesOid:be,objectOid:Number.MAX_SAFE_INTEGER}),Hn.publish("postPutResources")},Gv=function(){Hn.publish("putAdditionalObjects");for(var k=0;k<it.length;k++){var z=it[k];ie(z.objId,!0),Ae(z.content),Ae("endobj")}Hn.publish("postPutAdditionalObjects")},$v=function(k){kr[k.fontName]=kr[k.fontName]||{},kr[k.fontName][k.fontStyle]=k.id},Nf=function(k,z,Pe,We,rt){var wt={id:"F"+(Object.keys(ir).length+1).toString(10),postScriptName:k,fontName:z,fontStyle:Pe,encoding:We,isStandardFont:rt||!1,metadata:{}};return Hn.publish("addFont",{font:wt,instance:this}),ir[wt.id]=wt,$v(wt),wt.id},rx=function(k){for(var z=0,Pe=Wt.length;z<Pe;z++){var We=Nf.call(this,k[z][0],k[z][1],k[z][2],Wt[z][3],!0);v===!1&&(C[We]=!0);var rt=k[z][0].split("-");$v({id:We,fontName:rt[0],fontStyle:rt[1]||""})}Hn.publish("addFonts",{fonts:ir,dictionary:kr})},$l=function(k){return k.foo=function(){try{return k.apply(this,arguments)}catch(We){var z=We.stack||"";~z.indexOf(" at ")&&(z=z.split(" at ")[1]);var Pe="Error in function "+z.split(` 86`)[0].split("<")[0]+": "+We.message;if(!tn.console)throw new Error(Pe);tn.console.error(Pe,We),tn.alert&&alert(Pe)}},k.foo.bar=k,k.foo},_p=function(k,z){var Pe,We,rt,wt,$t,xi,Wi,hn,dn;if(rt=(z=z||{}).sourceEncoding||"Unicode",$t=z.outputEncoding,(z.autoencode||$t)&&ir[bn].metadata&&ir[bn].metadata[rt]&&ir[bn].metadata[rt].encoding&&(wt=ir[bn].metadata[rt].encoding,!$t&&ir[bn].encoding&&($t=ir[bn].encoding),!$t&&wt.codePages&&($t=wt.codePages[0]),typeof $t=="string"&&($t=wt[$t]),$t)){for(Wi=!1,xi=[],Pe=0,We=k.length;Pe<We;Pe++)(hn=$t[k.charCodeAt(Pe)])?xi.push(String.fromCharCode(hn)):xi.push(k[Pe]),xi[Pe].charCodeAt(0)>>8&&(Wi=!0);k=xi.join("")}for(Pe=k.length;Wi===void 0&&Pe!==0;)k.charCodeAt(Pe-1)>>8&&(Wi=!0),Pe--;if(!Wi)return k;for(xi=z.noBOM?[]:[254,255],Pe=0,We=k.length;Pe<We;Pe++){if((dn=(hn=k.charCodeAt(Pe))>>8)>>8)throw new Error("Character at position "+Pe+" of string '"+k+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");xi.push(dn),xi.push(hn-(dn<<8))}return String.fromCharCode.apply(void 0,xi)},ss=y.__private__.pdfEscape=y.pdfEscape=function(k,z){return _p(k,z).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Lf=y.__private__.beginPage=function(k){It[++Cr]=[],an[Cr]={objId:0,contentsObjId:0,userUnit:Number(d),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(k[0]),topRightY:Number(k[1])}},Yv(Cr),bt(It[Q])},zv=function(k,z){var Pe,We,rt;switch(t=z||t,typeof k=="string"&&(Pe=R(k.toLowerCase()),Array.isArray(Pe)&&(We=Pe[0],rt=Pe[1])),Array.isArray(k)&&(We=k[0]*fi,rt=k[1]*fi),isNaN(We)&&(We=r[0],rt=r[1]),(We>14400||rt>14400)&&(Dr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),We=Math.min(14400,We),rt=Math.min(14400,rt)),r=[We,rt],t.substr(0,1)){case"l":rt>We&&(r=[rt,We]);break;case"p":We>rt&&(r=[rt,We])}Lf(r),Qv(jf),Ae(zl),Hf!==0&&Ae(Hf+" J"),Gf!==0&&Ae(Gf+" j"),Hn.publish("addPage",{pageNumber:Cr})},ax=function(k){k>0&&k<=Cr&&(It.splice(k,1),an.splice(k,1),Cr--,Q>Cr&&(Q=Cr),this.setPage(Q))},Yv=function(k){k>0&&k<=Cr&&(Q=k)},ox=y.__private__.getNumberOfPages=y.getNumberOfPages=function(){return It.length-1},qv=function(k,z,Pe){var We,rt=void 0;return Pe=Pe||{},k=k!==void 0?k:ir[bn].fontName,z=z!==void 0?z:ir[bn].fontStyle,We=k.toLowerCase(),kr[We]!==void 0&&kr[We][z]!==void 0?rt=kr[We][z]:kr[k]!==void 0&&kr[k][z]!==void 0?rt=kr[k][z]:Pe.disableWarning===!1&&Dr.warn("Unable to look up font label for font '"+k+"', '"+z+"'. Refer to getFontList(
86) for available fonts."),rt||Pe.noFallback||(rt=kr.times[z])==null&&(rt=kr.times.normal),rt},sx=y.__private__.putInfo=function(){var k=oa(),z=function(We){return We};for(var Pe in f!==null&&(z=So.encryptor(k,0)),Ae("<<"),Ae("/Producer ("+ss(z("jsPDF "+$i.version))+")"),Zi)Zi.hasOwnProperty(Pe)&&Zi[Pe]&&Ae("/"+Pe.substr(0,1).toUpperCase()+Pe.substr(1)+" ("+ss(z(Zi[Pe]))+")");Ae("/CreationDate ("+ss(z($e))+")"),Ae(">>"),Ae("endobj")},Bf=y.__private__.putCatalog=function(k){var z=(k=k||{}).rootDictionaryObjId||ge;switch(oa(),Ae("<<"),Ae("/Type /Catalog"),Ae("/Pages "+z+" 0 R"),ri||(ri="fullwidth"),ri){case"fullwidth":Ae("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Ae("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Ae("/OpenAction [3 0 R /Fit]");break;case"original":Ae("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Pe=""+ri;Pe.substr(Pe.length-1)==="%"&&(ri=parseInt(ri)/100),typeof ri=="number"&&Ae("/OpenAction [3 0 R /XYZ null null "+Me(ri)+"]")}switch(ln||(ln="continuous"),ln){case"continuous":Ae("/PageLayout /OneColumn");break;case"single":Ae("/PageLayout /SinglePage");break;case"two":case"twoleft":Ae("/PageLayout /TwoColumnLeft");break;case"tworight":Ae("/PageLayout /TwoColumnRight")}Li&&Ae("/PageMode /"+Li),Hn.publish("putCatalog"),Ae(">>"),Ae("endobj")},lx=y.__private__.putTrailer=function(){Ae("trailer"),Ae("<<"),Ae("/Size "+(we+1)),Ae("/Root "+we+" 0 R"),Ae("/Info "+(we-1)+" 0 R"),f!==null&&Ae("/Encrypt "+So.oid+" 0 R"),Ae("/ID [ <"+Qe+"> <"+Qe+"> ]"),Ae(">>")},cx=y.__private__.putHeader=function(){Ae("%PDF-"+A),Ae("%\xBA\xDF\xAC\xE0")},dx=y.__private__.putXRef=function(){var k="0000000000";Ae("xref"),Ae("0 "+(we+1)),Ae("0000000000 65535 f ");for(var z=1;z<=we;z++)typeof Ve[z]=="function"?Ae((k+Ve[z]()).slice(-10)+" 00000 n "):Ve[z]!==void 0?Ae((k+Ve[z]).slice(-10)+" 00000 n "):Ae("0000000000 00000 n ")},md=y.__private__.buildDocument=function(){ni(),bt(Ge),Hn.publish("buildDocument"),cx(),ft(),Gv(),Hv(),f!==null&&dd(),sx(),Bf();var k=je;return dx(),lx(),Ae("startxref"),Ae(""+k),Ae("%%EOF"),bt(It[Q]),Ge.join(` 87`)},yp=y.__private__.getBlob=function(k){return new Blob([hi(k)],{type:"application/pdf"})},Sp=y.output=y.__private__.output=$l(function(k,z){switch(typeof(z=z||{})=="string"?z={filename:z}:z.filename=z.filename||"generated.pdf",k){case void 0:return md();case"save":y.save(z.filename);break;case"arraybuffer":return hi(md());case"blob":return yp(md());case"bloburi":case"bloburl":if(tn.URL!==void 0&&typeof tn.URL.createObjectURL=="function")return tn.URL&&tn.URL.createObjectURL(yp(md()))||void 0;Dr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Pe="",We=md();try{Pe=TD(We)}catch{Pe=TD(unescape(encodeURIComponent(We)))}return"data:application/pdf;filename="+z.filename+";base64,"+Pe;case"pdfobjectnewwindow":if(Object.prototype.toString.call(tn)==="[object Window]"){var rt="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",wt=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';z.pdfObjectUrl&&(rt=z.pdfObjectUrl,wt="");var $t='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+rt+'"'+wt+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(z)+");<\/script></body></html>",xi=tn.open();return xi!==null&&xi.document.write($t),xi}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(tn)==="[object Window]"){var Wi='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(z.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+z.filename+'" width="500px" height="400px" /></body></html>',hn=tn.open();if(hn!==null){hn.document.write(Wi);var dn=this;hn.document.documentElement.querySelector("#pdfViewer").onload=function(){hn.document.title=z.filename,hn.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(dn.output("bloburl"))}}return hn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(tn)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Rn='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",z)+'"></iframe></body></html>',Gr=tn.open();if(Gr!==null&&(Gr.document.write(Rn),Gr.document.title=z.filename),Gr||typeof safari>"u")return Gr;break;case"datauri":case"dataurl":return tn.document.location.href=this.output("datauristring",z);default:return null}}),Kv=function(k){return Array.isArray(cd)===!0&&cd.indexOf(k)>-1};switch(e){case"pt":fi=1;break;case"mm":fi=72/25.4;break;case"cm":fi=72/2.54;break;case"in":fi=72;break;case"px":fi=Kv("px_scaling")==1?.75:96/72;break;case"pc":case"em":fi=12;break;case"ex":fi=6;break;default:if(typeof e!="number")throw new Error("Invalid unit: "+e);fi=e}var So=null;Kt(),et();var mx=function(k){return f!==null?So.encryptor(k,0):function(z){return z}},Xv=y.__private__.getPageInfo=y.getPageInfo=function(k){if(isNaN(k)||k%1!=0)throw new Error("Invalid argument passed to
87jsPDF.getPageInfo");return{objId:an[k].objId,pageNumber:k,pageContext:an[k]}},cn=y.__private__.getPageInfoByObjId=function(k){if(isNaN(k)||k%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var z in an)if(an[z].objId===k)break;return Xv(z)},ux=y.__private__.getCurrentPageInfo=y.getCurrentPageInfo=function(){return{objId:an[Q].objId,pageNumber:Q,pageContext:an[Q]}};y.addPage=function(){return zv.apply(this,arguments),this},y.setPage=function(){return Yv.apply(this,arguments),bt.call(this,It[Q]),this},y.insertPage=function(k){return this.addPage(),this.movePage(Q,k),this},y.movePage=function(k,z){var Pe,We;if(k>z){Pe=It[k],We=an[k];for(var rt=k;rt>z;rt--)It[rt]=It[rt-1],an[rt]=an[rt-1];It[z]=Pe,an[z]=We,this.setPage(z)}else if(k<z){Pe=It[k],We=an[k];for(var wt=k;wt<z;wt++)It[wt]=It[wt+1],an[wt]=an[wt+1];It[z]=Pe,an[z]=We,this.setPage(z)}return this},y.deletePage=function(){return ax.apply(this,arguments),this},y.__private__.text=y.text=function(k,z,Pe,We,rt){var wt,$t,xi,Wi,hn,dn,Rn,Gr,Jr,va=(We=We||{}).scope||this;if(typeof k=="number"&&typeof z=="number"&&(typeof Pe=="string"||Array.isArray(Pe))){var bo=Pe;Pe=z,z=k,k=bo}if(arguments[3]instanceof zi?(ae("The transform parameter of text() with a Matrix value"),Jr=rt):(xi=arguments[4],Wi=arguments[5],_r(Rn=arguments[3])==="object"&&Rn!==null||(typeof xi=="string"&&(Wi=xi,xi=null),typeof Rn=="string"&&(Wi=Rn,Rn=null),typeof Rn=="number"&&(xi=Rn,Rn=null),We={flags:Rn,angle:xi,align:Wi})),isNaN(z)||isNaN(Pe)||k==null)throw new Error("Invalid arguments passed to jsPDF.text");if(k.length===0)return va;var Ha="",Yl=!1,$s=typeof We.lineHeightFactor=="number"?We.lineHeightFactor:bu,Mc=va.internal.scaleFactor;function a_(Mr){return Mr=Mr.split(" ").join(Array(We.TabLen||9).join(" ")),ss(Mr,Rn)}function Kf(Mr){for(var Ar,ca=Mr.concat(),Oa=[],gd=ca.length;gd--;)typeof(Ar=ca.shift())=="string"?Oa.push(Ar):Array.isArray(Mr)&&(Ar.length===1||Ar[1]===void 0&&Ar[2]===void 0)?Oa.push(Ar[0]):Oa.push([Ar[0],Ar[1],Ar[2]]);return Oa}function Xf(Mr,Ar){var ca;if(typeof Mr=="string")ca=Ar(Mr)[0];else if(Array.isArray(Mr)){for(var Oa,gd,rg=Mr.concat(),Op=[],d_=rg.length;d_--;)typeof(Oa=rg.shift())=="string"?Op.push(Ar(Oa)[0]):Array.isArray(Oa)&&typeof Oa[0]=="string"&&(gd=Ar(Oa[0],Oa[1],Oa[2]),Op.push([gd[0],gd[1],gd[2]]));ca=Op}return ca}var Tp=!1,Jf=!0;if(typeof k=="string")Tp=!0;else if(Array.isArray(k)){var Zf=k.concat();$t=[];for(var Dp,ao=Zf.length;ao--;)(typeof(Dp=Zf.shift())!="string"||Array.isArray(Dp)&&typeof Dp[0]!="string")&&(Jf=!1);Tp=Jf}if(Tp===!1)throw new Error('Type of text must be string or Array. "'+k+'" is not recognized.');typeof k=="string"&&(k=k.match(/[\r?\n]/)?k.split(/\r\n|\r|\n/g):[k]);var Ip=Xt/va.internal.scaleFactor,kp=Ip*($s-1);switch(We.baseline){case"bottom":Pe-=kp;break;case"top":Pe+=Ip-kp;break;case"hanging":Pe+=Ip-2*kp;break;case"middle":Pe+=Ip/2-kp}if((dn=We.maxWidth||0)>0&&(typeof k=="string"?k=va.splitTextToSize(k,dn):Object.prototype.toString.call(k)==="[object Array]"&&(k=k.reduce(function(Mr,Ar){return Mr.concat(va.splitTextToSize(Ar,dn))},[]))),wt={text:k,x:z,y:Pe,options:We,mutex:{pdfEscape:ss,activeFontKey:bn,fonts:ir,activeFontSize:Xt}},Hn.publish("preProcessText",wt),k=wt.text,xi=(We=wt.options).angle,!(Jr instanceof zi)&&xi&&typeof xi=="number"){xi*=Math.PI/180,We.rotationDirection===0&&(xi=-xi),H===L.ADVANCED&&(xi=-xi);var Mp=Math.cos(xi),Qf=Math.sin(xi);Jr=new zi(Mp,Qf,-Qf,Mp,0,0)}else xi&&xi instanceof zi&&(Jr=xi);H!==L.ADVANCED||Jr||(Jr=os),(hn=We.charSpace||Cp)!==void 0&&(Ha+=re(J(hn))+` Tc 88`,this.setCharSpace(this.getCharSpace()||0)),(Gr=We.horizontalScale)!==void 0&&(Ha+=re(100*Gr)+` Tz 89`),We.lang;var ls=-1,xx=We.renderingMode!==void 0?We.renderingMode:We.stroke,eg=va.internal.getCurrentPageInfo().pageContext;switch(xx){case 0:case!1:case"fill":ls=0;break;case 1:case!0:case"stroke":ls=1;break;case 2:case"fillThenStroke":ls=2;break;case 3:case"invisible":ls=3;break;case 4:case"fillAndAddForClipping":ls=4;break;case 5:case"strokeAndAddPathForClipping":ls=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":ls=6;break;
89case 7:case"addToPathForClipping":ls=7}var o_=eg.usedRenderingMode!==void 0?eg.usedRenderingMode:-1;ls!==-1?Ha+=ls+` Tr 90`:o_!==-1&&(Ha+=`0 Tr 91`),ls!==-1&&(eg.usedRenderingMode=ls),Wi=We.align||"left";var fl,Ap=Xt*$s,s_=va.internal.pageSize.getWidth(),l_=ir[bn];hn=We.charSpace||Cp,dn=We.maxWidth||0,Rn=Object.assign({autoencode:!0,noBOM:!0},We.flags);var dm=[],Eu=function(Mr){return va.getStringUnitWidth(Mr,{font:l_,charSpace:hn,fontSize:Xt,doKerning:!1})*Xt/Mc};if(Object.prototype.toString.call(k)==="[object Array]"){var cs;$t=Kf(k),Wi!=="left"&&(fl=$t.map(Eu));var jo,mm=0;if(Wi==="right"){z-=fl[0],k=[],ao=$t.length;for(var pd=0;pd<ao;pd++)pd===0?(jo=kc(z),cs=ud(Pe)):(jo=J(mm-fl[pd]),cs=-Ap),k.push([$t[pd],jo,cs]),mm=fl[pd]}else if(Wi==="center"){z-=fl[0]/2,k=[],ao=$t.length;for(var hd=0;hd<ao;hd++)hd===0?(jo=kc(z),cs=ud(Pe)):(jo=J((mm-fl[hd])/2),cs=-Ap),k.push([$t[hd],jo,cs]),mm=fl[hd]}else if(Wi==="left"){k=[],ao=$t.length;for(var Pp=0;Pp<ao;Pp++)k.push($t[Pp])}else if(Wi==="justify"&&l_.encoding==="Identity-H"){k=[],ao=$t.length,dn=dn!==0?dn:s_;for(var fd=0,la=0;la<ao;la++)if(cs=la===0?ud(Pe):-Ap,jo=la===0?kc(z):fd,la<ao-1){var tg=J((dn-fl[la])/($t[la].split(" ").length-1)),Wo=$t[la].split(" ");k.push([Wo[0]+" ",jo,cs]),fd=0;for(var gl=1;gl<Wo.length;gl++){var Fp=(Eu(Wo[gl-1]+" "+Wo[gl])-Eu(Wo[gl]))*Mc+tg;gl==Wo.length-1?k.push([Wo[gl],Fp,0]):k.push([Wo[gl]+" ",Fp,0]),fd-=Fp}}else k.push([$t[la],jo,cs]);k.push(["",fd,0])}else{if(Wi!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(k=[],ao=$t.length,dn=dn!==0?dn:s_,la=0;la<ao;la++)cs=la===0?ud(Pe):-Ap,jo=la===0?kc(z):0,la<ao-1?dm.push(re(J((dn-fl[la])/($t[la].split(" ").length-1)))):dm.push(0),k.push([$t[la],jo,cs])}}var c_=typeof We.R2L=="boolean"?We.R2L:Mi;c_===!0&&(k=Xf(k,function(Mr,Ar,ca){return[Mr.split("").reverse().join(""),Ar,ca]})),wt={text:k,x:z,y:Pe,options:We,mutex:{pdfEscape:ss,activeFontKey:bn,fonts:ir,activeFontSize:Xt}},Hn.publish("postProcessText",wt),k=wt.text,Yl=wt.mutex.isHex||!1;var ig=ir[bn].encoding;ig!=="WinAnsiEncoding"&&ig!=="StandardEncoding"||(k=Xf(k,function(Mr,Ar,ca){return[a_(Mr),Ar,ca]})),$t=Kf(k),k=[];for(var wu,Tu,um,Du=0,Rp=1,Iu=Array.isArray($t[0])?Rp:Du,pm="",ng=function(Mr,Ar,ca){var Oa="";return ca instanceof zi?(ca=typeof We.angle=="number"?Hs(ca,new zi(1,0,0,1,Mr,Ar)):Hs(new zi(1,0,0,1,Mr,Ar),ca),H===L.ADVANCED&&(ca=Hs(new zi(1,0,0,-1,0,0),ca)),Oa=ca.join(" ")+` Tm 92`):Oa=re(Mr)+" "+re(Ar)+` Td 93`,Oa},vl=0;vl<$t.length;vl++){switch(pm="",Iu){case Rp:um=(Yl?"<":"(")+$t[vl][0]+(Yl?">":")"),wu=parseFloat($t[vl][1]),Tu=parseFloat($t[vl][2]);break;case Du:um=(Yl?"<":"(")+$t[vl]+(Yl?">":")"),wu=kc(z),Tu=ud(Pe)}dm!==void 0&&dm[vl]!==void 0&&(pm=dm[vl]+` Tw 94`),vl===0?k.push(pm+ng(wu,Tu,Jr)+um):Iu===Du?k.push(pm+um):Iu===Rp&&k.push(pm+ng(wu,Tu,Jr)+um)}k=Iu===Du?k.join(` Tj 95T* `):k.join(` Tj 96`),k+=` Tj 97`;var _l=`BT 98/`;return _l+=bn+" "+Xt+` Tf 99`,_l+=re(Xt*$s)+` TL 100`,_l+=xu+` 101`,_l+=Ha,_l+=k,Ae(_l+="ET"),C[bn]=!0,va};var px=y.__private__.clip=y.clip=function(k){return Ae(k==="evenodd"?"W*":"W"),this};y.clipEvenOdd=function(){return px("evenodd")},y.__private__.discardPath=y.discardPath=function(){return Ae("n"),this};var Ic=y.__private__.isValidStyle=function(k){var z=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(k)!==-1&&(z=!0),z};y.__private__.setDefaultPathOperation=y.setDefaultPathOperation=function(k){return Ic(k)&&(h=k),this};var Jv=y.__private__.getStyle=y.getStyle=function(k){var z=h;switch(k){case"D":case"S":z="S";break;case"F":z="f";break;case"FD":case"DF":z="B";break;case"f":case"f*":case"B":case"B*":z=k}return z},Zv=y.close=function(){return Ae("h"),this};y.stroke=function(){return Ae("S"),this},y.fill=function(k){return bp("f",k),this},y.fillEvenOdd=function(k){return bp("f*",k),this},y.fillStroke=function(k){return bp("B",k),this},y.fillStrokeEvenOdd=function(k){return bp("B*",k),this};var bp=function(k,z){_r(z)==="object"?fx(z,k):Ae(k)},Vf=function(k){k===null||H===L.ADVANCED&&k===void 0||(k=Jv(k),Ae(k))};function hx(k,z,Pe,We,rt){var wt=new df(z||this.boundingBox,Pe||this.xStep,We||this.yStep,this.gState,rt||this.matrix
vendor: 4,588 bytes, line 101
101);wt.stream=this.stream;var $t=k+"$$"+this.cloneIndex+++"$$";return yo($t,wt),wt}var fx=function(k,z){var Pe=wc[k.key],We=Ln[Pe];if(We instanceof z0)Ae("q"),Ae(gx(z)),We.gState&&y.setGState(We.gState),Ae(k.matrix.toString()+" cm"),Ae("/"+Pe+" sh"),Ae("Q");else if(We instanceof df){var rt=new zi(1,0,0,-1,0,cm());k.matrix&&(rt=rt.multiply(k.matrix||os),Pe=hx.call(We,k.key,k.boundingBox,k.xStep,k.yStep,rt).id),Ae("q"),Ae("/Pattern cs"),Ae("/"+Pe+" scn"),We.gState&&y.setGState(We.gState),Ae(z),Ae("Q")}},gx=function(k){switch(k){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},Uf=y.moveTo=function(k,z){return Ae(re(J(k))+" "+re(Fe(z))+" m"),this},Su=y.lineTo=function(k,z){return Ae(re(J(k))+" "+re(Fe(z))+" l"),this},sm=y.curveTo=function(k,z,Pe,We,rt,wt){return Ae([re(J(k)),re(Fe(z)),re(J(Pe)),re(Fe(We)),re(J(rt)),re(Fe(wt)),"c"].join(" ")),this};y.__private__.line=y.line=function(k,z,Pe,We,rt){if(isNaN(k)||isNaN(z)||isNaN(Pe)||isNaN(We)||!Ic(rt))throw new Error("Invalid arguments passed to jsPDF.line");return H===L.COMPAT?this.lines([[Pe-k,We-z]],k,z,[1,1],rt||"S"):this.lines([[Pe-k,We-z]],k,z,[1,1]).stroke()},y.__private__.lines=y.lines=function(k,z,Pe,We,rt,wt){var $t,xi,Wi,hn,dn,Rn,Gr,Jr,va,bo,Ha,Yl;if(typeof k=="number"&&(Yl=Pe,Pe=z,z=k,k=Yl),We=We||[1,1],wt=wt||!1,isNaN(z)||isNaN(Pe)||!Array.isArray(k)||!Array.isArray(We)||!Ic(rt)||typeof wt!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Uf(z,Pe),$t=We[0],xi=We[1],hn=k.length,bo=z,Ha=Pe,Wi=0;Wi<hn;Wi++)(dn=k[Wi]).length===2?(bo=dn[0]*$t+bo,Ha=dn[1]*xi+Ha,Su(bo,Ha)):(Rn=dn[0]*$t+bo,Gr=dn[1]*xi+Ha,Jr=dn[2]*$t+bo,va=dn[3]*xi+Ha,bo=dn[4]*$t+bo,Ha=dn[5]*xi+Ha,sm(Rn,Gr,Jr,va,bo,Ha));return wt&&Zv(),Vf(rt),this},y.path=function(k){for(var z=0;z<k.length;z++){var Pe=k[z],We=Pe.c;switch(Pe.op){case"m":Uf(We[0],We[1]);break;case"l":Su(We[0],We[1]);break;case"c":sm.apply(this,We);break;case"h":Zv()}}return this},y.__private__.rect=y.rect=function(k,z,Pe,We,rt){if(isNaN(k)||isNaN(z)||isNaN(Pe)||isNaN(We)||!Ic(rt))throw new Error("Invalid arguments passed to jsPDF.rect");return H===L.COMPAT&&(We=-We),Ae([re(J(k)),re(Fe(z)),re(J(Pe)),re(J(We)),"re"].join(" ")),Vf(rt),this},y.__private__.triangle=y.triangle=function(k,z,Pe,We,rt,wt,$t){if(isNaN(k)||isNaN(z)||isNaN(Pe)||isNaN(We)||isNaN(rt)||isNaN(wt)||!Ic($t))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Pe-k,We-z],[rt-Pe,wt-We],[k-rt,z-wt]],k,z,[1,1],$t,!0),this},y.__private__.roundedRect=y.roundedRect=function(k,z,Pe,We,rt,wt,$t){if(isNaN(k)||isNaN(z)||isNaN(Pe)||isNaN(We)||isNaN(rt)||isNaN(wt)||!Ic($t))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var xi=4/3*(Math.SQRT2-1);return rt=Math.min(rt,.5*Pe),wt=Math.min(wt,.5*We),this.lines([[Pe-2*rt,0],[rt*xi,0,rt,wt-wt*xi,rt,wt],[0,We-2*wt],[0,wt*xi,-rt*xi,wt,-rt,wt],[2*rt-Pe,0],[-rt*xi,0,-rt,-wt*xi,-rt,-wt],[0,2*wt-We],[0,-wt*xi,rt*xi,-wt,rt,-wt]],k+rt,z,[1,1],$t,!0),this},y.__private__.ellipse=y.ellipse=function(k,z,Pe,We,rt){if(isNaN(k)||isNaN(z)||isNaN(Pe)||isNaN(We)||!Ic(rt))throw new Error("Invalid arguments passed to jsPDF.ellipse");var wt=4/3*(Math.SQRT2-1)*Pe,$t=4/3*(Math.SQRT2-1)*We;return Uf(k+Pe,z),sm(k+Pe,z-$t,k+wt,z-We,k,z-We),sm(k-wt,z-We,k-Pe,z-$t,k-Pe,z),sm(k-Pe,z+$t,k-wt,z+We,k,z+We),sm(k+wt,z+We,k+Pe,z+$t,k+Pe,z),Vf(rt),this},y.__private__.circle=y.circle=function(k,z,Pe,We){if(isNaN(k)||isNaN(z)||isNaN(Pe)||!Ic(We))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(k,z,Pe,Pe,We)},y.setFont=function(k,z,Pe){return Pe&&(z=Ue(z,Pe)),bn=qv(k,z,{disableWarning:!1}),this};var vx=y.__private__.getFont=y.getFont=function(){return ir[qv.apply(y,arguments)]};y.__private__.getFontList=y.getFontList=function(){var k,z,Pe={};for(k in kr)if(kr.hasOwnProperty(k))for(z in Pe[k]=[],kr[k])kr[k].hasOwnProperty(z)&&Pe[k].push(z);return Pe},y.addFont=function(k,z,Pe,We,rt){var wt=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&wt.indexOf(arguments[3])!==-1?rt=arguments[3]:arguments[3]&&wt.indexOf(arguments[3])==-1&&(Pe=Ue(Pe,We)),rt=rt||"Identity-H",Nf.call(this,k,z,Pe,rt)};var bu,jf=i.lineWidth||.200025,xp=y.__private__.getLineWidth=y.getLineWidth=function(){return jf},Qv=y.__private__.setLineWidth=y.setLineWidth=function(k){return jf=k,Ae(re(J(k))+" w"),this};y.__private__.setLineDash=$i.API.setLineDash=$i.API.setLineDashPattern=function(k,z){if(k=k||[],z=z||0,isNaN(z)||!Array.isArray(k))throw new Error("Invalid arguments passed to
101jsPDF.setLineDash");return k=k.map(function(Pe){return re(J(Pe))}).join(" "),z=re(J(z)),Ae("["+k+"] "+z+" d"),this};var e_=y.__private__.getLineHeight=y.getLineHeight=function(){return Xt*bu};y.__private__.getLineHeight=y.getLineHeight=function(){return Xt*bu};var t_=y.__private__.setLineHeightFactor=y.setLineHeightFactor=function(k){return typeof(k=k||1.15)=="number"&&(bu=k),this},i_=y.__private__.getLineHeightFactor=y.getLineHeightFactor=function(){return bu};t_(i.lineHeight);var kc=y.__private__.getHorizontalCoordinate=function(k){return J(k)},ud=y.__private__.getVerticalCoordinate=function(k){return H===L.ADVANCED?k:an[Q].mediaBox.topRightY-an[Q].mediaBox.bottomLeftY-J(k)},_x=y.__private__.getHorizontalCoordinateString=y.getHorizontalCoordinateString=function(k){return re(kc(k))},lm=y.__private__.getVerticalCoordinateString=y.getVerticalCoordinateString=function(k){return re(ud(k))},zl=i.strokeColor||"0 G";y.__private__.getStrokeColor=y.getDrawColor=function(){return De(zl)},y.__private__.setStrokeColor=y.setDrawColor=function(k,z,Pe,We){return zl=ke({ch1:k,ch2:z,ch3:Pe,ch4:We,pdfColorType:"draw",precision:2}),Ae(zl),this};var Wf=i.fillColor||"0 g";y.__private__.getFillColor=y.getFillColor=function(){return De(Wf)},y.__private__.setFillColor=y.setFillColor=function(k,z,Pe,We){return Wf=ke({ch1:k,ch2:z,ch3:Pe,ch4:We,pdfColorType:"fill",precision:2}),Ae(Wf),this};var xu=i.textColor||"0 g",yx=y.__private__.getTextColor=y.getTextColor=function(){return De(xu)};y.__private__.setTextColor=y.setTextColor=function(k,z,Pe,We){return xu=ke({ch1:k,ch2:z,ch3:Pe,ch4:We,pdfColorType:"text",precision:3}),this};var Cp=i.charSpace,Sx=y.__private__.getCharSpace=y.getCharSpace=function(){return parseFloat(Cp||0)};y.__private__.setCharSpace=y.setCharSpace=function(k){if(isNaN(k))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Cp=k,this};var Hf=0;y.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},y.__private__.setLineCap=y.setLineCap=function(k){var z=y.CapJoinStyles[k];if(z===void 0)throw new Error("Line cap style of '"+k+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Hf=z,Ae(z+" J"),this};var Gf=0;y.__private__.setLineJoin=y.setLineJoin=function(k){var z=y.CapJoinStyles[k];if(z===void 0)throw new Error("Line join style of '"+k+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Gf=z,Ae(z+" j"),this},y.__private__.setLineMiterLimit=y.__private__.setMiterLimit=y.setLineMiterLimit=y.setMiterLimit=function(k){if(k=k||0,isNaN(k))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Ae(re(J(k))+" M"),this},y.GState=b2,y.setGState=function(k){(k=typeof k=="string"?Fr[Ws[k]]:n_(null,k)).equals(Hl)||(Ae("/"+k.id+" gs"),Hl=k)};var n_=function(k,z){if(!k||!Ws[k]){var Pe=!1;for(var We in Fr)if(Fr.hasOwnProperty(We)&&Fr[We].equals(z)){Pe=!0;break}if(Pe)z=Fr[We];else{var rt="GS"+(Object.keys(Fr).length+1).toString(10);Fr[rt]=z,z.id=rt}return k&&(Ws[k]=z.id),Hn.publish("addGState",z),z}};y.addGState=function(k,z){return n_(k,z),this},y.saveGraphicsState=function(){return Ae("q"),ul.push({key:bn,size:Xt,color:xu}),this},y.restoreGraphicsState=function(){Ae("Q");var k=ul.pop();return bn=k.key,Xt=k.size,xu=k.color,Hl=null,this},y.setCurrentTransformationMatrix=function(k){return Ae(k.toString()+" cm"),this},y.comment=function(k){return Ae("#"+k),this};var Ep=function(k,z){var Pe=k||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Pe},set:function(wt){isNaN(wt)||(Pe=parseFloat(wt))}});var We=z||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return We},set:function(wt){isNaN(wt)||(We=parseFloat(wt))}});var rt="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return rt},set:function(wt){rt=wt.toString()}}),this},$f=function(k,z,Pe,We){Ep.call(this,k,z),this.type="rect";var rt=Pe||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return rt},set:function($t){isNaN($t)||(rt=parseFloat($t))}});var wt=We||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return wt},set:function($t){isNaN($t)||(wt=parseFloat($t))}}),this},zf=function(){this.page=Cr,this.currentPage=Q,this.pages=It.slice(0),this.pagesContext=an.slice(0),this.x=Aa,this.y=Pn,this.matrix=as,this.width=Cu(Q),this.height=cm(Q),this.outputDestination=qt,this.id="",this.objectNumber=-1};zf.prototype.restore=function(){Cr=this.page,Q=this.currentPage,an=this.pagesContext,It=this.pages,Aa=this.x,Pn=this.y,as=this.matrix,Yf(Q,this.width),qf(Q,this.height),qt=this.outputDestination};var r_=function(k,z,Pe,We,rt){hl.push(new zf),Cr=Q=0,It=[],Aa=k,Pn=z,as=rt,Lf([Pe,We])}
101,bx=function(k){if(pl[k])hl.pop().restore();else{var z=new zf,Pe="Xo"+(Object.keys(Pa).length+1).toString(10);z.id=Pe,pl[k]=Pe,Pa[Pe]=z,Hn.publish("addFormObject",z),hl.pop().restore()}};for(var wp in y.beginFormObject=function(k,z,Pe,We,rt){return r_(k,z,Pe,We,rt),this},y.endFormObject=function(k){return bx(k),this},y.doFormObject=function(k,z){var Pe=Pa[pl[k]];return Ae("q"),Ae(z.toString()+" cm"),Ae("/"+Pe.id+" Do"),Ae("Q"),this},y.getFormObject=function(k){var z=Pa[pl[k]];return{x:z.x,y:z.y,width:z.width,height:z.height,matrix:z.matrix}},y.save=function(k,z){return k=k||"generated.pdf",(z=z||{}).returnPromise=z.returnPromise||!1,z.returnPromise===!1?($0(yp(md()),k),typeof $0.unload=="function"&&tn.setTimeout&&setTimeout($0.unload,911),this):new Promise(function(Pe,We){try{var rt=$0(yp(md()),k);typeof $0.unload=="function"&&tn.setTimeout&&setTimeout($0.unload,911),Pe(rt)}catch(wt){We(wt.message)}})},$i.API)$i.API.hasOwnProperty(wp)&&(wp==="events"&&$i.API.events.length?function(k,z){var Pe,We,rt;for(rt=z.length-1;rt!==-1;rt--)Pe=z[rt][0],We=z[rt][1],k.subscribe.apply(k,[Pe].concat(typeof We=="function"?[We]:We))}(Hn,$i.API.events):y[wp]=$i.API[wp]);var Cu=y.getPageWidth=function(k){return(an[k=k||Q].mediaBox.topRightX-an[k].mediaBox.bottomLeftX)/fi},Yf=y.setPageWidth=function(k,z){an[k].mediaBox.topRightX=z*fi+an[k].mediaBox.bottomLeftX},cm=y.getPageHeight=function(k){return(an[k=k||Q].mediaBox.topRightY-an[k].mediaBox.bottomLeftY)/fi},qf=y.setPageHeight=function(k,z){an[k].mediaBox.topRightY=z*fi+an[k].mediaBox.bottomLeftY};return y.internal={pdfEscape:ss,getStyle:Jv,getFont:vx,getFontSize:di,getCharSpace:Sx,getTextColor:yx,getLineHeight:e_,getLineHeightFactor:i_,getLineWidth:xp,write:Lt,getHorizontalCoordinate:kc,getVerticalCoordinate:ud,getCoordinateString:_x,getVerticalCoordinateString:lm,collections:{},newObject:oa,newAdditionalObject:Ie,newObjectDeferred:Xr,newObjectDeferredBegin:ie,getFilters:lt,putStream:xt,events:Hn,scaleFactor:fi,pageSize:{getWidth:function(){return Cu(Q)},setWidth:function(k){Yf(Q,k)},getHeight:function(){return cm(Q)},setHeight:function(k){qf(Q,k)}},encryptionOptions:f,encryption:So,getEncryptor:mx,output:Sp,getNumberOfPages:ox,pages:It,out:Ae,f2:Me,f3:W,getPageInfo:Xv,getPageInfoByObjId:cn,getCurrentPageInfo:ux,getPDFVersion:D,Point:Ep,Rectangle:$f,Matrix:zi,hasHotfix:Kv},Object.defineProperty(y.internal.pageSize,"width",{get:function(){return Cu(Q)},set:function(k){Yf(Q,k)},enumerable:!0,configurable:!0}),Object.defineProperty(y.internal.pageSize,"height",{get:function(){return cm(Q)},set:function(k){qf(Q,k)},enumerable:!0,configurable:!0}),rx.call(y,Wt),bn="F1",zv(r,t),Hn.publish("initialized"),y}lf.prototype.lsbFirstWord=function(i){return String.fromCharCode(i>>0&255,i>>8&255,i>>16&255,i>>24&255)},lf.prototype.toHexString=function(i){return i.split("").map(function(n){return("0"+(255&n.charCodeAt(0)).toString(16)).slice(-2)}).join("")},lf.prototype.hexToBytes=function(i){for(var n=[],t=0;t<i.length;t+=2)n.push(String.fromCharCode(parseInt(i.substr(t,2),16)));return n.join("")},lf.prototype.processOwnerPassword=function(i,n){return ID(DD(n).substr(0,5),i)},lf.prototype.encryptor=function(i,n){var t=DD(this.encryptionKey+String.fromCharCode(255&i,i>>8&255,i>>16&255,255&n,n>>8&255)).substr(0,10);return function(e){return ID(t,e)}},b2.prototype.equals=function(i){var n,t="id,objectNumber,equals";if(!i||_r(i)!==_r(this))return!1;var e=0;for(n in this)if(!(t.indexOf(n)>=0)){if(this.hasOwnProperty(n)&&!i.hasOwnProperty(n)||this[n]!==i[n])return!1;e++}for(n in i)i.hasOwnProperty(n)&&t.indexOf(n)<0&&e--;return e===0},$i.API={events:[]},$i.version="3.0.1";var na=$i.API,PD=1,q0=function(i){return i.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},of=function(i){return i.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},pn=function(i){return i.toFixed(2)},lu=function(i){return i.toFixed(5)};na.__acroform__={};var Ds=function(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i},aN=function(i){return i*PD},id=function(i){var n=new xN,t=ki.internal.getHeight(i)||0,e=ki.internal.getWidth(i)||0;return n.BBox=[0,0,Number(pn(e)),Number(pn(t))],n},gie=na.__acroform__.setBit=function(i,n){if(i=i||0,n=n||0,isNaN(i)||isNaN(n))throw new Error("Invalid arguments passed to
101jsPDF.API.__acroform__.setBit");return i|=1<<n},vie=na.__acroform__.clearBit=function(i,n){if(i=i||0,n=n||0,isNaN(i)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return i&=~(1<<n)},_ie=na.__acroform__.getBit=function(i,n){if(isNaN(i)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(i&1<<n)==0?0:1},ha=na.__acroform__.getBitForPdf=function(i,n){if(isNaN(i)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return _ie(i,n-1)},fa=na.__acroform__.setBitForPdf=function(i,n){if(isNaN(i)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return gie(i,n-1)},ga=na.__acroform__.clearBitForPdf=function(i,n){if(isNaN(i)||isNaN(n))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return vie(i,n-1)},yie=na.__acroform__.calculateCoordinates=function(i,n){var t=n.internal.getHorizontalCoordinate,e=n.internal.getVerticalCoordinate,r=i[0],a=i[1],c=i[2],d=i[3],u={};return u.lowerLeft_X=t(r)||0,u.lowerLeft_Y=e(a+d)||0,u.upperRight_X=t(r+c)||0,u.upperRight_Y=e(a)||0,[Number(pn(u.lowerLeft_X)),Number(pn(u.lowerLeft_Y)),Number(pn(u.upperRight_X)),Number(pn(u.upperRight_Y))]},Sie=function(i){if(i.appearanceStreamContent)return i.appearanceStreamContent;if(i.V||i.DV){var n=[],t=i._V||i.DV,e=kD(i,t),r=i.scope.internal.getFont(i.fontName,i.fontStyle).id;n.push("/Tx BMC"),n.push("q"),n.push("BT"),n.push(i.scope.__private__.encodeColorString(i.color)),n.push("/"+r+" "+pn(e.fontSize)+" Tf"),n.push("1 0 0 1 0 0 Tm"),n.push(e.text),n.push("ET"),n.push("Q"),n.push("EMC");var a=id(i);return a.scope=i.scope,a.stream=n.join(` 102`),a}},kD=function(i,n){var t=i.fontSize===0?i.maxFontSize:i.fontSize,e={text:"",fontSize:""},r=(n=(n=n.substr(0,1)=="("?n.substr(1):n).substr(n.length-1)==")"?n.substr(0,n.length-1):n).split(" ");r=i.multiline?r.map(function(W){return W.split(` 103`)}):r.map(function(W){return[W]});var a=t,c=ki.internal.getHeight(i)||0;c=c<0?-c:c;var d=ki.internal.getWidth(i)||0;d=d<0?-d:d;var u=function(W,J,Ee){if(W+1<r.length){var Fe=J+" "+r[W+1][0];return h2(Fe,i,Ee).width<=d-4}return!1};a++;e:for(;a>0;){n="",a--;var h,f,v=h2("3",i,a).height,C=i.multiline?c-a:(c-v)/2,y=C+=2,A=0,D=0,F=0;if(a<=0){n=`(...) Tj 104`,n+="% Width of Text: "+h2(n,i,a=12).width+", FieldWidth:"+d+` 105`;break}for(var R="",L=0,H=0;H<r.length;H++)if(r.hasOwnProperty(H)){var se=!1;if(r[H].length!==1&&F!==r[H].length-1){if((v+2)*(L+2)+2>c)continue e;R+=r[H][F],se=!0,D=H,H--}else{R=(R+=r[H][F]+" ").substr(R.length-1)==" "?R.substr(0,R.length-1):R;var Ce=parseInt(H),Ue=u(Ce,R,a),re=H>=r.length-1;if(Ue&&!re){R+=" ",F=0;continue}if(Ue||re){if(re)D=Ce;else if(i.multiline&&(v+2)*(L+2)+2>c)continue e}else{if(!i.multiline||(v+2)*(L+2)+2>c)continue e;D=Ce}}for(var ae="",ve=A;ve<=D;ve++){var Me=r[ve];if(i.multiline){if(ve===D){ae+=Me[F]+" ",F=(F+1)%Me.length;continue}if(ve===A){ae+=Me[Me.length-1]+" ";continue}}ae+=Me[0]+" "}switch(ae=ae.substr(ae.length-1)==" "?ae.substr(0,ae.length-1):ae,f=h2(ae,i,a).width,i.textAlign){case"right":h=d-f-2;break;case"center":h=(d-f)/2;break;case"left":default:h=2}n+=pn(h)+" "+pn(y)+` Td 106`,n+="("+q0(ae)+`) Tj 107`,n+=-pn(h)+` 0 Td 108`,y=-(a+2),f=0,A=se?D:D+1,L++,R=""}break}return e.text=n,e.fontSize=a,e},h2=function(i,n,t){var e=n.scope.internal.getFont(n.fontName,n.fontStyle),r=n.scope.getStringUnitWidth(i,{font:e,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:n.scope.getStringUnitWidth("3",{font:e,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:r}},bie={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},xie=function(i,n){var t={type:"reference",object:i};n.internal.getPageInfo(i.page).pageContext.annotations.find(function(e){return e.type===t.type&&e.object===t.object})===void 0&&n.internal.getPageInfo(i.page).pageContext.annotations.push(t)},Cie=function(i,n){for(var t in i)if(i.hasOwnProperty(t)){var e=t,r=i[t];n.internal.newObjectDeferredBegin(r.objId,!0),_r(r)==="object"&&typeof r.putStream=="function"&&r.putStream(),delete i[e]}},Eie=function(i,n){if(n.scope=i,i.internal!==void 0&&(i.internal.acroformPlugin===void 0||i.internal.acroformPlugin.isInitialized===!1)){if
108(vc.FieldNum=0,i.internal.acroformPlugin=JSON.parse(JSON.stringify(bie)),i.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");PD=i.internal.scaleFactor,i.internal.acroformPlugin.acroFormDictionaryRoot=new CN,i.internal.acroformPlugin.acroFormDictionaryRoot.scope=i,i.internal.acroformPlugin.acroFormDictionaryRoot._eventID=i.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(i)}),i.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var e=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];a.objId=void 0,a.hasAnnotation&&xie(a,t)}})(i)}),i.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(i)}),i.internal.events.subscribe("postPutPages",function(t){(function(e,r){var a=!e;for(var c in e||(r.internal.newObjectDeferredBegin(r.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),r.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||r.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(c)){var d=e[c],u=[],h=d.Rect;if(d.Rect&&(d.Rect=yie(d.Rect,r)),r.internal.newObjectDeferredBegin(d.objId,!0),d.DA=ki.createDefaultAppearanceStream(d),_r(d)==="object"&&typeof d.getKeyValueListForStream=="function"&&(u=d.getKeyValueListForStream()),d.Rect=h,d.hasAppearanceStream&&!d.appearanceStreamContent){var f=Sie(d);u.push({key:"AP",value:"<</N "+f+">>"}),r.internal.acroformPlugin.xForms.push(f)}if(d.appearanceStreamContent){var v="";for(var C in d.appearanceStreamContent)if(d.appearanceStreamContent.hasOwnProperty(C)){var y=d.appearanceStreamContent[C];if(v+="/"+C+" ",v+="<<",Object.keys(y).length>=1||Array.isArray(y)){for(var c in y)if(y.hasOwnProperty(c)){var A=y[c];typeof A=="function"&&(A=A.call(r,d)),v+="/"+c+" "+A+" ",r.internal.acroformPlugin.xForms.indexOf(A)>=0||r.internal.acroformPlugin.xForms.push(A)}}else typeof(A=y)=="function"&&(A=A.call(r,d)),v+="/"+c+" "+A,r.internal.acroformPlugin.xForms.indexOf(A)>=0||r.internal.acroformPlugin.xForms.push(A);v+=">>"}u.push({key:"AP",value:`<< 109`+v+">>"})}r.internal.putStream({additionalKeyValues:u,objectId:d.objId}),r.internal.out("endobj")}a&&Cie(r.internal.acroformPlugin.xForms,r)})(t,i)}),i.internal.acroformPlugin.isInitialized=!0}},bN=na.__acroform__.arrayToPdfArray=function(i,n,t){var e=function(c){return c};if(Array.isArray(i)){for(var r="[",a=0;a<i.length;a++)switch(a!==0&&(r+=" "),_r(i[a])){case"boolean":case"number":case"object":r+=i[a].toString();break;case"string":i[a].substr(0,1)!=="/"?(n!==void 0&&t&&(e=t.internal.getEncryptor(n)),r+="("+q0(e(i[a].toString()))+")"):r+=i[a].toString()}return r+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},CD=function(i,n,t){var e=function(r){return r};return n!==void 0&&t&&(e=t.internal.getEncryptor(n)),(i=i||"").toString(),i="("+q0(e(i))+")"},nd=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(i){this._objId=i}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};nd.prototype.toString=function(){return this.objId+" 0 R"},nd.prototype.putStream=function(){var i=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:i,objectId:this.objId}),this.scope.internal.out("endobj")},nd.prototype.getKeyValueListForStream=function(){var i=[],n=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var t in n)if(Object.getOwnPropertyDescriptor(this,n[t]).configurable===!1){var e=n[t],r=this[e];r&&(Array.isArray(r)?i.push({key:e,value:bN(r,this.objId,this.scope)}):r instanceof nd?(r.scope=this.scope,i.push({key:e,value:r.objId+" 0 R"})):typeof r!="function"&&i.push({key:e,value:r}))}return i};
vendor: 3,030 bytes, line 109
109var xN=function(){nd.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var i,n=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){i=t.trim()},get:function(){return i||null}})};Ds(xN,nd);var CN=function(){nd.call(this);var i,n=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return n.length>0?n:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return n}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(i){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+q0(t(i))+")"}},set:function(t){i=t}})};Ds(CN,nd);var vc=function i(){nd.call(this);var n=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return n},set:function(R){if(isNaN(R))throw new Error('Invalid value "'+R+'" for attribute F supplied.');n=R}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!ha(n,3)},set:function(R){R?this.F=fa(n,3):this.F=ga(n,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(R){if(isNaN(R))throw new Error('Invalid value "'+R+'" for attribute Ff supplied.');t=R}});var e=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(e.length!==0)return e},set:function(R){e=R!==void 0?R:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[0])?0:e[0]},set:function(R){e[0]=R}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[1])?0:e[1]},set:function(R){e[1]=R}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[2])?0:e[2]},set:function(R){e[2]=R}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!e||isNaN(e[3])?0:e[3]},set:function(R){e[3]=R}});var r="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return r},set:function(R){switch(R){case"/Btn":case"/Tx":case"/Ch":case"/Sig":r=R;break;default:throw new Error('Invalid value "'+R+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof x2)return;a="FieldObject"+i.FieldNum++}var R=function(L){return L};return this.scope&&(R=this.scope.internal.getEncryptor(this.objId)),"("+q0(R(a))+")"},set:function(R){a=R.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a}
109,set:function(R){a=R}});var c="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return c},set:function(R){c=R}});var d="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return d},set:function(R){d=R}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(R){u=R}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/PD:h},set:function(R){h=R}});var f="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return f},set:function(R){f=R}});var v="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!v||this instanceof x2||this instanceof Y0))return CD(v,this.objId,this.scope)},set:function(R){R=R.toString(),v=R}});var C=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(C)return this instanceof eo?C:CD(C,this.objId,this.scope)},set:function(R){R=R.toString(),C=this instanceof eo?R:R.substr(0,1)==="("?of(R.substr(1,R.length-2)):of(R)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof eo?of(C.substr(1,C.length-1)):C},set:function(R){R=R.toString(),C=this instanceof eo?"/"+R:R}});var y=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(y)return y},set:function(R){this.V=R}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(y)return this instanceof eo?y:CD(y,this.objId,this.scope)},set:function(R){R=R.toString(),y=this instanceof eo?R:R.substr(0,1)==="("?of(R.substr(1,R.length-2)):of(R)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof eo?of(y.substr(1,y.length-1)):y},set:function(R){R=R.toString(),y=this instanceof eo?"/"+R:R}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var A,D=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return D},set:function(R){R=!!R,D=R}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(A)return A},set:function(R){A=R}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,1)},set:function(R){R?this.Ff=fa(this.Ff,1):this.Ff=ga(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,2)},set:function(R){R?this.Ff=fa(this.Ff,2):this.Ff=ga(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,3)},set:function(R){R?this.Ff=fa(this.Ff,3):this.Ff=ga(this.Ff,3)}});var F=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(F!==null)return F},set:function(R){if([0,1,2].indexOf(R)===-1)throw new Error('Invalid value "'+R+'" for attribute Q supplied.');F=R}}),Object.defineProperty(this,"textAlign",{get:function(){var R;switch(F){case 0:default:R="left";break;case 1:R="center";break;case 2:R="right"}return R},configurable:!0,enumerable:!0,set:function(R){switch(R){case"right":case 2:F=2;break;case"center":case 1:F=1;break;case"left":case 0:default:F=0}}})};Ds(vc,nd);var mf=function(){vc.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var i=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return i},set:function(t){i=t}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return bN(n,this.objId,this.scope)},set:function(t){var e,r;
109r=[],typeof(e=t)=="string"&&(r=function(a,c,d){d||(d=1);for(var u,h=[];u=c.exec(a);)h.push(u[d]);return h}(e,/\((.*?)\)/g)),n=r}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=(t=t||"").toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,e){for(e=e||!1,t=(t=t||"").toString();n.indexOf(t)!==-1&&(n.splice(n.indexOf(t),1),e!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,18)},set:function(t){t?this.Ff=fa(this.Ff,18):this.Ff=ga(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=fa(this.Ff,19):this.Ff=ga(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,20)},set:function(t){t?(this.Ff=fa(this.Ff,20),n.sort()):this.Ff=ga(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,22)},set:function(t){t?this.Ff=fa(this.Ff,22):this.Ff=ga(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,23)},set:function(t){t?this.Ff=fa(this.Ff,23):this.Ff=ga(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,27)},set:function(t){t?this.Ff=fa(this.Ff,27):this.Ff=ga(this.Ff,27)}}),this.hasAppearanceStream=!1};Ds(mf,vc);var uf=function(){mf.call(this),this.fontName="helvetica",this.combo=!1};Ds(uf,mf);var pf=function(){uf.call(this),this.combo=!0};Ds(pf,uf);var v2=function(){pf.call(this),this.edit=!0};Ds(v2,pf);var eo=function(){vc.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,15)},set:function(t){t?this.Ff=fa(this.Ff,15):this.Ff=ga(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,16)},set:function(t){t?this.Ff=fa(this.Ff,16):this.Ff=ga(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,17)},set:function(t){t?this.Ff=fa(this.Ff,17):this.Ff=ga(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,26)},set:function(t){t?this.Ff=fa(this.Ff,26):this.Ff=ga(this.Ff,26)}});var i,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(a){return a};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(n).length!==0){var e,r=[];for(e in r.push("<<"),n)r.push("/"+e+" ("+q0(t(n[e]))+")");return r.push(">>"),r.join(` 110`)}},set:function(t){_r(t)==="object"&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){typeof t=="string"&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return i.substr(1,i.length-1)},set:function(t){i="/"+t}})};Ds(eo,vc);var _2=function(){eo.call(this),this.pushButton=!0};Ds(_2,eo);var hf=function(){eo.call(this),this.radio=!0,this.pushButton=!1;var i=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return i},set:function(n){i=n!==void 0?n:[]}})};Ds(hf,eo);var x2=function(){var i,n;vc.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return i},set:function(r){i=r}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(r){n=r}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(d){return d};this.scope&&(r=this.scope.internal.getEncryptor(this.objId));var a,c=[];for(a in c.push("<<"),e)c.push("/"+a+" ("+q0(r(e[a]))+")");return c.push(">>"),c.join(` 111`)}
vendor: 4,406 bytes, lines 111-113
111,set:function(r){_r(r)==="object"&&(e=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(r){typeof r=="string"&&(e.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(r){t="/"+r}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=ki.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ds(x2,vc),hf.prototype.setAppearance=function(i){if(!("createAppearanceStream"in i)||!("getCA"in i))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var n in this.Kids)if(this.Kids.hasOwnProperty(n)){var t=this.Kids[n];t.appearanceStreamContent=i.createAppearanceStream(t.optionName),t.caption=i.getCA()}},hf.prototype.createOption=function(i){var n=new x2;return n.Parent=this,n.optionName=i,this.Kids.push(n),wie.call(this.scope,n),n};var y2=function(){eo.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=ki.CheckBox.createAppearanceStream()};Ds(y2,eo);var Y0=function(){vc.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,13)},set:function(n){n?this.Ff=fa(this.Ff,13):this.Ff=ga(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,21)},set:function(n){n?this.Ff=fa(this.Ff,21):this.Ff=ga(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,23)},set:function(n){n?this.Ff=fa(this.Ff,23):this.Ff=ga(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,24)},set:function(n){n?this.Ff=fa(this.Ff,24):this.Ff=ga(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,25)},set:function(n){n?this.Ff=fa(this.Ff,25):this.Ff=ga(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,26)},set:function(n){n?this.Ff=fa(this.Ff,26):this.Ff=ga(this.Ff,26)}});var i=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return i},set:function(n){i=n}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return i},set:function(n){Number.isInteger(n)&&(i=n)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ds(Y0,vc);var S2=function(){Y0.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!ha(this.Ff,14)},set:function(i){i?this.Ff=fa(this.Ff,14):this.Ff=ga(this.Ff,14)}}),this.password=!0};Ds(S2,Y0);var ki={CheckBox:{createAppearanceStream:function(){return{N:{On:ki.CheckBox.YesNormal},D:{On:ki.CheckBox.YesPushDown,Off:ki.CheckBox.OffPushDown}}},YesPushDown:function(i){var n=id(i);n.scope=i.scope;var t=[],e=i.scope.internal.getFont(i.fontName,i.fontStyle).id,r=i.scope.__private__.encodeColorString(i.color),a=kD(i,i.caption);return t.push("0.749023 g"),t.push("0 0 "+pn(ki.internal.getWidth(i))+" "+pn(ki.internal.getHeight(i))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+e+" "+pn(a.fontSize)+" Tf "+r),t.push("BT"),t.push(a.text),t.push("ET"),t.push("Q"),t.push("EMC"),n.stream=t.join(` 112`),n},YesNormal:function(i){var n=id(i);n.scope=i.scope;var t=i.scope.internal.getFont(i.fontName,i.fontStyle).id,e=i.scope.__private__.encodeColorString(i.color),r=[],a=ki.internal.getHeight(i),c=ki.internal.getWidth(i),d=kD(i,i.caption);return r.push("1 g"),r.push("0 0 "+pn(c)+" "+pn(a)+" re"),r.push("f"),r.push("q"),r.push("0 0 1 rg"),r.push("0 0 "+pn(c-1)+" "+pn(a-1)+" re"),r.push("W"),r.push("n"),r.push("0 g"),r.push("BT"),r.push("/"+t+" "+pn(d.fontSize)+" Tf "+e),r.push(d.text),r.push("ET"),r.push("Q"),n.stream=r.join(` 113`),n},OffPushDown:function(i){var n=id(i);n.scope=i.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+pn(ki.internal.getWidth(i))+" "+pn(ki.internal.getHeight(i))+" re"),t.pu
vendor: 4,650 bytes, lines 113-120
113sh("f"),n.stream=t.join(` 114`),n}},RadioButton:{Circle:{createAppearanceStream:function(i){var n={D:{Off:ki.RadioButton.Circle.OffPushDown},N:{}};return n.N[i]=ki.RadioButton.Circle.YesNormal,n.D[i]=ki.RadioButton.Circle.YesPushDown,n},getCA:function(){return"l"},YesNormal:function(i){var n=id(i);n.scope=i.scope;var t=[],e=ki.internal.getWidth(i)<=ki.internal.getHeight(i)?ki.internal.getWidth(i)/4:ki.internal.getHeight(i)/4;e=Number((.9*e).toFixed(5));var r=ki.internal.Bezier_C,a=Number((e*r).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+lu(ki.internal.getWidth(i)/2)+" "+lu(ki.internal.getHeight(i)/2)+" cm"),t.push(e+" 0 m"),t.push(e+" "+a+" "+a+" "+e+" 0 "+e+" c"),t.push("-"+a+" "+e+" -"+e+" "+a+" -"+e+" 0 c"),t.push("-"+e+" -"+a+" -"+a+" -"+e+" 0 -"+e+" c"),t.push(a+" -"+e+" "+e+" -"+a+" "+e+" 0 c"),t.push("f"),t.push("Q"),n.stream=t.join(` 115`),n},YesPushDown:function(i){var n=id(i);n.scope=i.scope;var t=[],e=ki.internal.getWidth(i)<=ki.internal.getHeight(i)?ki.internal.getWidth(i)/4:ki.internal.getHeight(i)/4;e=Number((.9*e).toFixed(5));var r=Number((2*e).toFixed(5)),a=Number((r*ki.internal.Bezier_C).toFixed(5)),c=Number((e*ki.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+lu(ki.internal.getWidth(i)/2)+" "+lu(ki.internal.getHeight(i)/2)+" cm"),t.push(r+" 0 m"),t.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),t.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),t.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),t.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+lu(ki.internal.getWidth(i)/2)+" "+lu(ki.internal.getHeight(i)/2)+" cm"),t.push(e+" 0 m"),t.push(e+" "+c+" "+c+" "+e+" 0 "+e+" c"),t.push("-"+c+" "+e+" -"+e+" "+c+" -"+e+" 0 c"),t.push("-"+e+" -"+c+" -"+c+" -"+e+" 0 -"+e+" c"),t.push(c+" -"+e+" "+e+" -"+c+" "+e+" 0 c"),t.push("f"),t.push("Q"),n.stream=t.join(` 116`),n},OffPushDown:function(i){var n=id(i);n.scope=i.scope;var t=[],e=ki.internal.getWidth(i)<=ki.internal.getHeight(i)?ki.internal.getWidth(i)/4:ki.internal.getHeight(i)/4;e=Number((.9*e).toFixed(5));var r=Number((2*e).toFixed(5)),a=Number((r*ki.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+lu(ki.internal.getWidth(i)/2)+" "+lu(ki.internal.getHeight(i)/2)+" cm"),t.push(r+" 0 m"),t.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),t.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),t.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),t.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),t.push("f"),t.push("Q"),n.stream=t.join(` 117`),n}},Cross:{createAppearanceStream:function(i){var n={D:{Off:ki.RadioButton.Cross.OffPushDown},N:{}};return n.N[i]=ki.RadioButton.Cross.YesNormal,n.D[i]=ki.RadioButton.Cross.YesPushDown,n},getCA:function(){return"8"},YesNormal:function(i){var n=id(i);n.scope=i.scope;var t=[],e=ki.internal.calculateCross(i);return t.push("q"),t.push("1 1 "+pn(ki.internal.getWidth(i)-2)+" "+pn(ki.internal.getHeight(i)-2)+" re"),t.push("W"),t.push("n"),t.push(pn(e.x1.x)+" "+pn(e.x1.y)+" m"),t.push(pn(e.x2.x)+" "+pn(e.x2.y)+" l"),t.push(pn(e.x4.x)+" "+pn(e.x4.y)+" m"),t.push(pn(e.x3.x)+" "+pn(e.x3.y)+" l"),t.push("s"),t.push("Q"),n.stream=t.join(` 118`),n},YesPushDown:function(i){var n=id(i);n.scope=i.scope;var t=ki.internal.calculateCross(i),e=[];return e.push("0.749023 g"),e.push("0 0 "+pn(ki.internal.getWidth(i))+" "+pn(ki.internal.getHeight(i))+" re"),e.push("f"),e.push("q"),e.push("1 1 "+pn(ki.internal.getWidth(i)-2)+" "+pn(ki.internal.getHeight(i)-2)+" re"),e.push("W"),e.push("n"),e.push(pn(t.x1.x)+" "+pn(t.x1.y)+" m"),e.push(pn(t.x2.x)+" "+pn(t.x2.y)+" l"),e.push(pn(t.x4.x)+" "+pn(t.x4.y)+" m"),e.push(pn(t.x3.x)+" "+pn(t.x3.y)+" l"),e.push("s"),e.push("Q"),n.stream=e.join(` 119`),n},OffPushDown:function(i){var n=id(i);n.scope=i.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+pn(ki.internal.getWidth(i))+" "+pn(ki.internal.getHeight(i))+" re"),t.push("f"),n.stream=t.join(` 120`),n}}},createDefaultAppearanceStream:function(i){var n=i.scope.internal.getFont(i.fontName,i.fontStyle).id,t=i.scope.__private__.encodeColorString(i.color);return"/"+n+" "+i.fontSize+" Tf "+t}};ki.internal={Bezier_C:.551915024494,calculateCross:function(i){var n=ki.internal.getWidth(i),t=ki.internal.getHeight(i),e=Math.min(n,t);return{x1:{x:(n-e)/2,y:(t-e)/2+e},x2:{x:(n-e)/2+e,y:(t-e)/2},x3:{x:(n-e)/2,y:(t-e)/2},x4:{x:(n-e)/2+e,y:(t-e)/2+e}}}},ki.internal.getWidth=function(i){var n=0;return _r(i)==="object"&&(n=aN(i.Rect[2])),n},ki.internal.getHeight=function(i){var n=0;return _r(i)==="object"&&(n=aN(i.Rect[3])),n};var wie=na.addField=function(i){if(Eie(this,i),!(i instanceof vc))throw new Error("Invalid argument passed to
120jsPDF.addField.");var n;return(n=i).scope.internal.acroformPlugin.printedOut&&(n.scope.internal.acroformPlugin.printedOut=!1,n.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),n.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(n),i.page=i.scope.internal.getCurrentPageInfo().pageNumber,this};na.AcroFormChoiceField=mf,na.AcroFormListBox=uf,na.AcroFormComboBox=pf,na.AcroFormEditBox=v2,na.AcroFormButton=eo,na.AcroFormPushButton=_2,na.AcroFormRadioButton=hf,na.AcroFormCheckBox=y2,na.AcroFormTextField=Y0,na.AcroFormPasswordField=S2,na.AcroFormAppearance=ki,na.AcroForm={ChoiceField:mf,ListBox:uf,ComboBox:pf,EditBox:v2,Button:eo,PushButton:_2,RadioButton:hf,CheckBox:y2,TextField:Y0,PasswordField:S2,Appearance:ki},$i.AcroForm={ChoiceField:mf,ListBox:uf,ComboBox:pf,EditBox:v2,Button:eo,PushButton:_2,RadioButton:hf,CheckBox:y2,TextField:Y0,PasswordField:S2,Appearance:ki};var Rtt=$i.AcroForm;function EN(i){return i.reduce(function(n,t,e){return n[t]=e,n},{})}(function(i){i.__addimage__={};var n="UNKNOWN",t={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},e=i.__addimage__.getImageFileTypeByImageData=function(W,J){var Ee,Fe,$e,Qe,ot,et=n;if((J=J||n)==="RGBA"||W.data!==void 0&&W.data instanceof Uint8ClampedArray&&"height"in W&&"width"in W)return"RGBA";if(Ue(W))for(ot in t)for($e=t[ot],Ee=0;Ee<$e.length;Ee+=1){for(Qe=!0,Fe=0;Fe<$e[Ee].length;Fe+=1)if($e[Ee][Fe]!==void 0&&$e[Ee][Fe]!==W[Fe]){Qe=!1;break}if(Qe===!0){et=ot;break}}else for(ot in t)for($e=t[ot],Ee=0;Ee<$e.length;Ee+=1){for(Qe=!0,Fe=0;Fe<$e[Ee].length;Fe+=1)if($e[Ee][Fe]!==void 0&&$e[Ee][Fe]!==W.charCodeAt(Fe)){Qe=!1;break}if(Qe===!0){et=ot;break}}return et===n&&J!==n&&(et=J),et},r=function W(J){for(var Ee=this.internal.write,Fe=this.internal.putStream,$e=(0,this.internal.getFilters)();$e.indexOf("FlateEncode")!==-1;)$e.splice($e.indexOf("FlateEncode"),1);J.objectId=this.internal.newObject();var Qe=[];if(Qe.push({key:"Type",value:"/XObject"}),Qe.push({key:"Subtype",value:"/Image"}),Qe.push({key:"Width",value:J.width}),Qe.push({key:"Height",value:J.height}),J.colorSpace===F.INDEXED?Qe.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(J.palette.length/3-1)+" "+("sMask"in J&&J.sMask!==void 0?J.objectId+2:J.objectId+1)+" 0 R]"}):(Qe.push({key:"ColorSpace",value:"/"+J.colorSpace}),J.colorSpace===F.DEVICE_CMYK&&Qe.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),Qe.push({key:"BitsPerComponent",value:J.bitsPerComponent}),"decodeParameters"in J&&J.decodeParameters!==void 0&&Qe.push({key:"DecodeParms",value:"<<"+J.decodeParameters+">>"}),"transparency"in J&&Array.isArray(J.transparency)){for(var ot="",et=0,gt=J.transparency.length;et<gt;et++)ot+=J.transparency[et]+" "+J.transparency[et]+" ";Qe.push({key:"Mask",value:"["+ot+"]"})}J.sMask!==void 0&&Qe.push({key:"SMask",value:J.objectId+1+" 0 R"});var vt=J.filter!==void 0?["/"+J.filter]:void 0;if(Fe({data:J.data,additionalKeyValues:Qe,alreadyAppliedFilters:vt,objectId:J.objectId}),Ee("endobj"),"sMask"in J&&J.sMask!==void 0){var Kt="/Predictor "+J.predictor+" /Colors 1 /BitsPerComponent "+J.bitsPerComponent+" /Columns "+J.width,O={width:J.width,height:J.height,colorSpace:"DeviceGray",bitsPerComponent:J.bitsPerComponent,decodeParameters:Kt,data:J.sMask};"filter"in J&&(O.filter=J.filter),W.call(this,O)}if(J.colorSpace===F.INDEXED){var Q=this.internal.newObject();Fe({data:ae(new Uint8Array(J.palette)),objectId:Q}),Ee("endobj")}},a=function(){var W=this.internal.collections.addImage_images;for(var J in W)r.call(this,W[J])},c=function(){var W,J=this.internal.collections.addImage_images,Ee=this.internal.write;for(var Fe in J)Ee("/I"+(W=J[Fe]).index,W.objectId,"0","R")},d=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",c))},u=function(){var W=this.internal.collections.addImage_images;return d.call(this),W},h=function(){return Object.keys(this.internal.collections.addImage_images).length},f=function(W){return typeof i["process"+W.toUpperCase()]=="function"},v=function(W){return _r(W)==="object"&&W.nodeType===1},C=function(W,J){if(W.nodeName==="IMG"&&W.hasAttribute("src")){var Ee=""+W.getAttribute("src");if(Ee.indexOf("data:image/")===0)return yv(unescape(Ee).split("base64,").pop());var Fe=i.loadFile(Ee,!0);if(Fe!==void 0)return Fe}if(W.nodeName==="CANVAS"){if(W.width===0||W.height===0)throw new Error("Given canvas must have data. Canvas width: "+W.width+", height: "+W.height);var $e;switch(J){case"PNG":$e="image/png";break;case"WEBP":$e="image/webp";break;case"JPEG":case"JPG":default:$e="image/jpeg"}return yv(W.toDataURL($e,1).split("base64,").pop())}},y=function(W){var J=this.internal.collections.addImage_images;if(J){for(var Ee in J)if(W===J[Ee].alias)return J[Ee]}},A=function(W,J,Ee){return W||J||(W=-96,J=-96),W<0&&(W=-1*Ee.width*72/W/this.internal.scaleFactor),J<0&&(J=-1*Ee.he
120ight*72/J/this.internal.scaleFactor),W===0&&(W=J*Ee.width/Ee.height),J===0&&(J=W*Ee.height/Ee.width),[W,J]},D=function(W,J,Ee,Fe,$e,Qe){var ot=A.call(this,Ee,Fe,$e),et=this.internal.getCoordinateString,gt=this.internal.getVerticalCoordinateString,vt=u.call(this);if(Ee=ot[0],Fe=ot[1],vt[$e.index]=$e,Qe){Qe*=Math.PI/180;var Kt=Math.cos(Qe),O=Math.sin(Qe),Q=function(Y){return Y.toFixed(4)},V=[Q(Kt),Q(O),Q(-1*O),Q(Kt),0,0,"cm"]}this.internal.write("q"),Qe?(this.internal.write([1,"0","0",1,et(W),gt(J+Fe),"cm"].join(" ")),this.internal.write(V.join(" ")),this.internal.write([et(Ee),"0","0",et(Fe),"0","0","cm"].join(" "))):this.internal.write([et(Ee),"0","0",et(Fe),et(W),gt(J+Fe),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+$e.index+" Do"),this.internal.write("Q")},F=i.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};i.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var R=i.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},L=i.__addimage__.sHashCode=function(W){var J,Ee,Fe=0;if(typeof W=="string")for(Ee=W.length,J=0;J<Ee;J++)Fe=(Fe<<5)-Fe+W.charCodeAt(J),Fe|=0;else if(Ue(W))for(Ee=W.byteLength/2,J=0;J<Ee;J++)Fe=(Fe<<5)-Fe+W[J],Fe|=0;return Fe},H=i.__addimage__.validateStringAsBase64=function(W){(W=W||"").toString().trim();var J=!0;return W.length===0&&(J=!1),W.length%4!=0&&(J=!1),/^[A-Za-z0-9+/]+$/.test(W.substr(0,W.length-2))===!1&&(J=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(W.substr(-2))===!1&&(J=!1),J},se=i.__addimage__.extractImageFromDataUrl=function(W){if(W==null||!(W=W.trim()).startsWith("data:"))return null;var J=W.indexOf(",");return J<0?null:W.substring(0,J).trim().endsWith("base64")?W.substring(J+1):null},Ce=i.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};i.__addimage__.isArrayBuffer=function(W){return Ce()&&W instanceof ArrayBuffer};var Ue=i.__addimage__.isArrayBufferView=function(W){return Ce()&&typeof Uint32Array<"u"&&(W instanceof Int8Array||W instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&W instanceof Uint8ClampedArray||W instanceof Int16Array||W instanceof Uint16Array||W instanceof Int32Array||W instanceof Uint32Array||W instanceof Float32Array||W instanceof Float64Array)},re=i.__addimage__.binaryStringToUint8Array=function(W){for(var J=W.length,Ee=new Uint8Array(J),Fe=0;Fe<J;Fe++)Ee[Fe]=W.charCodeAt(Fe);return Ee},ae=i.__addimage__.arrayBufferToBinaryString=function(W){for(var J="",Ee=Ue(W)?W:new Uint8Array(W),Fe=0;Fe<Ee.length;Fe+=8192)J+=String.fromCharCode.apply(null,Ee.subarray(Fe,Fe+8192));return J};i.addImage=function(){var W,J,Ee,Fe,$e,Qe,ot,et,gt;if(typeof arguments[1]=="number"?(J=n,Ee=arguments[1],Fe=arguments[2],$e=arguments[3],Qe=arguments[4],ot=arguments[5],et=arguments[6],gt=arguments[7]):(J=arguments[1],Ee=arguments[2],Fe=arguments[3],$e=arguments[4],Qe=arguments[5],ot=arguments[6],et=arguments[7],gt=arguments[8]),_r(W=arguments[0])==="object"&&!v(W)&&"imageData"in W){var vt=W;W=vt.imageData,J=vt.format||J||n,Ee=vt.x||Ee||0,Fe=vt.y||Fe||0,$e=vt.w||vt.width||$e,Qe=vt.h||vt.height||Qe,ot=vt.alias||ot,et=vt.compression||et,gt=vt.rotation||vt.angle||gt}var Kt=this.internal.getFilters();if(et===void 0&&Kt.indexOf("FlateEncode")!==-1&&(et="SLOW"),isNaN(Ee)||isNaN(Fe))throw new Error("Invalid coordinates passed to jsPDF.addImage");d.call(this);var O=ve.call(this,W,J,ot,et);return D.call(this,Ee,Fe,$e,Qe,O,gt),this};var ve=function(W,J,Ee,Fe){var $e,Qe,ot;if(typeof W=="string"&&e(W)===n){W=unescape(W);var et=Me(W,!1);(et!==""||(et=i.loadFile(W,!0))!==void 0)&&(W=et)}if(v(W)&&(W=C(W,J)),J=e(W,J),!f(J))throw new Error("addImage does not support files of type '"+J+"', please ensure that a plugin for '"+J+"' support is added.");if(((ot=Ee)==null||ot.length===0)&&(Ee=function(gt){return typeof gt=="string"||Ue(gt)?L(gt):Ue(gt.data)?L(gt.data):null}(W)),($e=y.call(this,Ee))||(Ce()&&(W instanceof Uint8Array||J==="RGBA"||(Qe=W,W=re(W))),$e=this["process"+J.toUpperCase()](W,h.call(this),Ee,function(gt){return gt&&typeof gt=="string"&&(gt=gt.toUpperCase()),gt in i.image_compression?gt:R.NONE}(Fe),Qe)),!$e)throw new Error("An unknown error occurred whilst processing the image.");return $e},Me=i.__addimage__.convertBase64ToBinaryString=function(W,J){J=typeof J!="boolean"||J;var Ee,Fe="";if(typeof W=="string"){var $e;Ee=($e=se(W))!==null&&$e!==void 0?$e:W;try{Fe=yv(Ee)}catch(Qe){if(J)throw H(Ee)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+Qe.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return Fe};
120i.getImageProperties=function(W){var J,Ee,Fe="";if(v(W)&&(W=C(W)),typeof W=="string"&&e(W)===n&&((Fe=Me(W,!1))===""&&(Fe=i.loadFile(W)||""),W=Fe),Ee=e(W),!f(Ee))throw new Error("addImage does not support files of type '"+Ee+"', please ensure that a plugin for '"+Ee+"' support is added.");if(!Ce()||W instanceof Uint8Array||(W=re(W)),!(J=this["process"+Ee.toUpperCase()](W)))throw new Error("An unknown error occurred whilst processing the image");return J.fileType=Ee,J}})($i.API),function(i){var n=function(t){if(t!==void 0&&t!="")return!0};$i.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),i.events.push(["putPage",function(t){for(var e,r,a,c=this.internal.getCoordinateString,d=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(t.objId),h=t.pageContext.annotations,f=!1,v=0;v<h.length&&!f;v++)switch((e=h[v]).type){case"link":(n(e.options.url)||n(e.options.pageNumber))&&(f=!0);break;case"reference":case"text":case"freetext":f=!0}if(f!=0){this.internal.write("/Annots [");for(var C=0;C<h.length;C++){e=h[C];var y=this.internal.pdfEscape,A=this.internal.getEncryptor(t.objId);switch(e.type){case"reference":this.internal.write(" "+e.object.objId+" 0 R ");break;case"text":var D=this.internal.newAdditionalObject(),F=this.internal.newAdditionalObject(),R=this.internal.getEncryptor(D.objId),L=e.title||"Note";a="<</Type /Annot /Subtype /Text "+(r="/Rect ["+c(e.bounds.x)+" "+d(e.bounds.y+e.bounds.h)+" "+c(e.bounds.x+e.bounds.w)+" "+d(e.bounds.y)+"] ")+"/Contents ("+y(R(e.contents))+")",a+=" /Popup "+F.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+y(R(L))+") >>",D.content=a;var H=D.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(r="/Rect ["+c(e.bounds.x+30)+" "+d(e.bounds.y+e.bounds.h)+" "+c(e.bounds.x+e.bounds.w+30)+" "+d(e.bounds.y)+"] ")+" /Parent "+H,e.open&&(a+=" /Open true"),a+=" >>",F.content=a,this.internal.write(D.objId,"0 R",F.objId,"0 R");break;case"freetext":r="/Rect ["+c(e.bounds.x)+" "+d(e.bounds.y)+" "+c(e.bounds.x+e.bounds.w)+" "+d(e.bounds.y+e.bounds.h)+"] ";var se=e.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+r+"/Contents ("+y(A(e.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+se+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(e.options.name){var Ce=this.annotations._nameMap[e.options.name];e.options.pageNumber=Ce.page,e.options.top=Ce.y}else e.options.top||(e.options.top=0);if(r="/Rect ["+e.finalBounds.x+" "+e.finalBounds.y+" "+e.finalBounds.w+" "+e.finalBounds.h+"] ",a="",e.options.url)a="<</Type /Annot /Subtype /Link "+r+"/Border [0 0 0] /A <</S /URI /URI ("+y(A(e.options.url))+") >>";else if(e.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+r+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(e.options.pageNumber).objId+" 0 R",e.options.magFactor=e.options.magFactor||"XYZ",e.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+e.options.top+"]";break;case"FitV":e.options.left=e.options.left||0,a+=" /FitV "+e.options.left+"]";break;case"XYZ":default:var Ue=d(e.options.top);e.options.left=e.options.left||0,e.options.zoom===void 0&&(e.options.zoom=0),a+=" /XYZ "+e.options.left+" "+Ue+" "+e.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),i.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},i.link=function(t,e,r,a,c){var d=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;d.pageContext.annotations.push({finalBounds:{x:u(t),y:h(e),w:u(t+r),h:h(e+a)},options:c,type:"link"})},i.textWithLink=function(t,e,r,a){var c,d,u=this.getTextWidth(t),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){d=a.maxWidth;var f=this.splitTextToSize(t,d).length;c=Math.ceil(h*f)}else d=u,c=h;return this.text(t,e,r,a),r+=.2*h,a.align==="center"&&(e-=u/2),a.align==="right"&&(e-=u),this.link(e,r-h,d,c,a),u},i.getTextWidth=function(t){var e=this.internal.getFontSize();
120return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}}($i.API),function(i){var n={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,6437
vendor: 1,258 bytes, line 120
1207],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},t={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},r=[1570,1571,1573,1575];i.__arabicParser__={};var a=i.__arabicParser__.isInArabicSubstitutionA=function(D){return n[D.charCodeAt(0)]!==void 0},c=i.__arabicParser__.isArabicLetter=function(D){return typeof D=="str
120ing"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(D)},d=i.__arabicParser__.isArabicEndLetter=function(D){return c(D)&&a(D)&&n[D.charCodeAt(0)].length<=2},u=i.__arabicParser__.isArabicAlfLetter=function(D){return c(D)&&r.indexOf(D.charCodeAt(0))>=0};i.__arabicParser__.arabicLetterHasIsolatedForm=function(D){return c(D)&&a(D)&&n[D.charCodeAt(0)].length>=1};var h=i.__arabicParser__.arabicLetterHasFinalForm=function(D){return c(D)&&a(D)&&n[D.charCodeAt(0)].length>=2};i.__arabicParser__.arabicLetterHasInitialForm=function(D){return c(D)&&a(D)&&n[D.charCodeAt(0)].length>=3};var f=i.__arabicParser__.arabicLetterHasMedialForm=function(D){return c(D)&&a(D)&&n[D.charCodeAt(0)].length==4},v=i.__arabicParser__.resolveLigatures=function(D){var F=0,R=t,L="",H=0;for(F=0;F<D.length;F+=1)R[D.charCodeAt(F)]!==void 0?(H++,typeof(R=R[D.charCodeAt(F)])=="number"&&(L+=String.fromCharCode(R),R=t,H=0),F===D.length-1&&(R=t,L+=D.charAt(F-(H-1)),F-=H-1,H=0)):(R=t,L+=D.charAt(F-H),F-=H,H=0);return L};i.__arabicParser__.isArabicDiacritic=function(D){return D!==void 0&&e[D.charCodeAt(0)]!==void 0};var C=i.__arabicParser__.getCorrectForm=function(D,F,R){return c(D)?a(D)===!1?-1:!h(D)||!c(F)&&!c(R)||!c(R)&&d(F)||d(D)&&!c(F)||d(D)&&u(F)||d(D)&&d(F)?0:f(D)&&c(F)&&!d(F)&&c(R)&&h(R)?3:d(D)||!c(R)?1:2:-1},y=function(D){var F=0,R=0,L=0,H="",se="",Ce="",Ue=(D=D||"").split("\\s+"),re=[];for(F=0;F<Ue.length;F+=1){for(re.push(""),R=0;R<Ue[F].length;R+=1)H=Ue[F][R],se=Ue[F][R-1],Ce=Ue[F][R+1],c(H)?(L=C(H,se,Ce),re[F]+=L!==-1?String.fromCharCode(n[H.charCodeAt(0)][L]):H):re[F]+=H;re[F]=v(re[F])}return re.join(" ")},A=i.__arabicParser__.processArabic=i.processArabic=function(){var D,F=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,R=[];if(Array.isArray(F)){var L=0;for(R=[],L=0;L<F.length;L+=1)Array.isArray(F[L])?R.push([y(F[L][0]),F[L][1],F[L][2]]):R.push([y(F[L])]);D=R}else D=y(F);return typeof arguments[0]=="string"?D:(arguments[0].text=D,arguments[0])};i.events.push(["preProcessText",A])}($i.API),$i.API.autoPrint=function(i){var n;switch((i=i||{}).variant=i.variant||"non-conform",i.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+n+" 0 R")})}return this},function(i){var n=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(d){t=d}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(d){e=isNaN(d)||Number.isInteger(d)===!1||d<0?150:d,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(d){r=isNaN(d)||Number.isInteger(d)===!1||d<0?300:d,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a}
120,set:function(d){a=d}});var c={};Object.defineProperty(this,"style",{get:function(){return c},set:function(d){c=d}}),Object.defineProperty(this,"parentNode",{})};n.prototype.getContext=function(t,e){var r;if((t=t||"2d")!=="2d")return null;for(r in e)this.pdf.context2d.hasOwnProperty(r)&&(this.pdf.context2d[r]=e[r]);return this.pdf.context2d._canvas=this,this.pdf.context2d},n.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},i.events.push(["initialized",function(){this.canvas=new n,this.canvas.pdf=this}])}($i.API),function(i){var n={left:0,top:0,bottom:0,right:0},t=!1,e=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},n),this.internal.__cell__.margins.width=this.getPageWidth(),r.call(this))},r=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(D){u=D}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(D){h=D}});var f=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return f},set:function(D){f=D}});var v=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return v},set:function(D){v=D}});var C=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return C},set:function(D){C=D}});var y=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return y},set:function(D){y=D}});var A=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return A},set:function(D){A=D}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},i.setHeaderFunction=function(u){return e.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},i.getTextDimensions=function(u,h){e.call(this);var f=(h=h||{}).fontSize||this.getFontSize(),v=h.font||this.getFont(),C=h.scaleFactor||this.internal.scaleFactor,y=0,A=0,D=0,F=this;if(!Array.isArray(u)&&typeof u!="string"){if(typeof u!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");u=String(u)}var R=h.maxWidth;R>0?typeof u=="string"?u=this.splitTextToSize(u,R):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(H,se){return H.concat(F.splitTextToSize(se,R))},[])):u=Array.isArray(u)?u:[u];for(var L=0;L<u.length;L++)y<(D=this.getStringUnitWidth(u[L],{font:v})*f)&&(y=D);return y!==0&&(A=u.length),{w:y/=C,h:Math.max((A*f*this.getLineHeightFactor()-f*(this.getLineHeightFactor()-1))/C,0)}},i.cellAddPage=function(){e.call(this),this.addPage();var u=this.internal.__cell__.margins||n;return this.internal.__cell__.lastCell=new a(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var c=i.cell=function(){var u;u=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),e.call(this);var h=this.internal.__cell__.lastCell,f=this.internal.__cell__.padding,v=this.internal.__cell__.margins||n,C=this.internal.__cell__.tableHeaderRow,y=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===u.lineNumber?(u.x=(h.x||0)+(h.width||0),u.y=h.y||0):h.y+h.height+u.height+v.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=v.top,y&&C&&(this.printHeaderRow(u.lineNumber,!0),u.y+=C[0].height)):u.y=h.y+h.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,t===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-f,u.y+f,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+f,{align:"center",baseline:"top",maxWidth:u.width-f-f}):this.text(u.text,u.x+f,u.y+f,{align:"left",baseline:"top",maxWidth:u.width-f-f})),this.internal.__cell__.lastCell=u,this};i.table=function(u,h,f,v,C){if(e.call(this),!f)throw new Error("No data for PDF table.");var y,A,D,F,R=[],L=[],H=[],se={},Ce={},Ue=[],re=[],ae=(C=C||{}).autoSize||!1,ve=C.printHeaders!==!1,Me=C.css&&C.css["font-size"]!==void 0?16*C.css["font-size"]:C.fontSize||12,W=C.margins||Object.assign({width:this.getPageWidth()},n),J=typeof C.padding=="number"?C.padding:3,Ee=C.headerBackgroun
120dColor||"#c8c8c8",Fe=C.headerTextColor||"#000";if(r.call(this),this.internal.__cell__.printHeaders=ve,this.internal.__cell__.margins=W,this.internal.__cell__.table_font_size=Me,this.internal.__cell__.padding=J,this.internal.__cell__.headerBackgroundColor=Ee,this.internal.__cell__.headerTextColor=Fe,this.setFontSize(Me),v==null)L=R=Object.keys(f[0]),H=R.map(function(){return"left"});else if(Array.isArray(v)&&_r(v[0])==="object")for(R=v.map(function(vt){return vt.name}),L=v.map(function(vt){return vt.prompt||vt.name||""}),H=v.map(function(vt){return vt.align||"left"}),y=0;y<v.length;y+=1)Ce[v[y].name]=v[y].width*(19.049976/25.4);else Array.isArray(v)&&typeof v[0]=="string"&&(L=R=v,H=R.map(function(){return"left"}));if(ae||Array.isArray(v)&&typeof v[0]=="string")for(y=0;y<R.length;y+=1){for(se[F=R[y]]=f.map(function(vt){return vt[F]}),this.setFont(void 0,"bold"),Ue.push(this.getTextDimensions(L[y],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),A=se[F],this.setFont(void 0,"normal"),D=0;D<A.length;D+=1)Ue.push(this.getTextDimensions(A[D],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);Ce[F]=Math.max.apply(null,Ue)+J+J,Ue=[]}if(ve){var $e={};for(y=0;y<R.length;y+=1)$e[R[y]]={},$e[R[y]].text=L[y],$e[R[y]].align=H[y];var Qe=d.call(this,$e,Ce);re=R.map(function(vt){return new a(u,h,Ce[vt],Qe,$e[vt].text,void 0,$e[vt].align)}),this.setTableHeaderRow(re),this.printHeaderRow(1,!1)}var ot=v.reduce(function(vt,Kt){return vt[Kt.name]=Kt.align,vt},{});for(y=0;y<f.length;
vendor: 7,089 bytes, line 120
120y+=1){"rowStart"in C&&C.rowStart instanceof Function&&C.rowStart({row:y,data:f[y]},this);var et=d.call(this,f[y],Ce);for(D=0;D<R.length;D+=1){var gt=f[y][R[D]];"cellStart"in C&&C.cellStart instanceof Function&&C.cellStart({row:y,col:D,data:gt},this),c.call(this,new a(u,h,Ce[R[D]],et,gt,y+2,ot[R[D]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=h,this};var d=function(u,h){var f=this.internal.__cell__.padding,v=this.internal.__cell__.table_font_size,C=this.internal.scaleFactor;return Object.keys(u).map(function(y){var A=u[y];return this.splitTextToSize(A.hasOwnProperty("text")?A.text:A,h[y]-f-f)},this).map(function(y){return this.getLineHeightFactor()*y.length*v/C+f+f},this).reduce(function(y,A){return Math.max(y,A)},0)};i.setTableHeaderRow=function(u){e.call(this),this.internal.__cell__.tableHeaderRow=u},i.printHeaderRow=function(u,h){if(e.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var f;if(t=!0,typeof this.internal.__cell__.headerFunction=="function"){var v=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(v[0],v[1],v[2],v[3],void 0,-1)}this.setFont(void 0,"bold");for(var C=[],y=0;y<this.internal.__cell__.tableHeaderRow.length;y+=1){f=this.internal.__cell__.tableHeaderRow[y].clone(),h&&(f.y=this.internal.__cell__.margins.top||0,C.push(f)),f.lineNumber=u;var A=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),c.call(this,f),this.setTextColor(A)}C.length>0&&this.setTableHeaderRow(C),this.setFont(void 0,"normal"),t=!1}}($i.API);var wN={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},TN=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],MD=EN(TN),DN=[100,200,300,400,500,600,700,800,900],Tie=EN(DN);function AD(i){var n=i.family.replace(/"|'/g,"").toLowerCase(),t=function(a){return wN[a=a||"normal"]?a:"normal"}(i.style),e=function(a){if(!a)return 400;if(typeof a=="number")return a>=100&&a<=900&&a%100==0?a:400;if(/^\d00$/.test(a))return parseInt(a);switch(a){case"bold":return 700;case"normal":default:return 400}}(i.weight),r=function(a){return typeof MD[a=a||"normal"]=="number"?a:"normal"}(i.stretch);return{family:n,style:t,weight:e,stretch:r,src:i.src||[],ref:i.ref||{name:n,style:[r,t,e].join(" ")}}}function oN(i,n,t,e){var r;for(r=t;r>=0&&r<n.length;r+=e)if(i[n[r]])return i[n[r]];for(r=t;r>=0&&r<n.length;r-=e)if(i[n[r]])return i[n[r]]}var Die={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},sN={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function lN(i){return[i.stretch,i.style,i.weight,i.family].join(" ")}function Iie(i,n,t){for(var e=(t=t||{}).defaultFontFamily||"times",r=Object.assign({},Die,t.genericFontFamilies||{}),a=null,c=null,d=0;d<n.length;++d)if(r[(a=AD(n[d])).family]&&(a.family=r[a.family]),i.hasOwnProperty(a.family)){c=i[a.family];break}if(!(c=c||i[e]))throw new Error("Could not find a font-family for the rule '"+lN(a)+"' and default family '"+e+"'.");if(c=function(u,h){if(h[u])return h[u];var f=MD[u],v=f<=MD.normal?-1:1,C=oN(h,TN,f,v);if(!C)throw new Error("Could not find a matching font-stretch value for "+u);return C}(a.stretch,c),c=function(u,h){if(h[u])return h[u];for(var f=wN[u],v=0;v<f.length;++v)if(h[f[v]])return h[f[v]];throw new Error("Could not find a matching font-style for "+u)}(a.style,c),!(c=function(u,h){if(h[u])return h[u];if(u===400&&h[500])return h[500];if(u===500&&h[400])return h[400];var f=Tie[u],v=oN(h,DN,f,u<400?-1:1);if(!v)throw new Error("Could not find a matching font-weight for value "+u);return v}(a.weight,c)))throw new Error("Failed to resolve a font for the rule '"+lN(a)+"'.");return c}function cN(i){return i.trimLeft()}function kie(i,n){for(var t=0;t<i.length;){if(i.charAt(t)===n)return[i.substring(0,t),i.substring(t+1)];t+=1}return null}function Mie(i){var n=i.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return n===null?null:[n[0],i.substring(n[0].length)]}var f2,dN,mN,ED=["times"];(function(i){var n,t,e,r,a,c,d,u,h,f=function(O){return O=O||{},this.isStrokeTransparent=O.isStrokeTransparent||!1,this.strokeOpacity=O.strokeOpacity||1,this.strokeStyle=O.strokeStyle||"#000000",this.fillStyle=O.fillStyle||"#000000",this.isFillTransparent=O.isFillTransparent||!1,this.fillOpacity=O.fillOpacity||1,this.font=O.font||"10px sans-serif",this.textBaseline=O.textBaseline||"alphabetic",this.textAlign=O.textAlign||"left",this.lineWidth=O.lineWidth||1,this.lineJoin=O.lineJoin||"miter",this.lineCap=O.lineCap||"butt",this.path=O.path||[],this.transform=O.transform!==void 0?O.transform.clone():new u,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new c,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new c,this.lineDashOffset=O.lineDashOffset||0,this.lineDash=O.lineDash||[],this.margin=O.margin||[0,0,0,0],this.prevPageLastElemOffset=O.prevPageLastElemOffset||0,this.ignoreClearRect=typeof O.ignoreClearRect!="boolean"||O.ignoreClearRect,this};i.events.push(["initialized",function(){this.context2d=new v(this),n=this.internal.f2,t=this.internal.getCoordinateString,e=this.internal.getVerticalCoordinateString,r=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,c=this.internal.Point,d=this.internal.Rectangle,u=this.internal.Matrix,h=new f}]);var v=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var Q=O;Object.defineProperty(this,"pdf",{get:function(){return Q}});var V=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return V},set:function(bt){V=!!bt}});var Y=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Y},set:function(bt){Y=!!bt}});var we=0;Object.defineProperty(this,"posX",{get:function(){return we},set:function(bt){isNaN(bt)||(we=bt)}});var Ve=0;Object.defineProperty(this,"posY",{get:function(){return Ve},set:function(bt){isNaN(bt)||(Ve=bt)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(bt){var Ae;typeof bt=="number"?Ae=[bt,bt,bt,bt]:((Ae=new Array(4))[0]=bt[0],Ae[1]=bt.length>=2?bt[1]:Ae[0],Ae[2]=bt.length>=3?bt[2]:Ae[0],Ae[3]=bt.length>=4?bt[3]:Ae[1]),h.margin=Ae}});var Ge=!1;Object.defineProperty(this,"autoPaging",{get:function(){return Ge},set:function(bt){Ge=bt}});var je=0;Object.defineProperty(this,"lastBreak",{get:function(){return je},set:function(bt){je=bt}});var it=[];Object.defineProperty(this,"pageBreaks",{get:function(){return it},set:function(bt){it=bt}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(bt){bt instanceof f&&(h=bt)}}),Object.defineProperty(this,"path",{get:function(){return h.path}
120,set:function(bt){h.path=bt}});var It=[];Object.defineProperty(this,"ctxStack",{get:function(){return It},set:function(bt){It=bt}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(bt){var Ae;Ae=C(bt),this.ctx.fillStyle=Ae.style,this.ctx.isFillTransparent=Ae.a===0,this.ctx.fillOpacity=Ae.a,this.pdf.setFillColor(Ae.r,Ae.g,Ae.b,{a:Ae.a}),this.pdf.setTextColor(Ae.r,Ae.g,Ae.b,{a:Ae.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(bt){var Ae=C(bt);this.ctx.strokeStyle=Ae.style,this.ctx.isStrokeTransparent=Ae.a===0,this.ctx.strokeOpacity=Ae.a,Ae.a===0?this.pdf.setDrawColor(255,255,255):(Ae.a,this.pdf.setDrawColor(Ae.r,Ae.g,Ae.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(bt){["butt","round","square"].indexOf(bt)!==-1&&(this.ctx.lineCap=bt,this.pdf.setLineCap(bt))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(bt){isNaN(bt)||(this.ctx.lineWidth=bt,this.pdf.setLineWidth(bt))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(bt){["bevel","round","miter"].indexOf(bt)!==-1&&(this.ctx.lineJoin=bt,this.pdf.setLineJoin(bt))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(bt){isNaN(bt)||(this.ctx.miterLimit=bt,this.pdf.setMiterLimit(bt))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(bt){this.ctx.textBaseline=bt}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(bt){["right","end","center","left","start"].indexOf(bt)!==-1&&(this.ctx.textAlign=bt)}});var Nt=null;function qt(bt,Ae){if(Nt===null){var Lt=function(hi){var Wt=[];return Object.keys(hi).forEach(function(Xt){hi[Xt].forEach(function(ri){var di=null;switch(ri){case"bold":di={family:Xt,weight:"bold"};break;case"italic":di={family:Xt,style:"italic"};break;case"bolditalic":di={family:Xt,weight:"bold",style:"italic"};break;case"":case"normal":di={family:Xt}}di!==null&&(di.ref={name:Xt,style:ri},Wt.push(di))})}),Wt}(bt.getFontList());Nt=function(hi){for(var Wt={},Xt=0;Xt<hi.length;++Xt){var ri=AD(hi[Xt]),di=ri.family,Mi=ri.stretch,Li=ri.style,Ji=ri.weight;Wt[di]=Wt[di]||{},Wt[di][Mi]=Wt[di][Mi]||{},Wt[di][Mi][Li]=Wt[di][Mi][Li]||{},Wt[di][Mi][Li][Ji]=ri}return Wt}(Lt.concat(Ae))}return Nt}var ni=null;Object.defineProperty(this,"fontFaces",{get:function(){return ni},set:function(bt){Nt=null,ni=bt}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(bt){var Ae;if(this.ctx.font=bt,(Ae=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(bt))!==null){var Lt=Ae[1];Ae[2];var hi=Ae[3],Wt=Ae[4];Ae[5];var Xt=Ae[6],ri=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Wt)[2];Wt=Math.floor(ri==="px"?parseFloat(Wt)*this.pdf.internal.scaleFactor:ri==="em"?parseFloat(Wt)*this.pdf.getFontSize():parseFloat(Wt)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Wt);var di=function(Zi){var bn,fi,Aa=[],Pn=Zi.trim();if(Pn==="")return ED;if(Pn in sN)return[sN[Pn]];for(;Pn!=="";){switch(fi=null,bn=(Pn=cN(Pn)).charAt(0)){case'"':case"'":fi=kie(Pn.substring(1),bn);break;default:fi=Mie(Pn)}if(fi===null||(Aa.push(fi[0]),(Pn=cN(fi[1]))!==""&&Pn.charAt(0)!==","))return ED;Pn=Pn.replace(/^,/,"")}return Aa}(Xt);if(this.fontFaces){var Mi=Iie(qt(this.pdf,this.fontFaces),di.map(function(Zi){return{family:Zi,stretch:"normal",weight:hi,style:Lt}}));this.pdf.setFont(Mi.ref.name,Mi.ref.style)}else{var Li="";(hi==="bold"||parseInt(hi,10)>=700||Lt==="bold")&&(Li="bold"),Lt==="italic"&&(Li+="italic"),Li.length===0&&(Li="normal");for(var Ji="",ln={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Sn=0;Sn<di.length;Sn++){if(this.pdf.internal.getFont(di[Sn],Li,{noFallback:!0,disableWarning:!0})!==void 0){Ji=di[Sn];break}if(Li==="bolditalic"&&this.pdf.internal.getFont(di[Sn],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ji=di[Sn],Li="bold";else if(this.pdf.internal.getFont(di[Sn],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ji=di[Sn],Li="normal";break}}if(Ji===""){for(var wn=0;wn<di.length;wn++)if(ln[di[wn]]){Ji=ln[di[wn]];break}}Ji=Ji===""?"Times":Ji,this.pdf.setFont(Ji,Li)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(bt){this.ctx.globalCompositeOperation=bt}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(bt){this.ctx.globalAlpha=bt}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(bt){this.ctx.lineDashOffset=bt,Kt.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(bt){this.ctx.lineDash=bt,Kt.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(bt){this.ctx.ignoreClearRect=!!bt}}
120)};v.prototype.setLineDash=function(O){this.lineDash=O},v.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},v.prototype.fill=function(){se.call(this,"fill",!1)},v.prototype.stroke=function(){se.call(this,"stroke",!1)},v.prototype.beginPath=function(){this.path=[{type:"begin"}]},v.prototype.moveTo=function(O,Q){if(isNaN(O)||isNaN(Q))throw Dr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var V=this.ctx.transform.applyToPoint(new c(O,Q));this.path.push({type:"mt",x:V.x,y:V.y}),this.ctx.lastPoint=new c(O,Q)},v.prototype.closePath=function(){var O=new c(0,0),Q=0;for(Q=this.path.length-1;Q!==-1;Q--)if(this.path[Q].type==="begin"&&_r(this.path[Q+1])==="object"&&typeof this.path[Q+1].x=="number"){O=new c(this.path[Q+1].x,this.path[Q+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new c(O.x,O.y)},v.prototype.lineTo=function(O,Q){if(isNaN(O)||isNaN(Q))throw Dr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var V=this.ctx.transform.applyToPoint(new c(O,Q));this.path.push({type:"lt",x:V.x,y:V.y}),this.ctx.lastPoint=new c(V.x,V.y)},v.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),se.call(this,null,!0)},v.prototype.quadraticCurveTo=function(O,Q,V,Y){if(isNaN(V)||isNaN(Y)||isNaN(O)||isNaN(Q))throw Dr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var we=this.ctx.transform.applyToPoint(new c(V,Y)),Ve=this.ctx.transform.applyToPoint(new c(O,Q));this.path.push({type:"qct",x1:Ve.x,y1:Ve.y,x:we.x,y:we.y}),this.ctx.lastPoint=new c(we.x,we.y)},v.prototype.bezierCurveTo=function(O,Q,V,Y,we,Ve){if(isNaN(we)||isNaN(Ve)||isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y))throw Dr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var Ge=this.ctx.transform.applyToPoint(new c(we,Ve)),je=this.ctx.transform.applyToPoint(new c(O,Q)),it=this.ctx.transform.applyToPoint(new c(V,Y));this.path.push({type:"bct",x1:je.x,y1:je.y,x2:it.x,y2:it.y,x:Ge.x,y:Ge.y}),this.ctx.lastPoint=new c(Ge.x,Ge.y)},v.prototype.arc=function(O,Q,V,Y,we,Ve){if(isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y)||isNaN(we))throw Dr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Ve=!!Ve,!this.ctx.transform.isIdentity){var Ge=this.ctx.transform.applyToPoint(new c(O,Q));O=Ge.x,Q=Ge.y;var je=this.ctx.transform.applyToPoint(new c(0,V)),it=this.ctx.transform.applyToPoint(new c(0,0));V=Math.sqrt(Math.pow(je.x-it.x,2)+Math.pow(je.y-it.y,2))}Math.abs(we-Y)>=2*Math.PI&&(Y=0,we=2*Math.PI),this.path.push({type:"arc",x:O,y:Q,radius:V,startAngle:Y,endAngle:we,counterclockwise:Ve})},v.prototype.arcTo=function(O,Q,V,Y,we){throw new Error("arcTo not implemented.")},v.prototype.rect=function(O,Q,V,Y){if(isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y))throw Dr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,Q),this.lineTo(O+V,Q),this.lineTo(O+V,Q+Y),this.lineTo(O,Q+Y),this.lineTo(O,Q),this.lineTo(O+V,Q),this.lineTo(O,Q)},v.prototype.fillRect=function(O,Q,V,Y){if(isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y))throw Dr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!y.call(this)){var we={};this.lineCap!=="butt"&&(we.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(we.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,Q,V,Y),this.fill(),we.hasOwnProperty("lineCap")&&(this.lineCap=we.lineCap),we.hasOwnProperty("lineJoin")&&(this.lineJoin=we.lineJoin)}},v.prototype.strokeRect=function(O,Q,V,Y){if(isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y))throw Dr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to
120jsPDF.context2d.strokeRect");A.call(this)||(this.beginPath(),this.rect(O,Q,V,Y),this.stroke())},v.prototype.clearRect=function(O,Q,V,Y){if(isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y))throw Dr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,Q,V,Y))},v.prototype.save=function(O){O=typeof O!="boolean"||O;for(var Q=this.pdf.internal.getCurrentPageInfo().pageNumber,V=0;V<this.pdf.internal.getNumberOfPages();V++)this.pdf.setPage(V+1),this.pdf.internal.out("q");if(this.pdf.setPage(Q),O){this.ctx.fontSize=this.pdf.internal.getFontSize();var Y=new f(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Y}},v.prototype.restore=function(O){O=typeof O!="boolean"||O;for(var Q=this.pdf.internal.getCurrentPageInfo().pageNumber,V=0;V<this.pdf.internal.getNumberOfPages();V++)this.pdf.setPage(V+1),this.pdf.internal.out("Q");this.pdf.setPage(Q),O&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},v.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var C=function(O){var Q,V,Y,we;if(O.isCanvasGradient===!0&&(O=O.getColor()),!O)return{r:0,g:0,b:0,a:0,style:O};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(O))Q=0,V=0,Y=0,we=0;else{var Ve=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(O);if(Ve!==null)Q=parseInt(Ve[1]),V=parseInt(Ve[2]),Y=parseInt(Ve[3]),we=1;else if((Ve=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(O))!==null)Q=parseInt(Ve[1]),V=parseInt(Ve[2]),Y=parseInt(Ve[3]),we=parseFloat(Ve[4]);else{if(we=1,typeof O=="string"&&O.charAt(0)!=="#"){var Ge=new _N(O);O=Ge.ok?Ge.toHex():"#000000"}O.length===4?(Q=O.substring(1,2),Q+=Q,V=O.substring(2,3),V+=V,Y=O.substring(3,4),Y+=Y):(Q=O.substring(1,3),V=O.substring(3,5),Y=O.substring(5,7)),Q=parseInt(Q,16),V=parseInt(V,16),Y=parseInt(Y,16)}}return{r:Q,g:V,b:Y,a:we,style:O}},y=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},A=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};v.prototype.fillText=function(O,Q,V,Y){if(isNaN(Q)||isNaN(V)||typeof O!="string")throw Dr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Y=isNaN(Y)?void 0:Y,!y.call(this)){var we=et(this.ctx.transform.rotation),Ve=this.ctx.transform.scaleX;J.call(this,{text:O,x:Q,y:V,scale:Ve,angle:we,align:this.textAlign,maxWidth:Y})}},v.prototype.strokeText=function(O,Q,V,Y){if(isNaN(Q)||isNaN(V)||typeof O!="string")throw Dr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!A.call(this)){Y=isNaN(Y)?void 0:Y;var we=et(this.ctx.transform.rotation),Ve=this.ctx.transform.scaleX;J.call(this,{text:O,x:Q,y:V,scale:Ve,renderingMode:"stroke",angle:we,align:this.textAlign,maxWidth:Y})}},v.prototype.measureText=function(O){if(typeof O!="string")throw Dr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var Q=this.pdf,V=this.pdf.internal.scaleFactor,Y=Q.internal.getFontSize(),we=Q.getStringUnitWidth(O)*Y/Q.internal.scaleFactor,Ve=function(Ge){var je=(Ge=Ge||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return je}}),this};return new Ve({width:we*=Math.round(96*V/72*1e4)/1e4})},v.prototype.scale=function(O,Q){if(isNaN(O)||isNaN(Q))throw Dr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var V=new u(O,0,0,Q,0,0);this.ctx.transform=this.ctx.transform.multiply(V)},v.prototype.rotate=function(O){if(isNaN(O))throw Dr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to
120jsPDF.context2d.rotate");var Q=new u(Math.cos(O),Math.sin(O),-Math.sin(O),Math.cos(O),0,0);this.ctx.transform=this.ctx.transform.multiply(Q)},v.prototype.translate=function(O,Q){if(isNaN(O)||isNaN(Q))throw Dr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var V=new u(1,0,0,1,O,Q);this.ctx.transform=this.ctx.transform.multiply(V)},v.prototype.transform=function(O,Q,V,Y,we,Ve){if(isNaN(O)||isNaN(Q)||isNaN(V)||isNaN(Y)||isNaN(we)||isNaN(Ve))throw Dr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var Ge=new u(O,Q,V,Y,we,Ve);this.ctx.transform=this.ctx.transform.multiply(Ge)},v.prototype.setTransform=function(O,Q,V,Y,we,Ve){O=isNaN(O)?1:O,Q=isNaN(Q)?0:Q,V=isNaN(V)?0:V,Y=isNaN(Y)?1:Y,we=isNaN(we)?0:we,Ve=isNaN(Ve)?0:Ve,this.ctx.transform=new u(O,Q,V,Y,we,Ve)};var D=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};v.prototype.drawImage=function(O,Q,V,Y,we,Ve,Ge,je,it){var It=this.pdf.getImageProperties(O),Nt=1,qt=1,ni=1,bt=1;Y!==void 0&&je!==void 0&&(ni=je/Y,bt=it/we,Nt=It.width/Y*je/Y,qt=It.height/we*it/we),Ve===void 0&&(Ve=Q,Ge=V,Q=0,V=0),Y!==void 0&&je===void 0&&(je=Y,it=we),Y===void 0&&je===void 0&&(je=It.width,it=It.height);for(var Ae,Lt=this.ctx.transform.decompose(),hi=et(Lt.rotate.shx),Wt=new u,Xt=(Wt=(Wt=(Wt=Wt.multiply(Lt.translate)).multiply(Lt.skew)).multiply(Lt.scale)).applyToRectangle(new d(Ve-Q*ni,Ge-V*bt,Y*Nt,we*qt)),ri=F.call(this,Xt),di=[],Mi=0;Mi<ri.length;Mi+=1)di.indexOf(ri[Mi])===-1&&di.push(ri[Mi]);if(H(di),this.autoPaging)for(var Li=di[0],Ji=di[di.length-1],ln=Li;ln<Ji+1;ln++){this.pdf.setPage(ln);var Sn=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],wn=ln===1?this.posY+this.margin[0]:this.margin[0],Zi=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],bn=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],fi=ln===1?0:Zi+(ln-2)*bn;if(this.ctx.clip_path.length!==0){var Aa=this.path;Ae=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=L(Ae,this.posX+this.margin[3],-fi+wn+this.ctx.prevPageLastElemOffset),Ce.call(this,"fill",!0),this.path=Aa}var Pn=JSON.parse(JSON.stringify(Xt));Pn=L([Pn],this.posX+this.margin[3],-fi+wn+this.ctx.prevPageLastElemOffset)[0];var as=(ln>Li||ln<Ji)&&D.call(this);as&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Sn,bn,null).clip().discardPath()),this.pdf.addImage(O,"JPEG",Pn.x,Pn.y,Pn.w,Pn.h,null,null,hi),as&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(O,"JPEG",Xt.x,Xt.y,Xt.w,Xt.h,null,null,hi)};var F=function(O,Q,V){var Y=[];Q=Q||this.pdf.internal.pageSize.width,V=V||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var we=this.posY+this.ctx.prevPageLastElemOffset;switch(O.type){default:case"mt":case"lt":Y.push(Math.floor((O.y+we)/V)+1);break;case"arc":Y.push(Math.floor((O.y+we-O.radius)/V)+1),Y.push(Math.floor((O.y+we+O.radius)/V)+1);break;case"qct":var Ve=gt(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x,O.y);Y.push(Math.floor((Ve.y+we)/V)+1),Y.push(Math.floor((Ve.y+Ve.h+we)/V)+1);break;case"bct":var Ge=vt(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x2,O.y2,O.x,O.y);Y.push(Math.floor((Ge.y+we)/V)+1),Y.push(Math.floor((Ge.y+Ge.h+we)/V)+1);break;case"rect":Y.push(Math.floor((O.y+we)/V)+1),Y.push(Math.floor((O.y+O.h+we)/V)+1)}for(var je=0;je<Y.length;je+=1)for(;this.pdf.internal.getNumberOfPages()<Y[je];)R.call(this);return Y},R=function(){var O=this.fillStyle,Q=this.strokeStyle,V=this.font,Y=this.lineCap,we=this.lineWidth,Ve=this.lineJoin;this.pdf.addPage(),this.fillStyle=O,this.strokeStyle=Q,this.font=V,this.lineCap=Y,this.lineWidth=we,this.lineJoin=Ve},L=function(O,Q,V){for(var Y=0;Y<O.length;Y++)switch(O[Y].type){case"bct":O[Y].x2+=Q,O[Y].y2+=V;case"qct":O[Y].x1+=Q,O[Y].y1+=V;case"mt":case"lt":case"arc":default:O[Y].x+=Q,O[Y].y+=V}return O},H=function(O){return O.sort(function(Q,V){return Q-V})},se=function(O,Q){for(var V,Y,we=this.fillStyle,Ve=this.strokeStyle,Ge=this.lineCap,je=this.lineWidth,it=Math.abs(je*this.ctx.transform.scaleX),It=this.lineJoin,Nt=JSON.parse(JSON.stringify(this.path)),qt=JSON.parse(JSON.stringify(this.path)),ni=[],bt=0;bt<qt.length;bt++)if(qt[bt].x!==void 0)for(var Ae=F.call(this,qt[bt]),Lt=0;Lt<Ae.length;Lt+=1)ni.indexOf(Ae[Lt])===-1&&ni.push(Ae[Lt]);for(var hi=0;hi<ni.length;hi++)for(;this.pdf.internal.getNumberOfPages()<ni[hi];)R.call(this);if(H(ni),this.autoPaging)for(var Wt=ni[0],Xt=ni[ni.length-1],ri=Wt;ri<Xt+1;ri++){this.pdf.setPage(ri),this.fillStyle=we,this.strokeStyle=Ve,this.lineCap=Ge,this.lineWidth=it,this.lineJoin=It;var di=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Mi=ri===1?this.posY+this.margin[0]:this.margin[0],Li=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ji=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ln=ri===1?0:Li+(ri-2)*Ji;if(this.ctx.clip_path.length!==0){var Sn=this.path;V=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=L(V,this.posX+this.margin[3],-ln+Mi+this.ctx.prevPageLastElemOffset),Ce.call(this,O,!0),this.path=Sn}if(Y=JSON.parse(JSON.stringify(Nt)),this.path=L(Y,this.posX+this.margin[3],-ln+Mi+this.ctx.prevPageLastElemOffset),Q===!1||ri===0){var wn=(ri>Wt||ri<Xt)&&D.call(this);wn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],di,Ji,null).clip().discardPath()),Ce.call(this,O,Q),wn&&this.pdf.restoreGraphicsState()}this.lineWidth=je}else this.lineWidth=it,Ce.call(this,O,Q),this.lineWidth=je;this.path=Nt},Ce=function(O,Q){if((O!=="stroke"||Q||!A.call(this))&&(O==="stroke"||Q||!y.call(this))){for(var V,Y,we=[],Ve=this.path,Ge=0;Ge<Ve.length;Ge++){var je=Ve[Ge];switch(je.type){case"begin":we.push({begin:!0}
120);break;case"close":we.push({close:!0});break;case"mt":we.push({start:je,deltas:[],abs:[]});break;case"lt":var it=we.length;if(Ve[Ge-1]&&!isNaN(Ve[Ge-1].x)&&(V=[je.x-Ve[Ge-1].x,je.y-Ve[Ge-1].y],it>0)){for(;it>=0;it--)if(we[it-1].close!==!0&&we[it-1].begin!==!0){we[it-1].deltas.push(V),we[it-1].abs.push(je);break}}break;case"bct":V=[je.x1-Ve[Ge-1].x,je.y1-Ve[Ge-1].y,je.x2-Ve[Ge-1].x,je.y2-Ve[Ge-1].y,je.x-Ve[Ge-1].x,je.y-Ve[Ge-1].y],we[we.length-1].deltas.push(V);break;case"qct":var It=Ve[Ge-1].x+2/3*(je.x1-Ve[Ge-1].x),Nt=Ve[Ge-1].y+2/3*(je.y1-Ve[Ge-1].y),qt=je.x+2/3*(je.x1-je.x),ni=je.y+2/3*(je.y1-je.y),bt=je.x,Ae=je.y;V=[It-Ve[Ge-1].x,Nt-Ve[Ge-1].y,qt-Ve[Ge-1].x,ni-Ve[Ge-1].y,bt-Ve[Ge-1].x,Ae-Ve[Ge-1].y],we[we.length-1].deltas.push(V);break;case"arc":we.push({deltas:[],abs:[],arc:!0}),Array.isArray(we[we.length-1].abs)&&we[we.length-1].abs.push(je)}}Y=Q?null:O==="stroke"?"stroke":"fill";for(var Lt=!1,hi=0;hi<we.length;hi++)if(we[hi].arc)for(var Wt=we[hi].abs,Xt=0;Xt<Wt.length;Xt++){var ri=Wt[Xt];ri.type==="arc"?ae.call(this,ri.x,ri.y,ri.radius,ri.startAngle,ri.endAngle,ri.counterclockwise,void 0,Q,!Lt):Ee.call(this,ri.x,ri.y),Lt=!0}else if(we[hi].close===!0)this.pdf.internal.out("h"),Lt=!1;else if(we[hi].begin!==!0){var di=we[hi].start.x,Mi=we[hi].start.y;Fe.call(this,we[hi].deltas,di,Mi),Lt=!0}Y&&ve.call(this,Y),Q&&Me.call(this)}},Ue=function(O){var Q=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,V=Q*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return O-V;case"top":return O+Q-V;case"hanging":return O+Q-2*V;case"middle":return O+Q/2-V;case"ideographic":return O;case"alphabetic":default:return O}},re=function(O){return O+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};v.prototype.createLinearGradient=function(){var O=function(){};return O.colorStops=[],O.addColorStop=function(Q,V){this.colorStops.push([Q,V])},O.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},O.isCanvasGradient=!0,O},v.prototype.createPattern=function(){return this.createLinearGradient()},v.prototype.createRadialGradient=function(){return this.createLinearGradient()};var ae=function(O,Q,V,Y,we,Ve,Ge,je,it){for(var It=Qe.call(this,V,Y,we,Ve),Nt=0;Nt<It.length;Nt++){var qt=It[Nt];Nt===0&&(it?W.call(this,qt.x1+O,qt.y1+Q):Ee.call(this,qt.x1+O,qt.y1+Q)),$e.call(this,O,Q,qt.x2,qt.y2,qt.x3,qt.y3,qt.x4,qt.y4)}je?Me.call(this):ve.call(this,Ge)},ve=function(O){switch(O){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},Me=function(){this.pdf.clip(),this.pdf.discardPath()},W=function(O,Q){this.pdf.internal.out(t(O)+" "+e(Q)+" m")},J=function(O){var Q;switch(O.align){case"right":case"end":Q="right";break;case"center":Q="center";break;case"left":case"start":default:Q="left"}var V=this.pdf.getTextDimensions(O.text),Y=Ue.call(this,O.y),we=re.call(this,Y)-V.h,Ve=this.ctx.transform.applyToPoint(new c(O.x,Y)),Ge=this.ctx.transform.decompose(),je=new u;je=(je=(je=je.multiply(Ge.translate)).multiply(Ge.skew)).multiply(Ge.scale);for(var it,It,Nt,qt=this.ctx.transform.applyToRectangle(new d(O.x,Y,V.w,V.h)),ni=je.applyToRectangle(new d(O.x,we,V.w,V.h)),bt=F.call(this,ni),Ae=[],Lt=0;Lt<bt.length;Lt+=1)Ae.indexOf(bt[Lt])===-1&&Ae.push(bt[Lt]);if(H(Ae),this.autoPaging)for(var hi=Ae[0],Wt=Ae[Ae.length-1],Xt=hi;Xt<Wt+1;Xt++){this.pdf.setPage(Xt);var ri=Xt===1?this.posY+this.margin[0]:this.margin[0],di=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Mi=this.pdf.internal.pageSize.height-this.margin[2],Li=Mi-this.margin[0],Ji=this.pdf.internal.pageSize.width-this.margin[1],ln=Ji-this.margin[3],Sn=Xt===1?0:di+(Xt-2)*Li;if(this.ctx.clip_path.length!==0){var wn=this.path;it=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=L(it,this.posX+this.margin[3],-1*Sn+ri),Ce.call(this,"fill",!0),this.path=wn}var Zi=L([JSON.parse(JSON.stringify(ni))],this.posX+this.margin[3],-Sn+ri+this.ctx.prevPageLastElemOffset)[0];O.scale>=.01&&(It=this.pdf.internal.getFontSize(),this.pdf.setFontSize(It*O.scale),Nt=this.lineWidth,this.lineWidth=Nt*O.scale);var bn=this.autoPaging!=="text";if(bn||Zi.y+Zi.h<=Mi){if(bn||Zi.y>=ri&&Zi.x<=Ji){var fi=bn?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||Ji-Zi.x)[0],Aa=L([JSON.parse(JSON.stringify(qt))],this.posX+this.margin[3],-Sn+ri+this.ctx.prevPageLastElemOffset)[0],Pn=bn&&(Xt>hi||Xt<Wt)&&D.call(this);Pn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ln,Li,null).clip().discardPath()),this.pdf.text(fi,Aa.x,Aa.y,{angle:O.angle,align:Q,renderingMode:O.renderingMode}),Pn&&this.pdf.restoreGraphicsState()}}else Zi.y<Mi&&(this.ctx.prevPageLastElemOffset+=Mi-Zi.y);O.scale>=.01&&(this.pdf.setFontSize(It),this.lineWidth=Nt)}else O.scale>=.01&&(It=this.pdf.internal.getFontSize(),this.pdf.setFontSize(It*O.scale),Nt=this.lineWidth,this.lineWidth=Nt*O.scale),this.pdf.text(O.text,Ve.x+this.posX,Ve.y+this.posY,{angle:O.angle,align:Q,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(It),this.lineWidth=Nt)},Ee=function(O,Q,V,Y){V=V||0,Y=Y||0,this.pdf.internal.out(t(O+V)+" "+e(Q+Y)+" l")},Fe=function(O,Q,V){return this.pdf.lines(O,Q,V,null,null)}
120,$e=function(O,Q,V,Y,we,Ve,Ge,je){this.pdf.internal.out([n(r(V+O)),n(a(Y+Q)),n(r(we+O)),n(a(Ve+Q)),n(r(Ge+O)),n(a(je+Q)),"c"].join(" "))},Qe=function(O,Q,V,Y){for(var we=2*Math.PI,Ve=Math.PI/2;Q>V;)Q-=we;var Ge=Math.abs(V-Q);Ge<we&&Y&&(Ge=we-Ge);for(var je=[],it=Y?-1:1,It=Q;Ge>1e-5;){var Nt=It+it*Math.min(Ge,Ve);je.push(ot.call(this,O,It,Nt)),Ge-=Math.abs(Nt-It),It=Nt}return je},ot=function(O,Q,V){var Y=(V-Q)/2,we=O*Math.cos(Y),Ve=O*Math.sin(Y),Ge=we,je=-Ve,it=Ge*Ge+je*je,It=it+Ge*we+je*Ve,Nt=4/3*(Math.sqrt(2*it*It)-It)/(Ge*Ve-je*we),qt=Ge-Nt*je,ni=je+Nt*Ge,bt=qt,Ae=-ni,Lt=Y+Q,hi=Math.cos(Lt),Wt=Math.sin(Lt);return{x1:O*Math.cos(Q),y1:O*Math.sin(Q),x2:qt*hi-ni*Wt,y2:qt*Wt+ni*hi,x3:bt*hi-Ae*Wt,y3:bt*Wt+Ae*hi,x4:O*Math.cos(V),y4:O*Math.sin(V)}},et=function(O){return 180*O/Math.PI},gt=function(O,Q,V,Y,we,Ve){var Ge=O+.5*(V-O),je=Q+.5*(Y-Q),it=we+.5*(V-we),It=Ve+.5*(Y-Ve),Nt=Math.min(O,we,Ge,it),qt=Math.max(O,we,Ge,it),ni=Math.min(Q,Ve,je,It),bt=Math.max(Q,Ve,je,It);return new d(Nt,ni,qt-Nt,bt-ni)},vt=function(O,Q,V,Y,we,Ve,Ge,je){var it,It,Nt,qt,ni,bt,Ae,Lt,hi,Wt,Xt,ri,di,Mi,Li=V-O,Ji=Y-Q,ln=we-V,Sn=Ve-Y,wn=Ge-we,Zi=je-Ve;for(It=0;It<41;It++)hi=(Ae=(Nt=O+(it=It/40)*Li)+it*((ni=V+it*ln)-Nt))+it*(ni+it*(we+it*wn-ni)-Ae),Wt=(Lt=(qt=Q+it*Ji)+it*((bt=Y+it*Sn)-qt))+it*(bt+it*(Ve+it*Zi-bt)-Lt),It==0?(Xt=hi,ri=Wt,di=hi,Mi=Wt):(Xt=Math.min(Xt,hi),ri=Math.min(ri,Wt),di=Math.max(di,hi),Mi=Math.max(Mi,Wt));return new d(Math.round(Xt),Math.round(ri),Math.round(di-Xt),Math.round(Mi-ri))},Kt=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,Q,V=(O=this.ctx.lineDash,Q=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:Q}));this.prevLineDash!==V&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=V)}}})($i.API),function(i){var n=function(a){var c,d,u,h,f,v,C,y,A,D;for(/[^\x00-\xFF]/.test(a),d=[],u=0,h=(a+=c="\0\0\0\0".slice(a.length%4||4)).length;h>u;u+=4)(f=(a.charCodeAt(u)<<24)+(a.charCodeAt(u+1)<<16)+(a.charCodeAt(u+2)<<8)+a.charCodeAt(u+3))!==0?(v=(f=((f=((f=((f=(f-(D=f%85))/85)-(A=f%85))/85)-(y=f%85))/85)-(C=f%85))/85)%85,d.push(v+33,C+33,y+33,A+33,D+33)):d.push(122);return function(F,R){for(var L=R;L>0;L--)F.pop()}(d,c.length),String.fromCharCode.apply(String,d)+"~>"},t=function(a){var c,d,u,h,f,v=String,C="length",y=255,A="charCodeAt",D="slice",F="replace";for(a[D](-2),a=a[D](0,-2)[F](/\s/g,"")[F]("z","!!!!!"),u=[],h=0,f=(a+=c="uuuuu"[D](a[C]%5||5))[C];f>h;h+=5)d=52200625*(a[A](h)-33)+614125*(a[A](h+1)-33)+7225*(a[A](h+2)-33)+85*(a[A](h+3)-33)+(a[A](h+4)-33),u.push(y&d>>24,y&d>>16,y&d>>8,y&d);return function(R,L){for(var H=L;H>0;H--)R.pop()}(u,c[C]),v.fromCharCode.apply(v,u)},e=function(a){var c=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),c.test(a)===!1)return"";for(var d="",u=0;u<a.length;u+=2)d+=String.fromCharCode("0x"+(a[u]+a[u+1]));return d},r=function(a){for(var c=new Uint8Array(a.length),d=a.length;d--;)c[d]=a.charCodeAt(d);return a=(c=u2(c)).reduce(function(u,h){return u+String.fromCharCode(h)},"")};i.processDataByFilters=function(a,c){var d=0,u=a||"",h=[];for(typeof(c=c||[])=="string"&&(c=[c]),d=0;d<c.length;d+=1)switch(c[d]){case"ASCII85Decode":case"/ASCII85Decode":u=t(u),h.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=n(u),h.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=e(u),h.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=u.split("").map(function(f){return("0"+f.charCodeAt().toString(16)).slice(-2)}).join("")+">",h.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=r(u),h.push("/FlateDecode");break;default:throw new Error('The filter: "'+c[d]+'" is not implemented')}return{data:u,reverseChain:h.reverse().join(" ")}}}($i.API),function(i){i.loadFile=function(n,t,e){return function(r,a,c){a=a!==!1,c=typeof c=="function"?c:function(){};var d=void 0;try{d=function(u,h,f){var v=new XMLHttpRequest,C=0,y=function(A){var D=A.length,F=[],R=String.fromCharCode;for(C=0;C<D;C+=1)F.push(R(255&A.charCodeAt(C)));return F.join("")};if(v.open("GET",u,!h),v.overrideMimeType("text/plain;
120 charset=x-user-defined"),h===!1&&(v.onload=function(){v.status===200?f(y(this.responseText)):f(void 0)}),v.send(null),h&&v.status===200)return y(v.responseText)}(r,a,c)}catch{}return d}(n,t,e)},i.loadImageFile=i.loadFile}($i.API),function(i){function n(){return(tn.html2canvas?Promise.resolve(tn.html2canvas):import("./chunk-AQ4JQUZI.js")).catch(function(c){return Promise.reject(new Error("Could not load html2canvas: "+c))}).then(function(c){return c.default?c.default:c})}function t(){return(tn.DOMPurify?Promise.resolve(tn.DOMPurify):import("./chunk-JIFL3DD4.js")).catch(function(c){return Promise.reject(new Error("Could not load dompurify: "+c))}).then(function(c){return c.default?c.default:c})}var e=function(c){var d=_r(c);return d==="undefined"?"undefined":d==="string"||c instanceof String?"string":d==="number"||c instanceof Number?"number":d==="function"||c instanceof Function?"function":c&&c.constructor===Array?"array":c&&c.nodeType===1?"element":d==="object"?"object":"unknown"},r=function(c,d){var u=document.createElement(c);for(var h in d.className&&(u.className=d.className),d.innerHTML&&d.dompurify&&(u.innerHTML=d.dompurify.sanitize(d.innerHTML)),d.style)u.style[h]=d.style[h];return u},a=function c(d){var u=Object.assign(c.convert(Promise.resolve()),JSON.parse(JSON.stringify(c.template))),h=c.convert(Promise.resolve(),u);return h=(h=h.setProgress(1,c,1,[c])).set(d)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(c,d){return c.__proto__=d||a.prototype,c},a.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},a.prototype.from=function(c,d){return this.then(function(){switch(d=d||function(u){switch(e(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(c)){case"string":return this.then(t).then(function(u){return this.set({src:r("div",{innerHTML:c,dompurify:u})})});case"element":return this.set({src:c});case"canvas":return this.set({canvas:c});case"img":return this.set({img:c});default:return this.error("Unknown source type.")}})},a.prototype.to=function(c){switch(c){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var c={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},d=function u(h,f){for(var v=h.nodeType===3?document.createTextNode(h.nodeValue):h.cloneNode(!1),C=h.firstChild;C;C=C.nextSibling)f!==!0&&C.nodeType===1&&C.nodeName==="SCRIPT"||v.appendChild(u(C,f));return h.nodeType===1&&(h.nodeName==="CANVAS"?(v.width=h.width,v.height=h.height,v.getContext("2d").drawImage(h,0,0)):h.nodeName!=="TEXTAREA"&&h.nodeName!=="SELECT"||(v.value=h.value),v.addEventListener("load",function(){v.scrollTop=h.scrollTop,v.scrollLeft=h.scrollLeft},!0)),v}(this.prop.src,this.opt.html2canvas.javascriptEnabled);d.tagName==="BODY"&&(c.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=r("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=r("div",{className:"html2pdf__container",style:c}),this.prop.container.appendChild(d),this.prop.container.firstChild.appendChild(r("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},a.prototype.toCanvas=function(){var c=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(c).then(n).then(function(d){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,d(this.prop.container,u)}).then(function(d){(this.opt.html2canvas.onrendered||function(){})(d),this.prop.canvas=d,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var c=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(c).then(n).then(function(d){var u=this.opt.jsPDF,h=this.opt.fontFaces,f=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,v=Object.assign({async:!0,allowTaint:!0,scale:f,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete v.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=h,h)for(var C=0;C<h.length;++C){var y=h[C],A=y.src.find(function(D){return D.format==="truetype"});A&&u.addFont(A.url,y.ref.name,y.ref.style)}
120return v.windowHeight=v.windowHeight||0,v.windowHeight=v.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):v.windowHeight,u.context2d.save(!0),d(this.prop.container,v)}).then(function(d){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(d),this.prop.canvas=d,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var c=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=c})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(c,d,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(c,d):this.outputPdf(c,d)},a.prototype.outputPdf=function(c,d){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(c,d)})},a.prototype.outputImg=function(c){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(c){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+c+'" is not supported.'}})},a.prototype.save=function(c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(c?{filename:c}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(c){if(e(c)!=="object")return this;var d=Object.keys(c||{}).map(function(u){if(u in a.template.prop)return function(){this.prop[u]=c[u]};switch(u){case"margin":return this.setMargin.bind(this,c.margin);case"jsPDF":return function(){return this.opt.jsPDF=c.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,c.pageSize);default:return function(){this.opt[u]=c[u]}}},this);return this.then(function(){return this.thenList(d)})},a.prototype.get=function(c,d){return this.then(function(){var u=c in a.template.prop?this.prop[c]:this.opt[c];return d?d(u):u})},a.prototype.setMargin=function(c){return this.then(function(){switch(e(c)){case"number":c=[c,c,c,c];case"array":if(c.length===2&&(c=[c[0],c[1],c[0],c[1]]),c.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=c}).then(this.setPageSize)},a.prototype.setPageSize=function(c){function d(u,h){return Math.floor(u*h/72*96)}return this.then(function(){(c=c||$i.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(c.inner={width:c.width-this.opt.margin[1]-this.opt.margin[3],height:c.height-this.opt.margin[0]-this.opt.margin[2]},c.inner.px={width:d(c.inner.width,c.k),height:d(c.inner.height,c.k)},c.inner.ratio=c.inner.height/c.inner.width),this.prop.pageSize=c})},a.prototype.setProgress=function(c,d,u,h){return c!=null&&(this.progress.val=c),d!=null&&(this.progress.state=d),u!=null&&(this.progress.n=u),h!=null&&(this.progress.stack=h),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(c,d,u,h){return this.setProgress(c?this.progress.val+c:null,d||null,u?this.progress.n+u:null,h?this.progress.stack.concat(h):null)},a.prototype.then=function(c,d){var u=this;return this.thenCore(c,d,function(h,f){return u.updateProgress(null,null,1,[h]),Promise.prototype.then.call(this,function(v){return u.updateProgress(null,h),v}).then(h,f).then(function(v){return u.updateProgress(1),v})})},a.prototype.thenCore=function(c,d,u){u=u||Promise.prototype.then,c&&(c=c.bind(this)),d&&(d=d.bind(this));var h=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:a.convert(Object.assign({},this),Promise.prototype),f=u.call(h,c,d);return a.convert(f,this.__proto__)},a.prototype.thenExternal=function(c,d){return Promise.prototype.then.call(this,c,d)},a.prototype.thenList=function(c){var d=this;
vendor: 9,129 bytes, lines 120-126
120return c.forEach(function(u){d=d.thenCore(u)}),d},a.prototype.catch=function(c){c&&(c=c.bind(this));var d=Promise.prototype.catch.call(this,c);return a.convert(d,this)},a.prototype.catchExternal=function(c){return Promise.prototype.catch.call(this,c)},a.prototype.error=function(c){return this.then(function(){throw new Error(c)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,$i.getPageSize=function(c,d,u){if(_r(c)==="object"){var h=c;c=h.orientation,d=h.unit||d,u=h.format||u}d=d||"mm",u=u||"a4",c=(""+(c||"P")).toLowerCase();var f,v=(""+u).toLowerCase(),C={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(d){case"pt":f=1;break;case"mm":f=72/25.4;break;case"cm":f=72/2.54;break;case"in":f=72;break;case"px":f=.75;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+d}var y,A=0,D=0;if(C.hasOwnProperty(v))A=C[v][1]/f,D=C[v][0]/f;else try{A=u[1],D=u[0]}catch{throw new Error("Invalid format: "+u)}if(c==="p"||c==="portrait")c="p",D>A&&(y=D,D=A,A=y);else{if(c!=="l"&&c!=="landscape")throw"Invalid orientation: "+c;c="l",A>D&&(y=D,D=A,A=y)}return{width:D,height:A,unit:d,k:f,orientation:c}},i.html=function(c,d){(d=d||{}).callback=d.callback||function(){},d.html2canvas=d.html2canvas||{},d.html2canvas.canvas=d.html2canvas.canvas||this.canvas,d.jsPDF=d.jsPDF||this,d.fontFaces=d.fontFaces?d.fontFaces.map(AD):null;var u=new a(d);return d.worker?u:u.from(c).doCallback()}}($i.API),$i.API.addJS=function(i){return mN=i,this.internal.events.subscribe("postPutResources",function(){f2=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(f2+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),dN=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+mN+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){f2!==void 0&&dN!==void 0&&this.internal.out("/Names <</JavaScript "+f2+" 0 R>>")}),this},function(i){var n;i.events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var r=t.outline.render().split(/\r\n/),a=0;a<r.length;a++){var c=r[a],d=e.exec(c);if(d!=null){var u=d[1];t.internal.newObjectDeferredBegin(u,!1)}t.internal.write(c)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,f=[];for(a=0;a<h;a++){var v=t.internal.newObject();f.push(v);var C=t.internal.getPageInfo(a+1);t.internal.write("<< /D["+C.objId+" 0 R /XYZ null null null]>> endobj")}var y=t.internal.newObject();for(t.internal.write("<< /Names [ "),a=0;a<f.length;a++)t.internal.write("(page_"+(a+1)+")"+f[a]+" 0 R");t.internal.write(" ] >>","endobj"),n=t.internal.newObject(),t.internal.write("<< /Dests "+y+" 0 R"),t.internal.write(">>","endobj")}}]),i.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+n+" 0 R"))}]),i.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(e,r,a){var c={title:r,options:a,children:[]};return e==null&&(e=this.root),e.children.push(c),c},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(e){e.id=t.internal.newObjectDeferred();for(var r=0;r<e.children.length;r++)this.genIds_r(e.children[r])},t.outline.renderRoot=function(e){this.objStart(e),this.line("/Type /Outlines"),e.children.length>0&&(this.line("/First "+this.makeRef(e.children[0])),this.line("/Last "+this.makeRef(e.children[e.children.length-1]))),this.line("/Count "+this.count_r({count:0},e)),this.objEnd()},t.outline.renderItems=function(e){for(var r=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<e.children.length;a++){var c=e.children[a];this.objStart(c),this.line("/Title "+this.makeString(c.title)),this.line("/Parent "+this.makeRef(e)),a>0&&this.line("/Prev "+this.makeRef(e.children[a-1])),a<e.children.length-1&&this.line("/Next "+this.makeRef(e.children[a+1])),c.children.length>0&&(this.line("/First "+this.makeRef(c.children[0])),this.line("/Last "+this.makeRef(c.children[c.children.length-1])));var d=this.count=this.count_r({count:0},c);if(d>0&&this.line("/Count "+d),c.options&&c.options.pageNumber){var u=t.internal.getPageInfo(c.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+r(0)+" 0]")}this.objEnd()}for(var h=0;h<e.children.length;h++)this.renderItems(e.children[h])},t.outline.line=function(e){this.ctx.val+=e+`\r 121`},t.outline.makeRef=function(e){return e.id+" 0 R"},t.outline.makeString=function(e){return"("+t.internal.pdfEscape(e)+")"},t.outline.objStart=function(e){this.ctx.val+=`\r 122`+e.id+` 0 obj\r 123<<\r 124`},t.outline.objEnd=function(){this.ctx.val+=`>> \r 125endobj\r 126`},t.outline.count_r=function(e,r){for(var a=0;a<r.children.length;a++)e.count++,this.count_r(e,r.children[a]);return e.count}}])}($i.API),function(i){var n=[192,193,194,195,196,197,198,199];i.processJPEG=function(t,e,r,a,c,d){var u,h=this.decode.DCT_DECODE,f=null;if(typeof t=="string"||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=c||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(u=function(v){for(var C,y=256*v.charCodeAt(4)+v.charCodeAt(5),A=v.length,D={width:0,height:0,numcomponents:1},F=4;F<A;F+=2){if(F+=y,n.indexOf(v.charCodeAt(F+1))!==-1){C=256*v.charCodeAt(F+5)+v.charCodeAt(F+6),D={width:256*v.charCodeAt(F+7)+v.charCodeAt(F+8),height:C,numcomponents:v.charCodeAt(F+9)};break}y=256*v.charCodeAt(F+2)+v.charCodeAt(F+3)}return D}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:d=this.color_spaces.DEVICE_GRAY;break;case 4:d=this.color_spaces.DEVICE_CMYK;break;case 3:d=this.color_spaces.DEVICE_RGB}f={data:t,width:u.width,height:u.height,colorSpace:d,bitsPerComponent:8,filter:h,index:e,alias:r}}return f}}($i.API);var sf,g2,uN,pN,hN,Aie=function(){var i,n,t;function e(a){var c,d,u,h,f,v,C,y,A,D,F,R,L,H;for(this.data=a,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},v=null;;){switch(c=this.readUInt32(),A=(function(){var se,Ce;for(Ce=[],se=0;se<4;++se)Ce.push(String.fromCharCode(this.data[this.pos++]));return Ce}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(c);break;case"fcTL":v&&this.animation.frames.push(v),this.pos+=4,v={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},f=this.readUInt16(),h=this.readUInt16()||100,v.delay=1e3*f/h,v.disposeOp=this.data[this.pos++],v.blendOp=this.data[this.pos++],v.data=[];break;case"IDAT":case"fdAT":for(A==="fdAT"&&(this.pos+=4,c-=4),a=v?.data||this.imgData,R=0;0<=c?R<c:R>c;0<=c?++R:--R)a.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(u=this.palette.length/3,this.transparency.indexed=this.read(c),this.transparency.indexed.length>u)throw new Error("More transparent colors than palette size");if((D=u-this.transparency.indexed.length)>0)for(L=0;0<=D?L<D:L>D;0<=D?++L:--L)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(c)[0];break;case 2:this.transparency.rgb=this.read(c)}break;case"tEXt":C=(F=this.read(c)).indexOf(0),y=String.fromCharCode.apply(String,F.slice(0,C)),this.text[y]=String.fromCharCode.apply(String,F.slice(C+1));break;case"IEND":return v&&this.animation.frames.push(v),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(H=this.colorType)===4||H===6,d=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*d,this.colorSpace
126=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=c}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}e.prototype.read=function(a){var c,d;for(d=[],c=0;0<=a?c<a:c>a;0<=a?++c:--c)d.push(this.data[this.pos++]);return d},e.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},e.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},e.prototype.decodePixels=function(a){var c=this.pixelBitlength/8,d=new Uint8Array(this.width*this.height*c),u=0,h=this;if(a==null&&(a=this.imgData),a.length===0)return new Uint8Array(0);function f(v,C,y,A){var D,F,R,L,H,se,Ce,Ue,re,ae,ve,Me,W,J,Ee,Fe,$e,Qe,ot,et,gt,vt=Math.ceil((h.width-v)/y),Kt=Math.ceil((h.height-C)/A),O=h.width==vt&&h.height==Kt;for(J=c*vt,Me=O?d:new Uint8Array(J*Kt),se=a.length,W=0,F=0;W<Kt&&u<se;){switch(a[u++]){case 0:for(L=$e=0;$e<J;L=$e+=1)Me[F++]=a[u++];break;case 1:for(L=Qe=0;Qe<J;L=Qe+=1)D=a[u++],H=L<c?0:Me[F-c],Me[F++]=(D+H)%256;break;case 2:for(L=ot=0;ot<J;L=ot+=1)D=a[u++],R=(L-L%c)/c,Ee=W&&Me[(W-1)*J+R*c+L%c],Me[F++]=(Ee+D)%256;break;case 3:for(L=et=0;et<J;L=et+=1)D=a[u++],R=(L-L%c)/c,H=L<c?0:Me[F-c],Ee=W&&Me[(W-1)*J+R*c+L%c],Me[F++]=(D+Math.floor((H+Ee)/2))%256;break;case 4:for(L=gt=0;gt<J;L=gt+=1)D=a[u++],R=(L-L%c)/c,H=L<c?0:Me[F-c],W===0?Ee=Fe=0:(Ee=Me[(W-1)*J+R*c+L%c],Fe=R&&Me[(W-1)*J+(R-1)*c+L%c]),Ce=H+Ee-Fe,Ue=Math.abs(Ce-H),ae=Math.abs(Ce-Ee),ve=Math.abs(Ce-Fe),re=Ue<=ae&&Ue<=ve?H:ae<=ve?Ee:Fe,Me[F++]=(D+re)%256;break;default:throw new Error("Invalid filter algorithm: "+a[u-1])}if(!O){var Q=((C+W*A)*h.width+v)*c,V=W*J;for(L=0;L<vt;L+=1){for(var Y=0;Y<c;Y+=1)d[Q++]=Me[V++];Q+=(y-1)*c}}W++}}return a=eN(a),h.interlaceMethod==1?(f(0,0,8,8),f(4,0,8,8),f(0,4,4,8),f(2,0,4,4),f(0,2,2,4),f(1,0,2,2),f(0,1,1,2)):f(0,0,1,1),d},e.prototype.decodePalette=function(){var a,c,d,u,h,f,v,C,y;for(d=this.palette,f=this.transparency.indexed||[],h=new Uint8Array((f.length||0)+d.length),u=0,a=0,c=v=0,C=d.length;v<C;c=v+=3)h[u++]=d[c],h[u++]=d[c+1],h[u++]=d[c+2],h[u++]=(y=f[a++])!=null?y:255;return h},e.prototype.copyToImageData=function(a,c){var d,u,h,f,v,C,y,A,D,F,R;if(u=this.colors,D=null,d=this.hasAlphaChannel,this.palette.length&&(D=(R=this._decodedPalette)!=null?R:this._decodedPalette=this.decodePalette(),u=4,d=!0),A=(h=a.data||a).length,v=D||c,f=C=0,u===1)for(;f<A;)y=D?4*c[f/4]:C,F=v[y++],h[f++]=F,h[f++]=F,h[f++]=F,h[f++]=d?v[y++]:255,C=y;else for(;f<A;)y=D?4*c[f/4]:C,h[f++]=v[y++],h[f++]=v[y++],h[f++]=v[y++],h[f++]=d?v[y++]:255,C=y},e.prototype.decode=function(){var a;return a=new Uint8Array(this.width*this.height*4),this.copyToImageData(a,this.decodePixels()),a};var r=function(){if(Object.prototype.toString.call(tn)==="[object Window]"){try{n=tn.document.createElement("canvas"),t=n.getContext("2d")}catch{return!1}return!0}return!1};return r(),i=function(a){var c;if(r()===!0)return t.width=a.width,t.height=a.height,t.clearRect(0,0,a.width,a.height),t.putImageData(a,0,0),(c=new Image).src=n.toDataURL(),c;throw new Error("This method requires a Browser with Canvas-capability.")},e.prototype.decodeFrames=function(a){var c,d,u,h,f,v,C,y;if(this.animation){for(y=[],d=f=0,v=(C=this.animation.frames).length;f<v;d=++f)c=C[d],u=a.createImageData(c.width,c.height),h=this.decodePixels(new Uint8Array(c.data)),this.copyToImageData(u,h),c.imageData=u,y.push(c.image=i(u));return y}},e.prototype.renderFrame=function(a,c){var d,u,h;return d=(u=this.animation.frames)[c],h=u[c-1],c===0&&a.clearRect(0,0,this.width,this.height),h?.disposeOp===1?a.clearRect(h.xOffset,h.yOffset,h.width,h.height):h?.disposeOp===2&&a.putImageData(h.imageData,h.xOffset,h.yOffset),d.blendOp===0&&a.clearRect(d.xOffset,d.yOffset,d.width,d.height),a.drawImage(d.image,d.xOffset,d.yOffset)},e.prototype.animate=function(a){var c,d,u,h,f,v,C=this;return d=0,v=this.animation,h=v.numFrames,u=v.frames,f=v.numPlays,(c=function(){var y,A;if(y=d++%h,A=u[y],C.renderFrame(a,y),h>1&&d/h<f)return C.animation._timeout=setTimeout(c,A.delay)})()},e.prototype.stopAnimation=function(){var a;return clearTimeout((a=this.animation)!=null?a._timeout:void 0)},e.prototype.render=function(a){var c,d;return a._png&&a._png.stopAnimation(),a._png=this,a.width=this.width,a.height=this.height,c=a.getContext("2d"),this.animation?(this.decodeFrames(c),this.animate(c)):(d=c.createImageData(this.width,this.height),this.copyToImageData(d,this.decodePixels()),c.putImageData(d,0,0))},e}();function Pie(i){var n=0;if(i[n++]!==71||i[n++]!==73||i[n++]!==70||i[n++]!==56||(i[n++]+1&253)!=56||i[n++]!==97)throw new Error("Invalid GIF 87a/89a header.");var t=i[n++]|i[n++]<<8,e=i[n++]|i[n++]<<8,r=i[n++],a=r>>7,c=1<<(7&r)+1;i[n++],i[n++];var d=null,u=null;
126a&&(d=n,u=c,n+=3*c);var h=!0,f=[],v=0,C=null,y=0,A=null;for(this.width=t,this.height=e;h&&n<i.length;)switch(i[n++]){case 33:switch(i[n++]){case 255:if(i[n]!==11||i[n+1]==78&&i[n+2]==69&&i[n+3]==84&&i[n+4]==83&&i[n+5]==67&&i[n+6]==65&&i[n+7]==80&&i[n+8]==69&&i[n+9]==50&&i[n+10]==46&&i[n+11]==48&&i[n+12]==3&&i[n+13]==1&&i[n+16]==0)n+=14,A=i[n++]|i[n++]<<8,n++;else for(n+=12;;){if(!((W=i[n++])>=0))throw Error("Invalid block size");if(W===0)break;n+=W}break;case 249:if(i[n++]!==4||i[n+4]!==0)throw new Error("Invalid graphics extension block.");var D=i[n++];v=i[n++]|i[n++]<<8,C=i[n++],(1&D)==0&&(C=null),y=D>>2&7,n++;break;case 254:for(;;){if(!((W=i[n++])>=0))throw Error("Invalid block size");if(W===0)break;n+=W}break;default:throw new Error("Unknown graphic control label: 0x"+i[n-1].toString(16))}break;case 44:var F=i[n++]|i[n++]<<8,R=i[n++]|i[n++]<<8,L=i[n++]|i[n++]<<8,H=i[n++]|i[n++]<<8,se=i[n++],Ce=se>>6&1,Ue=1<<(7&se)+1,re=d,ae=u,ve=!1;se>>7&&(ve=!0,re=n,ae=Ue,n+=3*Ue);var Me=n;for(n++;;){var W;if(!((W=i[n++])>=0))throw Error("Invalid block size");if(W===0)break;n+=W}f.push({x:F,y:R,width:L,height:H,has_local_palette:ve,palette_offset:re,palette_size:ae,data_offset:Me,data_length:n-Me,transparent_index:C,interlaced:!!Ce,delay:v,disposal:y});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+i[n-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return A},this.frameInfo=function(J){if(J<0||J>=f.length)throw new Error("Frame index out of range.");return f[J]},this.decodeAndBlitFrameBGRA=function(J,Ee){var Fe=this.frameInfo(J),$e=Fe.width*Fe.height,Qe=new Uint8Array($e);fN(i,Fe.data_offset,Qe,$e);var ot=Fe.palette_offset,et=Fe.transparent_index;et===null&&(et=256);var gt=Fe.width,vt=t-gt,Kt=gt,O=4*(Fe.y*t+Fe.x),Q=4*((Fe.y+Fe.height)*t+Fe.x),V=O,Y=4*vt;Fe.interlaced===!0&&(Y+=4*t*7);for(var we=8,Ve=0,Ge=Qe.length;Ve<Ge;++Ve){var je=Qe[Ve];if(Kt===0&&(Kt=gt,(V+=Y)>=Q&&(Y=4*vt+4*t*(we-1),V=O+(gt+vt)*(we<<1),we>>=1)),je===et)V+=4;else{var it=i[ot+3*je],It=i[ot+3*je+1],Nt=i[ot+3*je+2];Ee[V++]=Nt,Ee[V++]=It,Ee[V++]=it,Ee[V++]=255}--Kt}},this.decodeAndBlitFrameRGBA=function(J,Ee){var Fe=this.frameInfo(J),$e=Fe.width*Fe.height,Qe=new Uint8Array($e);fN(i,Fe.data_offset,Qe,$e);var ot=Fe.palette_offset,et=Fe.transparent_index;et===null&&(et=256);var gt=Fe.width,vt=t-gt,Kt=gt,O=4*(Fe.y*t+Fe.x),Q=4*((Fe.y+Fe.height)*t+Fe.x),V=O,Y=4*vt;Fe.interlaced===!0&&(Y+=4*t*7);for(var we=8,Ve=0,Ge=Qe.length;Ve<Ge;++Ve){var je=Qe[Ve];if(Kt===0&&(Kt=gt,(V+=Y)>=Q&&(Y=4*vt+4*t*(we-1),V=O+(gt+vt)*(we<<1),we>>=1)),je===et)V+=4;else{var it=i[ot+3*je],It=i[ot+3*je+1],Nt=i[ot+3*je+2];Ee[V++]=it,Ee[V++]=It,Ee[V++]=Nt,Ee[V++]=255}--Kt}}}function fN(i,n,t,e){for(var r=i[n++],a=1<<r,c=a+1,d=c+1,u=r+1,h=(1<<u)-1,f=0,v=0,C=0,y=i[n++],A=new Int32Array(4096),D=null;;){for(;f<16&&y!==0;)v|=i[n++]<<f,f+=8,y===1?y=i[n++]:--y;if(f<u)break;var F=v&h;if(v>>=u,f-=u,F!==a){if(F===c)break;for(var R=F<d?F:D,L=0,H=R;H>a;)H=A[H]>>8,++L;var se=H;if(C+L+(R!==F?1:0)>e)return void Dr.log("Warning, gif stream longer than expected.");t[C++]=se;var Ce=C+=L;for(R!==F&&(t[C++]=se),H=R;L--;)H=A[H],t[--Ce]=255&H,H>>=8;D!==null&&d<4096&&(A[d++]=D<<8|se,d>=h+1&&u<12&&(++u,h=h<<1|1)),D=F}else d=c+1,h=(1<<(u=r+1))-1,D=null}return C!==e&&Dr.log("Warning, gif stream shorter than expected."),t}function wD(i){var n,t,e,r,a,c=Math.floor,d=new Array(64),u=new Array(64),h=new Array(64),f=new Array(64),v=new Array(65535),C=new Array(65535),y=new Array(64),A=new Array(64),D=[],F=0,R=7,L=new Array(64),H=new Array(64),se=new Array(64),Ce=new Array(256),Ue=new Array(2048),re=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],ae=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],ve=[0,1,2,3,4,5,6,7,8,9,10,11],Me=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],W=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],J=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Ee=[0,1,2,3,4,5,6,7,8,9,10,11],Fe=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],$e=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Qe(O,Q){for(var V=0,Y=0,we=new Array,Ve=1;Ve<=16;Ve++){for(var Ge=1;Ge<=O[Ve];Ge++)we[Q[Y]]=[],we[Q[Y]][0]=V,we[Q[Y]][1]=Ve,Y++,V++;V*=2}return we}function ot(O){for(var Q=O[0],V=O[1]-1;V>=0;)Q&1<<V&&(F|=1<<R),V--,--R<0&&(F==255?(et(255),et(0)):et(F),R=7,F=0)}function et(O){D.push(O)}function gt(O){et(O>>8&255),et(255&O)}function vt(O,Q,V,Y,we){for(var Ve,Ge=we[0],je=we[240],it=function(Wt,Xt){var ri,di,Mi,Li,Ji,ln,Sn,wn,Zi,bn,fi=0;for(Zi=0;Zi<8;++Zi){ri=Wt[fi],di=Wt[fi+1],Mi=Wt[fi+2],Li=Wt[fi+3],Ji=Wt[fi+4],ln=Wt[fi+5],Sn=Wt[fi+6];var Aa=ri+(wn=Wt[fi+7]),Pn=ri-wn,as=di+Sn,ir=di-Sn,kr=Mi+ln,ul=Mi-ln,Ln=Li+Ji,wc=Li-Ji,Fr=Aa+Ln,Ws=Aa-Ln,Hl=as+kr,Cr=as-kr;Wt[fi]=Fr+Hl,Wt[fi+4]=Fr-Hl;var an=.707106781*(Cr+Ws);Wt[fi+2]=Ws+an,Wt[fi+6]=Ws-an;var Hn=.382683433*((Fr=wc+ul)-(Cr=ir+Pn)),cd=.5411961*Fr+Hn,Pa=1.306562965*Cr+Hn,pl=.707106781*(Hl=ul+ir),hl=Pn+pl,zi=Pn-pl;Wt[fi+5]=zi+cd,Wt[fi+3]=zi-cd,Wt[fi+1]=hl+Pa,Wt[fi+7]=hl-Pa,fi+=8}for(fi=0,Zi=0;Zi<8;++Zi){ri=Wt[fi],di=Wt[fi+8],Mi=Wt[fi+16],Li=Wt[fi+24],Ji=Wt[fi+32],ln=Wt[fi+40],Sn=Wt[fi+48];var Hs=ri+(wn=Wt[fi+56]),os=ri-wn,yo=di+Sn,oa=di-Sn,Xr=Mi+ln,ie=Mi-l
vendor: 12,925 bytes, line 126
126n,Ie=Li+Ji,ge=Li-Ji,be=Hs+Ie,De=Hs-Ie,ke=yo+Xr,lt=yo-Xr;Wt[fi]=be+ke,Wt[fi+32]=be-ke;var xt=.707106781*(lt+De);Wt[fi+16]=De+xt,Wt[fi+48]=De-xt;var dt=.382683433*((be=ge+ie)-(lt=oa+os)),ft=.5411961*be+dt,yt=1.306562965*lt+dt,zt=.707106781*(ke=ie+oa),ei=os+zt,bi=os-zt;Wt[fi+40]=bi+ft,Wt[fi+24]=bi-ft,Wt[fi+8]=ei+yt,Wt[fi+56]=ei-yt,fi++}for(Zi=0;Zi<64;++Zi)bn=Wt[Zi]*Xt[Zi],y[Zi]=bn>0?bn+.5|0:bn-.5|0;return y}(O,Q),It=0;It<64;++It)A[re[It]]=it[It];var Nt=A[0]-V;V=A[0],Nt==0?ot(Y[0]):(ot(Y[C[Ve=32767+Nt]]),ot(v[Ve]));for(var qt=63;qt>0&&A[qt]==0;)qt--;if(qt==0)return ot(Ge),V;for(var ni,bt=1;bt<=qt;){for(var Ae=bt;A[bt]==0&&bt<=qt;)++bt;var Lt=bt-Ae;if(Lt>=16){ni=Lt>>4;for(var hi=1;hi<=ni;++hi)ot(je);Lt&=15}Ve=32767+A[bt],ot(we[(Lt<<4)+C[Ve]]),ot(v[Ve]),bt++}return qt!=63&&ot(Ge),V}function Kt(O){O=Math.min(Math.max(O,1),100),a!=O&&(function(Q){for(var V=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Y=0;Y<64;Y++){var we=c((V[Y]*Q+50)/100);we=Math.min(Math.max(we,1),255),d[re[Y]]=we}for(var Ve=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Ge=0;Ge<64;Ge++){var je=c((Ve[Ge]*Q+50)/100);je=Math.min(Math.max(je,1),255),u[re[Ge]]=je}for(var it=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],It=0,Nt=0;Nt<8;Nt++)for(var qt=0;qt<8;qt++)h[It]=1/(d[re[It]]*it[Nt]*it[qt]*8),f[It]=1/(u[re[It]]*it[Nt]*it[qt]*8),It++}(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),a=O)}this.encode=function(O,Q){Q&&Kt(Q),D=new Array,F=0,R=7,gt(65496),gt(65504),gt(16),et(74),et(70),et(73),et(70),et(0),et(1),et(1),et(0),gt(1),gt(1),et(0),et(0),function(){gt(65499),gt(132),et(0);for(var di=0;di<64;di++)et(d[di]);et(1);for(var Mi=0;Mi<64;Mi++)et(u[Mi])}(),function(di,Mi){gt(65472),gt(17),et(8),gt(Mi),gt(di),et(3),et(1),et(17),et(0),et(2),et(17),et(1),et(3),et(17),et(1)}(O.width,O.height),function(){gt(65476),gt(418),et(0);for(var di=0;di<16;di++)et(ae[di+1]);for(var Mi=0;Mi<=11;Mi++)et(ve[Mi]);et(16);for(var Li=0;Li<16;Li++)et(Me[Li+1]);for(var Ji=0;Ji<=161;Ji++)et(W[Ji]);et(1);for(var ln=0;ln<16;ln++)et(J[ln+1]);for(var Sn=0;Sn<=11;Sn++)et(Ee[Sn]);et(17);for(var wn=0;wn<16;wn++)et(Fe[wn+1]);for(var Zi=0;Zi<=161;Zi++)et($e[Zi])}(),gt(65498),gt(12),et(3),et(1),et(0),et(2),et(17),et(3),et(17),et(0),et(63),et(0);var V=0,Y=0,we=0;F=0,R=7,this.encode.displayName="_encode_";for(var Ve,Ge,je,it,It,Nt,qt,ni,bt,Ae=O.data,Lt=O.width,hi=O.height,Wt=4*Lt,Xt=0;Xt<hi;){for(Ve=0;Ve<Wt;){for(It=Wt*Xt+Ve,qt=-1,ni=0,bt=0;bt<64;bt++)Nt=It+(ni=bt>>3)*Wt+(qt=4*(7&bt)),Xt+ni>=hi&&(Nt-=Wt*(Xt+1+ni-hi)),Ve+qt>=Wt&&(Nt-=Ve+qt-Wt+4),Ge=Ae[Nt++],je=Ae[Nt++],it=Ae[Nt++],L[bt]=(Ue[Ge]+Ue[je+256>>0]+Ue[it+512>>0]>>16)-128,H[bt]=(Ue[Ge+768>>0]+Ue[je+1024>>0]+Ue[it+1280>>0]>>16)-128,se[bt]=(Ue[Ge+1280>>0]+Ue[je+1536>>0]+Ue[it+1792>>0]>>16)-128;V=vt(L,h,V,n,e),Y=vt(H,f,Y,t,r),we=vt(se,f,we,t,r),Ve+=32}Xt+=8}if(R>=0){var ri=[];ri[1]=R+1,ri[0]=(1<<R+1)-1,ot(ri)}return gt(65497),new Uint8Array(D)},i=i||50,function(){for(var O=String.fromCharCode,Q=0;Q<256;Q++)Ce[Q]=O(Q)}(),n=Qe(ae,ve),t=Qe(J,Ee),e=Qe(Me,W),r=Qe(Fe,$e),function(){for(var O=1,Q=2,V=1;V<=15;V++){for(var Y=O;Y<Q;Y++)C[32767+Y]=V,v[32767+Y]=[],v[32767+Y][1]=V,v[32767+Y][0]=Y;for(var we=-(Q-1);we<=-O;we++)C[32767+we]=V,v[32767+we]=[],v[32767+we][1]=V,v[32767+we][0]=Q-1+we;O<<=1,Q<<=1}}(),function(){for(var O=0;O<256;O++)Ue[O]=19595*O,Ue[O+256>>0]=38470*O,Ue[O+512>>0]=7471*O+32768,Ue[O+768>>0]=-11059*O,Ue[O+1024>>0]=-21709*O,Ue[O+1280>>0]=32768*O+8421375,Ue[O+1536>>0]=-27439*O,Ue[O+1792>>0]=-5329*O}(),Kt(i)}function gc(i,n){if(this.pos=0,this.buffer=i,this.datav=new DataView(i.buffer),this.is_with_alpha=!!n,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function gN(i){function n(ae){if(!ae)throw Error("assert :P")}function t(ae,ve,Me){for(var W=0;4>W;W++)if(ae[ve+W]!=Me.charCodeAt(W))return!0;return!1}function e(ae,ve,Me,W,J){for(var Ee=0;Ee<J;Ee++)ae[ve+Ee]=Me[W+Ee]}function r(ae,ve,Me,W){for(var J=0;J<W;J++)ae[ve+J]=Me}function a(ae){return new Int32Array(ae)}function c(ae,ve){for(var Me=[],W=0;W<ae;W++)Me.push(new ve);return Me}function d(ae,ve){var Me=[];return function W(J,Ee,Fe){for(var $e=Fe[Ee],Qe=0;Qe<$e&&(J.push(Fe.length>Ee+1?[]:new ve),!(Fe.length<Ee+1));Qe++)W(J[Qe],Ee+1,Fe)}(Me,0,ae),Me}var u=function(){var ae=this;function ve(g,E){for(var P=1<<E-1>>>0;g&P;)P>>>=1;return P?(g&P-1)+P:g}function Me(g,E,P,N,G){n(!(N%P));do g[E+(N-=P)]=G;while(0<N)}function W(g,E,P,N,G){if(n(2328>=G),512>=G)var ee=a(512);else if((ee=a(G))==null)return 0;return function(ne,oe,de,Te,Ye,mt){var ut,Ze,Rt=oe,Ct=1<<de,qe=a(16),Xe=a(16);for(n(Ye!=0),n(Te!=null),n(ne!=null),n(0<de),Ze=0;Ze<Ye;++Ze){if(15<Te[Ze])return 0;++qe[Te[Ze]]}if(qe[0]==Ye)return 0;for(Xe[1]=0,ut=1;15>ut;++ut){if(qe[ut]>1<<ut)return 0;Xe[ut+1]=Xe[ut]+qe[ut]}for(Ze=0;Ze<Ye;++Ze)ut=Te[Ze],0<Te[Ze]&&(mt[Xe[ut]++]=Ze);if(Xe[15]==1)return(Te=new J).g=0,Te.value=mt[0],Me(ne,Rt,1,Ct,Te),Ct;var Pt,jt=-1,Ft=Ct-1,Ei=0,mi=1,Yi=1,pi=1<<de;for(Ze=0,ut=1,Ye=2;ut<=de;++ut,Ye<<=1){if(mi+=Yi<<=1,0>(Yi-=qe[ut]))return 0;for(;0<qe[ut];--qe[ut])(Te=new J).g=ut,Te.value=mt[Ze++],Me(ne,Rt+Ei,Ye,pi,Te),Ei=ve(Ei,ut)}for(ut=de+1,Ye=2;15>=ut;++ut,Ye<<=1){if(mi+=Yi<<=1,0>(Yi-=qe[ut]))return 0;for(;0<qe[ut];--qe[ut]){if(Te=new J,(Ei&Ft)!=jt){for(Rt+=pi,Pt=1<<(jt=ut)-de;15>jt&&!(0>=(Pt-=qe[jt]));)++jt,Pt<<=1;Ct+=pi=1<<(Pt=jt-de),ne[oe+(jt=Ei&Ft)].g=Pt+de,ne[oe+jt].value=Rt-oe-jt}Te.g=ut-de,Te.value=mt[Ze++],Me(ne,Rt+(Ei>>de),Ye,pi,Te),Ei=ve(Ei,ut)}}return mi!=2*Xe[15]-1?0:Ct}(g,E,P,N,G,ee)}function J(){this.value=this.g=0}function Ee(){this.value=this.g=0}function Fe(){this.G=c(5,J),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=c(ao,Ee)}function $e(g,E,P,N){n(g!=null),n(E!=null),n(2147483648>N),g.Ca=254,g.I=0,g.b=-8,g.Ka=0,g.oa=E,g.pa=P,g.Jd=E,g.Yc=P+N,g.Zc=4<=N?P+N-4+1:P,Ve(g)}function Qe(g,E){for(var P=0;0<E--;)P|=je(g,128)<<E;return P}function ot(g,E){var P=Qe(g,E);return Ge(g)?-P:P}function et(g,E,P,N){var G,ee=0;for(n(g!=null),n(E!=null),n(4294967288>N),g.Sb=N,g.Ra=0,g.u=0,g.h=0,4<N&&(N=4),G=0;G<N;++G)ee+=E[P+G]<<8*G;g.Ra=ee,g.bb=N,g.oa=E,g.pa=P}function gt(g){for(;8<=g.u&&g.bb<g.Sb;)g.Ra>>>=8,g.Ra+=g.oa[g.pa+g.bb]<<Mp-8>>>0,++g.bb,g.u-=8;V(g)&&(g.h=1,g.u=0)}function vt(g,E){if(n(0<=E),!g.h&&E<=kp){var P=Q(g)&Ip[E];return g.u+=E,gt(g),P}return g.h=1,g.u=0}function Kt(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function O(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function Q(g){return g.Ra>>>(g.u&Mp-1)>>>0}function V(g){return n(g.bb<=g.Sb),g.h||g.bb==g.Sb&&g.u>Mp}function Y(g,E){g.u=E,g.h=V(g)}function we(g){g.u>=Qf&&(n(g.u>=Qf),gt(g))}function Ve(g){n(g!=null&&g.oa!=null),g.pa<g.Zc?(g.I=(g.oa[g.pa++]|g.I<<8)>>>0,g.b+=8):(n(g!=null&&g.oa!=null),g.pa<g.Yc?(g.b+=8,g.I=g.oa[g.pa++]|g.I<<8):g.Ka?g.b=0:(g.I<<=8,g.b+=8,g.Ka=1))}function Ge(g){return Qe(g,1)}function je(g,E){var P=g.Ca;0>g.b&&Ve(g);var N=g.b,G=P*E>>>8,ee=(g.I>>>N>G)+0;for(ee?(P-=G,g.I-=G+1<<N>>>0):P=G+1,N=P,G=0;256<=N;)G+=8,N>>=8;return N=7^G+ls[N],g.b-=N,g.Ca=(P<<N)-1,ee}function it(g,E,P){g[E+0]=P>>24&255,g[E+1]=P>>16&255,g[E+2]=P>>8&255,g[E+3]=P>>0&255}function It(g,E){return g[E+0]<<0|g[E+1]<<8}function Nt(g,E){return It(g,E)|g[E+2]<<16}function qt(g,E){return It(g,E)|It(g,E+2)<<16}function ni(g,E){var P=1<<E;return n(g!=null),n(0<E),g.X=a(P),g.X==null?0:(g.Mb=32-E,g.Xa=E,1)}function bt(g,E){n(g!=null),n(E!=null),n(g.Xa==E.Xa),e(E.X,0,g.X,0,1<<E.Xa)}function Ae(){this.X=[],this.Xa=this.Mb=0}function Lt(g,E,P,N){n(P!=null),n(N!=null);var G=P[0],ee=N[0];return G==0&&(G=(g*ee+E/2)/E),ee==0&&(ee=(E*G+g/2)/g),0>=G||0>=ee?0:(P[0]=G,N[0]=ee,1)}function hi(g,E){return g+(1<<E)-1>>>E}function Wt(g,E){return((4278255360&g)+(4278255360&E)>>>0&4278255360)+((16711935&g)+(16711935&E)>>>0&16711935)>>>0}function Xt(g,E){ae[E]=function(P,N,G,ee,ne,oe,de){var Te;for(Te=0;Te<ne;++Te){var Ye=ae[g](oe[de+Te-1],G,ee+Te);oe[de+Te]=Wt(P[N+Te],Ye)}}}function ri(){this.ud=this.hd=this.jd=0}function di(g,E){return((4278124286&(g^E))>>>1)+(g&E)>>>0}function Mi(g){return 0<=g&&256>g?g:0>g?0:255<g?255:void 0}function Li(g,E){return Mi(g+(g-E+.5>>1))}function Ji(g,E,P){return Math.abs(E-P)-Math.abs(g-P)}function ln(g,E,P,N,G,ee,ne){for(N=ee[ne-1],P=0;P<G;++P)ee[ne+P]=N=Wt(g[E+P],N)}function Sn(g,E,P,N,G){var ee;for(ee=0;ee<P;++ee){var ne=g[E+ee],oe=ne>>8&255,de=16711935&(de=(de=16711935&ne)+((oe<<16)+oe));N[G+ee]=(4278255360&ne)+de>>>0}}function wn(g,E){E.jd=g>>0&255,E.hd=g>>8&255,E.ud=g>>16&255}function Zi(g,E,P,N,G,ee){var ne;for(ne=0;ne<N;++ne){var oe=E[P+ne],de=oe>>>8,Te=oe,Ye=255&(Ye=(Ye=oe>>>16)+((g.jd<<24>>24)*(de<<24>>24)>>>5));Te=255&(Te=(Te=Te+((g.hd<<24>>24)*(de<<24>>24)>>>5))+((g.ud<<24>>24)*(Ye<<24>>24)>>>5)),G[ee+ne]=(4278255360&oe)+(Ye<<16)+Te}}function bn(g,E,P,N,G){ae[E]=function(ee,ne,oe,de,Te,Ye,mt,ut,Ze){for(de=mt;de<ut;++de)for(mt=0;mt<Ze;++mt)Te[Ye++]=G(oe[N(ee[ne++])])},ae[g]=function(ee,ne,oe,de,Te,Ye,mt){var ut=8>>ee.b,Ze=ee.Ea,Rt=ee.K[0],Ct=ee.w;if(8>ut)for(ee=(1<<ee.b)-1,Ct=(1<<ut)-1;ne<oe;++ne){var qe,Xe=0;for(qe=0;qe<Ze;++qe)qe&ee||(Xe=N(de[Te++])),Ye[mt++]=G(Rt[Xe&Ct]),Xe>>=ut}else ae["VP8LMapColor"+P](de,Te,Rt,Ct,Ye,mt,ne,oe,Ze)}}function fi(g,E,P,N,G){for(P=E+P;E<P;){var ee=g[E++];N[G++]=ee>>16&255,N[G++]=ee>>8&255,N[G++]=ee>>0&255}}function Aa(g,E,P,N,G){for(P=E+P;E<P;){var ee=g[E++];N[G++]=ee>>16&255,N[G++]=ee>>8&255,N[G++]=ee>>0&255,N[G++]=ee>>24&255}}function Pn(g,E,P,N,G){for(P=E+P;E<P;){var ee=(ne=g[E++])>>16&240|ne>>12&15,ne=ne>>0&240|ne>>28&15;N[G++]=ee,N[G++]=ne}}function as(g,E,P,N,G){for(P=E+P;E<P;){var ee=(ne=g[E++])>>16&248|ne>>13&7,ne=ne>>5&224|ne>>3&31;N[G++]=ee,N[G++]=ne}}function ir(g,E,P,N,G){for(P=E+P;E<P;){var ee=g[E++];N[G++]=ee>>0&255,N[G++]=ee>>8&255,N[G++]=ee>>16&255}}function kr(g,E,P,N,G,ee){if(ee==0)for(P=E+P;E<P;)it(N,((ee=g[E++])[0]>>24|ee[1]>>8&65280|ee[2]<<8&16711680|ee[3]<<24)>>>0),G+=32;else e(N,G,g,E,P)}function ul(g,E){ae[E][0]=ae[g+"0"],ae[E][1]=ae[g+"1"],ae[E][2]=ae[g+"2"],ae[E][3]=ae[g+"3"],ae[E][4]=ae[g+"4"],ae[E][5]=ae[g+"5"],ae[E][6]=ae[g+"6"],ae[E][7]=ae[g+"7"],ae[E][8]=ae[g+"8"],ae[E][9]=ae[g+"9"],ae[E][10]=ae[g+"10"],ae[E][11]=ae[g+"11"],ae[E][12]=ae[g+"12"],ae[E][13]=ae[g+"13"],ae[E][14]=ae[g+"0"],ae[E][15]=ae[g+"0"]}function Ln(g){return g==wx||g==Tx||g==g_||g==Dx}function wc(){this.eb=[],this.size=this.A=this.fb=0}function Fr(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Ws(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new wc,this.f.kb=new Fr,this.sd=null}function Hl(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Cr(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function an(g){return alert("todo:WebPSamplerProcessPlane"),g.T}function Hn(g,E){var P=g.T,N=E.ba.f.RGBA,G=N.eb,ee=N.fb+g.ka*N.A,ne=Sl[E.ba.S],oe=g.y,de=g.O,Te=g.f,Ye=g.N,mt=g.ea,ut=g.W,Ze=E.cc,Rt=E.dc,Ct=E.Mc,qe=E.Nc,Xe=g.ka,Pt=g.ka+g.T,jt=g.U,Ft=jt+1>>1;for(Xe==0?ne(oe,de,null,null,Te,Ye,mt,ut,Te,Ye,mt,ut,G,ee,null,null,jt):(ne(E.ec,E.fc,oe,de,Ze,Rt,Ct,qe,Te,Ye,mt,ut,G,ee-N.A,G,ee,jt),++P);Xe+2<Pt;Xe+=2)Ze=Te,Rt=Ye,Ct=mt,qe=ut,Ye+=g.Rc,ut+=g.Rc,ee+=2*N.A,ne(oe,(de+=2*g.fa)-g.fa,oe,de,Ze,Rt,Ct,qe,Te,Ye,mt,ut,G,ee-N.A,G,ee,jt);return de+=g.fa,g.j+Pt<g.o?(e(E.ec,E.fc,oe,de,jt),e(E.cc,E.dc,Te,Ye,Ft),e(E.Mc,E.Nc,mt,ut,Ft),P--):1&Pt||ne(oe,de,null,null,Te,Ye,mt,ut,Te,Ye,mt,ut,G,ee+N.A,null,null,jt),P}function cd(g,E,P){var N=g.F,G=[g.J];if(N!=null){var ee=g.U,ne=E.ba.S,oe=ne==f_||ne==g_;E=E.ba.f.RGBA;var de=[0],Te=g.ka;de[0]=g.T,g.Kb&&(Te==0?--de[0]:(--Te,G[0]-=g.width),g.j+g.ka+g.T==g.o&&(de[0]=g.o-g.j-Te));var Ye=E.eb;Te=E.fb+Te*E.A,g=Ar(N,G[0],g.width,ee,de,Ye,Te+(oe?0:3),E.A),n(P==de),g&&Ln(ne)&&_l(Ye,Te,oe,ee,de,E.A)}return 0}function Pa(g){var E=g.ma,P=E.ba.S,N=11>P,G=P==p_||P==h_||P==f_||P==Ex||P==12||Ln(P);if(E.memory=null,E.Ib=null,E.Jb=null,E.Nd=null,!Jf(E.Oa,g,G?11:12))return 0;if(G&&Ln(P)&&$t(),g.da)alert("todo:use_scaling");else{if(N){if(E.Ib=an,g.Kb){if(P=g.U+1>>1,E.memory=a(g.U+2*P),E.memory==null)return 0;E.ec=E.memory,E.fc=0,E.cc=E.ec,E.dc=E.fc+g.U,E.Mc=E.cc,E.Nc=E.dc+P,E.Ib=Hn,$t()}}else alert("todo:EmitYUV");G&&(E.Jb=cd,N&&rt())}if(N&&!x3){for(g=0;256>g;++g)OV[g]=89858*(g-128)+__>>v_,BV[g]=-22014*(g-128)+__,LV[g]=-45773*(g-128),NV[g]=113618*(g-128)+__>>v_;for(g=og;g<Mx;++g)E=76283*(g-16)+__>>v_,VV[g-og]=$s(E,255),UV[g-og]=$s(E+8>>4,15);x3=1}return 1}function pl(g){var E=g.ma,P=g.U,N=g.T;
vendor: 4,160 bytes, line 126
126return n(!(1&g.ka)),0>=P||0>=N?0:(P=E.Ib(g,E),E.Jb!=null&&E.Jb(g,E,P),E.Dc+=P,1)}function hl(g){g.ma.memory=null}function zi(g,E,P,N){return vt(g,8)!=47?0:(E[0]=vt(g,14)+1,P[0]=vt(g,14)+1,N[0]=vt(g,1),vt(g,3)!=0?0:!g.h)}function Hs(g,E){if(4>g)return g+1;var P=g-2>>1;return(2+(1&g)<<P)+vt(E,P)+1}function os(g,E){return 120<E?E-120:1<=(P=((P=bV[E-1])>>4)*g+(8-(15&P)))?P:1;var P}function yo(g,E,P){var N=Q(P),G=g[E+=255&N].g-8;return 0<G&&(Y(P,P.u+8),N=Q(P),E+=g[E].value,E+=N&(1<<G)-1),Y(P,P.u+g[E].g),g[E].value}function oa(g,E,P){return P.g+=g.g,P.value+=g.value<<E>>>0,n(8>=P.g),g.g}function Xr(g,E,P){var N=g.xc;return n((E=N==0?0:g.vc[g.md*(P>>N)+(E>>N)])<g.Wb),g.Ya[E]}function ie(g,E,P,N){var G=g.ab,ee=g.c*E,ne=g.C;E=ne+E;var oe=P,de=N;for(N=g.Ta,P=g.Ua;0<G--;){var Te=g.gc[G],Ye=ne,mt=E,ut=oe,Ze=de,Rt=(de=N,oe=P,Te.Ea);switch(n(Ye<mt),n(mt<=Te.nc),Te.hc){case 2:o_(ut,Ze,(mt-Ye)*Rt,de,oe);break;case 0:var Ct=Ye,qe=mt,Xe=de,Pt=oe,jt=(pi=Te).Ea;Ct==0&&(xx(ut,Ze,null,null,1,Xe,Pt),ln(ut,Ze+1,0,0,jt-1,Xe,Pt+1),Ze+=jt,Pt+=jt,++Ct);for(var Ft=1<<pi.b,Ei=Ft-1,mi=hi(jt,pi.b),Yi=pi.K,pi=pi.w+(Ct>>pi.b)*mi;Ct<qe;){var Yn=Yi,or=pi,Bn=1;for(eg(ut,Ze,Xe,Pt-jt,1,Xe,Pt);Bn<jt;){var Mn=(Bn&~Ei)+Ft;Mn>jt&&(Mn=jt),(0,dm[Yn[or++]>>8&15])(ut,Ze+ +Bn,Xe,Pt+Bn-jt,Mn-Bn,Xe,Pt+Bn),Bn=Mn}Ze+=jt,Pt+=jt,++Ct&Ei||(pi+=mi)}mt!=Te.nc&&e(de,oe-Rt,de,oe+(mt-Ye-1)*Rt,Rt);break;case 1:for(Rt=ut,qe=Ze,jt=(ut=Te.Ea)-(Pt=ut&~(Xe=(Ze=1<<Te.b)-1)),Ct=hi(ut,Te.b),Ft=Te.K,Te=Te.w+(Ye>>Te.b)*Ct;Ye<mt;){for(Ei=Ft,mi=Te,Yi=new ri,pi=qe+Pt,Yn=qe+ut;qe<pi;)wn(Ei[mi++],Yi),Eu(Yi,Rt,qe,Ze,de,oe),qe+=Ze,oe+=Ze;qe<Yn&&(wn(Ei[mi++],Yi),Eu(Yi,Rt,qe,jt,de,oe),qe+=jt,oe+=jt),++Ye&Xe||(Te+=Ct)}break;case 3:if(ut==de&&Ze==oe&&0<Te.b){for(qe=de,ut=Rt=oe+(mt-Ye)*Rt-(Pt=(mt-Ye)*hi(Te.Ea,Te.b)),Ze=de,Xe=oe,Ct=[],Pt=(jt=Pt)-1;0<=Pt;--Pt)Ct[Pt]=Ze[Xe+Pt];for(Pt=jt-1;0<=Pt;--Pt)qe[ut+Pt]=Ct[Pt];fl(Te,Ye,mt,de,Rt,de,oe)}else fl(Te,Ye,mt,ut,Ze,de,oe)}oe=N,de=P}de!=P&&e(N,P,oe,de,ee)}function Ie(g,E){var P=g.V,N=g.Ba+g.c*g.C,G=E-g.C;if(n(E<=g.l.o),n(16>=G),0<G){var ee=g.l,ne=g.Ta,oe=g.Ua,de=ee.width;if(ie(g,G,P,N),G=oe=[oe],n((P=g.C)<(N=E)),n(ee.v<ee.va),N>ee.o&&(N=ee.o),P<ee.j){var Te=ee.j-P;P=ee.j,G[0]+=Te*de}if(P>=N?P=0:(G[0]+=4*ee.v,ee.ka=P-ee.j,ee.U=ee.va-ee.v,ee.T=N-P,P=1),P){if(oe=oe[0],11>(P=g.ca).S){var Ye=P.f.RGBA,mt=(N=P.S,G=ee.U,ee=ee.T,Te=Ye.eb,Ye.A),ut=ee;for(Ye=Ye.fb+g.Ma*Ye.A;0<ut--;){var Ze=ne,Rt=oe,Ct=G,qe=Te,Xe=Ye;switch(N){case u_:cs(Ze,Rt,Ct,qe,Xe);break;case p_:jo(Ze,Rt,Ct,qe,Xe);break;case wx:jo(Ze,Rt,Ct,qe,Xe),_l(qe,Xe,0,Ct,1,0);break;case u3:hd(Ze,Rt,Ct,qe,Xe);break;case h_:kr(Ze,Rt,Ct,qe,Xe,1);break;case Tx:kr(Ze,Rt,Ct,qe,Xe,1),_l(qe,Xe,0,Ct,1,0);break;case f_:kr(Ze,Rt,Ct,qe,Xe,0);break;case g_:kr(Ze,Rt,Ct,qe,Xe,0),_l(qe,Xe,1,Ct,1,0);break;case Ex:mm(Ze,Rt,Ct,qe,Xe);break;case Dx:mm(Ze,Rt,Ct,qe,Xe),Mr(qe,Xe,Ct,1,0);break;case p3:pd(Ze,Rt,Ct,qe,Xe);break;default:n(0)}oe+=de,Ye+=mt}g.Ma+=ee}else alert("todo:EmitRescaledRowsYUVA");n(g.Ma<=P.height)}}g.C=E,n(g.C<=g.i)}function ge(g){var E;if(0<g.ua)return 0;for(E=0;E<g.Wb;++E){var P=g.Ya[E].G,N=g.Ya[E].H;if(0<P[1][N[1]+0].g||0<P[2][N[2]+0].g||0<P[3][N[3]+0].g)return 0}return 1}function be(g,E,P,N,G,ee){if(g.Z!=0){var ne=g.qd,oe=g.rd;for(n(fm[g.Z]!=null);E<P;++E)fm[g.Z](ne,oe,N,G,N,G,ee),ne=N,oe=G,G+=ee;g.qd=ne,g.rd=oe}}function De(g,E){var P=g.l.ma,N=P.Z==0||P.Z==1?g.l.j:g.C;if(N=g.C<N?N:g.C,n(E<=g.l.o),E>N){var G=g.l.width,ee=P.ca,ne=P.tb+G*N,oe=g.V,de=g.Ba+g.c*N,Te=g.gc;n(g.ab==1),n(Te[0].hc==3),s_(Te[0],N,E,oe,de,ee,ne),be(P,N,E,ee,ne,G)}g.C=g.Ma=E}function ke(g,E,P,N,G,ee,ne){var oe=g.$/N,de=g.$%N,Te=g.m,Ye=g.s,mt=P+g.$,ut=mt;G=P+N*G;var Ze=P+N*ee,Rt=280+Ye.ua,Ct=g.Pb?oe:16777216,qe=0<Ye.ua?Ye.Wa:null,Xe=Ye.wc,Pt=mt<Ze?Xr(Ye,de,oe):null;n(g.C<ee),n(Ze<=G);var jt=!1;e:for(;;){for(;jt||mt<Ze;){var Ft=0;if(oe>=Ct){var Ei=mt-P;n((Ct=g).Pb),Ct.wd=Ct.m,Ct.xd=Ei,0<Ct.s.ua&&bt(Ct.s.Wa,Ct.s.vb),Ct=oe+CV}if(de&Xe||(Pt=Xr(Ye,de,oe)),n(Pt!=null),Pt.Qb&&(E[mt]=Pt.qb,jt=!0),!jt)if(we(Te),Pt.jc){Ft=Te,Ei=E;var mi=mt,Yi=Pt.pd[Q(Ft)&ao-1];n(Pt.jc),256>Yi.g?(Y(Ft,Ft.u+Yi.g),Ei[mi]=Yi.value,Ft=0):(Y(Ft,Ft.u+Yi.g-256),n(256<=Yi.value),Ft=Yi.value),Ft==0&&(jt=!0)}else Ft=yo(Pt.G[0],Pt.H[0],Te);
vendor: 24,464 bytes, line 126
126if(Te.h)break;if(jt||256>Ft){if(!jt)if(Pt.nd)E[mt]=(Pt.qb|Ft<<8)>>>0;else{if(we(Te),jt=yo(Pt.G[1],Pt.H[1],Te),we(Te),Ei=yo(Pt.G[2],Pt.H[2],Te),mi=yo(Pt.G[3],Pt.H[3],Te),Te.h)break;E[mt]=(mi<<24|jt<<16|Ft<<8|Ei)>>>0}if(jt=!1,++mt,++de>=N&&(de=0,++oe,ne!=null&&oe<=ee&&!(oe%16)&&ne(g,oe),qe!=null))for(;ut<mt;)Ft=E[ut++],qe.X[(506832829*Ft&4294967295)>>>qe.Mb]=Ft}else if(280>Ft){if(Ft=Hs(Ft-256,Te),Ei=yo(Pt.G[4],Pt.H[4],Te),we(Te),Ei=os(N,Ei=Hs(Ei,Te)),Te.h)break;if(mt-P<Ei||G-mt<Ft)break e;for(mi=0;mi<Ft;++mi)E[mt+mi]=E[mt+mi-Ei];for(mt+=Ft,de+=Ft;de>=N;)de-=N,++oe,ne!=null&&oe<=ee&&!(oe%16)&&ne(g,oe);if(n(mt<=G),de&Xe&&(Pt=Xr(Ye,de,oe)),qe!=null)for(;ut<mt;)Ft=E[ut++],qe.X[(506832829*Ft&4294967295)>>>qe.Mb]=Ft}else{if(!(Ft<Rt))break e;for(jt=Ft-280,n(qe!=null);ut<mt;)Ft=E[ut++],qe.X[(506832829*Ft&4294967295)>>>qe.Mb]=Ft;Ft=mt,n(!(jt>>>(Ei=qe).Xa)),E[Ft]=Ei.X[jt],jt=!0}jt||n(Te.h==V(Te))}if(g.Pb&&Te.h&&mt<G)n(g.m.h),g.a=5,g.m=g.wd,g.$=g.xd,0<g.s.ua&&bt(g.s.vb,g.s.Wa);else{if(Te.h)break e;ne?.(g,oe>ee?ee:oe),g.a=0,g.$=mt-P}return 1}return g.a=3,0}function lt(g){n(g!=null),g.vc=null,g.yc=null,g.Ya=null;var E=g.Wa;E!=null&&(E.X=null),g.vb=null,n(g!=null)}function xt(){var g=new bx;return g==null?null:(g.a=0,g.xb=g3,ul("Predictor","VP8LPredictors"),ul("Predictor","VP8LPredictors_C"),ul("PredictorAdd","VP8LPredictorsAdd"),ul("PredictorAdd","VP8LPredictorsAdd_C"),o_=Sn,Eu=Zi,cs=fi,jo=Aa,mm=Pn,pd=as,hd=ir,ae.VP8LMapColor32b=Ap,ae.VP8LMapColor8b=l_,g)}function dt(g,E,P,N,G){var ee=1,ne=[g],oe=[E],de=N.m,Te=N.s,Ye=null,mt=0;e:for(;;){if(P)for(;ee&&vt(de,1);){var ut=ne,Ze=oe,Rt=N,Ct=1,qe=Rt.m,Xe=Rt.gc[Rt.ab],Pt=vt(qe,2);if(Rt.Oc&1<<Pt)ee=0;else{switch(Rt.Oc|=1<<Pt,Xe.hc=Pt,Xe.Ea=ut[0],Xe.nc=Ze[0],Xe.K=[null],++Rt.ab,n(4>=Rt.ab),Pt){case 0:case 1:Xe.b=vt(qe,3)+2,Ct=dt(hi(Xe.Ea,Xe.b),hi(Xe.nc,Xe.b),0,Rt,Xe.K),Xe.K=Xe.K[0];break;case 3:var jt,Ft=vt(qe,8)+1,Ei=16<Ft?0:4<Ft?1:2<Ft?2:3;if(ut[0]=hi(Xe.Ea,Ei),Xe.b=Ei,jt=Ct=dt(Ft,1,0,Rt,Xe.K)){var mi,Yi=Ft,pi=Xe,Yn=1<<(8>>pi.b),or=a(Yn);if(or==null)jt=0;else{var Bn=pi.K[0],Mn=pi.w;for(or[0]=pi.K[0][0],mi=1;mi<1*Yi;++mi)or[mi]=Wt(Bn[Mn+mi],or[mi-1]);for(;mi<4*Yn;++mi)or[mi]=0;pi.K[0]=null,pi.K[0]=or,jt=1}}Ct=jt;break;case 2:break;default:n(0)}ee=Ct}}if(ne=ne[0],oe=oe[0],ee&&vt(de,1)&&!(ee=1<=(mt=vt(de,4))&&11>=mt)){N.a=3;break e}var Er;if(Er=ee)t:{var hr,_n,_a,ds=N,ya=ne,ms=oe,sr=mt,Ys=P,qs=ds.m,Ga=ds.s,oo=[null],Ho=1,bl=0,Ac=xV[sr];i:for(;;){if(Ys&&vt(qs,1)){var $a=vt(qs,3)+2,_d=hi(ya,$a),ku=hi(ms,$a),Np=_d*ku;if(!dt(_d,ku,0,ds,oo))break i;for(oo=oo[0],Ga.xc=$a,hr=0;hr<Np;++hr){var gm=oo[hr]>>8&65535;oo[hr]=gm,gm>=Ho&&(Ho=gm+1)}}if(qs.h)break i;for(_n=0;5>_n;++_n){var Zr=h3[_n];!_n&&0<sr&&(Zr+=1<<sr),bl<Zr&&(bl=Zr)}var Ax=c(Ho*Ac,J),w3=Ho,T3=c(w3,Fe);if(T3==null)var S_=null;else n(65536>=w3),S_=T3;var sg=a(bl);if(S_==null||sg==null||Ax==null){ds.a=1;break i}var b_=Ax;for(hr=_a=0;hr<Ho;++hr){var Kl=S_[hr],Lp=Kl.G,Bp=Kl.H,D3=0,x_=1,I3=0;for(_n=0;5>_n;++_n){Zr=h3[_n],Lp[_n]=b_,Bp[_n]=_a,!_n&&0<sr&&(Zr+=1<<sr);r:{var C_,Px=Zr,E_=ds,lg=sg,HV=b_,GV=_a,Fx=0,vm=E_.m,$V=vt(vm,1);if(r(lg,0,0,Px),$V){var zV=vt(vm,1)+1,YV=vt(vm,1),k3=vt(vm,YV==0?1:8);lg[k3]=1,zV==2&&(lg[k3=vt(vm,8)]=1);var w_=1}else{var M3=a(19),A3=vt(vm,4)+4;if(19<A3){E_.a=3;var T_=0;break r}for(C_=0;C_<A3;++C_)M3[SV[C_]]=vt(vm,3);var Rx=void 0,cg=void 0,P3=E_,qV=M3,D_=Px,F3=lg,Ox=0,_m=P3.m,R3=8,O3=c(128,J);n:for(;W(O3,0,7,qV,19);){if(vt(_m,1)){var KV=2+2*vt(_m,3);if((Rx=2+vt(_m,KV))>D_)break n}else Rx=D_;for(cg=0;cg<D_&&Rx--;){we(_m);var N3=O3[0+(127&Q(_m))];Y(_m,_m.u+N3.g);var Vp=N3.value;if(16>Vp)F3[cg++]=Vp,Vp!=0&&(R3=Vp);else{var XV=Vp==16,L3=Vp-16,JV=_V[L3],B3=vt(_m,vV[L3])+JV;if(cg+B3>D_)break n;for(var ZV=XV?R3:0;0<B3--;)F3[cg++]=ZV}}Ox=1;break n}Ox||(P3.a=3),w_=Ox}(w_=w_&&!vm.h)&&(Fx=W(HV,GV,8,lg,Px)),w_&&Fx!=0?T_=Fx:(E_.a=3,T_=0)}if(T_==0)break i;if(x_&&yV[_n]==1&&(x_=b_[_a].g==0),D3+=b_[_a].g,_a+=T_,3>=_n){var dg,Nx=sg[0];for(dg=1;dg<Zr;++dg)sg[dg]>Nx&&(Nx=sg[dg]);I3+=Nx}}if(Kl.nd=x_,Kl.Qb=0,x_&&(Kl.qb=(Lp[3][Bp[3]+0].value<<24|Lp[1][Bp[1]+0].value<<16|Lp[2][Bp[2]+0].value)>>>0,D3==0&&256>Lp[0][Bp[0]+0].value&&(Kl.Qb=1,Kl.qb+=Lp[0][Bp[0]+0].value<<8)),Kl.jc=!Kl.Qb&&6>I3,Kl.jc){var I_,yd=Kl;for(I_=0;I_<ao;++I_){var ym=I_,Sm=yd.pd[ym],k_=yd.G[0][yd.H[0]+ym];256<=k_.value?(Sm.g=k_.g+256,Sm.value=k_.value):(Sm.g=0,Sm.value=0,ym>>=oa(k_,8,Sm),ym>>=oa(yd.G[1][yd.H[1]+ym],16,Sm),ym>>=oa(yd.G[2][yd.H[2]+ym],0,Sm),oa(yd.G[3][yd.H[3]+ym],24,Sm))}}}Ga.vc=oo,Ga.Wb=Ho,Ga.Ya=S_,Ga.yc=Ax,Er=1;break t}Er=0}if(!(ee=Er)){N.a=3;break e}if(0<mt){if(Te.ua=1<<mt,!ni(Te.Wa,mt)){N.a=1,ee=0;break e}}else Te.ua=0;var Lx=N,V3=ne,QV=oe,Bx=Lx.s,Vx=Bx.xc;if(Lx.c=V3,Lx.i=QV,Bx.md=hi(V3,Vx),Bx.wc=Vx==0?-1:(1<<Vx)-1,P){N.xb=MV;break e}if((Ye=a(ne*oe))==null){N.a=1,ee=0;break e}ee=(ee=ke(N,Ye,0,ne,oe,oe,null))&&!de.h;break e}return ee?(G!=null?G[0]=Ye:(n(Ye==null),n(P)),N.$=0,P||lt(Te)):lt(Te),ee}function ft(g,E){var P=g.c*g.i,N=P+E+16*E;return n(g.c<=E),g.V=a(N),g.V==null?(g.Ta=null,g.Ua=0,g.a=1,0):(g.Ta=g.V,g.Ua=g.Ba+P+E,1)}function yt(g,E){var P=g.C,N=E-P,G=g.V,ee=g.Ba+g.c*P;for(n(E<=g.l.o);0<N;){var ne=16<N?16:N,oe=g.l.ma,de=g.l.width,Te=de*ne,Ye=oe.ca,mt=oe.tb+de*P,ut=g.Ta,Ze=g.Ua;ie(g,ne,G,ee),ca(ut,Ze,Ye,mt,Te),be(oe,P,P+ne,Ye,mt,de),N-=ne,G+=ne*g.c,P+=ne}n(P==E),g.C=g.Ma=E}function zt(){this.ub=this.yd=this.td=this.Rb=0}function ei(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function bi(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function ti(){this.Yb=function(){var g=[];return function E(P,N,G){for(var ee=G[N],ne=0;ne<ee&&(P.push(G.length>N+1?[]:0),!(G.length<N+1));ne++)E(P[ne],N+1,G)}(g,0,[3,11]),g}()}function li(){this.jb=a(3),this.Wc=d([4,8],ti),this.Xc=d([4,17],ti)}function nn(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Gn(){this.ld=this.La=this.dd=this.tc=0}function Fa(){this.Na=this.la=0}function Br(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ra(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function dd(){this.uc=this.M=this.Nb=0,this.wa=Array(new Gn),this.Y=0,this.ya=Array(new Ra),this.aa=0,this.l=new Dc}function Tc(){this.y=a(16),this.f=a(8),this.ea=a(8)}function Gl(){this.cb=this.a=0,this.sc="",this.m=new Kt,this.Od=new zt,this.Kc=new ei,this.ed=new nn,this.Qa=new bi,this.Ic=this.$c=this.Aa=0,this.D=new dd,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=c(8,Kt),this.ia=0,this.pb=c(4,Br),this.Pa=new li,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Tc),this.Hd=0,this.rb=Array(new Fa),this.sb=0,this.wa=Array(new Gn),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ra),this.L=this.aa=0,this.gd=d([4,2],Gn),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Dc(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Gs(){var g=new Gl;return g!=null&&(g.a=0,g.sc="OK",g.cb=0,g.Xb=0,ag||(ag=$v)),g}function sa(g,E,P){return g.a==0&&(g.a=E,g.sc=P,g.cb=0),0}function Hv(g,E,P){return 3<=P&&g[E+0]==157&&g[E+1]==1&&g[E+2]==42}function Gv(g,E){if(g==null)return 0;if(g.a=0,g.sc="OK",E==null)return sa(g,2,"null VP8Io passed to VP8GetHeaders()");var P=E.data,N=E.w,G=E.ha;if(4>G)return sa(g,7,"Truncated header.");var ee=P[N+0]|P[N+1]<<8|P[N+2]<<16,ne=g.Od;if(ne.Rb=!(1&ee),ne.td=ee>>1&7,ne.yd=ee>>4&1,ne.ub=ee>>5,3<ne.td)return sa(g,3,"Incorrect keyframe parameters.");if(!ne.yd)return sa(g,4,"Frame not displayable.");N+=3,G-=3;var oe=g.Kc;if(ne.Rb){if(7>G)return sa(g,7,"cannot parse picture header");if(!Hv(P,N,G))return sa(g,3,"Bad code word");oe.c=16383&(P[N+4]<<8|P[N+3]),oe.Td=P[N+4]>>6,oe.i=16383&(P[N+6]<<8|P[N+5]),oe.Ud=P[N+6]>>6,N+=7,G-=7,g.za=oe.c+15>>4,g.Ub=oe.i+15>>4,E.width=oe.c,E.height=oe.i,E.Da=0,E.j=0,E.v=0,E.va=E.width,E.o=E.height,E.da=0,E.ib=E.width,E.hb=E.height,E.U=E.width,E.T=E.height,r((ee=g.Pa).jb,0,255,ee.jb.length),n((ee=g.Qa)!=null),ee.Cb=0,ee.Bb=0,ee.Fb=1,r(ee.Zb,0,0,ee.Zb.length),r(ee.Lb,0,0,ee.Lb)}if(ne.ub>G)return sa(g,7,"bad partition length");$e(ee=g.m,P,N,ne.ub),N+=ne.ub,G-=ne.ub,ne.Rb&&(oe.Ld=Ge(ee),oe.Kd=Ge(ee)),oe=g.Qa;var de,Te=g.Pa;if(n(ee!=null),n(oe!=null),oe.Cb=Ge(ee),oe.Cb){if(oe.Bb=Ge(ee),Ge(ee)){for(oe.Fb=Ge(ee),de=0;4>de;++de)oe.Zb[de]=Ge(ee)?ot(ee,7):0;for(de=0;4>de;++de)oe.Lb[de]=Ge(ee)?ot(ee,6):0}if(oe.Bb)for(de=0;3>de;++de)Te.jb[de]=Ge(ee)?Qe(ee,8):255}else oe.Bb=0;if(ee.Ka)return sa(g,3,"cannot parse segment header");if((oe=g.ed).zd=Ge(ee),oe.Tb=Qe(ee,6),oe.wb=Qe(ee,3),oe.Pc=Ge(ee),oe.Pc&&Ge(ee)){for(Te=0;4>Te;++Te)Ge(ee)&&(oe.vd[Te]=ot(ee,6));for(Te=0;4>Te;++Te)Ge(ee)&&(oe.od[Te]=ot(ee,6))}if(g.L=oe.Tb==0?0:oe.zd?1:2,ee.Ka)return sa(g,3,"cannot parse filter header");var Ye=G;if(G=de=N,N=de+Ye,oe=Ye,g.Xb=(1<<Qe(g.m,2))-1,Ye<3*(Te=g.Xb))P=7;else{for(de+=3*Te,oe-=3*Te,Ye=0;Ye<Te;++Ye){var mt=P[G+0]|P[G+1]<<8|P[G+2]<<16;mt>oe&&(mt=oe),$e(g.Jc[+Ye],P,de,mt),de+=mt,oe-=mt,G+=3}$e(g.Jc[+Te],P,de,oe),P=de<N?0:5}if(P!=0)return sa(g,P,"cannot parse partitions");for(P=Qe(de=g.m,7),G=Ge(de)?ot(de,4):0,N=Ge(de)?ot(de,4):0,oe=Ge(de)?ot(de,4):0,Te=Ge(de)?ot(de,4):0,de=Ge(de)?ot(de,4):0,Ye=g.Qa,mt=0;4>mt;++mt){if(Ye.Cb){var ut=Ye.Zb[mt];Ye.Fb||(ut+=P)}else{if(0<mt){g.pb[mt]=g.pb[0];continue}ut=P}var Ze=g.pb[mt];Ze.Sc[0]=Ix[$s(ut+G,127)],Ze.Sc[1]=kx[$s(ut+0,127)],Ze.Eb[0]=2*Ix[$s(ut+N,127)],Ze.Eb[1]=101581*kx[$s(ut+oe,127)]>>16,8>Ze.Eb[1]&&(Ze.Eb[1]=8),Ze.Qc[0]=Ix[$s(ut+Te,117)],Ze.Qc[1]=kx[$s(ut+de,127)],Ze.lc=ut+de}if(!ne.Rb)return sa(g,4,"Not a key frame.");for(Ge(ee),ne=g.Pa,P=0;4>P;++P){for(G=0;8>G;++G)for(N=0;3>N;++N)for(oe=0;11>oe;++oe)Te=je(ee,IV[P][G][N][oe])?Qe(ee,8):TV[P][G][N][oe],ne.Wc[P][G].Yb[N][oe]=Te;for(G=0;17>G;++G)ne.Xc[P][G]=ne.Wc[P][kV[G]]}return g.kc=Ge(ee),g.kc&&(g.Bd=Qe(ee,8)),g.cb=1}function $v(g,E,P,N,G,ee,ne){var oe=E[G].Yb[P];for(P=0;16>G;++G){if(!je(g,oe[P+0]))return G;for(;!je(g,oe[P+1]);)if(oe=E[++G].Yb[0],P=0,G==16)return 16;var de=E[G+1].Yb;if(je(g,oe[P+2])){var Te=g,Ye=0;if(je(Te,(ut=oe)[(mt=P)+3]))if(je(Te,ut[mt+6])){for(oe=0,mt=2*(Ye=je(Te,ut[mt+8]))+(ut=je(Te,ut[mt+9+Ye])),Ye=0,ut=EV[mt];ut[oe];++oe)Ye+=Ye+je(Te,ut[oe]);Ye+=3+(8<<mt)}else je(Te,ut[mt+7])?(Ye=7+2*je(Te,165),Ye+=je(Te,145)):Ye=5+je(Te,159);else Ye=je(Te,ut[mt+4])?3+je(Te,ut[mt+5]):2;oe=de[2]}else Ye=1,oe=de[1];de=ne+wV[G],0>(Te=g).b&&Ve(Te);var mt,ut=Te.b,Ze=(mt=Te.Ca>>1)-(Te.I>>ut)>>31;--Te.b,Te.Ca+=Ze,Te.Ca|=1,Te.I-=(mt+1&Ze)<<ut,ee[de]=((Ye^Ze)-Ze)*N[(0<G)+0]}return 16}function Nf(g){var E=g.rb[g.sb-1];E.la=0,E.Na=0,r(g.zc,0,0,g.zc.length),g.ja=0}function rx(g,E){if(g==null)return 0;if(E==null)return sa(g,2,"NULL VP8Io parameter in VP8Decode().");if(!g.cb&&!Gv(g,E))return 0;if(n(g.cb),E.ac==null||E.ac(E)){E.ob&&(g.L=0);var P=y_[g.L];if(g.L==2?(g.yb=0,g.zb=0):(g.yb=E.v-P>>4,g.zb=E.j-P>>4,0>g.yb&&(g.yb=0),0>g.zb&&(g.zb=0)),g.Va=E.o+15+P>>4,g.Hb=E.va+15+P>>4,g.Hb>g.za&&(g.Hb=g.za),g.Va>g.Ub&&(g.Va=g.Ub),0<g.L){var N=g.ed;for(P=0;4>P;++P){var G;if(g.Qa.Cb){var ee=g.Qa.Lb[P];g.Qa.Fb||(ee+=N.Tb)}else ee=N.Tb;for(G=0;1>=G;++G){var ne=g.gd[P][G],oe=ee;if(N.Pc&&(oe+=N.vd[0],G&&(oe+=N.od[0])),0<(oe=0>oe?0:63<oe?63:oe)){var de=oe;0<N.wb&&(de=4<N.wb?de>>2:de>>1)>9-N.wb&&(de=9-N.wb),1>de&&(de=1),ne.dd=de,ne.tc=2*oe+de,ne.ld=40<=oe?2:15<=oe?1:0}else ne.tc=0;ne.La=G}}}P=0}else sa(g,6,"Frame setup failed"),P=g.a;if(P=P==0){if(P){g.$c=0,0<g.Aa||(g.Ic=WV);e:{P=g.Ic,N=4*(de=g.za);var Te=32*de,Ye=de+1,mt=0<g.L?de*(0<g.Aa?2:1):0,ut=(g.Aa==2?2:1)*de;if((ne=N+832+(G=3*(16*P+y_[g.L])/2*Te)+(ee=g.Fa!=null&&0<g.Fa.length?g.Kc.c*g.Kc.i:0))!=ne)P=0;else{if(ne>g.Vb){if(g.Vb=0,g.Ec=a(ne),g.Fc=0,g.Ec==null){P=sa(g,1,"no memory during frame initialization.");break e}g.Vb=ne}ne=g.Ec,oe=g.Fc,g.Ac=ne,g.Bc=oe,oe+=N,g.Gd=c(Te,Tc),g.Hd=0,g.rb=c(Ye+1,Fa),g.sb=1,g.wa=mt?c(mt,Gn):null,g.Y=0,g.D.Nb=0,g.D.wa=g.wa,g.D.Y=g.Y,0<g.Aa&&(g.D.Y+=de),n(!0),g.oc=ne,g.pc=oe,oe+=832,g.ya=c(ut,Ra),g.aa=0,g.D.ya=g.ya,g.D.aa=g.aa,g.Aa==2&&(g.D.aa+=de),g.R=16*de,g.B=8*de,de=(Te=y_[g.L])*g.R,Te=Te/2*g.B,g.sa=ne,g.ta=oe+de,g.qa=g.sa,g.ra=g.ta+16*P*g.R+Te,g.Ha=g.qa,g.Ia=g.ra+8*P*g.B+Te,g.$c=0,oe+=G,g.mb=ee?ne:null,g.nb=ee?oe:null,n(oe+ee<=g.Fc+g.Vb),Nf(g),r(g.Ac,g.Bc,0,N),P=1}}if(P){if(E.ka=0,E.y=g.sa,E.O=g.ta,E.f=g.qa,E.N=g.ra,E.ea=g.Ha,E.Vd=g.Ia,E.fa=g.R,E.Rc=g.B,E.F=null,E.J=0,!d_){for(P=-255;255>=P;++P)Oa[255+P]=0>P?-P:P;for(P=-1020;1020>=P;++P)gd[1020+P]=-128>P?-128:127<P?127:P;for(P=-112;112>=P;++P)rg[112+P]=-16>P?-16:15<P?15:P;for(P=-255;510>=P;++P)Op[255+P]=0>P?0:255<P?255:P;d_=1}Pp=sx,fd=ax,tg=Yv,Wo=ox,gl=qv,la=zv,Fp=Wf,c_=xu,ig=Sx,wu=Hf,Tu=yx,um=Cp,Du=Gf,Rp=n_,Iu=i_,pm=kc,ng=ud,vl=_x,ql[0]=Ic,ql[1]=lx,ql[2]=ux,ql[3]=px,ql[4]=Jv,ql[5]=bp,ql[6]=Zv,ql[7]=Vf,ql[8]=fx,ql[9]=hx,hm[0]=Kv,hm[1]=dx,hm[2]=md,hm[3]=yp,hm[4]=So,hm[5]=mx,hm[6]=Xv,vd[0]=sm,vd[1]=cx,vd[2]=gx,vd[3]=Uf,vd[4]=bu,vd[5]=vx,vd[6]=jf,P=1}else P=0}P&&(P=function(Ze,Rt){for(Ze.M=0;Ze.M<Ze.Va;++Ze.M){var Ct,qe=Ze.Jc[Ze.M&Ze.Xb],Xe=Ze.m,Pt=Ze;for(Ct=0;Ct<Pt.za;++Ct){var jt=Xe,Ft=Pt,Ei=Ft.Ac,mi=Ft.Bc+4*Ct,Yi=Ft.zc,pi=Ft.ya[Ft.aa+Ct];if(Ft.Qa.Bb?pi.$b=je(jt,Ft.Pa.jb[0])?2+je(jt,Ft.Pa.jb[2]):je(jt,Ft.Pa.jb[1]):pi.$b=0,Ft.kc&&(pi.Ad=je(jt,Ft.Bd)),pi.Za=!je(jt,145)+0,pi.Za){var Yn=pi.Ob,or=0;for(Ft=0;4>Ft;++Ft){var Bn,Mn=Yi[0+Ft];for(Bn=0;4>Bn;++Bn){Mn=DV[Ei[mi+Bn]][Mn];for(var Er=f3[je(jt,Mn[0])];0<Er;)Er=f3[2*Er+je(jt,Mn[Er])];Mn=-Er,Ei[mi+Bn]=Mn}e(Yn,or,Ei,mi,4),or+=4,Yi[0+Ft]=Mn}}else Mn=je(jt,156)?je(jt,128)?1:3:je(jt,163)?2:0,pi.Ob[0]=Mn,r(Ei,mi,Mn,4),r(Yi,0,Mn,4);pi.Dd=je(jt,142)?je(jt,114)?je(jt,183)?1:3:2:0}if(Pt.m.Ka)return sa(Ze,7,"Premature end-of-partition0 encountered.");for(;Ze.ja<Ze.za;++Ze.ja){if(Pt=qe,jt=(Xe=Ze).rb[Xe.sb-1],Ei=Xe.rb[Xe.sb+Xe.ja],Ct=Xe.ya[Xe.aa+Xe.ja],mi=Xe.kc?Ct.Ad:0)jt.la=Ei.la=0,Ct.Za||(jt.Na=Ei.Na=0),Ct.Hc=0,Ct.Gc=0,Ct.ia=0;else{var hr,_n;if(jt=Ei,Ei=Pt,mi=Xe.Pa.Xc,Yi=Xe.ya[Xe.aa+Xe.ja],pi=Xe.pb[Yi.$b],Ft=Yi.ad,Yn=0,or=Xe.rb[Xe.sb-1],Mn=Bn=0,r(Ft,Yn,0,384),Yi.Za)var _a=0,ds=mi[3];else{Er=a(16);var ya=jt.Na+or.Na;if(ya=ag(Ei,mi[1],ya,pi.Eb,0,Er,0),jt.Na=or.Na=(0<ya)+0,1<ya)Pp(Er,0,Ft,Yn);else{var ms=Er[0]+3>>3;for(Er=0;256>Er;Er+=16)Ft[Yn+Er]=ms}_a=1,ds=mi[0]}var sr=15&jt.la,Ys=15&or.la;for(Er=0;4>Er;++Er){var qs=1&Ys;for(ms=_n=0;4>ms;++ms)sr=sr>>1|(qs=(ya=ag(Ei,ds,ya=qs+(1&sr),pi.Sc,_a,Ft,Yn))>_a)<<7,_n=_n<<2|(3<ya?3:1<ya?2:Ft[Yn+0]!=0),Yn+=16;sr>>=4,Ys=Ys>>1|qs<<7,Bn=(Bn<<8|_n)>>>0}for(ds=sr,_a=Ys>>4,hr=0;4>hr;hr+=2){for(_n=0,sr=jt.la>>4+hr,Ys=or.la>>4+hr,Er=0;2>Er;++Er){for(qs=1&Ys,ms=0;2>ms;++ms)ya=qs+(1&sr),sr=sr>>1|(qs=0<(ya=ag(Ei,mi[2],ya,pi.Qc,0,Ft,Yn)))<<3,_n=_n<<2|(3<ya?3:1<ya?2:Ft[Yn+0]!=0),Yn+=16;sr>>=2,Ys=Ys>>1|qs<<5}Mn|=_n<<4*hr,ds|=sr<<4<<hr,_a|=(240&Ys)<<hr}jt.la=ds,or.la=_a,Yi.Hc=Bn,Yi.Gc=Mn,Yi.ia=43690&Mn?0:pi.ia,mi=!(Bn|Mn)}if(0<Xe.L&&(Xe.wa[Xe.Y+Xe.ja]=Xe.gd[Ct.$b][Ct.Za],Xe.wa[Xe.Y+Xe.ja].La|=!mi),Pt.Ka)return sa(Ze,7,"Premature end-of-file encountered.")}if(Nf(Ze),Xe=Rt,Pt=1,Ct=(qe=Ze).D,jt=0<qe.L&&qe.M>=qe.zb&&qe.M<=qe.Va,qe.Aa==0)e:{if(Ct.M=qe.M,Ct.uc=jt,Xf(qe,Ct),Pt=1,Ct=(_n=qe.D).Nb,jt=(Mn=y_[qe.L])*qe.R,Ei=Mn/2*qe.B,Er=16*Ct*qe.R,ms=8*Ct*qe.B,mi=qe.sa,Yi=qe.ta-jt+Er,pi=qe.qa,Ft=qe.ra-Ei+ms,Yn=qe.Ha,or=qe.Ia-Ei+ms,Ys=(sr=_n.M)==0,Bn=sr>=qe.Va-1,qe.Aa==2&&Xf(qe,_n),_n.uc)for(qs=(ya=qe).D.M,n(ya.D.uc),_n=ya.yb;_n<ya.Hb;++_n){_a=_n,ds=qs;var Ga=(oo=(Zr=ya).D).Nb;hr=Zr.R;var oo=oo.wa[oo.Y+_a],Ho=Zr.sa,bl=Zr.ta+16*Ga*hr+16*_a,Ac=oo.dd,$a=oo.tc;if($a!=0)if(n(3<=$a),Zr.L==1)0<_a&&pm(Ho,bl,hr,$a+4),oo.La&&vl(Ho,bl,hr,$a),0<ds&&Iu(Ho,bl,hr,$a+4),oo.La&&ng(Ho,bl,hr,$a);else{var _d=Zr.B,ku=Zr.qa,Np=Zr.ra+8*Ga*_d+8*_a,gm=Zr.Ha,Zr=Zr.Ia+8*Ga*_d+8*_a;Ga=oo.ld,0<_a&&(c_(Ho,bl,hr,$a+4,Ac,Ga),wu(ku,Np,gm,Zr,_d,$a+4,Ac,Ga)),oo.La&&(um(Ho,bl,hr,$a,Ac,Ga),Rp(ku,Np,gm,Zr,_d,$a,Ac,Ga)),0<ds&&(Fp(Ho,bl,hr,$a+4,Ac,Ga),ig(ku,Np,gm,Zr,_d,$a+4,Ac,Ga)),oo.La&&(Tu(Ho,bl,hr,$a,Ac,Ga),Du(ku,Np,gm,Zr,_d,$a,Ac,Ga))}}if(qe.ia&&alert("todo:DitherRow"),Xe.put!=null){if(_n=16*sr,sr=16*(sr+1),Ys?(Xe.y=qe.sa,Xe.O=qe.ta+Er,Xe.f=qe.qa,Xe.N=qe.ra+ms,Xe.ea=qe.Ha,Xe.W=qe.Ia+ms):(_n-=Mn,Xe.y=mi,Xe.O=Yi,Xe.f=pi,Xe.N=Ft,Xe.ea=Yn,Xe.W=or),Bn||(sr-=Mn),sr>Xe.o&&(sr=Xe.o),Xe.F=null,Xe.J=null,qe.Fa!=null&&0<qe.Fa.length&&_n<sr&&(Xe.J=qf(qe,Xe,_n,sr-_n),Xe.F=qe.mb,Xe.F==null&&Xe.F.length==0)){Pt=sa(qe,3,"Could not decode alpha data.");break e}_n<Xe.j&&(Mn=Xe.j-_n,_n=Xe.j,n(!(1&Mn)),Xe.O+=qe.R*Mn,Xe.N+=qe.B*(Mn>>1),Xe.W+=qe.B*(Mn>>1),Xe.F!=null&&(Xe.J+=Xe.width*Mn)),_n<sr&&(Xe.O+=Xe.v,Xe.N+=Xe.v>>1,Xe.W+=Xe.v>>1,Xe.F!=null&&(Xe.J+=Xe.v),Xe.ka=_n-Xe.j,Xe.U=Xe.va-Xe.v,Xe.T=sr-_n,Pt=Xe.put(Xe))}Ct+1!=qe.Ic||Bn||(e(qe.sa,qe.ta-jt,mi,Yi+16*qe.R,jt),e(qe.qa,qe.ra-Ei,pi,Ft+8*qe.B,Ei),e(qe.Ha,qe.Ia-Ei,Yn,or+8*qe.B,Ei))}if(!Pt)return sa(Ze,6,"Output aborted.")}return 1}(g,E)),E.bc!=null&&E.bc(E),P&=1}return P?(g.cb=0,P):0}function $l(g,E,P,N,G){G=g[E+P+32*N]+(G>>3),g[E+P+32*N]=-256&G?0>G?0:255:G}function _p(g,E,P,N,G,ee){$l(g,E,0,P,N+G),$l(g,E,1,P,N+ee),$l(g,E,2,P,N-ee),$l(g,E,3,P,N-G)}function ss(g){return(20091*g>>16)+g}function Lf(g,E,P,N){var G,ee=0,ne=a(16);for(G=0;4>G;++G){var oe=g[E+0]+g[E+8],de=g[E+0]-g[E+8],Te=(35468*g[E+4]>>16)-ss(g[E+12]),Ye=ss(g[E+4])+(35468*g[E+12]>>16);ne[ee+0]=oe+Ye,ne[ee+1]=de+Te,ne[ee+2]=de-Te,ne[ee+3]=oe-Ye,ee+=4,E++}for(G=ee=0;4>G;++G)oe=(g=ne[ee+0]+4)+ne[ee+8],de=g-ne[ee+8],Te=(35468*ne[ee+4]>>16)-ss(ne[ee+12]),$l(P,N,0,0,oe+(Ye=ss(ne[ee+4])+(35468*ne[ee+12]>>16))),$l(P,N,1,0,de+Te),$l(P,N,2,0,de-Te),$l(P,N,3,0,oe-Ye),ee++,N+=32}function zv(g,E,P,N){var G=g[E+0]+4,ee=35468*g[E+4]>>16,ne=ss(g[E+4]),oe=35468*g[E+1]>>16;_p(P,N,0,G+ne,g=ss(g[E+1]),oe),_p(P,N,1,G+ee,g,oe),_p(P,N,2,G-ee,g,oe),_p(P,N,3,G-ne,g,oe)}function ax(g,E,P,N,G){Lf(g,E,P,N),G&&Lf(g,E+16,P,N+4)}function Yv(g,E,P,N){fd(g,E+0,P,N,1),fd(g,E+32,P,N+128,1)}function ox(g,E,P,N){var G;for(g=g[E+0]+4,G=0;4>G;++G)for(E=0;4>E;++E)$l(P,N,E,G,g)}function qv(g,E,P,N){g[E+0]&&Wo(g,E+0,P,N),g[E+16]&&Wo(g,E+16,P,N+4),g[E+32]&&Wo(g,E+32,P,N+128),g[E+48]&&Wo(g,E+48,P,N+128+4)}function sx(g,E,P,N){var G,ee=a(16);for(G=0;4>G;++G){var ne=g[E+0+G]+g[E+12+G],oe=g[E+4+G]+g[E+8+G],de=g[E+4+G]-g[E+8+G],Te=g[E+0+G]-g[E+12+G];ee[0+G]=ne+oe,ee[8+G]=ne-oe,ee[4+G]=Te+de,ee[12+G]=Te-de}for(G=0;4>G;++G)ne=(g=ee[0+4*G]+3)+ee[3+4*G],oe=ee[1+4*G]+ee[2+4*G],de=ee[1+4*G]-ee[2+4*G],Te=g-ee[3+4*G],P[N+0]=ne+oe>>3,P[N+16]=Te+de>>3,P[N+32]=ne-oe>>3,P[N+48]=Te-de>>3,N+=64}function Bf(g,E,P){var N,G=E-32,ee=zs,ne=255-g[G-1];for(N=0;N<P;++N){var oe,de=ee,Te=ne+g[E-1];for(oe=0;oe<P;++oe)g[E+oe]=de[Te+g[G+oe]];E+=32}}function lx(g,E){Bf(g,E,4)}function cx(g,E){Bf(g,E,8)}function dx(g,E){Bf(g,E,16)}function md(g,E){var P;for(P=0;16>P;++P)e(g,E+32*P,g,E-32,16)}function yp(g,E){var P;for(P=16;0<P;--P)r(g,E,g[E-1],16),E+=32}function Sp(g,E,P){var N;for(N=0;16>N;++N)r(E,P+32*N,g,16)}function Kv(g,E){var P,N=16;for(P=0;16>P;++P)N+=g[E-1+32*P]+g[E+P-32];Sp(N>>5,g,E)}function So(g,E){var P,N=8;for(P=0;16>P;++P)N+=g[E-1+32*P];Sp(N>>4,g,E)}function mx(g,E){var P,N=8;for(P=0;16>P;++P)N+=g[E+P-32];Sp(N>>4,g,E)}function Xv(g,E){Sp(128,g,E)}function cn(g,E,P){return g+2*E+P+2>>2}function ux(g,E){var P,N=E-32;for(N=new Uint8Array([cn(g[N-1],g[N+0],g[N+1]),cn(g[N+0],g[N+1],g[N+2]),cn(g[N+1],g[N+2],g[N+3]),cn(g[N+2],g[N+3],g[N+4])]),P=0;4>P;++P)e(g,E+32*P,N,0,N.length)}function px(g,E){var P=g[E-1],N=g[E-1+32],G=g[E-1+64],ee=g[E-1+96];it(g,E+0,16843009*cn(g[E-1-32],P,N)),it(g,E+32,16843009*cn(P,N,G)),it(g,E+64,16843009*cn(N,G,ee)),it(g,E+96,16843009*cn(G,ee,ee))}function Ic(g,E){var P,N=4;for(P=0;4>P;++P)N+=g[E+P-32]+g[E-1+32*P];for(N>>=3,P=0;4>P;++P)r(g,E+32*P,N,4)}function Jv(g,E){var P=g[E-1+0],N=g[E-1+32],G=g[E-1+64],ee=g[E-1-32],ne=g[E+0-32],oe=g[E+1-32],de=g[E+2-32],Te=g[E+3-32];g[E+0+96]=cn(N,G,g[E-1+96]),g[E+1+96]=g[E+0+64]=cn(P,N,G),g[E+2+96]=g[E+1+64]=g[E+0+32]=cn(ee,P,N),g[E+3+96]=g[E+2+64]=g[E+1+32]=g[E+0+0]=cn(ne,ee,P),g[E+3+64]=g[E+2+32]=g[E+1+0]=cn(oe,ne,ee),g[E+3+32]=g[E+2+0]=cn(de,oe,ne),g[E+3+0]=cn(Te,de,oe)}function Zv(g,E){var P=g[E+1-32],N=g[E+2-32],G=g[E+3-32],ee=g[E+4-32],ne=g[E+5-32],oe=g[E+6-32],de=g[E+7-32];g[E+0+0]=cn(g[E+0-32],P,N),g[E+1+0]=g[E+0+32]=cn(P,N,G),g[E+2+0]=g[E+1+32]=g[E+0+64]=cn(N,G,ee),g[E+3+0]=g[E+2+32]=g[E+1+64]=g[E+0+96]=cn(G,ee,ne),g[E+3+32]=g[E+2+64]=g[E+1+96]=cn(ee,ne,oe),g[E+3+64]=g[E+2+96]=cn(ne,oe,de),g[E+3+96]=cn(oe,de,de)}function bp(g,E){var P=g[E-1+0],N=g[E-1+32],G=g[E-1+64],ee=g[E-1-32],ne=g[E+0-32],oe=g[E+1-32],de=g[E+2-32],Te=g[E+3-32];g[E+0+0]=g[E+1+64]=ee+ne+1>>1,g[E+1+0]=g[E+2+64]=ne+oe+1>>1,g[E+2+0]=g[E+3+64]=oe+de+1>>1,g[E+3+0]=de+Te+1>>1,g[E+0+96]=cn(G,N,P),g[E+0+64]=cn(N,P,ee),g[E+0+32]=g[E+1+96]=cn(P,ee,ne),g[E+1+32]=g[E+2+96]=cn(ee,ne,oe),g[E+2+32]=g[E+3+96]=cn(ne,oe,de),g[E+3+32]=cn(oe,de,Te)}function Vf(g,E){var P=g[E+0-32],N=g[E+1-32],G=g[E+2-32],ee=g[E+3-32],ne=g[E+4-32],oe=g[E+5-32],de=g[E+6-32],Te=g[E+7-32];g[E+0+0]=P+N+1>>1,g[E+1+0]=g[E+0+64]=N+G+1>>1,g[E+2+0]=g[E+1+64]=G+ee+1>>1,g[E+3+0]=g[E+2+64]=ee+ne+1>>1,g[E+0+32]=cn(P,N,G),g[E+1+32]=g[E+0+96]=cn(N,G,ee),g[E+2+32]=g[E+1+96]=cn(G,ee,ne),g[E+3+32]=g[E+2+96]=cn(ee,ne,oe),g[E+3+64]=cn(ne,oe,de),g[E+3+96]=cn(oe,de,Te)}function hx(g,E){var P=g[E-1+0],N=g[E-1+32],G=g[E-1+64],ee=g[E-1+96];g[E+0+0]=P+N+1>>1,g[E+2+0]=g[E+0+32]=N+G+1>>1,g[E+2+32]=g[E+0+64]=G+ee+1>>1,g[E+1+0]=cn(P,N,G),g[E+3+0]=g[E+1+32]=cn(N,G,ee),g[E+3+32]=g[E+1+64]=cn(G,ee,ee),g[E+3+64]=g[E+2+64]=g[E+0+96]=g[E+1+96]=g[E+2+96]=g[E+3+96]=ee}function fx(g,E){var P=g[E-1+0],N=g[E-1+32],G=g[E-1+64],ee=g[E-1+96],ne=g[E-1-32],oe=g[E+0-32],de=g[E+1-32],Te=g[E+2-32];g[E+0+0]=g[E+2+32]=P+ne+1>>1,g[E+0+32]=g[E+2+64]=N+P+1>>1,g[E+0+64]=g[E+2+96]=G+N+1>>1,g[E+0+96]=ee+G+1>>1,g[E+3+0]=cn(oe,de,Te),g[E+2+0]=cn(ne,oe,de),g[E+1+0]=g[E+3+32]=cn(P,ne,oe),g[E+1+32]=g[E+3+64]=cn(N,P,ne),g[E+1+64]=g[E+3+96]=cn(G,N,P),g[E+1+96]=cn(ee,G,N)}function gx(g,E){var P;for(P=0;8>P;++P)e(g,E+32*P,g,E-32,8)}function Uf(g,E){var P;for(P=0;8>P;++P)r(g,E,g[E-1],8),E+=32}function Su(g,E,P){var N;for(N=0;8>N;++N)r(E,P+32*N,g,8)}function sm(g,E){var P,N=8;for(P=0;8>P;++P)N+=g[E+P-32]+g[E-1+32*P];Su(N>>4,g,E)}function vx(g,E){var P,N=4;for(P=0;8>P;++P)N+=g[E+P-32];Su(N>>3,g,E)}function bu(g,E){var P,N=4;for(P=0;8>P;++P)N+=g[E-1+32*P];Su(N>>3,g,E)}function jf(g,E){Su(128,g,E)}function xp(g,E,P){var N=g[E-P],G=g[E+0],ee=3*(G-N)+Cx[1020+g[E-2*P]-g[E+P]],ne=m_[112+(ee+4>>3)];g[E-P]=zs[255+N+m_[112+(ee+3>>3)]],g[E+0]=zs[255+G-ne]}function Qv(g,E,P,N){var G=g[E+0],ee=g[E+P];return yl[255+g[E-2*P]-g[E-P]]>N||yl[255+ee-G]>N}function e_(g,E,P,N){return 4*yl[255+g[E-P]-g[E+0]]+yl[255+g[E-2*P]-g[E+P]]<=N}function t_(g,E,P,N,G){var ee=g[E-3*P],ne=g[E-2*P],oe=g[E-P],de=g[E+0],Te=g[E+P],Ye=g[E+2*P],mt=g[E+3*P];return 4*yl[255+oe-de]+yl[255+ne-Te]>N?0:yl[255+g[E-4*P]-ee]<=G&&yl[255+ee-ne]<=G&&yl[255+ne-oe]<=G&&yl[255+mt-Ye]<=G&&yl[255+Ye-Te]<=G&&yl[255+Te-de]<=G}function i_(g,E,P,N){var G=2*N+1;for(N=0;16>N;++N)e_(g,E+N,P,G)&&xp(g,E+N,P)}function kc(g,E,P,N){var G=2*N+1;for(N=0;16>N;++N)e_(g,E+N*P,1,G)&&xp(g,E+N*P,1)}function ud(g,E,P,N){var G;for(G=3;0<G;--G)i_(g,E+=4*P,P,N)}function _x(g,E,P,N){var G;for(G=3;0<G;--G)kc(g,E+=4,P,N)}function lm(g,E,P,N,G,ee,ne,oe){for(ee=2*ee+1;0<G--;){if(t_(g,E,P,ee,ne))if(Qv(g,E,P,oe))xp(g,E,P);else{var de=g,Te=E,Ye=P,mt=de[Te-2*Ye],ut=de[Te-Ye],Ze=de[Te+0],Rt=de[Te+Ye],Ct=de[Te+2*Ye],qe=27*(Pt=Cx[1020+3*(Ze-ut)+Cx[1020+mt-Rt]])+63>>7,Xe=18*Pt+63>>7,Pt=9*Pt+63>>7;de[Te-3*Ye]=zs[255+de[Te-3*Ye]+Pt],de[Te-2*Ye]=zs[255+mt+Xe],de[Te-Ye]=zs[255+ut+qe],de[Te+0]=zs[255+Ze-qe],de[Te+Ye]=zs[255+Rt-Xe],de[Te+2*Ye]=zs[255+Ct-Pt]}E+=N}}function zl(g,E,P,N,G,ee,ne,oe){for(ee=2*ee+1;0<G--;){if(t_(g,E,P,ee,ne))if(Qv(g,E,P,oe))xp(g,E,P);else{var de=g,Te=E,Ye=P,mt=de[Te-Ye],ut=de[Te+0],Ze=de[Te+Ye],Rt=m_[112+((Ct=3*(ut-mt))+4>>3)],Ct=m_[112+(Ct+3>>3)],qe=Rt+1>>1;de[Te-2*Ye]=zs[255+de[Te-2*Ye]+qe],de[Te-Ye]=zs[255+mt+Ct],de[Te+0]=zs[255+ut-Rt],de[Te+Ye]=zs[255+Ze-qe]}E+=N}}function Wf(g,E,P,N,G,ee){lm(g,E,P,1,16,N,G,ee)}function xu(g,E,P,N,G,ee){lm(g,E,1,P,16,N,G,ee)}function yx(g,E,P,N,G,ee){var ne;for(ne=3;0<ne;--ne)zl(g,E+=4*P,P,1,16,N,G,ee)}function Cp(g,E,P,N,G,ee){var ne;for(ne=3;0<ne;--ne)zl(g,E+=4,1,P,16,N,G,ee)}function Sx(g,E,P,N,G,ee,ne,oe){lm(g,E,G,1,8,ee,ne,oe),lm(P,N,G,1,8,ee,ne,oe)}function Hf(g,E,P,N,G,ee,ne,oe){lm(g,E,1,G,8,ee,ne,oe),lm(P,N,1,G,8,ee,ne,oe)}function Gf(g,E,P,N,G,ee,ne,oe){zl(g,E+4*G,G,1,8,ee,ne,oe),zl(P,N+4*G,G,1,8,ee,ne,oe)}
126function n_(g,E,P,N,G,ee,ne,oe){zl(g,E+4,1,G,8,ee,ne,oe),zl(P,N+4,1,G,8,ee,ne,oe)}function Ep(){this.ba=new Ws,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Cr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function $f(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function zf(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function r_(){this.ua=0,this.Wa=new Ae,this.vb=new Ae,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new Fe,this.yc=new J}function bx(){this.xb=this.a=0,this.l=new Dc,this.ca=new Ws,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new O,this.Pb=0,this.wd=new O,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new r_,this.ab=0,this.gc=c(4,zf),this.Oc=0}function wp(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Dc,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Cu(g,E,P,N,G,ee,ne){for(g=g==null?0:g[E+0],E=0;E<ne;++E)G[ee+E]=g+P[N+E]&255,g=G[ee+E]}function Yf(g,E,P,N,G,ee,ne){var oe;if(g==null)Cu(null,null,P,N,G,ee,ne);else for(oe=0;oe<ne;++oe)G[ee+oe]=g[E+oe]+P[N+oe]&255}function cm(g,E,P,N,G,ee,ne){if(g==null)Cu(null,null,P,N,G,ee,ne);else{var oe,de=g[E+0],Te=de,Ye=de;for(oe=0;oe<ne;++oe)Te=Ye+(de=g[E+oe])-Te,Ye=P[N+oe]+(-256&Te?0>Te?0:255:Te)&255,Te=de,G[ee+oe]=Ye}}function qf(g,E,P,N){var G=E.width,ee=E.o;if(n(g!=null&&E!=null),0>P||0>=N||P+N>ee)return null;if(!g.Cc){if(g.ga==null){var ne;if(g.ga=new wp,(ne=g.ga==null)||(ne=E.width*E.o,n(g.Gb.length==0),g.Gb=a(ne),g.Uc=0,g.Gb==null?ne=0:(g.mb=g.Gb,g.nb=g.Uc,g.rc=null,ne=1),ne=!ne),!ne){ne=g.ga;var oe=g.Fa,de=g.P,Te=g.qc,Ye=g.mb,mt=g.nb,ut=de+1,Ze=Te-1,Rt=ne.l;if(n(oe!=null&&Ye!=null&&E!=null),fm[0]=null,fm[1]=Cu,fm[2]=Yf,fm[3]=cm,ne.ca=Ye,ne.tb=mt,ne.c=E.width,ne.i=E.height,n(0<ne.c&&0<ne.i),1>=Te)E=0;else if(ne.$a=oe[de+0]>>0&3,ne.Z=oe[de+0]>>2&3,ne.Lc=oe[de+0]>>4&3,de=oe[de+0]>>6&3,0>ne.$a||1<ne.$a||4<=ne.Z||1<ne.Lc||de)E=0;else if(Rt.put=pl,Rt.ac=Pa,Rt.bc=hl,Rt.ma=ne,Rt.width=E.width,Rt.height=E.height,Rt.Da=E.Da,Rt.v=E.v,Rt.va=E.va,Rt.j=E.j,Rt.o=E.o,ne.$a)e:{n(ne.$a==1),E=xt();t:for(;;){if(E==null){E=0;break e}if(n(ne!=null),ne.mc=E,E.c=ne.c,E.i=ne.i,E.l=ne.l,E.l.ma=ne,E.l.width=ne.c,E.l.height=ne.i,E.a=0,et(E.m,oe,ut,Ze),!dt(ne.c,ne.i,1,E,null)||(E.ab==1&&E.gc[0].hc==3&&ge(E.s)?(ne.ic=1,oe=E.c*E.i,E.Ta=null,E.Ua=0,E.V=a(oe),E.Ba=0,E.V==null?(E.a=1,E=0):E=1):(ne.ic=0,E=ft(E,ne.c)),!E))break t;E=1;break e}ne.mc=null,E=0}else E=Ze>=ne.c*ne.i;ne=!E}if(ne)return null;g.ga.Lc!=1?g.Ga=0:N=ee-P}n(g.ga!=null),n(P+N<=ee);
126e:{if(E=(oe=g.ga).c,ee=oe.l.o,oe.$a==0){if(ut=g.rc,Ze=g.Vc,Rt=g.Fa,de=g.P+1+P*E,Te=g.mb,Ye=g.nb+P*E,n(de<=g.P+g.qc),oe.Z!=0)for(n(fm[oe.Z]!=null),ne=0;ne<N;++ne)fm[oe.Z](ut,Ze,Rt,de,Te,Ye,E),ut=Te,Ze=Ye,Ye+=E,de+=E;else for(ne=0;ne<N;++ne)e(Te,Ye,Rt,de,E),ut=Te,Ze=Ye,Ye+=E,de+=E;g.rc=ut,g.Vc=Ze}else{if(n(oe.mc!=null),E=P+N,n((ne=oe.mc)!=null),n(E<=ne.i),ne.C>=E)E=1;else if(oe.ic||rt(),oe.ic){oe=ne.V,ut=ne.Ba,Ze=ne.c;var Ct=ne.i,qe=(Rt=1,de=ne.$/Ze,Te=ne.$%Ze,Ye=ne.m,mt=ne.s,ne.$),Xe=Ze*Ct,Pt=Ze*E,jt=mt.wc,Ft=qe<Pt?Xr(mt,Te,de):null;n(qe<=Xe),n(E<=Ct),n(ge(mt));t:for(;;){for(;!Ye.h&&qe<Pt;){if(Te&jt||(Ft=Xr(mt,Te,de)),n(Ft!=null),we(Ye),256>(Ct=yo(Ft.G[0],Ft.H[0],Ye)))oe[ut+qe]=Ct,++qe,++Te>=Ze&&(Te=0,++de<=E&&!(de%16)&&De(ne,de));else{if(!(280>Ct)){Rt=0;break t}Ct=Hs(Ct-256,Ye);var Ei,mi=yo(Ft.G[4],Ft.H[4],Ye);if(we(Ye),!(qe>=(mi=os(Ze,mi=Hs(mi,Ye)))&&Xe-qe>=Ct)){Rt=0;break t}for(Ei=0;Ei<Ct;++Ei)oe[ut+qe+Ei]=oe[ut+qe+Ei-mi];for(qe+=Ct,Te+=Ct;Te>=Ze;)Te-=Ze,++de<=E&&!(de%16)&&De(ne,de);qe<Pt&&Te&jt&&(Ft=Xr(mt,Te,de))}n(Ye.h==V(Ye))}De(ne,de>E?E:de);break t}!Rt||Ye.h&&qe<Xe?(Rt=0,ne.a=Ye.h?5:3):ne.$=qe,E=Rt}else E=ke(ne,ne.V,ne.Ba,ne.c,ne.i,E,yt);if(!E){N=0;break e}}P+N>=ee&&(g.Cc=1),N=1}if(!N)return null;if(g.Cc&&((N=g.ga)!=null&&(N.mc=null),g.ga=null,0<g.Ga))return alert("todo:WebPDequantizeLevels"),null}return g.nb+P*G}function k(g,E,P,N,G,ee){for(;0<G--;){var ne,oe=g,de=E+(P?1:0),Te=g,Ye=E+(P?0:3);for(ne=0;ne<N;++ne){var mt=Te[Ye+4*ne];mt!=255&&(mt*=32897,oe[de+4*ne+0]=oe[de+4*ne+0]*mt>>23,oe[de+4*ne+1]=oe[de+4*ne+1]*mt>>23,oe[de+4*ne+2]=oe[de+4*ne+2]*mt>>23)}E+=ee}}function z(g,E,P,N,G){for(;0<N--;){var ee;for(ee=0;ee<P;++ee){var ne=g[E+2*ee+0],oe=15&(Te=g[E+2*ee+1]),de=4369*oe,Te=(240&Te|Te>>4)*de>>16;g[E+2*ee+0]=(240&ne|ne>>4)*de>>16&240|(15&ne|ne<<4)*de>>16>>4&15,g[E+2*ee+1]=240&Te|oe}E+=G}}function Pe(g,E,P,N,G,ee,ne,oe){var de,Te,Ye=255;for(Te=0;Te<G;++Te){for(de=0;de<N;++de){var mt=g[E+de];ee[ne+4*de]=mt,Ye&=mt}E+=P,ne+=oe}return Ye!=255}function We(g,E,P,N,G){var ee;for(ee=0;ee<G;++ee)P[N+ee]=g[E+ee]>>8}function rt(){_l=k,Mr=z,Ar=Pe,ca=We}function wt(g,E,P){ae[g]=function(N,G,ee,ne,oe,de,Te,Ye,mt,ut,Ze,Rt,Ct,qe,Xe,Pt,jt){var Ft,Ei=jt-1>>1,mi=oe[de+0]|Te[Ye+0]<<16,Yi=mt[ut+0]|Ze[Rt+0]<<16;n(N!=null);var pi=3*mi+Yi+131074>>2;for(E(N[G+0],255&pi,pi>>16,Ct,qe),ee!=null&&(pi=3*Yi+mi+131074>>2,E(ee[ne+0],255&pi,pi>>16,Xe,Pt)),Ft=1;Ft<=Ei;++Ft){var Yn=oe[de+Ft]|Te[Ye+Ft]<<16,or=mt[ut+Ft]|Ze[Rt+Ft]<<16,Bn=mi+Yn+Yi+or+524296,Mn=Bn+2*(Yn+Yi)>>3;pi=Mn+mi>>1,mi=(Bn=Bn+2*(mi+or)>>3)+Yn>>1,E(N[G+2*Ft-1],255&pi,pi>>16,Ct,qe+(2*Ft-1)*P),E(N[G+2*Ft-0],255&mi,mi>>16,Ct,qe+(2*Ft-0)*P),ee!=null&&(pi=Bn+Yi>>1,mi=Mn+or>>1,E(ee[ne+2*Ft-1],255&pi,pi>>16,Xe,Pt+(2*Ft-1)*P),E(ee[ne+2*Ft+0],255&mi,mi>>16,Xe,Pt+(2*Ft+0)*P)),mi=Yn,Yi=or}1&jt||(pi=3*mi+Yi+131074>>2,E(N[G+jt-1],255&pi,pi>>16,Ct,qe+(jt-1)*P),ee!=null&&(pi=3*Yi+mi+131074>>2,E(ee[ne+jt-1],255&pi,pi>>16,Xe,Pt+(jt-1)*P)))}}function $t(){Sl[u_]=AV,Sl[p_]=v3,Sl[u3]=PV,Sl[h_]=_3,Sl[f_]=y3,Sl[Ex]=S3,Sl[p3]=FV,Sl[wx]=v3,Sl[Tx]=_3,Sl[g_]=y3,Sl[Dx]=S3}function xi(g){return g&~RV?0>g?0:255:g>>b3}function Wi(g,E){return xi((19077*g>>8)+(26149*E>>8)-14234)}function hn(g,E,P){return xi((19077*g>>8)-(6419*E>>8)-(13320*P>>8)+8708)}function dn(g,E){return xi((19077*g>>8)+(33050*E>>8)-17685)}function Rn(g,E,P,N,G){N[G+0]=Wi(g,P),N[G+1]=hn(g,E,P),N[G+2]=dn(g,E)}function Gr(g,E,P,N,G){N[G+0]=dn(g,E),N[G+1]=hn(g,E,P),N[G+2]=Wi(g,P)}function Jr(g,E,P,N,G){var ee=hn(g,E,P);E=ee<<3&224|dn(g,E)>>3,N[G+0]=248&Wi(g,P)|ee>>5,N[G+1]=E}function va(g,E,P,N,G){var ee=240&dn(g,E)|15;N[G+0]=240&Wi(g,P)|hn(g,E,P)>>4,N[G+1]=ee}function bo(g,E,P,N,G){N[G+0]=255,Rn(g,E,P,N,G+1)}function Ha(g,E,P,N,G){Gr(g,E,P,N,G),N[G+3]=255}function Yl(g,E,P,N,G){Rn(g,E,P,N,G),N[G+3]=255}function $s(g,E){return 0>g?0:g>E?E:g}function Mc(g,E,P){ae[g]=function(N,G,ee,ne,oe,de,Te,Ye,mt){for(var ut=Ye+(-2&mt)*P;Ye!=ut;)E(N[G+0],ee[ne+0],oe[de+0],Te,Ye),E(N[G+1],ee[ne+0],oe[de+0],Te,Ye+P),G+=2,++ne,++de,Ye+=2*P;1&mt&&E(N[G+0],ee[ne+0],oe[de+0],Te,Ye)}}function a_(g,E,P){return P==0?g==0?E==0?6:5:E==0?4:0:P}function Kf(g,E,P,N,G){switch(g>>>30){case 3:fd(E,P,N,G,0);break;case 2:la(E,P,N,G);break;case 1:Wo(E,P,N,G)}}function Xf(g,E){var P,N,G=E.M,ee=E.Nb,ne=g.oc,oe=g.pc+40,de=g.oc,Te=g.pc+584,Ye=g.oc,mt=g.pc+600;for(P=0;16>P;++P)ne[oe+32*P-1]=129;for(P=0;8>P;
126++P)de[Te+32*P-1]=129,Ye[mt+32*P-1]=129;for(0<G?ne[oe-1-32]=de[Te-1-32]=Ye[mt-1-32]=129:(r(ne,oe-32-1,127,21),r(de,Te-32-1,127,9),r(Ye,mt-32-1,127,9)),N=0;N<g.za;++N){var ut=E.ya[E.aa+N];if(0<N){for(P=-1;16>P;++P)e(ne,oe+32*P-4,ne,oe+32*P+12,4);for(P=-1;8>P;++P)e(de,Te+32*P-4,de,Te+32*P+4,4),e(Ye,mt+32*P-4,Ye,mt+32*P+4,4)}var Ze=g.Gd,Rt=g.Hd+N,Ct=ut.ad,qe=ut.Hc;if(0<G&&(e(ne,oe-32,Ze[Rt].y,0,16),e(de,Te-32,Ze[Rt].f,0,8),e(Ye,mt-32,Ze[Rt].ea,0,8)),ut.Za){var Xe=ne,Pt=oe-32+16;for(0<G&&(N>=g.za-1?r(Xe,Pt,Ze[Rt].y[15],4):e(Xe,Pt,Ze[Rt+1].y,0,4)),P=0;4>P;P++)Xe[Pt+128+P]=Xe[Pt+256+P]=Xe[Pt+384+P]=Xe[Pt+0+P];for(P=0;16>P;++P,qe<<=2)Xe=ne,Pt=oe+C3[P],ql[ut.Ob[P]](Xe,Pt),Kf(qe,Ct,16*+P,Xe,Pt)}else if(Xe=a_(N,G,ut.Ob[0]),hm[Xe](ne,oe),qe!=0)for(P=0;16>P;++P,qe<<=2)Kf(qe,Ct,16*+P,ne,oe+C3[P]);for(P=ut.Gc,Xe=a_(N,G,ut.Dd),vd[Xe](de,Te),vd[Xe](Ye,mt),qe=Ct,Xe=de,Pt=Te,255&(ut=P>>0)&&(170&ut?tg(qe,256,Xe,Pt):gl(qe,256,Xe,Pt)),ut=Ye,qe=mt,255&(P>>=8)&&(170&P?tg(Ct,320,ut,qe):gl(Ct,320,ut,qe)),G<g.Ub-1&&(e(Ze[Rt].y,0,ne,oe+480,16),e(Ze[Rt].f,0,de,Te+224,8),e(Ze[Rt].ea,0,Ye,mt+224,8)),P=8*ee*g.B,Ze=g.sa,Rt=g.ta+16*N+16*ee*g.R,Ct=g.qa,ut=g.ra+8*N+P,qe=g.Ha,Xe=g.Ia+8*N+P,P=0;16>P;++P)e(Ze,Rt+P*g.R,ne,oe+32*P,16);for(P=0;8>P;++P)e(Ct,ut+P*g.B,de,Te+32*P,8),e(qe,Xe+P*g.B,Ye,mt+32*P,8)}}function Tp(g,E,P,N,G,ee,ne,oe,de){var Te=[0],Ye=[0],mt=0,ut=de!=null?de.kd:0,Ze=de??new $f;if(g==null||12>P)return 7;Ze.data=g,Ze.w=E,Ze.ha=P,E=[E],P=[P],Ze.gb=[Ze.gb];e:{var Rt=E,Ct=P,qe=Ze.gb;if(n(g!=null),n(Ct!=null),n(qe!=null),qe[0]=0,12<=Ct[0]&&!t(g,Rt[0],"RIFF")){if(t(g,Rt[0]+8,"WEBP")){qe=3;break e}var Xe=qt(g,Rt[0]+4);if(12>Xe||4294967286<Xe){qe=3;break e}if(ut&&Xe>Ct[0]-8){qe=7;break e}qe[0]=Xe,Rt[0]+=12,Ct[0]-=12}qe=0}if(qe!=0)return qe;for(Xe=0<Ze.gb[0],P=P[0];;){e:{var Pt=g;Ct=E,qe=P;var jt=Te,Ft=Ye,Ei=Rt=[0];if((pi=mt=[mt])[0]=0,8>qe[0])qe=7;else{if(!t(Pt,Ct[0],"VP8X")){if(qt(Pt,Ct[0]+4)!=10){qe=3;break e}if(18>qe[0]){qe=7;break e}var mi=qt(Pt,Ct[0]+8),Yi=1+Nt(Pt,Ct[0]+12);if(2147483648<=Yi*(Pt=1+Nt(Pt,Ct[0]+15))){qe=3;break e}Ei!=null&&(Ei[0]=mi),jt!=null&&(jt[0]=Yi),Ft!=null&&(Ft[0]=Pt),Ct[0]+=18,qe[0]-=18,pi[0]=1}qe=0}}if(mt=mt[0],Rt=Rt[0],qe!=0)return qe;if(Ct=!!(2&Rt),!Xe&&mt)return 3;if(ee!=null&&(ee[0]=!!(16&Rt)),ne!=null&&(ne[0]=Ct),oe!=null&&(oe[0]=0),ne=Te[0],Rt=Ye[0],mt&&Ct&&de==null){qe=0;break}if(4>P){qe=7;break}if(Xe&&mt||!Xe&&!mt&&!t(g,E[0],"ALPH")){P=[P],Ze.na=[Ze.na],Ze.P=[Ze.P],Ze.Sa=[Ze.Sa];e:{mi=g,qe=E,Xe=P;var pi=Ze.gb;jt=Ze.na,Ft=Ze.P,Ei=Ze.Sa,Yi=22,n(mi!=null),n(Xe!=null),Pt=qe[0];var Yn=Xe[0];for(n(jt!=null),n(Ei!=null),jt[0]=null,Ft[0]=null,Ei[0]=0;;){if(qe[0]=Pt,Xe[0]=Yn,8>Yn){qe=7;break e}var or=qt(mi,Pt+4);if(4294967286<or){qe=3;break e}var Bn=8+or+1&-2;if(Yi+=Bn,0<pi&&Yi>pi){qe=3;break e}if(!t(mi,Pt,"VP8 ")||!t(mi,Pt,"VP8L")){qe=0;break e}if(Yn[0]<Bn){qe=7;break e}t(mi,Pt,"ALPH")||(jt[0]=mi,Ft[0]=Pt+8,Ei[0]=or),Pt+=Bn,Yn-=Bn}}if(P=P[0],Ze.na=Ze.na[0],Ze.P=Ze.P[0],Ze.Sa=Ze.Sa[0],qe!=0)break}P=[P],Ze.Ja=[Ze.Ja],Ze.xa=[Ze.xa];e:if(pi=g,qe=E,Xe=P,jt=Ze.gb[0],Ft=Ze.Ja,Ei=Ze.xa,mi=qe[0],Pt=!t(pi,mi,"VP8 "),Yi=!t(pi,mi,"VP8L"),n(pi!=null),n(Xe!=null),n(Ft!=null),n(Ei!=null),8>Xe[0])qe=7;else{if(Pt||Yi){if(pi=qt(pi,mi+4),12<=jt&&pi>jt-12){qe=3;break e}if(ut&&pi>Xe[0]-8){qe=7;break e}Ft[0]=pi,qe[0]+=8,Xe[0]-=8,Ei[0]=Yi}else Ei[0]=5<=Xe[0]&&pi[mi+0]==47&&!(pi[mi+4]>>5),Ft[0]=Xe[0];qe=0}if(P=P[0],Ze.Ja=Ze.Ja[0],Ze.xa=Ze.xa[0],E=E[0],qe!=0)break;if(4294967286<Ze.Ja)return 3;if(oe==null||Ct||(oe[0]=Ze.xa?2:1),ne=[ne],Rt=[Rt],Ze.xa){if(5>P){qe=7;break}oe=ne,ut=Rt,Ct=ee,g==null||5>P?g=0:5<=P&&g[E+0]==47&&!(g[E+4]>>5)?(Xe=[0],pi=[0],jt=[0],et(Ft=new O,g,E,P),zi(Ft,Xe,pi,jt)?(oe!=null&&(oe[0]=Xe[0]),ut!=null&&(ut[0]=pi[0]),Ct!=null&&(Ct[0]=jt[0]),g=1):g=0):g=0}else{if(10>P){qe=7;break}oe=Rt,g==null||10>P||!Hv(g,E+3,P-3)?g=0:(ut=g[E+0]|g[E+1]<<8|g[E+2]<<16,Ct=16383&(g[E+7]<<8|g[E+6]),g=16383&(g[E+9]<<8|g[E+8]),1&ut||3<(ut>>1&7)||!(ut>>4&1)||ut>>5>=Ze.Ja||!Ct||!g?g=0:(ne&&(ne[0]=Ct),oe&&(oe[0]=g),g=1))}if(!g||(ne=ne[0],Rt=Rt[0],mt&&(Te[0]!=ne||Ye[0]!=Rt)))return 3;de!=null&&(de[0]=Ze,de.offset=E-de.w,n(4294967286>E-de.w),n(de.offset==de.ha-P));break}
126return qe==0||qe==7&&mt&&de==null?(ee!=null&&(ee[0]|=Ze.na!=null&&0<Ze.na.length),N!=null&&(N[0]=ne),G!=null&&(G[0]=Rt),0):qe}function Jf(g,E,P){var N=E.width,G=E.height,ee=0,ne=0,oe=N,de=G;if(E.Da=g!=null&&0<g.Da,E.Da&&(oe=g.cd,de=g.bd,ee=g.v,ne=g.j,11>P||(ee&=-2,ne&=-2),0>ee||0>ne||0>=oe||0>=de||ee+oe>N||ne+de>G))return 0;if(E.v=ee,E.j=ne,E.va=ee+oe,E.o=ne+de,E.U=oe,E.T=de,E.da=g!=null&&0<g.da,E.da){if(!Lt(oe,de,P=[g.ib],ee=[g.hb]))return 0;E.ib=P[0],E.hb=ee[0]}return E.ob=g!=null&&g.ob,E.Kb=g==null||!g.Sd,E.da&&(E.ob=E.ib<3*N/4&&E.hb<3*G/4,E.Kb=0),1}function Zf(g){if(g==null)return 2;if(11>g.S){var E=g.f.RGBA;E.fb+=(g.height-1)*E.A,E.A=-E.A}else E=g.f.kb,g=g.height,E.O+=(g-1)*E.fa,E.fa=-E.fa,E.N+=(g-1>>1)*E.Ab,E.Ab=-E.Ab,E.W+=(g-1>>1)*E.Db,E.Db=-E.Db,E.F!=null&&(E.J+=(g-1)*E.lb,E.lb=-E.lb);return 0}function Dp(g,E,P,N){if(N==null||0>=g||0>=E)return 2;if(P!=null){if(P.Da){var G=P.cd,ee=P.bd,ne=-2&P.v,oe=-2&P.j;if(0>ne||0>oe||0>=G||0>=ee||ne+G>g||oe+ee>E)return 2;g=G,E=ee}if(P.da){if(!Lt(g,E,G=[P.ib],ee=[P.hb]))return 2;g=G[0],E=ee[0]}}N.width=g,N.height=E;e:{var de=N.width,Te=N.height;if(g=N.S,0>=de||0>=Te||!(g>=u_&&13>g))g=2;else{if(0>=N.Rd&&N.sd==null){ne=ee=G=E=0;var Ye=(oe=de*E3[g])*Te;if(11>g||(ee=(Te+1)/2*(E=(de+1)/2),g==12&&(ne=(G=de)*Te)),(Te=a(Ye+2*ee+ne))==null){g=1;break e}N.sd=Te,11>g?((de=N.f.RGBA).eb=Te,de.fb=0,de.A=oe,de.size=Ye):((de=N.f.kb).y=Te,de.O=0,de.fa=oe,de.Fd=Ye,de.f=Te,de.N=0+Ye,de.Ab=E,de.Cd=ee,de.ea=Te,de.W=0+Ye+ee,de.Db=E,de.Ed=ee,g==12&&(de.F=Te,de.J=0+Ye+2*ee),de.Tc=ne,de.lb=G)}if(E=1,G=N.S,ee=N.width,ne=N.height,G>=u_&&13>G)if(11>G)g=N.f.RGBA,E&=(oe=Math.abs(g.A))*(ne-1)+ee<=g.size,E&=oe>=ee*E3[G],E&=g.eb!=null;else{g=N.f.kb,oe=(ee+1)/2,Ye=(ne+1)/2,de=Math.abs(g.fa),Te=Math.abs(g.Ab);var mt=Math.abs(g.Db),ut=Math.abs(g.lb),Ze=ut*(ne-1)+ee;E&=de*(ne-1)+ee<=g.Fd,E&=Te*(Ye-1)+oe<=g.Cd,E=(E&=mt*(Ye-1)+oe<=g.Ed)&de>=ee&Te>=oe&mt>=oe,E&=g.y!=null,E&=g.f!=null,E&=g.ea!=null,G==12&&(E&=ut>=ee,E&=Ze<=g.Tc,E&=g.F!=null)}else E=0;g=E?0:2}}return g!=0||P!=null&&P.fd&&(g=Zf(N)),g}var ao=64,Ip=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],kp=24,Mp=32,Qf=8,ls=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Xt("Predictor0","PredictorAdd0"),ae.Predictor0=function(){return 4278190080},ae.Predictor1=function(g){return g},ae.Predictor2=function(g,E,P){return E[P+0]},ae.Predictor3=function(g,E,P){return E[P+1]},ae.Predictor4=function(g,E,P){return E[P-1]},ae.Predictor5=function(g,E,P){return di(di(g,E[P+1]),E[P+0])},ae.Predictor6=function(g,E,P){return di(g,E[P-1])},ae.Predictor7=function(g,E,P){return di(g,E[P+0])},ae.Predictor8=function(g,E,P){return di(E[P-1],E[P+0])},ae.Predictor9=function(g,E,P){return di(E[P+0],E[P+1])},ae.Predictor10=function(g,E,P){return di(di(g,E[P-1]),di(E[P+0],E[P+1]))},ae.Predictor11=function(g,E,P){var N=E[P+0];return 0>=Ji(N>>24&255,g>>24&255,(E=E[P-1])>>24&255)+Ji(N>>16&255,g>>16&255,E>>16&255)+Ji(N>>8&255,g>>8&255,E>>8&255)+Ji(255&N,255&g,255&E)?N:g},ae.Predictor12=function(g,E,P){var N=E[P+0];return(Mi((g>>24&255)+(N>>24&255)-((E=E[P-1])>>24&255))<<24|Mi((g>>16&255)+(N>>16&255)-(E>>16&255))<<16|Mi((g>>8&255)+(N>>8&255)-(E>>8&255))<<8|Mi((255&g)+(255&N)-(255&E)))>>>0},ae.Predictor13=function(g,E,P){var N=E[P-1];return(Li((g=di(g,E[P+0]))>>24&255,N>>24&255)<<24|Li(g>>16&255,N>>16&255)<<16|Li(g>>8&255,N>>8&255)<<8|Li(g>>0&255,N>>0&255))>>>0};var xx=ae.PredictorAdd0;ae.PredictorAdd1=ln,Xt("Predictor2","PredictorAdd2"),Xt("Predictor3","PredictorAdd3"),Xt("Predictor4","PredictorAdd4"),Xt("Predictor5","PredictorAdd5"),Xt("Predictor6","PredictorAdd6"),Xt("Predictor7","PredictorAdd7"),Xt("Predictor8","PredictorAdd8"),Xt("Predictor9","PredictorAdd9"),Xt("Predictor10","PredictorAdd10"),Xt("Predictor11","PredictorAdd11"),Xt("Predictor12","PredictorAdd12"),Xt("Predictor13","PredictorAdd13");var eg=ae.PredictorAdd2;bn("ColorIndexInverseTransform","MapARGB","32b",function(g){return g>>8&255},function(g){return g}),bn("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(g){return g},function(g){return g>>8&255});var o_,fl=ae.ColorIndexInverseTransform,Ap=ae.MapARGB,s_=ae.VP8LColorIndexInverseTransformAlpha,l_=ae.MapAlpha,dm=ae.VP8LPredictorsAdd=[];dm.length=16,(ae.VP8LPredictors=[]).length=16,(ae.VP8LPredictorsAdd_C=[]).length=16,(ae.VP8LPredictors_C=[]).length=16;
vendor: 4,811 bytes, line 126
126var Eu,cs,jo,mm,pd,hd,Pp,fd,la,tg,Wo,gl,Fp,c_,ig,wu,Tu,um,Du,Rp,Iu,pm,ng,vl,_l,Mr,Ar,ca,Oa=a(511),gd=a(2041),rg=a(225),Op=a(767),d_=0,Cx=gd,m_=rg,zs=Op,yl=Oa,u_=0,p_=1,u3=2,h_=3,f_=4,Ex=5,p3=6,wx=7,Tx=8,g_=9,Dx=10,vV=[2,3,7],_V=[3,3,11],h3=[280,256,256,256,40],yV=[0,1,1,1,0],SV=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],bV=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],xV=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],CV=8,Ix=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],kx=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ag=null,EV=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],wV=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],f3=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],TV=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,25
1265,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],DV=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,
1261,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],IV=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,25
1265,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],kV=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],hm=[],ql=[],vd=[],MV=1,g3=2,fm=[],Sl=[];wt("UpsampleRgbLinePair",Rn,3),wt("UpsampleBgrLinePair",Gr,3),wt("UpsampleRgbaLinePair",Yl,4),wt("UpsampleBgraLinePair",Ha,4),wt("UpsampleArgbLinePair",bo,4),wt("UpsampleRgba4444LinePair",va,2),wt("UpsampleRgb565LinePair",Jr,2);var AV=ae.UpsampleRgbLinePair,PV=ae.UpsampleBgrLinePair,v3=ae.UpsampleRgbaLinePair,_3=ae.UpsampleBgraLinePair,y3=ae.UpsampleArgbLinePair,S3=ae.UpsampleRgba4444LinePair,FV=ae.UpsampleRgb565LinePair,v_=16,__=1<<v_-1,og=-227,Mx=482,b3=6,RV=(256<<b3)-1,x3=0,OV=a(256),NV=a(256),LV=a(256),BV=a(256),VV=a(Mx-og),UV=a(Mx-og);Mc("YuvToRgbRow",Rn,3),Mc("YuvToBgrRow",Gr,3),Mc("YuvToRgbaRow",Yl,4),Mc("YuvToBgraRow",Ha,4),Mc("YuvToArgbRow",bo,4),Mc("YuvToRgba4444Row",va,2),Mc("YuvToRgb565Row",Jr,2);var C3=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],y_=[0,2,8],jV=[8,7,6,4,4,2,2,2,1,1,1,1],WV=1;this.WebPDecodeRGBA=function(g,E,P,N,G){var ee=p_,ne=new Ep,oe=new Ws;ne.ba=oe,oe.S=ee,oe.width=[oe.width],oe.height=[oe.height];var de=oe.width,Te=oe.height,Ye=new Hl;if(Ye==null||g==null)var mt=2;else n(Ye!=null),mt=Tp(g,E,P,Ye.width,Ye.height,Ye.Pd,Ye.Qd,Ye.format,null);if(mt!=0?de=0:(de!=null&&(de[0]=Ye.width[0]),Te!=null&&(Te[0]=Ye.height[0]),de=1),de){oe.width=oe.width[0],oe.height=oe.height[0],N!=null&&(N[0]=oe.width),G!=null&&(G[0]=oe.height);e:{if(N=new Dc,(G=new $f).data=g,G.w=E,G.ha=P,G.kd=1,E=[0],n(G!=null),((g=Tp(G.data,G.w,G.ha,null,null,null,E,null,G))==0||g==7)&&E[0]&&(g=4),(E=g)==0){if(n(ne!=null),N.data=G.data,N.w=G.w+G.offset,N.ha=G.ha-G.offset,N.put=pl,N.ac=Pa,N.bc=hl,N.ma=ne,G.xa){if((g=xt())==null){ne=1;break e}if(function(ut,Ze){var Rt=[0],Ct=[0],qe=[0];t:for(;;){if(ut==null)return 0;if(Ze==null)return ut.a=2,0;if(ut.l=Ze,ut.a=0,et(ut.m,Ze.data,Ze.w,Ze.ha),!zi(ut.m,Rt,Ct,qe)){ut.a=3;break t}if(ut.xb=g3,Ze.width=Rt[0],Ze.height=Ct[0],!dt(Rt[0],Ct[0],1,ut,null))break t;return 1}return n(ut.a!=0),0}(g,N)){if(N=(E=Dp(N.width,N.height,ne.Oa,ne.ba))==0){t:{N=g;i:for(;;){if(N==null){N=0;break t}if(n(N.s.yc!=null),n(N.s.Ya!=null),n(0<N.s.Wb),n((P=N.l)!=null),n((G=P.ma)!=null),N.xb!=0){if(N.ca=G.ba,N.tb=G.tb,n(N.ca!=null),!Jf(G.Oa,P,h_)){N.a=2;break i}if(!ft(N,P.width)||P.da)break i;if((P.da||Ln(N.ca.S))&&rt(),11>N.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),N.ca.f.kb.F!=null&&rt()),N.Pb&&0<N.s.ua&&N.s.vb.X==null&&!ni(N.s.vb,N.s.Wa.Xa)){N.a=1;break i}N.xb=0}if(!ke(N,N.V,N.Ba,N.c,N.i,P.o,Ie))break i;G.Dc=N.Ma,N=1;break t}n(N.a!=0),N=0}N=!N}N&&(E=g.a)}else E=g.a}else{if((g=new Gs)==null){ne=1;break e}if(g.Fa=G.na,g.P=G.P,g.qc=G.Sa,Gv(g,N)){if((E=Dp(N.width,N.height,ne.Oa,ne.ba))==0){if(g.Aa=0,P=ne.Oa,n((G=g)!=null),P!=null){if(0<(de=0>(de=P.Md)?0:100<de?255:255*de/100)){for(Te=Ye=0;4>Te;++Te)12>(mt=G.pb[Te]).lc&&(mt.ia=de*jV[0>mt.lc?0:mt.lc]>>3),Ye|=mt.ia;Ye&&(alert("todo:VP8InitRandom"),G.ia=1)}G.Ga=P.Id,100<G.Ga?G.Ga=100:0>G.Ga&&(G.Ga=0)}rx(g,N)||(E=g.a)}}else E=g.a}E==0&&ne.Oa!=null&&ne.Oa.fd&&(E=Zf(ne.ba))}ne=E}ee=ne!=0?null:11>ee?oe.f.RGBA.eb:oe.f.kb.y}else ee=null;return ee};var E3=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(ae,ve){for(var Me="",W=0;W<4;W++)Me+=String.fromCharCode(ae[ve++]);return Me}function f(ae,ve){return(ae[ve+0]<<0|ae[ve+1]<<8|ae[ve+2]<<16)>>>0}function v(ae,ve){return(ae[ve+0]<<0|ae[ve+1]<<8|ae[ve+2]<<16|ae[ve+3]<<24)>>>0}new u;var C=[0],y=[0],A=[],D=new u,F=i,R=function(ae,ve){var Me={},W=0,J=!1,Ee=0,Fe=0;if(Me.frames=[],!function(Q,V,Y,we){for(var Ve=0;Ve<we;Ve++)if(Q[V+Ve]!=Y.charCodeAt(Ve))return!0;return!1}(ae,ve,"RIFF",4)){for(v(ae,ve+=4),ve+=8;ve<ae.length;){var $e=h(ae,ve),Qe=v(ae,ve+=4);ve+=4;var ot=Qe+(1&Qe);switch($e){case"VP8 ":case"VP8L":Me.frames[W]===void 0&&(Me.frames[W]={}),(vt=Me.frames[W]).src_off=J?Fe:ve-8,vt.src_size=Ee+Qe+8,W++,J&&(J=!1,Ee=0,Fe=0);break;case"VP8X":(vt=Me.header={}).feature_flags=ae[ve];var et=ve+4;vt.canvas_width=1+f(ae,et),et+=3,vt.canvas_height=1+f(ae,et),et+=3;break;case"ALPH":J=!0,Ee=ot+8,Fe=ve-8;break;case"ANIM":(vt=Me.header).bgcolor=v(ae,ve),et=ve+4,vt.loop_count=(Kt=ae)[(O=et)+0]<<0|Kt[O+1]<<8,et+=2;break;case"ANMF":var gt,vt;(vt=Me.frames[W]={}).offset_x=2*f(ae,ve),ve+=3,vt.offset_y=2*f(ae,ve),ve+=3,vt.width=1+f(ae,ve),ve+=3,vt.height=1+f(ae,ve),ve+=3,vt.duration=f(ae,ve),ve+=3,gt=ae[ve++],vt.dispose=1>,vt.blend=gt>>1&1}$e!="ANMF"&&(ve+=ot)}var Kt,O;return Me}}(F,0);R.response=F,R.rgbaoutput=!0,R.dataurl=!1;var L=R.header?R.header:null,H=R.frames?R.frames:null;if(L){L.loop_counter=L.loop_count,C=[L.canvas_height],y=[L.canvas_width];for(var se=0;se<H.length&&H[se].blend!=0;se++);}var Ce=H[0],Ue=D.WebPDecodeRGBA(F,Ce.src_off,Ce.src_size,y,C);Ce.rgba=Ue,Ce.imgwidth=y[0],Ce.imgheight=C[0];for(var re=0;re<y[0]*C[0]*4;re++)A[re]=Ue[re];return this.width=y,this.height=C,this.data=A,this}(function(i){var n=function(){return typeof u2=="function"},t=function(C,y,A,D){var F=4,R=c;switch(D){case i.image_compression.FAST:F=1,R=a;break;case i.image_compression.MEDIUM:F=6,R=d;break;case i.image_compression.SLOW:F=9,R=u}C=e(C,y,A,R);var L=u2(C,{level:F});return i.__addimage__.arrayBufferToBinaryString(L)},e=function(C,y,A,D){for(var F,R,L,H=C.length/y,se=new Uint8Array(C.length+H),Ce=f(),Ue=0;Ue<H;Ue+=1){if(L=Ue*y,F=C.subarray(L,L+y),D)se.set(D(F,A,R),L+Ue);else{for(var re,ae=Ce.length,ve=[];re<ae;re+=1)ve[re]=Ce[re](F,A,R);var Me=v(ve.concat());se.set(ve[Me],L+Ue)}R=F}return se},r=function(C){var y=Array.apply([],C);return y.unshift(0),y},a=function(C,y){var A,D=[],F=C.length;D[0]=1;for(var R=0;R<F;R+=1)A=C[R-y]||0,D[R+1]=C[R]-A+256&255;return D},c=function(C,y,A){var D,F=[],R=C.length;F[0]=2;
126for(var L=0;L<R;L+=1)D=A&&A[L]||0,F[L+1]=C[L]-D+256&255;return F},d=function(C,y,A){var D,F,R=[],L=C.length;R[0]=3;for(var H=0;H<L;H+=1)D=C[H-y]||0,F=A&&A[H]||0,R[H+1]=C[H]+256-(D+F>>>1)&255;return R},u=function(C,y,A){var D,F,R,L,H=[],se=C.length;H[0]=4;for(var Ce=0;Ce<se;Ce+=1)D=C[Ce-y]||0,F=A&&A[Ce]||0,R=A&&A[Ce-y]||0,L=h(D,F,R),H[Ce+1]=C[Ce]-L+256&255;return H},h=function(C,y,A){if(C===y&&y===A)return C;var D=Math.abs(y-A),F=Math.abs(C-A),R=Math.abs(C+y-A-A);return D<=F&&D<=R?C:F<=R?y:A},f=function(){return[r,a,c,d,u]},v=function(C){var y=C.map(function(A){return A.reduce(function(D,F){return D+Math.abs(F)},0)});return y.indexOf(Math.min.apply(null,y))};i.processPNG=function(C,y,A,D){var F,R,L,H,se,Ce,Ue,re,ae,ve,Me,W,J,Ee,Fe,$e=this.decode.FLATE_DECODE,Qe="";if(this.__addimage__.isArrayBuffer(C)&&(C=new Uint8Array(C)),this.__addimage__.isArrayBufferView(C)){if(C=(L=new Aie(C)).imgData,R=L.bits,F=L.colorSpace,se=L.colors,[4,6].indexOf(L.colorType)!==-1){if(L.bits===8){ae=(re=L.pixelBitlength==32?new Uint32Array(L.decodePixels().buffer):L.pixelBitlength==16?new Uint16Array(L.decodePixels().buffer):new Uint8Array(L.decodePixels().buffer)).length,Me=new Uint8Array(ae*L.colors),ve=new Uint8Array(ae);var ot,et=L.pixelBitlength-L.bits;for(Ee=0,Fe=0;Ee<ae;Ee++){for(J=re[Ee],ot=0;ot<et;)Me[Fe++]=J>>>ot&255,ot+=L.bits;ve[Ee]=J>>>ot&255}}if(L.bits===16){ae=(re=new Uint32Array(L.decodePixels().buffer)).length,Me=new Uint8Array(ae*(32/L.pixelBitlength)*L.colors),ve=new Uint8Array(ae*(32/L.pixelBitlength)),W=L.colors>1,Ee=0,Fe=0;for(var gt=0;Ee<ae;)J=re[Ee++],Me[Fe++]=J>>>0&255,W&&(Me[Fe++]=J>>>16&255,J=re[Ee++],Me[Fe++]=J>>>0&255),ve[gt++]=J>>>16&255;R=8}D!==i.image_compression.NONE&&n()?(C=t(Me,L.width*L.colors,L.colors,D),Ue=t(ve,L.width,1,D)):(C=Me,Ue=ve,$e=void 0)}if(L.colorType===3&&(F=this.color_spaces.INDEXED,Ce=L.palette,L.transparency.indexed)){var vt=L.transparency.indexed,Kt=0;for(Ee=0,ae=vt.length;Ee<ae;++Ee)Kt+=vt[Ee];if((Kt/=255)===ae-1&&vt.indexOf(0)!==-1)H=[vt.indexOf(0)];else if(Kt!==ae){for(re=L.decodePixels(),ve=new Uint8Array(re.length),Ee=0,ae=re.length;Ee<ae;Ee++)ve[Ee]=vt[re[Ee]];Ue=t(ve,L.width,1)}}var O=function(Q){var V;switch(Q){case i.image_compression.FAST:V=11;break;case i.image_compression.MEDIUM:V=13;break;case i.image_compression.SLOW:V=14;break;default:V=12}return V}(D);return $e===this.decode.FLATE_DECODE&&(Qe="/Predictor "+O+" "),Qe+="/Colors "+se+" /BitsPerComponent "+R+" /Columns "+L.width,(this.__addimage__.isArrayBuffer(C)||this.__addimage__.isArrayBufferView(C))&&(C=this.__addimage__.arrayBufferToBinaryString(C)),(Ue&&this.__addimage__.isArrayBuffer(Ue)||this.__addimage__.isArrayBufferView(Ue))&&(Ue=this.__addimage__.arrayBufferToBinaryString(Ue)),{alias:A,data:C,index:y,filter:$e,decodeParameters:Qe,transparency:H,palette:Ce,sMask:Ue,predictor:O,width:L.width,height:L.height,bitsPerComponent:R,colorSpace:F}}}})($i.API),function(i){i.processGIF89A=function(n,t,e,r){var a=new Pie(n),c=a.width,d=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var h={data:u,width:c,height:d},f=new wD(100).encode(h,100);return i.processJPEG.call(this,f,t,e,r)},i.processGIF87A=i.processGIF89A}($i.API),gc.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var i=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(i);for(var n=0;n<i;n++){var t=this.datav.getUint8(this.pos++,!0),e=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[n]={red:r,green:e,blue:t,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},gc.prototype.parseBGR=function(){this.pos=this.offset;try{var i="bit"+this.bitPP,n=this.width*this.height*4;this.data=new Uint8Array(n),this[i]()}catch(t){Dr.log("bit decode error:"+t)}},gc.prototype.bit1=function(){var i,n=Math.ceil(this.width/8),t=n%4;for(i=this.height-1;i>=0;i--){for(var e=this.bottom_up?i:this.height-1-i,r=0;r<n;r++)for(var a=this.datav.getUint8(this.pos++,!0),c=e*this.width*4+8*r*4,d=0;d<8&&8*r+d<this.width;d++){var u=this.palette[a>>7-d&1];this.data[c+4*d]=u.blue,this.data[c+4*d+1]=u.green,this.data[c+4*d+2]=u.red,this.data[c+4*d+3]=255}t!==0&&(this.pos+=4-t)}},gc.prototype.bit4=function(){for(var i=Math.ceil(this.width/2),n=i%4,t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<i;r++){var a=this.datav.getUint8(this.pos++,!0),c=e*this.width*4+2*r*4,d=a>>4,u=15&a,h=this.palette[d];if(this.data[c]=h.blue,this.data[c+1]=h.green,this.data[c+2]=h.red,this.data[c+3]=255,2*r+1>=this.width)break;h=this.palette[u],this.data[c+4]=h.blue,this.data[c+4+1]=h.green,this.data[c+4+2]=h.red,this.data[c+4+3]=255}n!==0&&(this.pos+=4-n)}},gc.prototype.bit8=function(){for(var i=this.width%4,n=this.height-1;n>=0;n--){for(var t=this.bottom_up?n:this.height-1-n,e=0;e<this.width;e++){var r=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*e;if(r<this.palette.length){var c=this.palette[r];this.data[a]=c.red,this.data[a+1]=c.green,this.data[a+2]=c.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}i!==0&&(this.pos+=4-i)}},gc.prototype.bit15=function(){for(var i=this.width%3,n=parseInt("11111",2),t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var c=(a&n)/n*255|0,d=(a>>5&n)/n*255|0,u=(a>>10&n)/n*255|0,h=a>>15?255:0,f=e*this.width*4+4*r;this.data[f]=u,this.data[f+1]=d,this.data[f+2]=c,this.data[f+3]=h}this.pos+=i}},gc.prototype.bit16=function(){for(var i=this.width%3,n=parseInt("11111",2),t=parseInt("111111",2),e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,a=0;a<this.width;a++){var c=this.datav.getUint16(this.pos,!0);this.pos+=2;var d=(c&n)/n*255|0,u=(c>>5&t)/t*255|0,h=(c>>11)/n*255|0,f=r*this.width*4+4*a;this.data[f]=h,this.data[f+1]=u,this.data[f+2]=d,this.data[f+3]=255}this.pos+=i}},gc.prototype.bit24=function(){for(var i=this.height-1;i>=0;i--){for(var n=this.bottom_up?i:this.height-1-i,t=0;t<this.width;t++){var e=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),c=n*this.width*4+4*t;this.data[c]=a,this.data[c+1]=r,this.data[c+2]=e,this.data[c+3]=255}this.pos+=this.width%4}},gc.prototype.bit32=function(){for(var i=this.height-1;i>=0;i--)for(var n=this.bottom_up?i:this.height-1-i,t=0;t<this.width;t++){var e=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),c=this.datav.getUint8(this.pos++,!0),d=n*this.width*4+4*t;this.data[d]=a,this.data[d+1]=r,this.data[d+2]=e,this.data[d+3]=c}},gc.prototype.getData=function(){return this.data},function(i){i.processBMP=function(n,t,e,r){var a=new gc(n,!1),c=a.width,d=a.height,u={data:a.getData(),width:c,height:d},h=new wD(100).encode(u,100);return i.processJPEG.call(this,h,t,e,r)}}($i.API),gN.prototype.getData=function(){return this.data},function(i){i.processWEBP=function(n,t,e,r){var a=new gN(n),c=a.width,d=a.height,u={data:a.getData(),width:c,height:d},h=new wD(100).encode(u,100);return i.processJPEG.call(this,h,t,e,r)}}($i.API),$i.API.processRGBA=function(i,n,t){for(var e=i.data,r=e.length,a=new Uint8Array(r/4*3),c=new Uint8Array(r/4),d=0,u=0,h=0;h<r;h+=4){var f=e[h],v=e[h+1],C=e[h+2],y=e[h+3];a[d++]=f,a[d++]=v,a[d++]=C,c[u++]=y}var A=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(c),data:A,index:n,alias:t,colorSpace:"DeviceRGB",bitsPerComponent:8,width:i.width,height:i.height}},$i.API.setLanguage=function(i){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq
126:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[i]!==void 0&&(this.internal.languageSettings.languageCode=i,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},sf=$i.API,g2=sf.getCharWidthsArray=function(i,n){var t,e,r=(n=n||{}).font||this.internal.getFont(),a=n.fontSize||this.internal.getFontSize(),c=n.charSpace||this.internal.getCharSpace(),d=n.widths?
126n.widths:r.metadata.Unicode.widths,u=d.fof?d.fof:1,h=n.kerning?n.kerning:r.metadata.Unicode.kerning,f=h.fof?h.fof:1,v=n.doKerning!==!1,C=0,y=i.length,A=0,D=d[0]||u,F=[];for(t=0;t<y;t++)e=i.charCodeAt(t),typeof r.metadata.widthOfString=="function"?F.push((r.metadata.widthOfGlyph(r.metadata.characterToGlyph(e))+c*(1e3/a)||0)/1e3):(C=v&&_r(h[e])==="object"&&!isNaN(parseInt(h[e][A],10))?h[e][A]/f:0,F.push((d[e]||D)/u+C)),A=e;return F},uN=sf.getStringUnitWidth=function(i,n){var t=(n=n||{}).fontSize||this.internal.getFontSize(),e=n.font||this.internal.getFont(),r=n.charSpace||this.internal.getCharSpace();return sf.processArabic&&(i=sf.processArabic(i)),typeof e.metadata.widthOfString=="function"?e.metadata.widthOfString(i,t,r)/t:g2.apply(this,arguments).reduce(function(a,c){return a+c},0)},pN=function(i,n,t,e){for(var r=[],a=0,c=i.length,d=0;a!==c&&d+n[a]<t;)d+=n[a],a++;r.push(i.slice(0,a));var u=a;for(d=0;a!==c;)d+n[a]>e&&(r.push(i.slice(u,a)),d=0,u=a),d+=n[a],a++;return u!==a&&r.push(i.slice(u,a)),r},hN=function(i,n,t){t||(t={});var e,r,a,c,d,u,h,f=[],v=[f],C=t.textIndent||0,y=0,A=0,D=i.split(" "),F=g2.apply(this,[" ",t])[0];if(u=t.lineIndent===-1?D[0].length+2:t.lineIndent||0){var R=Array(u).join(" "),L=[];D.map(function(se){(se=se.split(/\s*\n/)).length>1?L=L.concat(se.map(function(Ce,Ue){return(Ue&&Ce.length?` 127`:"")+Ce})):L.push(se[0])}),D=L,u=uN.apply(this,[R,t])}for(a=0,c=D.length;a<c;a++){var H=0;if(e=D[a],u&&e[0]==` 128`&&(e=e.substr(1),H=1),C+y+(A=(r=g2.apply(this,[e,t])).reduce(function(se,Ce){return se+Ce},0))>n||H){if(A>n){for(d=pN.apply(this,[e,r,n-(C+y),n]),f.push(d.shift()),f=[d.pop()];d.length;)v.push([d.shift()]);A=r.slice(e.length-(f[0]?f[0].length:0)).reduce(function(se,Ce){return se+Ce},0)}else f=[e];v.push(f),C=A+u,y=F}else f.push(e),C+=y+A,y=F}return h=u?function(se,Ce){return(Ce?R:"")+se.join(" ")}:function(se){return se.join(" ")},v.map(h)},sf.splitTextToSize=function(i,n,t){var e,r=(t=t||{}).fontSize||this.internal.getFontSize(),a=(function(f){if(f.widths&&f.kerning)return{widths:f.widths,kerning:f.kerning};var v=this.internal.getFont(f.fontName,f.fontStyle);return v.metadata.Unicode?{widths:v.metadata.Unicode.widths||{0:1},kerning:v.metadata.Unicode.kerning||{}}:{font:v.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);e=Array.isArray(i)?i:String(i).split(/\r?\n/);var c=1*this.internal.scaleFactor*n/r;a.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/r:0,a.lineIndent=t.lineIndent;var d,u,h=[];for(d=0,u=e.length;d<u;d++)h=h.concat(hN.apply(this,[e[d],c,a]));return h},function(i){i.__fontmetrics__=i.__fontmetrics__||{};for(var n="klmnopqrstuvwxyz",t={},e={},r=0;r<n.length;r++)t[n[r]]="0123456789abcdef"[r],e["0123456789abcdef"[r]]=n[r];var a=function(v){return"0x"+parseInt(v,10).toString(16)},c=i.__fontmetrics__.compress=function(v){var C,y,A,D,F=["{"];for(var R in v){if(C=v[R],isNaN(parseInt(R,10))?y="'"+R+"'":(R=parseInt(R,10),y=(y=a(R).slice(2)).slice(0,-1)+e[y.slice(-1)]),typeof C=="number")C<0?(A=a(C).slice(3),D="-"):(A=a(C).slice(2),D=""),A=D+A.slice(0,-1)+e[A.slice(-1)];else{if(_r(C)!=="object")throw new Error("Don't know what to do with value type "+_r(C)+".");A=c(C)}F.push(y+A)}return F.push("}"),F.join("")},d=i.__fontmetrics__.uncompress=function(v){if(typeof v!="string")throw new Error("Invalid argument passed to uncompress.");for(var C,y,A,D,F={},R=1,L=F,H=[],se="",Ce="",Ue=v.length-1,re=1;re<Ue;re+=1)(D=v[re])=="'"?C?(A=C.join(""),C=void 0):C=[]:C?C.push(D):D=="{"?(H.push([L,A]),L={},A=void 0):D=="}"?((y=H.pop())[0][y[1]]=L,A=void 0,L=y[0]):D=="-"?R=-1:A===void 0?t.hasOwnProperty(D)?(se+=t[D],A=parseInt(se,16)*R,R=1,se=""):se+=D:t.hasOwnProperty(D)?(Ce+=t[D],L[A]=parseInt(Ce,16)*R,R=1,A=void 0,Ce=""):Ce+=D;return F},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:d("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},h={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},f={Unicode:{"Courier-Oblique":d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":d("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3me
128k3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":d("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
128dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":d("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:d("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:d("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
128dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":d("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
128dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:d("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":d("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":d("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}
128fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":d("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":d("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
128dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};i.events.push(["addFont",function(v){var C=v.font,y=f.Unicode[C.postScriptName];y&&(C.metadata.Unicode={},C.metadata.Unicode.widths=y.widths,C.metadata.Unicode.kerning=y.kerning);var A=h.Unicode[C.postScriptName];A&&(C.metadata.Unicode.encoding=A,C.encoding=A.codePages[0])}])}($i.API),function(i){var n=function(t){for(var e=t.length,r=new Uint8Array(e),a=0;a<e;a++)r[a]=t.charCodeAt(a);return r};i.API.events.push(["addFont",function(t){var e=void 0,r=t.font,a=t.instance;if(!r.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");if(typeof(e=a.existsFileInVFS(r.postScriptName)===!1?a.loadFile(r.postScriptName):a.getFileFromVFS(r.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");(function(c,d){d=/^\x00\x01\x00\x00/.test(d)?n(d):n(yv(d)),c.metadata=i.API.TTFFont.open(d),c.metadata.Unicode=c.metadata.Unicode||{encoding:{},kerning:{},widths:[]},c.metadata.glyIdsUsed=[0]})(r,e)}}])}($i),function(i){function n(){return(tn.canvg?Promise.resolve(tn.canvg):import("./chunk-ZZLGQ6FH.js")).catch(function(t){return Promise.reject(new Error("Could not load canvg: "+t))}).then(function(t){return t.default?t.default:t})}$i.API.addSvgAsImage=function(t,e,r,a,c,d,u,h){if(isNaN(e)||isNaN(r))throw Dr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(a)||isNaN(c))throw Dr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=a,f.height=c;var v=f.getContext("2d");v.fillStyle="#fff",v.fillRect(0,0,f.width,f.height);var C={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},y=this;return n().then(function(A){return A.fromString(v,t,C)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(C)}).then(function(){y.addImage(f.toDataURL("image/jpeg",1),e,r,a,c,u,h)})}}(),$i.API.putTotalPages=function(i){var n,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(i,"g"),t=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(i,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var e=1;e<=this.internal.getNumberOfPages();e++)for(var r=0;r<this.internal.pages[e].length;r++)this.internal.pages[e][r]=this.internal.pages[e][r].replace(n,t);return this},$i.API.viewerPreferences=function(i,n){var t;i=i||{},n=n||!1;var e,r,a,c={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},d=Object.keys(c),u=[],h=0,f=0,v=0;function C(A,D){var F,R=!1;for(F=0;F<A.length;F+=1)A[F]===D&&(R=!0);return R}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(c)),this.internal.viewerpreferences.isSubscribed=!1),t=this.internal.viewerpreferences.configuration,i==="reset"||n===!0){var y=d.length;for(v=0;v<y;v+=1)t[d[v]].value=t[d[v]].defaultValue,t[d[v]].explicitSet=!1}if(_r(i)==="object"){for(r in i)if(a=i[r],C(d,r)&&a!==void 0){if(t[r].type==="boolean"&&typeof a=="boolean")t[r].value=a;else if(t[r].type==="name"&&C(t[r].valueSet,a))t[r].value=a;else if(t[r].type==="integer"&&Number.isInteger(a))t[r].value=a;else if(t[r].type==="array"){for(h=0;h<a.length;h+=1)if(e=!0,a[h].length===1&&typeof a[h][0]=="number")u.push(String(a[h]-1));else if(a[h].length>1){for(f=0;f<a[h].length;f+=1)typeof a[h][f]!="number"&&(e=!1);e===!0&&u.push([a[h][0]-1,a[h][1]-1].join(" "))}t[r].value="["+u.join(" ")+"]"}else t[r].value=t[r].defaultValue;t[r].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var A,D=[];for(A in t)t[A].explicitSet===!0&&(t[A].type==="name"?D.push("/"+A+" /"+t[A].value):D.push("/"+A+" "+t[A].value));D.length!==0&&this.internal.write(`/ViewerPreferences 129<< 130`+D.join(` 131`)+` 132>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},function(i){var n=function(){var e='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',r=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(e)),c=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),d=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),h=a.length+c.length+d.length+r.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+h+" >>"),this.internal.write("stream"),this.internal.write(r+a+c+d+u),this.internal.write("endstream"),this.internal.write("endobj")},t=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};i.addMetadata=function(e,r){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceuri:r||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",t),this.internal.events.subscribe("postPutResources",n)),this}}($i.API),function(i){var n=i.API,t=n.pdfEscape16=function(a,c){for(var d,u=c.metadata.Unicode.widths,h=["","0","00","000","0000"],f=[""],v=0,C=a.length;v<C;
132++v){if(d=c.metadata.characterToGlyph(a.charCodeAt(v)),c.metadata.glyIdsUsed.push(d),c.metadata.toUnicode[d]=a.charCodeAt(v),u.indexOf(d)==-1&&(u.push(d),u.push([parseInt(c.metadata.widthOfGlyph(d),10)])),d=="0")return f.join("");d=d.toString(16),f.push(h[4-d.length],d)}return f.join("")},e=function(a){var c,d,u,h,f,v,C;for(f=`/CIDInit /ProcSet findresource begin 13312 dict begin 134begincmap 135/CIDSystemInfo << 136 /Registry (Adobe) 137 /Ordering (UCS) 138 /Supplement 0 139>> def 140/CMapName /Adobe-Identity-UCS def 141/CMapType 2 def 1421 begincodespacerange 143<0000><ffff> 144endcodespacerange`,u=[],v=0,C=(d=Object.keys(a).sort(function(y,A){return y-A})).length;v<C;v++)c=d[v],u.length>=100&&(f+=` 145`+u.length+` beginbfchar 146`+u.join(` 147`)+` 148endbfchar`,u=[]),a[c]!==void 0&&a[c]!==null&&typeof a[c].toString=="function"&&(h=("0000"+a[c].toString(16)).slice(-4),c=("0000"+(+c).toString(16)).slice(-4),u.push("<"+c+"><"+h+">"));return u.length&&(f+=` 149`+u.length+` beginbfchar 150`+u.join(` 151`)+` 152endbfchar 153`),f+=`endcmap 154CMapName currentdict /CMap defineresource pop 155end 156end`};n.events.push(["putFont",function(a){(function(c){var d=c.font,u=c.out,h=c.newObject,f=c.putStream;if(d.metadata instanceof i.API.TTFFont&&d.encoding==="Identity-H"){for(var v=d.metadata.Unicode.widths,C=d.metadata.subset.encode(d.metadata.glyIdsUsed,1),y="",A=0;A<C.length;A++)y+=String.fromCharCode(C[A]);var D=h();f({data:y,addLength1:!0,objectId:D}),u("endobj");var F=h();f({data:e(d.metadata.toUnicode),addLength1:!0,objectId:F}),u("endobj");var R=h();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+cf(d.fontName)),u("/FontFile2 "+D+" 0 R"),u("/FontBBox "+i.API.PDFObject.convert(d.metadata.bbox)),u("/Flags "+d.metadata.flags),u("/StemV "+d.metadata.stemV),u("/ItalicAngle "+d.metadata.italicAngle),u("/Asce
156nt "+d.metadata.ascender),u("/Descent "+d.metadata.decender),u("/CapHeight "+d.metadata.capHeight),u(">>"),u("endobj");var L=h();u("<<"),u("/Type /Font"),u("/BaseFont /"+cf(d.fontName)),u("/FontDescriptor "+R+" 0 R"),u("/W "+i.API.PDFObject.convert(v)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+d.encoding+")"),u(">>"),u(">>"),u("endobj"),d.objectNumber=h(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+F+" 0 R"),u("/BaseFont /"+cf(d.fontName)),u("/Encoding /"+d.encoding),u("/DescendantFonts ["+L+" 0 R]"),u(">>"),u("endobj"),d.isAlreadyPutted=!0}})(a)}]),n.events.push(["putFont",function(a){(function(c){var d=c.font,u=c.out,h=c.newObject,f=c.putStream;if(d.metadata instanceof i.API.TTFFont&&d.encoding==="WinAnsiEncoding"){for(var v=d.metadata.rawData,C="",y=0;y<v.length;y++)C+=String.fromCharCode(v[y]);var A=h();f({data:C,addLength1:!0,objectId:A}),u("endobj");var D=h();f({data:e(d.metadata.toUnicode),addLength1:!0,objectId:D}),u("endobj");var F=h();u("<<"),u("/Descent "+d.metadata.decender),u("/CapHeight "+d.metadata.capHeight),u("/StemV "+d.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+A+" 0 R"),u("/Flags 96"),u("/FontBBox "+i.API.PDFObject.convert(d.metadata.bbox)),u("/FontName /"+cf(d.fontName)),u("/ItalicAngle "+d.metadata.italicAngle),u("/Asce
156nt "+d.metadata.ascender),u(">>"),u("endobj"),d.objectNumber=h();for(var R=0;R<d.metadata.hmtx.widths.length;R++)d.metadata.hmtx.widths[R]=parseInt(d.metadata.hmtx.widths[R]*(1e3/d.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+D+" 0 R/BaseFont/"+cf(d.fontName)+"/FontDescriptor "+F+" 0 R/Encoding/"+d.encoding+" /FirstChar 29 /LastChar 255 /Widths "+i.API.PDFObject.convert(d.metadata.hmtx.widths)+">>"),u("endobj"),d.isAlreadyPutted=!0}})(a)}]);var r=function(a){var c,d=a.text||"",u=a.x,h=a.y,f=a.options||{},v=a.mutex||{},C=v.pdfEscape,y=v.activeFontKey,A=v.fonts,D=y,F="",R=0,L="",H=A[D].encoding;if(A[D].encoding!=="Identity-H")return{text:d,x:u,y:h,options:f,mutex:v};for(L=d,D=y,Array.isArray(d)&&(L=d[0]),R=0;R<L.length;R+=1)A[D].metadata.hasOwnProperty("cmap")&&(c=A[D].metadata.cmap.unicode.codeMap[L[R].charCodeAt(0)]),c||L[R].charCodeAt(0)<256&&A[D].metadata.hasOwnProperty("Unicode")?F+=L[R]:F+="";var se="";return parseInt(D.slice(1))<14||H==="WinAnsiEncoding"?se=C(F,D).split("").map(function(Ce){return Ce.charCodeAt(0).toString(16)}).join(""):H==="Identity-H"&&(se=t(F,A[D])),v.isHex=!0,{text:se,x:u,y:h,options:f,mutex:v}};n.events.push(["postProcessText",function(a){var c=a.text||"",d=[],u={text:c,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(c)){var h=0;for(h=0;h<c.length;h+=1)Array.isArray(c[h])&&c[h].length===3?d.push([r(Object.assign({},u,{text:c[h][0]})).text,c[h][1],c[h][2]]):d.push(r(Object.assign({},u,{text:c[h]})).text);a.text=d}else a.text=r(Object.assign({},u,{text:c})).text}])}($i),function(i){var n=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};i.existsFileInVFS=function(t){return n.call(this),this.internal.vFS[t]!==void 0},i.addFileToVFS=function(t,e){return n.call(this),this.internal.vFS[t]=e,this},i.getFileFromVFS=function(t){return n.call(this),this.internal.vFS[t]!==void 0?this.internal.vFS[t]:null}}($i.API),function(i){i.__bidiEngine__=i.prototype.__bidiEngine__=function(e){var r,a,c,d,u,h,f,v=n,C=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],y=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],A={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},D={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},F=["(",")","(","<",">","<","[","]","[","{","}","{","\xAB","\xBB","\xAB","\u2039","\u203A","\u2039","\u2045","\u2046","\u2045","\u207D","\u207E","\u207D","\u208D","\u208E","\u208D","\u2264","\u2265","\u2264","\u2329","\u232A","\u2329","\uFE59","\uFE5A","\uFE59","\uFE5B","\uFE5C","\uFE5B","\uFE5D","\uFE5E","\uFE5D","\uFE64","\uFE65","\uFE64"],R=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),L=!1,H=0;this.__bidiEngine__={};var se=function(W){var J=W.charCodeAt(),Ee=J>>8,Fe=D[Ee];return Fe!==void 0?v[256*Fe+(255&J)]:Ee===252||Ee===253?"AL":R.test(Ee)?"L":Ee===8?"R":"N"},Ce=function(W){for(var J,Ee=0;Ee<W.length;Ee++){if((J=se(W.charAt(Ee)))==="L")return!1;if(J==="R")return!0}return!1},Ue=function(W,J,Ee,Fe){var $e,Qe,ot,et,gt=J[Fe];switch(gt){case"L":case"R":L=!1;break;case"N":case"AN":break;case"EN":L&&(gt="AN");break;case"AL":L=!0,gt="R";break;case"WS":gt="N";break;case"CS":Fe<1||Fe+1>=J.length||($e=Ee[Fe-1])!=="EN"&&$e!=="AN"||(Qe=J[Fe+1])!=="EN"&&Qe!=="AN"?gt="N":L&&(Qe="AN"),gt=Qe===$e?Qe:"N";break;case"ES":gt=($e=Fe>0?Ee[Fe-1]:"B")==="EN"&&Fe+1<J.length&&J[Fe+1]==="EN"?"EN":"N";break;case"ET":if(Fe>0&&Ee[Fe-1]==="EN"){gt="EN";break}if(L){gt="N";break}for(ot=Fe+1,et=J.length;ot<et&&J[ot]==="ET";)ot++;gt=ot<et&&J[ot]==="EN"?"EN":"N";break;case"NSM":if(c&&!d){for(et=J.length,ot=Fe+1;ot<et&&J[ot]==="NSM";)ot++;if(ot<et){var vt=W[Fe],Kt=vt>=1425&&vt<=2303||vt===64286;if($e=J[ot],Kt&&($e==="R"||$e==="AL")){gt="R";break}}}gt=Fe<1||($e=J[Fe-1])==="B"?"N":Ee[Fe-1];break;case"B":L=!1,r=!0,gt=H;break;case"S":a=!0,gt="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":L=!1;break;case"BN":gt="N"}return gt},re=function(W,J,Ee){var Fe=W.split("");return Ee&&ae(Fe,Ee,{hiLevel:H}),Fe.reverse(),J&&J.reverse(),Fe.join("")},ae=function(W,J,Ee){var Fe,$e,Qe,ot,et,gt=-1,vt=W.length,Kt=0,O=[],Q=H?y:C,V=[];for(L=!1,r=!1,a=!1,$e=0;$e<vt;$e++)V[$e]=se(W[$e]);for(Qe=0;Qe<vt;Qe++){if(et=Kt,O[Qe]=Ue(W,V,O,Qe),Fe=240&(Kt=Q[et][A[O[Qe]]]),Kt&=15,J[Qe]=ot=Q[Kt][5],Fe>0)if(Fe===16){for($e=gt;$e<Qe;$e++)J[$e]=1;gt=-1}else gt=-1;if(Q[Kt][6])gt===-1&&(gt=Qe);else if(gt>-1){for($e=gt;$e<Qe;$e++)J[$e]=ot;gt=-1}V[Qe]==="B"&&(J[Qe]=0),Ee.hiLevel|=ot}a&&function(Y,we,Ve){for(var Ge=0;Ge<Ve;Ge++)if(Y[Ge]==="S"){we[Ge]=H;for(var je=Ge-1;je>=0&&Y[je]==="WS";je--)we[je]=H}}(V,J,vt)},ve=function(W,J,Ee,Fe,$e){if(!($e.hiLevel<W)){if(W===1&&H===1&&!r)return J.reverse(),void(Ee&&Ee.reverse());for(var Qe,ot,et,gt,vt=J.length,Kt=0;Kt<vt;){if(Fe[Kt]>=W){for(et=Kt+1;et<vt&&Fe[et]>=W;)et++;for(gt=Kt,ot=et-1;gt<ot;gt++,ot--)Qe=J[gt],J[gt]=J[ot],J[ot]=Qe,Ee&&(Qe=Ee[gt],Ee[gt]=Ee[ot],Ee[ot]=Qe);Kt=et}Kt++}}},Me=function(W,J,Ee){var Fe=W.split(""),$e={hiLevel:H};return Ee||(Ee=[]),ae(Fe,Ee,$e),function(Qe,ot,et){if(et.hiLevel!==0&&f)for(var gt,vt=0;vt<Qe.length;vt++)ot[vt]===1&&(gt=F.indexOf(Qe[vt]))>=0&&(Qe[vt]=F[gt+1])}(Fe,Ee,$e),ve(2,Fe,J,Ee,$e),ve(1,Fe,J,Ee,$e),Fe.join("")};return this.__bidiEngine__.doBidiReorder=function(W,J,Ee){if(function($e,Qe){if(Qe)for(var ot=0;ot<$e.length;ot++)Qe[ot]=ot;d===void 0&&(d=Ce($e)),h===void 0&&(h=Ce($e))}
vendor: 10,568 bytes, line 156
156(W,J),c||!u||h)if(c&&u&&d^h)H=d?1:0,W=re(W,J,Ee);else if(!c&&u&&h)H=d?1:0,W=Me(W,J,Ee),W=re(W,J);else if(!c||d||u||h){if(c&&!u&&d^h)W=re(W,J),d?(H=0,W=Me(W,J,Ee)):(H=1,W=Me(W,J,Ee),W=re(W,J));else if(c&&d&&!u&&h)H=1,W=Me(W,J,Ee),W=re(W,J);else if(!c&&!u&&d^h){var Fe=f;d?(H=1,W=Me(W,J,Ee),H=0,f=!1,W=Me(W,J,Ee),f=Fe):(H=0,W=Me(W,J,Ee),W=re(W,J),H=1,f=!1,W=Me(W,J,Ee),f=Fe,W=re(W,J))}}else H=0,W=Me(W,J,Ee);else H=d?1:0,W=Me(W,J,Ee);return W},this.__bidiEngine__.setOptions=function(W){W&&(c=W.isInputVisual,u=W.isOutputVisual,d=W.isInputRtl,h=W.isOutputRtl,f=W.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var n=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],t=new i.__bidiEngine__({isInputVisual:!0});i.API.events.push(["postProcessText",function(e){var r=e.text;e.x,e.y;var a=e.options||{};e.mutex,a.lang;var c=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,t.setOptions(a),Object.prototype.toString.call(r)==="[object Array]"){var d=0;for(c=[],d=0;d<r.length;d+=1)Object.prototype.toString.call(r[d])==="[object Array]"?c.push([t.doBidiReorder(r[d][0]),r[d][1],r[d][2]]
vendor: 7,836 bytes, line 156
156):c.push([t.doBidiReorder(r[d])]);e.text=c}else e.text=t.doBidiReorder(r);t.setOptions({isInputVisual:!0})}])}($i),$i.API.TTFFont=function(){function i(n){var t;if(this.rawData=n,t=this.contents=new du(n),this.contents.pos=4,t.readString(4)==="ttcf")throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new Yie(this),this.registerTTF()}return i.open=function(n){return new i(n)},i.prototype.parse=function(){return this.directory=new Fie(this.contents),this.head=new Oie(this),this.name=new Uie(this),this.cmap=new IN(this),this.toUnicode={},this.hhea=new Nie(this),this.maxp=new jie(this),this.hmtx=new Wie(this),this.post=new Bie(this),this.os2=new Lie(this),this.loca=new zie(this),this.glyf=new Hie(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},i.prototype.registerTTF=function(){var n,t,e,r,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var c,d,u,h;for(h=[],c=0,d=(u=this.bbox).length;c<d;c++)n=u[c],h.push(Math.round(n*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(e=255&(r=this.post.italic_angle),(32768&(t=r>>16))!=0&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+e)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},i.prototype.characterToGlyph=function(n){var t;return((t=this.cmap.unicode)!=null?t.codeMap[n]:void 0)||0},i.prototype.widthOfGlyph=function(n){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(n).advance*t},i.prototype.widthOfString=function(n,t,e){var r,a,c,d;for(c=0,a=0,d=(n=""+n).length;0<=d?a<d:a>d;a=0<=d?++a:--a)r=n.charCodeAt(a),c+=this.widthOfGlyph(this.characterToGlyph(r))+e*(1e3/t)||0;return c*(t/1e3)},i.prototype.lineHeight=function(n,t){var e;return t==null&&(t=!1),e=t?this.lineGap:0,(this.ascender+e-this.decender)/1e3*n},i}();var _c,du=function(){function i(n){this.data=n??[],this.pos=0,this.length=this.data.length}return i.prototype.readByte=function(){return this.data[this.pos++]},i.prototype.writeByte=function(n){return this.data[this.pos++]=n},i.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},i.prototype.writeUInt32=function(n){return this.writeByte(n>>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},i.prototype.readInt32=function(){var n;return(n=this.readUInt32())>=2147483648?n-4294967296:n},i.prototype.writeInt32=function(n){return n<0&&(n+=4294967296),this.writeUInt32(n)},i.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},i.prototype.writeUInt16=function(n){return this.writeByte(n>>8&255),this.writeByte(255&n)},i.prototype.readInt16=function(){var n;return(n=this.readUInt16())>=32768?n-65536:n},i.prototype.writeInt16=function(n){return n<0&&(n+=65536),this.writeUInt16(n)},i.prototype.readString=function(n){var t,e;for(e=[],t=0;0<=n?t<n:t>n;t=0<=n?++t:--t)e[t]=String.fromCharCode(this.readByte());return e.join("")},i.prototype.writeString=function(n){var t,e,r;for(r=[],t=0,e=n.length;0<=e?t<e:t>e;t=0<=e?++t:--t)r.push(this.writeByte(n.charCodeAt(t)));return r},i.prototype.readShort=function(){return this.readInt16()},i.prototype.writeShort=function(n){return this.writeInt16(n)},i.prototype.readLongLong=function(){var n,t,e,r,a,c,d,u;return n=this.readByte(),t=this.readByte(),e=this.readByte(),r=this.readByte(),a=this.readByte(),c=this.readByte(),d=this.readByte(),u=this.readByte(),128&n?-1*(72057594037927940*(255^n)+281474976710656*(255^t)+1099511627776*(255^e)+4294967296*(255^r)+16777216*(255^a)+65536*(255^c)+256*(255^d)+(255^u)+1):72057594037927940*n+281474976710656*t+1099511627776*e+4294967296*r+16777216*a+65536*c+256*d+u},i.prototype.writeLongLong=function(n){var t,e;return t=Math.floor(n/4294967296),e=4294967295&n,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},i.prototype.readInt=function(){return this.readInt32()},i.prototype.writeInt=function(n){return this.writeInt32(n)},i.prototype.read=function(n){var t,e;for(t=[],e=0;0<=n?e<n:e>n;e=0<=n?++e:--e)t.push(this.readByte());return t},i.prototype.write=function(n){var t,e,r,a;for(a=[],e=0,r=n.length;e<r;e++)t=n[e],a.push(this.writeByte(t));return a},i}(),Fie=function(){var i;function n(t){var e,r,a;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},r=0,a=this.tableCount;0<=a?r<a:r>a;r=0<=a?++r:--r)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}return n.prototype.encode=function(t){var e,r,a,c,d,u,h,f,v,C,y,A,D;for(D in y=Object.keys(t).length,u=Math.log(2),v=16*Math.floor(Math.log(y)/u),c=Math.floor(v/u),f=16*y-v,(r=new du).writeInt(this.scalarType),r.writeShort(y),r.writeShort(v),r.writeShort(c),r.writeShort(f),a=16*y,h=r.pos+a,d=null,A=[],t)for(C=t[D],r.writeString(D),r.writeInt(i(C)),r.writeInt(h),r.writeInt(C.length),A=A.concat(C),D==="head"&&(d=h),h+=C.length;h%4;)A.push(0),h++;return r.write(A),e=2981146554-i(r.data),r.pos=d+8,r.writeUInt32(e),r.data},i=function(t){var e,r,a,c;for(t=kN.call(t);t.length%4;)t.push(0);for(a=new du(t),r=0,e=0,c=t.length;e<c;e=e+=4)r+=a.readUInt32();return 4294967295&r},n}(),Rie={}.hasOwnProperty,rd=function(i,n){for(var t in n)Rie.call(n,t)&&(i[t]=n[t]);function e(){this.constructor=i}return e.prototype=n.prototype,i.prototype=new e,i.__super__=n.prototype,i};_c=function(){function i(n){var t;this.file=n,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return i.prototype.parse=function(){},i.prototype.encode=function(){},i.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},i}();var Oie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="head",n.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},n.prototype.encode=function(t){var e;return(e=new du).writeInt(this.version),e.writeInt(this.revision),e.writeInt(this.checkSumAdjustment),e.writeInt(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.writeLongLong(this.created),e.writeLongLong(this.modified),e.writeShort(this.xMin),e.writeShort(this.yMin),e.writeShort(this.xMax),e.writeShort(this.yMax
156),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort(this.fontDirectionHint),e.writeShort(t),e.writeShort(this.glyphDataFormat),e.data},n}(),vN=function(){function i(n,t){var e,r,a,c,d,u,h,f,v,C,y,A,D,F,R,L,H;switch(this.platformID=n.readUInt16(),this.encodingID=n.readShort(),this.offset=t+n.readInt(),v=n.pos,n.pos=this.offset,this.format=n.readUInt16(),this.length=n.readUInt16(),this.language=n.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(u=0;u<256;++u)this.codeMap[u]=n.readByte();break;case 4:for(y=n.readUInt16(),C=y/2,n.pos+=6,a=function(){var se,Ce;for(Ce=[],u=se=0;0<=C?se<C:se>C;u=0<=C?++se:--se)Ce.push(n.readUInt16());return Ce}(),n.pos+=2,D=function(){var se,Ce;for(Ce=[],u=se=0;0<=C?se<C:se>C;u=0<=C?++se:--se)Ce.push(n.readUInt16());return Ce}(),h=function(){var se,Ce;for(Ce=[],u=se=0;0<=C?se<C:se>C;u=0<=C?++se:--se)Ce.push(n.readUInt16());return Ce}(),f=function(){var se,Ce;for(Ce=[],u=se=0;0<=C?se<C:se>C;u=0<=C?++se:--se)Ce.push(n.readUInt16());return Ce}(),r=(this.length-n.pos+this.offset)/2,d=function(){var se,Ce;for(Ce=[],u=se=0;0<=r?se<r:se>r;u=0<=r?++se:--se)Ce.push(n.readUInt16());return Ce}(),u=R=0,H=a.length;R<H;u=++R)for(F=a[u],e=L=A=D[u];A<=F?L<=F:L>=F;e=A<=F?++L:--L)f[u]===0?c=e+h[u]:(c=d[f[u]/2+(e-A)-(C-u)]||0)!==0&&(c+=h[u]),this.codeMap[e]=65535&c}n.pos=v}return i.encode=function(n,t){var e,r,a,c,d,u,h,f,v,C,y,A,D,F,R,L,H,se,Ce,Ue,re,ae,ve,Me,W,J,Ee,Fe,$e,Qe,ot,et,gt,vt,Kt,O,Q,V,Y,we,Ve,Ge,je,it,It,Nt;switch(Fe=new du,c=Object.keys(n).sort(function(qt,ni){return qt-ni}),t){case"macroman":for(D=0,F=function(){var qt=[];for(A=0;A<256;++A)qt.push(0);return qt}(),L={0:0},a={},$e=0,gt=c.length;$e<gt;$e++)L[je=n[r=c[$e]]]==null&&(L[je]=++D),a[r]={old:n[r],new:L[n[r]]},F[r]=L[n[r]];return Fe.writeUInt16(1),Fe.writeUInt16(0),Fe.writeUInt32(12),Fe.writeUInt16(0),Fe.writeUInt16(262),Fe.writeUInt16(0),Fe.write(F),{charMap:a,subtable:Fe.data,maxGlyphID:D+1};case"unicode":for(J=[],v=[],H=0,L={},e={},R=h=null,Qe=0,vt=c.length;Qe<vt;Qe++)L[Ce=n[r=c[Qe]]]==null&&(L[Ce]=++H),e[r]={old:Ce,new:L[Ce]},d=L[Ce]-r,R!=null&&d===h||(R&&v.push(R),J.push(r),h=d),R=r;for(R&&v.push(R),v.push(65535),J.push(65535),Me=2*(ve=J.length),ae=2*Math.pow(Math.log(ve)/Math.LN2,2),C=Math.log(ae/2)/Math.LN2,re=2*ve-ae,u=[],Ue=[],y=[],A=ot=0,Kt=J.length;ot<Kt;A=++ot){if(W=J[A],f=v[A],W===65535){u.push(0),Ue.push(0);break}if(W-(Ee=e[W].new)>=32768)for(u.push(0),Ue.push(2*(y.length+ve-A)),r=et=W;W<=f?et<=f:et>=f;r=W<=f?++et:--et)y.push(e[r].new);else u.push(Ee-W),Ue.push(0)}for(Fe.writeUInt16(3),Fe.writeUInt16(1),Fe.writeUInt32(12),Fe.writeUInt16(4),Fe.writeUInt16(16+8*ve+2*y.length),Fe.writeUInt16(0),Fe.writeUInt16(Me),Fe.writeUInt16(ae),Fe.writeUInt16(C),Fe.writeUInt16(re),Ve=0,O=v.length;Ve<O;Ve++)r=v[Ve],Fe.writeUInt16(r);for(Fe.writeUInt16(0),Ge=0,Q=J.length;Ge<Q;Ge++)r=J[Ge],Fe.writeUInt16(r);for(it=0,V=u.length;it<V;it++)d=u[it],Fe.writeUInt16(d);for(It=0,Y=Ue.length;It<Y;It++)se=Ue[It],Fe.writeUInt16(se);for(Nt=0,we=y.length;Nt<we;Nt++)D=y[Nt],Fe.writeUInt16(D);return{charMap:e,subtable:Fe.data,maxGlyphID:H+1}}},i}(),IN=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="cmap",n.prototype.parse=function(t){var e,r,a;for(t.pos=this.offset,this.version=t.readUInt16(),a=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=a?r<a:r>a;r=0<=a?++r:--r)e=new vN(t,this.offset),this.tables.push(e),e.isUnicode&&this.unicode==null&&(this.unicode=e);return!0},n.encode=function(t,e){var r,a;return e==null&&(e="macroman"),r=vN.encode(t,e),(a=new du).writeUInt16(0),a.writeUInt16(1),r.table=a.data.concat(r.subtable),r},n}(),Nie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="hhea",n.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},n}(),Lie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="OS/2",n.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var e,r;for(r=[],e=0;e<10;++e)r.push(t.readByte());return r}(),this.charRange=function(){var e,r;for(r=[],e=0;e<4;++e)r.push(t.readInt());return r}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var e,r;for(r=[],e=0;e<2;e=++e)r.push(t.readInt());return r}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},n}(),Bie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="post",n.prototype.parse=function(t){var e,r,a;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:break;case 131072:var c;for(r=t.readUInt16(),this.glyphNameIndex=[],c=0;0<=r?c<r:c>r;c=0<=r?++c:--c)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],a=[];t.pos<this.offset+this.length;)e=t.readByte(),a.push(this.names.push(t.readString(e)));return a;case 151552:return r=t.readUInt16(),this.offsets=t.read(r);case 196608:break;case 262144:return this.map=(function(){var d,u,h;for(h=[],c=d=0,u=this.file.maxp.numGlyphs;0<=u?d<u:d>u;c=0<=u?++d:--d)h.push(t.readUInt32());return h}).call(this)}},n}(),Vie=function(i,n){this.raw=i,this.length=i.length,this.platformID=n.platformID,this.encodingID=n.encodingID,this.languageID=n.languageID},Uie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="name",n.prototype.parse=function(t){var e,r,a,c,d,u,h,f,v,C,y;for(t.pos=this.offset,t.readShort(),e=t.readShort(),u=t.readShort(),r=[],c=0;0<=e?c<e:c>e;
156c=0<=e?++c:--c)r.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+u+t.readShort()});for(h={},c=v=0,C=r.length;v<C;c=++v)a=r[c],t.pos=a.offset,f=t.readString(a.length),d=new Vie(f,a),h[y=a.nameID]==null&&(h[y]=[]),h[a.nameID].push(d);this.strings=h,this.copyright=h[0],this.fontFamily=h[1],this.fontSubfamily=h[2],this.uniqueSubfamily=h[3],this.fontName=h[4],this.version=h[5];try{this.postscriptName=h[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=h[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=h[7],this.manufacturer=h[8],this.designer=h[9],this.description=h[10],this.vendorUrl=h[11],this.designerUrl=h[12],this.license=h[13],this.licenseUrl=h[14],this.preferredFamily=h[15],this.preferredSubfamily=h[17],this.compatibleFull=h[18],this.sampleText=h[19]},n}(),jie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="maxp",n.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},n}(),Wie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="hmtx",n.prototype.parse=function(t){var e,r,a,c,d,u,h;for(t.pos=this.offset,this.metrics=[],e=0,u=this.file.hhea.numberOfMetrics;0<=u?e<u:e>u;e=0<=u?++e:--e)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var f,v;for(v=[],e=f=0;0<=a?f<a:f>a;e=0<=a?++f:--f)v.push(t.readInt16());return v}(),this.widths=(function(){var f,v,C,y;for(y=[],f=0,v=(C=this.metrics).length;f<v;f++)c=C[f],y.push(c.advance);return y}).call(this),r=this.widths[this.widths.length-1],h=[],e=d=0;0<=a?d<a:d>a;e=0<=a?++d:--d)h.push(this.widths.push(r));return h},n.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},n}(),kN=[].slice,Hie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="glyf",n.prototype.parse=function(){return this.cache={}},n.prototype.glyphFor=function(t){var e,r,a,c,d,u,h,f,v,C;return t in this.cache?this.cache[t]:(c=this.file.loca,e=this.file.contents,r=c.indexOf(t),(a=c.lengthOf(t))===0?this.cache[t]=null:(e.pos=this.offset+r,d=(u=new du(e.read(a))).readShort(),f=u.readShort(),C=u.readShort(),h=u.readShort(),v=u.readShort(),this.cache[t]=d===-1?new $ie(u,f,C,h,v):new Gie(u,d,f,C,h,v),this.cache[t]))},n.prototype.encode=function(t,e,r){var a,c,d,u,h;for(d=[],c=[],u=0,h=e.length;u<h;u++)a=t[e[u]],c.push(d.length),a&&(d=d.concat(a.encode(r)));return c.push(d.length),{table:d,offsets:c}},n}(),Gie=function(){function i(n,t,e,r,a,c){this.raw=n,this.numberOfContours=t,this.xMin=e,this.yMin=r,this.xMax=a,this.yMax=c,this.compound=!1}return i.prototype.encode=function(){return this.raw.data},i}(),$ie=function(){function i(n,t,e,r,a){var c,d;for(this.raw=n,this.xMin=t,this.yMin=e,this.xMax=r,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],c=this.raw;d=c.readShort(),this.glyphOffsets.push(c.pos),this.glyphIDs.push(c.readUInt16()),32&d;)c.pos+=1&d?4:2,128&d?c.pos+=8:64&d?c.pos+=4:8&d&&(c.pos+=2)}return i.prototype.encode=function(){var n,t,e;for(t=new du(kN.call(this.raw.data)),n=0,e=this.glyphIDs.length;n<e;++n)t.pos=this.glyphOffsets[n];return t.data},i}(),zie=function(i){function n(){return n.__super__.constructor.apply(this,arguments)}return rd(n,_c),n.prototype.tag="loca",n.prototype.parse=function(t){var e,r;return t.pos=this.offset,e=this.file.head.indexToLocFormat,this.offsets=e===0?(function(){var a,c;for(c=[],r=0,a=this.length;r<a;r+=2)c.push(2*t.readUInt16());return c}).call(this):(function(){var a,c;for(c=[],r=0,a=this.length;r<a;r+=4)c.push(t.readUInt32());return c}).call(this)},n.prototype.indexOf=function(t){return this.offsets[t]},n.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]}
156,n.prototype.encode=function(t,e){for(var r=new Uint32Array(this.offsets.length),a=0,c=0,d=0;d<r.length;++d)if(r[d]=a,c<e.length&&e[c]==d){++c,r[d]=a;var u=this.offsets[d],h=this.offsets[d+1]-u;h>0&&(a+=h)}for(var f=new Array(4*r.length),v=0;v<r.length;++v)f[4*v+3]=255&r[v],f[4*v+2]=(65280&r[v])>>8,f[4*v+1]=(16711680&r[v])>>16,f[4*v]=(4278190080&r[v])>>24;return f},n}(),Yie=function(){function i(n){this.font=n,this.subset={},this.unicodes={},this.next=33}return i.prototype.generateCmap=function(){var n,t,e,r,a;for(t in r=this.font.cmap.tables[0].codeMap,n={},a=this.subset)e=a[t],n[t]=r[e];return n},i.prototype.glyphsFor=function(n){var t,e,r,a,c,d,u;for(r={},c=0,d=n.length;c<d;c++)r[a=n[c]]=this.font.glyf.glyphFor(a);for(a in t=[],r)(e=r[a])!=null&&e.compound&&t.push.apply(t,e.glyphIDs);if(t.length>0)for(a in u=this.glyphsFor(t))e=u[a],r[a]=e;return r},i.prototype.encode=function(n,t){var e,r,a,c,d,u,h,f,v,C,y,A,D,F,R;for(r in e=IN.encode(this.generateCmap(),"unicode"),c=this.glyphsFor(n),y={0:0},R=e.charMap)y[(u=R[r]).old]=u.new;for(A in C=e.maxGlyphID,c)A in y||(y[A]=C++);return f=function(L){var H,se;for(H in se={},L)se[L[H]]=H;return se}(y),v=Object.keys(f).sort(function(L,H){return L-H}),D=function(){var L,H,se;for(se=[],L=0,H=v.length;L<H;L++)d=v[L],se.push(f[d]);return se}(),a=this.font.glyf.encode(c,D,y),h=this.font.loca.encode(a.offsets,D),F={cmap:this.font.cmap.raw(),glyf:a.table,loca:h,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(F["OS/2"]=this.font.os2.raw()),this.font.directory.encode(F)},i}();$i.API.PDFObject=function(){var i;function n(){}return i=function(t,e){return(Array(e+1).join("0")+t).slice(-e)},n.convert=function(t){var e,r,a,c;if(Array.isArray(t))return"["+function(){var d,u,h;for(h=[],d=0,u=t.length;d<u;d++)e=t[d],h.push(n.convert(e));return h}().join(" ")+"]";if(typeof t=="string")return"/"+t;if(t?.isString)return"("+t+")";if(t instanceof Date)return"(D:"+i(t.getUTCFullYear(),4)+i(t.getUTCMonth(),2)+i(t.getUTCDate(),2)+i(t.getUTCHours(),2)+i(t.getUTCMinutes(),2)+i(t.getUTCSeconds(),2)+"Z)";if({}.toString.call(t)==="[object Object]"){for(r in a=["<<"],t)c=t[r],a.push("/"+r+" "+n.convert(c));return a.push(">>"),a.join(` 157`)}return""+t},n}();var qie=["reviewModal"],Kie=["invoiceContent"],Xie=i=>({collapsed:i}),Jie=(i,n,t,e)=>({approved:i,rejected:n,hold:t,"in-review":e});function Zie(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Qie(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function ene(i,n){if(i&1){let t=he();s(0,"button",60),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.generatePDF(r))}),s(1,"i",14),l(2,"picture_as_pdf"),o()()}}function tne(i,n){if(i&1){let t=he();s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),o(),s(11,"td",23)(12,"span",56),l(13),o()(),s(14,"td",24),l(15),I(16,"currencyFormat"),o(),s(17,"td",23)(18,"div",57)(19,"button",58),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onReviewClick(r))}),s(20,"i",14),l(21,"visibility"),o()(),T(22,ene,3,0,"button",59),o()()()}if(i&2){let t=n.$implicit,e=w();m(2),b(t.guide_id),m(2),b(t.bank_code),m(2),b(t.bank_branch_code),m(2),b(t.bank_account_number),m(2),b(t.bank_account_name),m(2),p("ngClass",El(11,Jie,t.status==="approved",t.status==="rejected",t.status==="hold",!t.status)),m(),_(" ",e.getStatusLabel(t.status)," "),m(2),_(" ",M(16,9,t.totals.total_after_tax||0),"/- "),m(7),p("ngIf",t.status==="approved")}}function ine(i,n){if(i&1&&(s(0,"p"),l(1),o()),i&2){let t=w(2);m(),_(" ",t.guideDetails==null?null:t.guideDetails.address_line_2," ")}}function nne(i,n){if(i&1&&(s(0,"div",72)(1,"div",73),l(2),I(3,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(2),W_(" ",t.name," (",t.country,") - ",t.count," x LKR ",M(3,4,t.price)," ")}}function rne(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div",68),l(3),I(4,"date"),o(),s(5,"div",69),T(6,nne,4,6,"div",70),o()(),s(7,"td",71),l(8),I(9,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(3),Pi(" ",Jt(4,4,t.issueddate,"MMM dd, yyyy hh:mm a")," - Entrance Ticket# ",t.serialnumber," "),m(3),p("ngForOf",t.visitordetails),m(2),_(" ",M(9,7,t.visitortotal)," ")}}
157function ane(i,n){if(i&1&&(s(0,"div",41)(1,"div",42)(2,"div",43)(3,"div",44)(4,"p",45),l(5,"from"),o(),s(6,"h6"),l(7,"Ambuluwawa Biodiversity Complex"),o(),s(8,"p"),l(9,"Gampola 20500"),o(),s(10,"p"),l(11,"Sri Lanka"),o(),s(12,"p"),l(13,"+94 71 272 4724"),o(),s(14,"p"),l(15,"[email protected]"),o()(),s(16,"div",46)(17,"p",45),l(18,"to"),o(),s(19,"h6"),l(20),o(),s(21,"p"),l(22),o(),T(23,ine,2,1,"p",47),s(24,"p"),l(25),o(),s(26,"p"),l(27),o(),s(28,"p"),l(29),o()(),s(30,"div",48)(31,"p",45),l(32,"Statement / Period"),o(),s(33,"h6"),l(34),o(),s(35,"p"),l(36),o(),s(37,"p"),l(38),o(),s(39,"p"),l(40,"REF Expenses"),o()()()(),s(41,"div",49)(42,"div",20)(43,"table",21)(44,"thead")(45,"tr")(46,"th"),l(47,"DESCRIPTION"),o(),s(48,"th",24),l(49,"SUB TOTAL (LKR)"),o()()(),s(50,"tbody"),T(51,rne,10,9,"tr",11),o()()()(),s(52,"div",61)(53,"div",51)(54,"div",52)(55,"small"),l(56,"Total Amount (LKR):"),o(),s(57,"span",53),l(58),I(59,"currencyFormat"),o()()(),s(60,"div",54)(61,"div",62)(62,"div",63)(63,"small",64),l(64,"Total Expense before tax (LKR):"),o(),s(65,"span",65),l(66),I(67,"currencyFormat"),o()(),s(68,"div",63)(69,"small",64),l(70,"Applied Tax (LKR):"),o(),s(71,"span",65),l(72),I(73,"currencyFormat"),o()()(),s(74,"div",52)(75,"small"),l(76,"Total expense (LKR):"),o(),s(77,"span",55),l(78),I(79,"currencyFormat"),o()()()(),s(80,"div",66)(81,"p"),B(82,"i",67),l(83," ambuluwawa.com"),o()()()),i&2){let t=w();m(20),Pi(" ",t.guideDetails==null?null:t.guideDetails.firstname," ",t.guideDetails==null?null:t.guideDetails.lastname," "),m(2),b(t.guideDetails==null?null:t.guideDetails.address_line_1),m(),p("ngIf",t.guideDetails==null?null:t.guideDetails.address_line_2),m(2),Pi("",t.guideDetails==null?null:t.guideDetails.city,", ",t.guideDetails==null?null:t.guideDetails.postal_code),m(2),b(t.guideDetails==null?null:t.guideDetails.country),m(2),b(t.guideDetails==null?null:t.guideDetails.phone),m(5),_("Statement ID: ",t.userCode),m(2),Pi("",t.selectedMonth," ",t.selectedYear),m(2),_("Guide# ",t.userCode),m(13),p("ngForOf",t.transactionData),m(7),_(" ",M(59,17,t.guideTotals==null?null:t.guideTotals.total_transactions_amount),"/- "),m(8),_(" ",M(67,19,t.guideTotals==null?null:t.guideTotals.original_total_expense),"/- "),m(6),_(" ",M(73,21,t.guideTotals==null?null:t.guideTotals.applied_tax),"/- "),m(6),_(" ",M(79,23,t.guideTotals==null?null:t.guideTotals.total_after_tax),"/- ")}}function one(i,n){if(i&1&&(s(0,"p"),l(1),o()),i&2){let t=w();m(),_(" ",t.guideDetails==null?null:t.guideDetails.address_line_2," ")}}function sne(i,n){if(i&1&&(Ui(0),l(1),I(2,"currencyFormat"),ji()),i&2){let t=n.$implicit,e=n.last;m(),H_(" ",t.name," (",t.country,") - ",t.count," x LKR ",M(2,5,t.price),"",e?"":" / "," ")}}function lne(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div",74),l(3),I(4,"date"),o(),s(5,"div",69),T(6,sne,3,7,"ng-container",11),o()(),s(7,"td",24),l(8),I(9,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(3),Pi(" ",Jt(4,4,t.issueddate,"MMM dd, yyyy hh:mm a")," - Entrance Ticket# ",t.serialnumber," "),m(3),p("ngForOf",t.visitordetails),m(2),_(" ",M(9,7,t.visitortotal)," ")}}var AN=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.tourGuideServiceService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.cdr=h,this.selectedMonth="",this.selectedYear="",this.months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.years=[],this.isCollapsed=!1,this.items=[],this.isAccountant=!1,this.isOfficeUser=!1,this.transactionData=[],this.userCode=""}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.onClickGenerategetGuideWiseExpense(),this.checkUserRole()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}setDefaultMonth(){let e=new Date;e.setMonth(e.getMonth()-1),this.selectedMonth=this.months[e.getMonth()],this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear();this.years=Array.from({length:6},(r,a)=>e-(5-a))}onClickGenerateExcel(){this.getGuideExpenseExcel()}getGuideExpenseExcel(){let e=this.getMonthNumber(this.selectedMonth),r=this.selectedYear;e&&r&&(this.spinner.show(),this.tourGuideServiceService.getGuideExpenseExcel(Number(e),Number(r)).subscribe({next:a=>{let c=`Guide expense report ${e}-${r}.xlsx`;(0,MN.default)(a,c),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:a=>{console.error("Error downloading Excel:",a),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGenerategetGuideWiseExpense(){if(this.selectedMonth&&this.selectedYear){let e=this.getMonthNumber(this.selectedMonth);this.getGuideWiseExpense(e,this.selectedYear)}}getGuideWiseExpense(e,r){this.spinner.show(),this.tourGuideServiceService.getGuideWiseExpense(e,r).subscribe({next:a=>{a&&a.data&&(this.items=a.data.items.map(c=>tt(le({},c),{expense:Number(c.expense),totals:{original_total_expense:Number(c.totals?.original_total_expense||0),applied_tax:Number(c.totals?.applied_tax||0),total_after_tax:Number(c.totals?.total_after_tax||0)}}))),this.spinner.hide(),this.items.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}getMonthNumber(e){return{January:"01",February:"02",March:"03",April:"04",May:"05",June:"06",July:"07",August:"08",September:"09",October:"10",November:"11",December:"12"}[e]}onReviewClick(e){this.getGuideExpenseTransaction(e)}getGuideExpenseTransaction(e){this.spinner.show();let r=this.getMonthNumber(this.selectedMonth);r&&this.selectedYear&&this.tourGuideServiceService.getGuideExpenseTransaction(e.guide_id,parseInt(r,10),parseInt(this.selectedYear,10)).subscribe({next:a=>{this.guideDetails=a.data,console.log(this.guideDetails),this.transactionData=a.data.transactions,console.log(this.transactionData),this.guideTotals=a.data.totals,a.data&&(this.userCode=a.data.usercode),this.spinner.hide();let c=document.getElementById("reviewModal");c&&new bootstrap.Modal(c).show()},error:a=>{console.error("Error fetching transaction data:",a),this.spinner.hide(),this.toastr.error("Failed to fetch transaction data","Error")}})}calculateTotals(){let e=0,r=0;for(let a of this.transactionData)e+=Number(a.visitortotal),r+=Number(a.expense);return{totalAmount:e,totalExpense:r}}updateStatus(e,r){if(!this.transactionData.length){this.toastr.error("No transaction data available");return}let a=this.guideDetails.usercode,c=this.getMonthNumber(this.selectedMonth),d=parseInt(this.selectedYear);console.log(a,c,d,e,r),this.spinner.show(),this.tourGuideServiceService.getUpdateStatus(a,parseInt(c),d,e,r).subscribe({next:u=>{this.toastr.success(`Status updated to ${e} successfully`),this.spinner.hide();let h=document.getElementById("reviewModal");h&&bootstrap.Modal.getInstance(h)?.hide(),this.onClickGenerategetGuideWiseExpense()},error:u=>{console.error("Error updating status:",u),this.toastr.error("Failed to update status"),this.spinner.hide()}})}getStatusLabel(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"In Review"}getStatusClass(e){switch(e){case"approved":return"text-success";case"rejected":return"text-danger";case"hold":return"text-warning";default:return"text-secondary"}}generatePDF(e){return ye(this,null,function*(){this.spinner.show();try{let r=this.getMonthNumber(this.selectedMonth),a=yield this.tourGuideServiceService.getGuideExpenseTransaction(e.guide_id,parseInt(r),parseInt(this.selectedYear)).toPromise();this.guideDetails=a.data,this.transactionData=a.data.transactions,this.guideTotals=a.data.totals;let c=new $i("p","mm","a4"),d=c.internal.pageSize.width,u=15,h=d-u*2,f=5,v="assets/ambuluwawaLogo.png",C=40,y=20,A=u,D=f;c.addImage(v,"PNG",A,D,C,y),f=D+y+5,c.setFontSize(9),c.setTextColor(128,128,128),c.text("from",u,f),f+=6,c.setTextColor(0),c.setFont("helvetica","normal"),c.text("Ambuluwawa Biodiversity Complex",u,f),f+=5,c.text("Gampola 20500",u,f),f+=5,c.text("Sri Lanka",u,f),f+=5,c.text("+94 71 272 4724",u,f),f+=5,c.text("[email protected]",u,f);let F=d/2.5,R=D+y+5;c.setTextColor(128,128,128),c.text("to",F,R),R+=6,c.setTextColor(0),c.text(`${this.guideDetails.firstname} ${this.guideDetails.lastname}`,F,R),R+=5,c.text(this.guideDetails.address_line_1,F,R),this.guideDetails.address_line_2&&(R+=5,c.text(this.guideDetails.address_line_2,F,R)),R+=5,c.text(`${this.guideDetails.city}, ${this.guideDetails.postal_code}`,F,R),R+=5,c.text(this.guideDetails.country,F,R),R+=5,c.text(this.guideDetails.phone,F,R);let L=d-u,H=D+y+5;c.setTextColor(128,128,128),c.text("Statement / Period",L,H,{align:"right"}),H+=6,c.setTextColor(0),c.text(`Statement ID: ${this.guideDetails.usercode}`,L,H,{align:"right"}),H+=5,c.text(`${this.selectedMonth} ${this.selectedYear}`,L,H,{align:"right"}),H+=5,c.text(`Guide# ${this.guideDetails.usercode}`,L,H,{align:"right"}),H+=5,c.text("REF Expenses",L,H,{align:"right"}
157),f=Math.max(f,R,H)+5,c.setDrawColor(220,220,220),c.setLineWidth(.5),c.setFontSize(9),c.setTextColor(0),c.setFont("helvetica","bold"),c.text("DESCRIPTION",u,f),c.text("SUB TOTAL (LKR)",d-u,f,{align:"right"}),f+=5,c.line(u,f,d-u,f),f+=5,c.setFont("helvetica","normal");for(let ot of this.transactionData){f>c.internal.pageSize.height-40&&(c.addPage(),f=u),c.setFont("helvetica","bold");let gt=`${new Date(ot.issueddate).toLocaleString("en-US",{month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})} - Entrance Ticket# ${ot.serialnumber}`;c.text(gt,u,f),c.setTextColor(0),c.text(ot.visitortotal.toLocaleString(),d-u,f,{align:"right"}),f+=6,c.setFont("helvetica","normal");for(let vt of ot.visitordetails){f>c.internal.pageSize.height-20&&(c.addPage(),f=u);let Kt=`${vt.name} (${vt.country}) - ${vt.count} x LKR ${vt.price.toLocaleString()}`,O=c.splitTextToSize(Kt,h-60);c.text(O,u,f),f+=O.length*2+2}c.setDrawColor(220,220,220),c.line(u,f,d-u,f),f+=5}f>c.internal.pageSize.height-20&&(c.addPage(),f=u),f+=2,c.setFontSize(11),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text("Total Amount (LKR):",u,f),c.setTextColor(0),c.setFont("helvetica","bold");let se=(this.guideTotals?.total_transactions_amount||0).toLocaleString()+"/-";c.text(se,u+50,f);let Ce=d-u-80,Ue=d-u,re=f;c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.setFontSize(11),c.text("Total Expense before tax (LKR):",Ce,re),c.setTextColor(0),c.setFont("helvetica","normal");let ae=(this.guideTotals?.original_total_expense||0).toLocaleString()+"/-";c.text(ae,Ue,re,{align:"right"}),re+=5,c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text("Applied Tax (LKR):",Ce,re),c.setTextColor(0),c.setFont("helvetica","normal");let ve=(this.guideTotals?.applied_tax||0).toLocaleString()+"/-";c.text(ve,Ue,re,{align:"right"}),re+=5,c.setFontSize(11),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text("Total expense (LKR):",Ce,re),c.setTextColor(0),c.setFont("helvetica","bold");let Me=(this.guideTotals?.total_after_tax||0).toLocaleString()+"/-";c.text(Me,Ue,re,{align:"right"}),f=re+5,c.setDrawColor(220,220,220),c.line(u,f,d-u,f),f+=10;let Fe=20+10+7.5;f+Fe>c.internal.pageSize.height-u&&(c.addPage(),f=u),c.setFontSize(9),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text(`Account Holder Name: ${this.guideDetails.bank_account_name}`,u,f),f+=5,c.text(`Account Number: ${this.guideDetails.bank_account_number}`,u,f),f+=5,c.text(`Bank Name: ${this.guideDetails.bank_name}`,u,f),f+=5,c.text(`Bank Branch: ${this.guideDetails.bank_branch}`,u,f),f+=10,c.setFont("helvetica","bold"),c.text("Terms & Conditions:",u,f),f+=5,c.setFont("helvetica","normal");let Qe=c.splitTextToSize("All payments are issued by Check or Electronic Deposit within 30 days of statement date. For any questions, please contact Accounts Payable at +94 71 272 4724",h);c.text(Qe,u,f),f+=Qe.length*2+5,c.setDrawColor(220,220,220),c.line(u,f,d-u,f),f+=5,c.setFontSize(9),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text("THANK YOU FOR YOUR SUPPORT",d*.5,f,{align:"center"}),f+=5,c.text("Ambuluwawa Biodiversity Complex | ambuluwawa.com",d*.5,f,{align:"center"}),c.save(`${this.guideDetails.usercode}.pdf`),this.toastr.success("PDF generated successfully!","Success")}catch(r){console.error("Error generating PDF:",r),this.toastr.error("Failed to generate PDF:","Error")}finally{this.spinner.hide()}})}formatCurrency(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}isAllEntriesApproved(){return!this.items||this.items.length===0?!1:this.items.every(e=>e.status==="approved")}onDropdownClick(e){console.log("Dropdown clicked for:",e)}};n.\u0275fac=function(r){return new(r||n)(x(c2),x(pe),x(me),x(ze),x(_t),x(ce),x(Kn))},n.\u0275cmp=te({type:n,selectors:[["app-tour-guide-expense"]],viewQuery:function(r,a){if(r&1&&(An(qie,5),An(Kie,5)),r&2){let c;on(c=sn())&&(a.reviewModal=c.first),on(c=sn())&&(a.invoiceContent=c.first)}},standalone:!1,decls:159,vars:33,consts:[["invoiceContent",""],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","ngModel"],["value",""],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"btn","btn-outline-primary","withIcon"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-center"],[1,"text-end"],[1,"tbody","rowH"],["id","reviewModal","tabindex","-1","aria-labelledby","reviewModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
157-lg"],[1,"modal-content"],[1,"modal-header"],["id","reviewModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],["class","invoice pdf-template",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"d-flex","gap-2"],[1,"btn","btn-success","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],[1,"btn","btn-warning","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],[1,"btn","btn-danger","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["id","invoiceContent",1,"d-none"],[1,"invoice","pdf-template"],[1,"invoice-header"],[1,"from-to-section"],[1,"from"],[1,"mb-1"],[1,"to"],[4,"ngIf"],[1,"statement-info"],[1,"invoice-content","mt-4"],[1,"invoice-price"],[1,"invoice-price-left"],[1,"sub-price"],[1,"text-inverse"],[1,"invoice-price-right"],[1,"f-w-600"],[1,"status",3,"ngClass"],[1,"d-flex","gap-2","justify-content-center"],["title","Review",1,"btn","btn-outline-secondary","btn-sm","btn-icon",3,"click"],["class","btn btn-outline-secondary btn-sm btn-icon","title","Generate PDF",3,"click",4,"ngIf"],["title","Generate PDF",1,"btn","btn-outline-secondary","btn-sm","btn-icon",3,"click"],[1,"invoice-price",2,"align-items","flex-end"],[1,"expense-breakdown","mb-3","p-3","rounded",2,"background-color","#f8f9fa","border-left","3px solid #007bff"],[1,"sub-price","mb-2"],[2,"color","#6c757d"],[1,"text-inverse",2,"color","#495057"],[1,"invoice-footer","text-center","mt-4"],[1,"fa","fa-globe"],[1,"ticket-header","mb-2"],[1,"visitor-details"],["class","row",4,"ngFor","ngForOf"],[1,"text-end","align-middle"],[1,"row"],[1,"col-12"],[1,"ticket-header"]],template:function(r,a){if(r&1){let c=he();s(0,"div",1)(1,"div",2)(2,"div")(3,"div",3),l(4,"Guide expense Reports"),o(),s(5,"div",4),l(6,"Transaction Reports Log"),o()()(),s(7,"div",5)(8,"div",6)(9,"div",7)(10,"label",8),l(11,"Month"),o(),s(12,"select",9),X("ngModelChange",function(u){return U(c),K(a.selectedMonth,u)||(a.selectedMonth=u),j(u)}),s(13,"option",10),l(14,"Select Month"),o(),T(15,Zie,2,1,"option",11),o()(),s(16,"div",7)(17,"label",8),l(18,"Year"),o(),s(19,"select",9),X("ngModelChange",function(u){return U(c),K(a.selectedYear,u)||(a.selectedYear=u),j(u)}),s(20,"option",10),l(21,"Select Year"),o(),T(22,Qie,2,1,"option",11),o()(),s(23,"div",12)(24,"button",13),S("click",function(){return U(c),j(a.onClickGenerategetGuideWiseExpense())}),s(25,"span",14),l(26,"search"),o(),l(27," Generate "),o()()(),s(28,"div",12)(29,"button",15),S("click",function(){return U(c),j(a.onClickGenerateExcel())}),s(30,"span",14),l(31,"description"),o(),l(32,"Excel "),o(),s(33,"button",16)(34,"span",14),l(35,"print"),o(),l(36,"Print "),o()()(),s(37,"div",17)(38,"div",18)(39,"div",19)(40,"div",20)(41,"table",21)(42,"thead",22)(43,"tr")(44,"th"),l(45,"#Serial"),o(),s(46,"th"),l(47,"Bank Code"),o(),s(48,"th"),l(49,"Branch Code"),o(),s(50,"th"),l(51,"Account No."),o(),s(52,"th"),l(53,"Name"),o(),s(54,"th",23),l(55,"Status"),o(),s(56,"th",24),l(57,"Amount (LKR)"),o(),s(58,"th",23),l(59,"Action"),o()()(),s(60,"tbody",25),T(61,tne,23,16,"tr",11),o()()()()()()(),s(62,"div",26)(63,"div",27)(64,"div",28)(65,"div",29)(66,"h5",30),l(67," Guide expense Statement "),o(),B(68,"button",31),o(),s(69,"div",32),T(70,ane,84,25,"div",33),o(),s(71,"div",34)(72,"div",35)(73,"button",36),S("click",function(){return U(c),j(a.updateStatus("approved",a.guideTotals==null?null:a.guideTotals.total_after_tax))}),s(74,"i",14),l(75,"check_circle"),o(),s(76,"span"),l(77,"Approve"),o()(),s(78,"button",37),S("click",function(){return U(c),j(a.updateStatus("hold",a.guideTotals==null?null:a.guideTotals.total_after_tax))}),s(79,"i",14),l(80,"pause_circle"),o(),s(81,"span"),l(82,"Hold"),o()(),s(83,"button",38),S("click",function(){return U(c),j(a.updateStatus("rejected",a.guideTotals==null?null:a.guideTotals.total_after_tax))}),s(84,"i",14),l(85,"cancel"),o(),s(86,"span"),l(87,"Reject"),o()()(),s(88,"button",39),l(89," Close "),o()()()()(),s(90,"div",40,0)(92,"div",41)(93,"div",42)(94,"div",43)(95,"div",44)(96,"p",45),l(97,"from"),o(),s(98,"h6"),l(99,"Ambuluwawa Biodiversity Complex"),o(),s(100,"p"),l(101,"Gampola 20500"),o(),s(102,"p"),l(103,"Sri Lanka"),o(),s(104,"p"),l(105,"+94 71 272 4724"),o(),s(106,"p"),l(107,"[email protected]"),o()(),s(108,"div",46)(109,"p",45),l(110,"to"),o(),s(111,"h6"),l(112),o(),s(113,"p"),l(114),o(),T(115,one,2,1,"p",47),s(116,"p"),l(117),o(),s(118,"p"),l(119),o(),s(120,"p"),l(121),o()(),s(122,"div",48)(123,"p",45),l(124,"Statement / Period"),o(),s(125,"h6"),l(126),o(),s(127,"p"),l(128),o(),s(129,"p"),l(130),o(),s(131,"p"),l(132,"REF Expenses"),o()()()(),s(133,"div",49)(134,"div",20)(135,"table",21)(136,"thead")(137,"tr")(138,"th"),l(139,"DESCRIPTION"),o(),s(140,"th",24),l(141,"SUB TOTAL (LKR)"),o()()(),s(142,"tbody"),T(143,lne,10,9,"tr",11),o()()(),s(144,"div",50)(145,"div",51)(146,"div",52)(147,"small"),l(148,"Total Amount (LKR):"),o(),s(149,"span",53),l(150),I(151,"currencyFormat"),o()()(),s(152,"div",54)(153,"div",52)(154,"small"),l(155,"Total expense (LKR):"),o(),s(156,"span",55),l(157),I(158,"currencyFormat"),o()()()()()()()}r&2&&(p("ngClass",Z(31,Xie,a.isCollapsed)),m(12),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(5),p("disabled",!a.isAllEntriesApproved()),m(32),p("ngForOf",a.items),m(9),p("ngIf",a.guideDetails),m(3),p("disabled",a.isOfficeUser),m(5),p("disabled",a.isOfficeUser),m(5),p("disabled",a.isOfficeUser),m(29),Pi("",a.guideDetails==null?null:a.guideDetails.firstname," ",a.guideDetails==null?null:a.guideDetails.lastname),m(2),b(a.guideDetails==null?null:a.guideDetails.address_line_1),m(),p("ngIf",a.guideDetails==null?null:a.guideDetails.address_line_2),m(2),Pi("",a.guideDetails==null?null:a.guideDetails.city,", ",a.guideDetails==null?null:a.guideDetails.postal_code),m(2),b(a.guideDetails==null?null:a.guideDetails.country),m(2),b(a.guideDetails==null?null:a.guideDetails.phone),m(5),_("Statement ID: ",a.guideDetails==null?null:a.guideDetails.usercode),m(2),Pi("",a.selectedMonth," ",a.selectedYear),m(2),_("Guide# ",a.guideDetails==null?null:a.guideDetails.usercode),m(13),p("ngForOf",a.guideDetails==null?null:a.guideDetails.transactions),m(7),_(" ",M(151,27,a.calculateTotals().totalAmount),"/- "),m(7),_(" ",M(158,29,a.calculateTotals().totalExpense),"/- "))},dependencies:[ue,_e,Dt,Bt,Vt,Ot,Ne,Le,St,Be],styles:[".modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border-radius:4px;font-weight:500}.modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;
157display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%}.modal-footer[_ngcontent-%COMP%] .btn.btn-success[_ngcontent-%COMP%]{background-color:#198754;color:#fff}.modal-footer[_ngcontent-%COMP%] .btn.btn-success[_ngcontent-%COMP%]:hover{background-color:#157347}.modal-footer[_ngcontent-%COMP%] .btn.btn-warning[_ngcontent-%COMP%]{background-color:#ffc107;color:#000}.modal-footer[_ngcontent-%COMP%] .btn.btn-warning[_ngcontent-%COMP%]:hover{background-color:#ffca2c}.modal-footer[_ngcontent-%COMP%] .btn.btn-danger[_ngcontent-%COMP%]{background-color:#dc3545;color:#fff}.modal-footer[_ngcontent-%COMP%] .btn.btn-danger[_ngcontent-%COMP%]:hover{background-color:#bb2d3b}.modal-footer[_ngcontent-%COMP%] .btn.btn-secondary[_ngcontent-%COMP%]{background-color:#6c757d;color:#fff}.modal-footer[_ngcontent-%COMP%] .btn.btn-secondary[_ngcontent-%COMP%]:hover{background-color:#5c636a}.invoice[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:20px;background:#fff}@media print{.invoice[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:none!important}}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .from[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .to[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .statement-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.25rem;color:#666;font-size:14px}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .from[_ngcontent-%COMP%] h6[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .to[_ngcontent-%COMP%] h6[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .statement-info[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-weight:500;font-size:16px;margin-bottom:.5rem}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .from[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .to[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .statement-info[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%]{color:#999;font-size:13px;text-transform:uppercase}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{border-collapse:collapse}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6;padding:12px;font-weight:500;font-size:14px}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px;border-bottom:1px solid #dee2e6}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .ticket-header[_ngcontent-%COMP%]{font-weight:500;font-size:14px;margin-bottom:4px}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .visitor-details[_ngcontent-%COMP%]{color:#666;font-size:14px;line-height:1.4}.invoice[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:20px;padding:15px;background-color:#f8f9fa}.invoice[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:13px;color:#666}.invoice[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:15px;font-weight:500}.text-success[_ngcontent-%COMP%]{color:#28a745;font-weight:500}.text-danger[_ngcontent-%COMP%]{color:#dc3545;font-weight:500}.text-warning[_ngcontent-%COMP%]{color:#ffc107;font-weight:500}.text-secondary[_ngcontent-%COMP%]{color:#6c757d;font-weight:500}.status[_ngcontent-%COMP%]{padding:4px 12px;border-radius:20px;font-size:13px;font-weight:500;text-transform:capitalize;display:inline-block}.status.approved[_ngcontent-%COMP%]{background-color:#28a7451a;color:#28a745}.status.rejected[_ngcontent-%COMP%]{background-color:#dc35451a;color:#dc3545}.status.hold[_ngcontent-%COMP%]{background-color:#ffc1071a;color:#ffc107}.status.in-review[_ngcontent-%COMP%]{background-color:#6c757d1a;color:#6c757d}.pdf-version[_ngcontent-%COMP%]{background:#fff;padding:40px;max-width:800px;margin:0 auto}
157.pdf-version[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%], .pdf-version[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .pdf-version[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:none!important}.btn-sm[_ngcontent-%COMP%]{padding:4px 8px;font-size:13px}.btn-sm[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px}.table[_ngcontent-%COMP%]{width:100%;margin-bottom:1rem;background-color:transparent;border-collapse:collapse}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.text-end[_ngcontent-%COMP%]{text-align:right!important}.status[_ngcontent-%COMP%]{print-color-adjust:exact;-webkit-print-color-adjust:exact}.pdf-template[_ngcontent-%COMP%]{padding:40px;background:#fff}.pdf-template[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin-bottom:30px}.pdf-template[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:8px}.pdf-template[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:4px;font-size:14px}.pdf-template[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%]{text-transform:uppercase;color:#666;font-size:12px;margin-bottom:8px}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f8f9fa;font-weight:600}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:top}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] .ticket-header[_ngcontent-%COMP%]{font-weight:500;margin-bottom:4px}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] .visitor-details[_ngcontent-%COMP%]{color:#666;line-height:1.5}.pdf-template[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:30px;padding-top:20px;border-top:1px solid #dee2e6}.pdf-template[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;margin-bottom:4px;color:#666}.pdf-template[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:16px;font-weight:600}.d-none[_ngcontent-%COMP%]{display:none!important}.btn-icon[_ngcontent-%COMP%]{width:32px;height:32px;padding:0!important;margin:0;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #ccc;background-color:#f8f9fa;line-height:1;flex-shrink:0}.btn-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .btn-icon[_ngcontent-%COMP%] .material-icons-outlined[_ngcontent-%COMP%]{font-size:18px;color:#666;line-height:1;margin:0;padding:0;display:inline-block;vertical-align:middle;font-weight:400}.btn-icon[_ngcontent-%COMP%]:hover{background-color:#e2e6ea}"]});let i=n;return i})();function cne(i,n){i&1&&(s(0,"h3"),l(1,"Reset Password"),o())}function dne(i,n){i&1&&(s(0,"h3"),l(1,"Confirm Password Reset"),o())}function mne(i,n){i&1&&(s(0,"p"),l(1," Please enter your username to receive a reset code. "),o())}function une(i,n){i&1&&(s(0,"p"),l(1," Enter the code sent to your registered email and a new password. "),o())}function pne(i,n){i&1&&(s(0,"div",11),B(1,"input",12),o())}function hne(i,n){if(i&1){let t=he();s(0,"div")(1,"div",11),B(2,"input",13),o(),s(3,"div",11),B(4,"input",14),s(5,"i",15),S("click",function(){U(t);let r=w();return j(r.togglePasswordVisibility())}),o()(),s(6,"div",11),B(7,"input",16),o()()}if(i&2){let t=w();m(4),p("type",t.passwordVisible?"text":"password"),m(),p("ngClass",t.passwordVisible?"fa fa-eye":"fa fa-eye-slash"),m(2),p("type",t.passwordVisible?"text":"password")}}var PN=(()=>{let n=class n{constructor(e,r,a,c,d){this.fb=e,this.cognitoService=r,this.toastr=a,this.spinner=c,this.router=d,this.isConfirmReset=!1,this.passwordVisible=!1,this.resetPasswordForm=this.fb.group({username:["",At.required],code:["",At.required],newPassword:["",At.required],confirmPassword:["",At.required]},{validator:this.passwordsMatchValidator})}passwordsMatchValidator(e){let r=e.get("newPassword")?.value,a=e.get("
157confirmPassword")?.value;return r===a?null:{passwordsMismatch:!0}}requestResetPassword(){let{username:e}=this.resetPasswordForm.value;this.spinner.show(),this.cognitoService.resetPassWord({email:"",password:"",code:"",name:e}).then(()=>{this.spinner.hide(),this.toastr.success("Reset code sent to your username!","Success"),this.isConfirmReset=!0}).catch(r=>{this.spinner.hide(),this.toastr.error("Failed to send reset code: "+r.message,"Error")})}onSubmit(){if(this.isConfirmReset){if(this.resetPasswordForm.invalid&&this.resetPasswordForm.hasError("passwordsMismatch")){this.toastr.error("Passwords do not match!","Error");return}let{username:e,code:r,newPassword:a}=this.resetPasswordForm.value;this.spinner.show(),this.cognitoService.confirmResetPassword({email:"",code:r,password:a,name:e}).then(()=>{this.spinner.hide(),this.toastr.success("Password reset successful!","Success"),this.resetPasswordForm.reset(),this.router.navigate(["/login"])}).catch(c=>{this.spinner.hide(),this.toastr.error("Password reset failed: "+c.message,"Error")})}else this.requestResetPassword()}togglePasswordVisibility(){this.passwordVisible=!this.passwordVisible}};n.\u0275fac=function(r){return new(r||n)(x(Qr),x(ze),x(me),x(pe),x(_t))},n.\u0275cmp=te({type:n,selectors:[["app-forgot-password"]],standalone:!1,decls:16,vars:8,consts:[[1,"login-container"],[1,"login-image"],[1,"image-wrapper"],["src","/assets/ambuluwawa-temple.jpg","alt","Login Image",1,"img-responsive"],[1,"slogan"],["src","/assets/logo.svg","alt","Company Logo",1,"slogan-logo"],[1,"forgot-password-container"],[3,"ngSubmit","formGroup"],[4,"ngIf"],["class","form-group",4,"ngIf"],["type","submit",1,"submit"],[1,"form-group"],["type","text","id","reset-username","formControlName","username","required","","placeholder","Username"],["type","text","id","code","formControlName","code","required","","placeholder","Confirmation Code"],["id","new-password","formControlName","newPassword","required","","placeholder","New Password",3,"type"],["aria-hidden","true",1,"eye-icon",3,"click","ngClass"],["id","confirm-password","formControlName","confirmPassword","required","","placeholder","Confirm Password",3,"type"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),B(3,"img",3),s(4,"div",4),B(5,"img",5),o()()(),s(6,"div",6)(7,"form",7),S("ngSubmit",function(){return a.onSubmit()}),T(8,cne,2,0,"h3",8)(9,dne,2,0,"h3",8)(10,mne,2,0,"p",8)(11,une,2,0,"p",8)(12,pne,2,0,"div",9)(13,hne,8,3,"div",8),s(14,"button",10),l(15),o()()()()),r&2&&(m(7),p("formGroup",a.resetPasswordForm),m(),p("ngIf",!a.isConfirmReset),m(),p("ngIf",a.isConfirmReset),m(),p("ngIf",!a.isConfirmReset),m(),p("ngIf",a.isConfirmReset),m(),p("ngIf",!a.isConfirmReset),m(),p("ngIf",a.isConfirmReset),m(2),_(" ",a.isConfirmReset?"Reset Password":"Send Reset Code"," "))},dependencies:[ue,Dt,Ni,Ke,Ne,Oi,vn,wr,$r],styles:["html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%;margin:0;font-family:Arial,sans-serif}.login-container[_ngcontent-%COMP%]{display:flex;height:100vh;background-color:#f4f4f4}.login-image[_ngcontent-%COMP%]{flex:1;max-width:25%;background-color:#fff;display:flex;align-items:center;justify-content:center}.image-wrapper[_ngcontent-%COMP%]{position:relative;width:100%;height:100vh}.img-responsive[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.slogan[_ngcontent-%COMP%]{position:absolute;top:15%;left:50%;transform:translate(-50%,-50%);text-align:center;z-index:1;color:#fff}.slogan-logo[_ngcontent-%COMP%]{width:100px;height:auto}.slogan[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:2.5rem;margin-top:10px;color:#fff}.forgot-password-container[_ngcontent-%COMP%]{flex:3;max-width:75%;display:flex;align-items:center;justify-content:center;background-color:#fff;padding:2rem}h3[_ngcontent-%COMP%]{margin-bottom:1rem;font-size:2rem;text-align:center;font-weight:700}p[_ngcontent-%COMP%]{margin-bottom:1rem;color:#666;line-height:1.5;font-weight:lighter}.form-group[_ngcontent-%COMP%]{position:relative;margin-bottom:1rem}input[_ngcontent-%COMP%]{width:95%;padding:.5rem;margin-top:.5rem;border:1px solid #ccc;border-radius:4px}button[_ngcontent-%COMP%]{width:100%;padding:.75rem;background-color:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;text-transform:uppercase}button[_ngcontent-%COMP%]:hover{background-color:#0056b3}.eye-icon[_ngcontent-%COMP%]{position:absolute;right:30px;top:60%;transform:translateY(-50%);cursor:pointer}@media (max-width: 1024px){.login-container[_ngcontent-%COMP%]{flex-direction:column;align-items:center}.login-image[_ngcontent-%COMP%]{display:none}.forgot-password-container[_ngcontent-%COMP%]{max-width:100%;padding:1.5rem;background-color:#ffffffe6}}@media (max-width: 768px){.forgot-password-container[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.forgot-password-container[_ngcontent-%COMP%]{padding:1rem}}"]});let i=n;return i})();var fne=i=>({collapsed:i});
157function gne(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var FN=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.paddleBoatService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.paddleBoatService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.paddleBoatService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.paddleBoatService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.paddleBoatService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_revenue+=Number(r.revenue);console.log("total revenue",this.total_revenue),this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Qa),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-paddle-boat-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
157date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],[3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Paddle Boat Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,gne,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-activity-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,fne,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,uo,Jn,Zn,Qn,Dn,Be],encapsulation:2});let i=n;return i})();var vne=i=>({collapsed:i}),_ne=i=>({show:i});function yne(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o(),s(5,"span",24),l(6),o()(),s(7,"div",25)(8,"div",26)(9,"div",27)(10,"div",28)(11,"span",29),l(12,"LKR"),o(),s(13,"input",30),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(14,"div",31)(15,"button",32),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(16,"span",33),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngClass",t.visitor_type==="Foreign"?"bg-primary":"bg-success"),m(),_(" ",t.visitor_type," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function Sne(i,n){if(i&1&&(s(0,"div",19)(1,"div",34)(2,"p",35),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",36)(5,"p",37)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",37)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",38)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function bne(i,n){if(i&1){let t=he();s(0,"div",39),S("click",function(){U(t);let r=w();return j(r.showConfirmModal=!1)}),o()}}function xne(i,n){if(i&1){let t=he();s(0,"div",39),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var RN=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.paddleBoatService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.selectedItem=null,this.showConfirmModal=!1,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.paddleBoatService.getItemPrice().subscribe({next:e=>{e.data&&e.data[0]&&(this.priceItems=e.data[0].map(r=>tt(le({}
157,r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.paddleBoatService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
157r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Qa),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-pricing-paddle-boat"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Paddle Boat \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,yne,19,6,"div",6),o()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.showConfirmModal=!1}),o()(),T(16,Sne,17,3,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,bne,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,xne,1,0,"div",17),o()),r&2&&(p("ngClass",Z(13,vne,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,_ne,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var Cne=i=>({collapsed:i});function Ene(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var ON=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.horseRideService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}
157ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.horseRideService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.horseRideService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_revenue+=Number(r.revenue);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.horseRideService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.horseRideService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Es),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-horse-riding-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
157date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],[3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Horse Ride Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,Ene,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-activity-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,Cne,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,uo,Jn,Zn,Qn,Dn,Be],encapsulation:2});let i=n;return i})();var wne=i=>({collapsed:i}),Tne=i=>({show:i}),Dne=(i,n,t,e)=>({"bg-primary":i,"bg-secondary":n,"bg-success":t,"bg-danger":e});function Ine(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o(),s(5,"span",24),l(6),o()(),s(7,"div",25)(8,"div",26)(9,"div",27)(10,"div",28)(11,"span",29),l(12,"LKR"),o(),s(13,"input",30),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(14,"div",31)(15,"button",32),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(16,"span",33),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngClass",El(6,Dne,t.visitor_type==="Foreign - Adults",t.visitor_type==="Local - Adults",t.visitor_type==="Local - Kids",t.visitor_type==="Foreign - Kids")),m(),_(" ",t.visitor_type," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function kne(i,n){if(i&1&&(s(0,"p",37)(1,"strong"),l(2,"Visitor Type:"),o(),l(3),o()),i&2){let t=w(2);m(3),_(" ",t.selectedItem.visitor_type," ")}}function Mne(i,n){if(i&1&&(s(0,"div",19)(1,"div",34)(2,"p",35),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",36)(5,"p",37)(6,"strong"),l(7,"Item:"),o(),l(8),o(),T(9,kne,4,1,"p",38),s(10,"p",37)(11,"strong"),l(12,"Old Price:"),o(),l(13),o(),s(14,"p",39)(15,"strong"),l(16,"New Price:"),o(),l(17),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(),p("ngIf",t.selectedItem.visitor_type),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function Ane(i,n){if(i&1){let t=he();s(0,"div",40),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function Pne(i,n){if(i&1){let t=he();s(0,"div",40),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var NN=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.horseRideService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.horseRideService.getItemPrice().subscribe({next:e=>{e.data&&e.data[0]&&(this.priceItems=e.data[0].map(r=>tt(le({}
157,r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})),this.priceItems.sort((r,a)=>r.visitor_type.localeCompare(a.visitor_type))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.horseRideService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
157r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Es),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-pricing-horse-ride"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],["class","mb-2",4,"ngIf"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Horse Ride \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,Ine,19,11,"div",6),o()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,Mne,18,4,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,Ane,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,Pne,1,0,"div",17),o()),r&2&&(p("ngClass",Z(13,wne,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,Tne,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var Fne=i=>({collapsed:i});function Rne(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var LN=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.herbalShopService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}
157ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.herbalShopService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.herbalShopService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_revenue+=Number(r.revenue);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.herbalShopService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.herbalShopService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(ws),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-herbal-shop-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
157date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items","revenueType"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Herbal Shop Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,Rne,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-activity-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,Fne,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items)("revenueType","Item Wise Revenue"),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,uo,Jn,Zn,Qn,Dn,Be],encapsulation:2});let i=n;return i})();var Iv={};Iv.version="0.18.5";var X0=1200,wf=1252,One=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Nne={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},E8=function(i){One.indexOf(i)!=-1&&(wf=Nne[0]=i)};function Lne(){E8(1252)}var kv=function(i){X0=i,E8(i)};function Bne(){kv(1200),Lne()}function Vne(i){for(var n=[],t=0;t<i.length>>1;++t)n[t]=String.fromCharCode(i.charCodeAt(2*t+1)+(i.charCodeAt(2*t)<<8));return n.join("")}var E2=function(n){return String.fromCharCode(n)},BN=function(n){return String.fromCharCode(n)},Ir;var sd=null,Sv=!0,uu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Mv(i){for(var n="",t=0,e=0,r=0,a=0,c=0,d=0,u=0,h=0;h<i.length;)t=i.charCodeAt(h++),a=t>>2,e=i.charCodeAt(h++),c=(t&3)<<4|e>>4,r=i.charCodeAt(h++),d=(e&15)<<2|r>>6,u=r&63,isNaN(e)?d=u=64:isNaN(r)&&(u=64),n+=uu.charAt(a)+uu.charAt(c)+uu.charAt(d)+uu.charAt(u);return n}function nm(i){var n="",t=0,e=0,r=0,a=0,c=0,d=0,u=0;i=i.replace(/[^\w\+\/\=]/g,"");for(var h=0;h<i.length;)a=uu.indexOf(i.charAt(h++)),c=uu.indexOf(i.charAt(h++)),t=a<<2|c>>4,n+=String.fromCharCode(t),d=uu.indexOf(i.charAt(h++)),e=(c&15)<<4|d>>2,d!==64&&(n+=String.fromCharCode(e)),u=uu.indexOf(i.charAt(h++)),r=(d&3)<<6|u,u!==64&&(n+=String.fromCharCode(r));return n}var tr=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),am=function(){if(typeof Buffer<"u"){var i=!Buffer.from;if(!i)try{Buffer.from("foo","utf8")}catch{i=!0}return i?function(n,t){return t?new Buffer(n,t):new Buffer(n)}:Buffer.from.bind(Buffer)}return function(){}}();function Z0(i){return tr?Buffer.alloc?Buffer.alloc(i):new Buffer(i):typeof Uint8Array<"u"?new Uint8Array(i):new Array(i)}function VN(i){return tr?Buffer.allocUnsafe?Buffer.allocUnsafe(i):new Buffer(i):typeof Uint8Array<"u"?new Uint8Array(i):new Array(i)}var bc=function(n){return tr?am(n,"binary"):n.split("").map(function(t){return t.charCodeAt(0)&255})};function z2(i){if(typeof ArrayBuffer>"u")return bc(i);for(var n=new ArrayBuffer(i.length),t=new Uint8Array(n),e=0;e!=i.length;++e)t[e]=i.charCodeAt(e)&255;return n}function Ov(i){if(Array.isArray(i))return i.map(function(e){return String.fromCharCode(e)}).join("");for(var n=[],t=0;t<i.length;++t)n[t]=String.fromCharCode(i[t]);return n.join("")}function Une(i){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(i)}var fo=tr?function(i){return Buffer.concat(i.map(function(n){return Buffer.isBuffer(n)?n:am(n)}))}:function(i){if(typeof Uint8Array<"u"){var n=0,t=0;for(n=0;n<i.length;++n)t+=i[n].length;var e=new Uint8Array(t),r=0;for(n=0,t=0;n<i.length;t+=r,++n)if(r=i[n].length,i[n]instanceof Uint8Array)e.set(i[n],t);else{if(typeof i[n]=="string")throw"wtf";e.set(new Uint8Array(i[n]),t)}return e}return[].concat.apply([],i.map(function(a){return Array.isArray(a)?a:[].slice.call(a)}))};function jne(i){for(var n=[],t=0,e=i.length+250,r=Z0(i.length+255),a=0;a<i.length;++a){var c=i.charCodeAt(a);if(c<128)r[t++]=c;
157else if(c<2048)r[t++]=192|c>>6&31,r[t++]=128|c&63;else if(c>=55296&&c<57344){c=(c&1023)+64;var d=i.charCodeAt(++a)&1023;r[t++]=240|c>>8&7,r[t++]=128|c>>2&63,r[t++]=128|d>>6&15|(c&3)<<4,r[t++]=128|d&63}else r[t++]=224|c>>12&15,r[t++]=128|c>>6&63,r[t++]=128|c&63;t>e&&(n.push(r.slice(0,t)),t=0,r=Z0(65535),e=65530)}return n.push(r.slice(0,t)),fo(n)}var Sf=/\u0000/g,w2=/[\u0001-\u0006]/g;function bf(i){for(var n="",t=i.length-1;t>=0;)n+=i.charAt(t--);return n}function xc(i,n){var t=""+i;return t.length>=n?t:ra("0",n-t.length)+t}function $D(i,n){var t=""+i;return t.length>=n?t:ra(" ",n-t.length)+t}function F2(i,n){var t=""+i;return t.length>=n?t:t+ra(" ",n-t.length)}function Wne(i,n){var t=""+Math.round(i);return t.length>=n?t:ra("0",n-t.length)+t}function Hne(i,n){var t=""+i;return t.length>=n?t:ra("0",n-t.length)+t}var UN=Math.pow(2,32);function ff(i,n){if(i>UN||i<-UN)return Wne(i,n);var t=Math.round(i);return Hne(t,n)}function R2(i,n){return n=n||0,i.length>=7+n&&(i.charCodeAt(n)|32)===103&&(i.charCodeAt(n+1)|32)===101&&(i.charCodeAt(n+2)|32)===110&&(i.charCodeAt(n+3)|32)===101&&(i.charCodeAt(n+4)|32)===114&&(i.charCodeAt(n+5)|32)===97&&(i.charCodeAt(n+6)|32)===108}var jN=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],FD=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function Gne(i){return i||(i={}),i[0]="General",i[1]="0",i[2]="0.00",i[3]="#,##0",i[4]="#,##0.00",i[9]="0%",i[10]="0.00%",i[11]="0.00E+00",i[12]="# ?/?",i[13]="# ??/??",i[14]="m/d/yy",i[15]="d-mmm-yy",i[16]="d-mmm",i[17]="mmm-yy",i[18]="h:mm AM/PM",i[19]="h:mm:ss AM/PM",i[20]="h:mm",i[21]="h:mm:ss",i[22]="m/d/yy h:mm",i[37]="#,##0 ;(#,##0)",i[38]="#,##0 ;[Red](#,##0)",i[39]="#,##0.00;(#,##0.00)",i[40]="#,##0.00;[Red](#,##0.00)",i[45]="mm:ss",i[46]="[h]:mm:ss",i[47]="mmss.0",i[48]="##0.0E+0",i[49]="@",i[56]='"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "',i}var aa={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "'},WN={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},$ne={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function O2(i,n,t){for(var e=i<0?-1:1,r=i*e,a=0,c=1,d=0,u=1,h=0,f=0,v=Math.floor(r);h<n&&(v=Math.floor(r),d=v*c+a,f=v*h+u,!(r-v<5e-8));)r=1/(r-v),a=c,c=d,u=h,h=f;if(f>n&&(h>n?(f=u,d=a):(f=h,d=c)),!t)return[0,e*d,f];var C=Math.floor(e*d/f);return[C,e*d-C*f,f]}function T2(i,n,t){if(i>2958465||i<0)return null;var e=i|0,r=Math.floor(86400*(i-e)),a=0,c=[],d={D:e,T:r,u:86400*(i-e)-r,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(d.u)<1e-6&&(d.u=0),n&&n.date1904&&(e+=1462),d.u>.9999&&(d.u=0,++r==86400&&(d.T=r=0,++e,++d.D)),e===60)c=t?[1317,10,29]:[1900,2,29],a=3;else if(e===0)c=t?[1317,8,29]:[1900,1,0],a=6;else{e>60&&--e;var u=new Date(1900,0,1);u.setDate(u.getDate()+e-1),c=[u.getFullYear(),u.getMonth()+1,u.getDate()],a=u.getDay(),e<60&&(a=(a+6)%7),t&&(a=Zne(u,c))}return d.y=c[0],d.m=c[1],d.d=c[2],d.S=r%60,r=Math.floor(r/60),d.M=r%60,r=Math.floor(r/60),d.H=r,d.q=a,d}var w8=new Date(1899,11,31,0,0,0),zne=w8.getTime(),Yne=new Date(1900,2,1,0,0,0);function T8(i,n){var t=i.getTime();return n?t-=1461*24*60*60*1e3:i>=Yne&&(t+=24*60*60*1e3),(t-(zne+(i.getTimezoneOffset()-w8.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function zD(i){return i.indexOf(".")==-1?i:i.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function qne(i){return i.indexOf("E")==-1?i:i.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Kne(i){var n=i<0?12:11,t=zD(i.toFixed(12));return t.length<=n||(t=i.toPrecision(10),t.length<=n)?t:i.toExponential(5)}function Xne(i){var n=zD(i.toFixed(11));return n.length>(i<0?12:11)||n==="0"||n==="-0"?i.toPrecision(6):n}function Jne(i){var n=Math.floor(Math.log(Math.abs(i))*Math.LOG10E),t;return n>=-4&&n<=-1?t=i.toPrecision(10+n):Math.abs(n)<=9?t=Kne(i):n===10?t=i.toFixed(10).substr(0,12):t=Xne(i),zD(qne(t.toUpperCase()))}function jD(i,n){switch(typeof i){case"string":return i;case"boolean":return i?"TRUE":"FALSE";case"number":return(i|0)===i?i.toString(10):Jne(i);case"undefined":return"";case"object":if(i==null)return"";if(i instanceof Date)return hu(14,T8(i,n&&n.date1904),n)}throw new Error("unsupported value in General format: "+i)}function Zne(i,n){n[0]-=581;var t=i.getDay();return i<60&&(t=(t+6)%7),t}function Qne(i,n,t,e){var r="",a=0,c=0,d=t.y,u,h=0;switch(i){case 98:d=t.y+543;case 121:switch(n.length){case 1:case 2:u=d%100,h=2;break;default:u=d%1e4,h=4;break}break;case 109:switch(n.length){case 1:case 2:u=t.m,h=n.length;break;case 3:return FD[t.m-1][1];case 5:return FD[t.m-1][0];default:return FD[t.m-1][2]}break;case 100:switch(n.length){case 1:case 2:u=t.d,h=n.length;break;case 3:return jN[t.q][0];default:return jN[t.q][1]}break;case 104:switch(n.length){case 1:case 2:u=1+(t.H+11)%12,h=n.length;break;default:throw"bad hour format: "+n}break;case 72:switch(n.length){case 1:case 2:u=t.H,h=n.length;break;default:throw"bad hour format: "+n}break;case 77:switch(n.length){case 1:case 2:u=t.M,h=n.length;break;default:throw"bad minute format: "+n}break;case 115:if(n!="s"&&n!="ss"&&n!=".0"&&n!=".00"&&n!=".000")throw"bad second format: "+n;return t.u===0&&(n=="s"||n=="ss")?xc(t.S,n.length):(e>=2?c=e===3?1e3:100:c=e===1?10:1,a=Math.round(c*(t.S+t.u)),a>=60*c&&(a=0),n==="s"?a===0?"0":""+a/c:(r=xc(a,2+e),n==="ss"?r.substr(0,2):"."+r.substr(2,n.length-1)));case 90:switch(n){case"[h]":case"[hh]":u=t.D*24+t.H;break;case"[m]":case"[mm]":u=(t.D*24+t.H)*60+t.M;break;case"[s]":case"[ss]":u=((t.D*24+t.H)*60+t.M)*60+Math.round(t.S+t.u);break;default:throw"bad abstime format: "+n}h=n.length===3?1:2;break;case 101:u=d,h=1;break}var f=h>0?xc(u,h):"";return f}function pu(i){var n=3;if(i.length<=n)return i;for(var t=i.length%n,e=i.substr(0,t);t!=i.length;t+=n)e+=(e.length>0?",":"")+i.substr(t,n);return e}var D8=/%/g;function ere(i,n,t){var e=n.replace(D8,""),r=n.length-e.length;return em(i,e,t*Math.pow(10,2*r))+ra("%",r)}function tre(i,n,t){for(var e=n.length-1;
vendor: 13,951 bytes, line 157
157n.charCodeAt(e-1)===44;)--e;return em(i,n.substr(0,e),t/Math.pow(10,3*(n.length-e)))}function I8(i,n){var t,e=i.indexOf("E")-i.indexOf(".")-1;if(i.match(/^#+0.0E\+0$/)){if(n==0)return"0.0E+0";if(n<0)return"-"+I8(i,-n);var r=i.indexOf(".");r===-1&&(r=i.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%r;if(a<0&&(a+=r),t=(n/Math.pow(10,a)).toPrecision(e+1+(r+a)%r),t.indexOf("e")===-1){var c=Math.floor(Math.log(n)*Math.LOG10E);for(t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(c-t.length+a):t+="E+"+(c-a);t.substr(0,2)==="0.";)t=t.charAt(0)+t.substr(2,r)+"."+t.substr(2+r),t=t.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(d,u,h,f){return u+h+f.substr(0,(r+a)%r)+"."+f.substr(a)+"E"})}else t=n.toExponential(e);return i.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),i.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}var k8=/# (\?+)( ?)\/( ?)(\d+)/;function ire(i,n,t){var e=parseInt(i[4],10),r=Math.round(n*e),a=Math.floor(r/e),c=r-a*e,d=e;return t+(a===0?"":""+a)+" "+(c===0?ra(" ",i[1].length+1+i[4].length):$D(c,i[1].length)+i[2]+"/"+i[3]+xc(d,i[4].length))}function nre(i,n,t){return t+(n===0?"":""+n)+ra(" ",i[1].length+2+i[4].length)}var M8=/^#*0*\.([0#]+)/,A8=/\).*[0#]/,P8=/\(###\) ###\\?-####/;function is(i){for(var n="",t,e=0;e!=i.length;++e)switch(t=i.charCodeAt(e)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(t)}return n}function HN(i,n){var t=Math.pow(10,n);return""+Math.round(i*t)/t}function GN(i,n){var t=i-Math.floor(i),e=Math.pow(10,n);return n<(""+Math.round(t*e)).length?0:Math.round(t*e)}function rre(i,n){return n<(""+Math.round((i-Math.floor(i))*Math.pow(10,n))).length?1:0}function are(i){return i<2147483647&&i>-2147483648?""+(i>=0?i|0:i-1|0):""+Math.floor(i)}function Vl(i,n,t){if(i.charCodeAt(0)===40&&!n.match(A8)){var e=n.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?Vl("n",e,t):"("+Vl("n",e,-t)+")"}if(n.charCodeAt(n.length-1)===44)return tre(i,n,t);if(n.indexOf("%")!==-1)return ere(i,n,t);if(n.indexOf("E")!==-1)return I8(n,t);if(n.charCodeAt(0)===36)return"$"+Vl(i,n.substr(n.charAt(1)==" "?2:1),t);var r,a,c,d,u=Math.abs(t),h=t<0?"-":"";if(n.match(/^00+$/))return h+ff(u,n.length);if(n.match(/^[#?]+$/))return r=ff(t,0),r==="0"&&(r=""),r.length>n.length?r:is(n.substr(0,n.length-r.length))+r;if(a=n.match(k8))return ire(a,u,h);if(n.match(/^#+0+$/))return h+ff(u,n.length-n.indexOf("0"));if(a=n.match(M8))return r=HN(t,a[1].length).replace(/^([^\.]+)$/,"$1."+is(a[1])).replace(/\.$/,"."+is(a[1])).replace(/\.(\d*)$/,function(A,D){return"."+D+ra("0",is(a[1]).length-D.length)}),n.indexOf("0.")!==-1?r:r.replace(/^0\./,".");if(n=n.replace(/^#+([0.])/,"$1"),a=n.match(/^(0*)\.(#*)$/))return h+HN(u,a[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=n.match(/^#{1,3},##0(\.?)$/))return h+pu(ff(u,0));if(a=n.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+Vl(i,n,-t):pu(""+(Math.floor(t)+rre(t,a[1].length)))+"."+xc(GN(t,a[1].length),a[1].length);if(a=n.match(/^#,#*,#0/))return Vl(i,n.replace(/^#,#*,/,""),t);if(a=n.match(/^([0#]+)(\\?-([0#]+))+$/))return r=bf(Vl(i,n.replace(/[\\-]/g,""),t)),c=0,bf(bf(n.replace(/\\/g,"")).replace(/[0#]/g,function(A){return c<r.length?r.charAt(c++):A==="0"?"0":""}));if(n.match(P8))return r=Vl(i,"##########",t),"("+r.substr(0,3)+") "+r.substr(3,3)+"-"+r.substr(6);var f="";if(a=n.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return c=Math.min(a[4].length,7),d=O2(u,Math.pow(10,c)-1,!1),r=""+h,f=em("n",a[1],d[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),r+=f+a[2]+"/"+a[3],f=F2(d[2],c),f.length<a[4].length&&(f=is(a[4].substr(a[4].length-f.length))+f),r+=f,r;if(a=n.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return c=Math.min(Math.max(a[1].length,a[4].length),7),d=O2(u,Math.pow(10,c)-1,!0),h+(d[0]||(d[1]?"":"0"))+" "+(d[1]?$D(d[1],c)+a[2]+"/"+a[3]+F2(d[2],c):ra(" ",2*c+1+a[2].length+a[3].length));if(a=n.match(/^[#0?]+$/))return r=ff(t,0),n.length<=r.length?r:is(n.substr(0,n.length-r.length))+r;if(a=n.match(/^([#0?]+)\.([#0]+)$/)){r=""+t.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),c=r.indexOf(".");var v=n.indexOf(".")-c,C=n.length-r.length-v;return is(n.substr(0,v)+r+n.substr(n.length-C))}if(a=n.match(/^00,000\.([#0]*0)$/))return c=GN(t,a[1].length),t<0?"-"+Vl(i,n,-t):pu(are(t)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(A){return"00,"+(A.length<3?xc(0,3-A.length):"")+A})+"."+xc(c,a[1].length);switch(n){case"###,##0.00":return Vl(i,"#,##0.00",t);case"###,###":case"##,###":case"#,###":var y=pu(ff(u,0));return y!=="0"?h+y:"";case"###,###.00":return Vl(i,"###,##0.00",t).replace(/^0\./,".");case"#,###.00":return Vl(i,"#,##0.00",t).replace(/^0\./,".");default:}throw new Error("unsupported format |"+n+"|")}function ore(i,n,t){for(var e=n.length-1;n.charCodeAt(e-1)===44;)--e;return em(i,n.substr(0,e),t/Math.pow(10,3*(n.length-e)))}function sre(i,n,t){var e=n.replace(D8,""),r=n.length-e.length;return em(i,e,t*Math.pow(10,2*r))+ra("%",r)}function F8(i,n){var t,e=i.indexOf("E")-i.indexOf(".")-1;if(i.match(/^#+0.0E\+0$/)){if(n==0)return"0.0E+0";if(n<0)return"-"+F8(i,-n);var r=i.indexOf(".");r===-1&&(r=i.indexOf("E"));var a=Math.floor(Math.log(n)*Math.LOG10E)%r;if(a<0&&(a+=r),t=(n/Math.pow(10,a)).toPrecision(e+1+(r+a)%r),!t.match(/[Ee]/)){var c=Math.floor(Math.log(n)*Math.LOG10E);t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(c-t.length+a):t+="E+"+(c-a),t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(d,u,h,f){return u+h+f.substr(0,(r+a)%r)+"."+f.substr(a)+"E"})}else t=n.toExponential(e);return i.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),i.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}function ad(i,n,t){if(i.charCodeAt(0)===40&&!n.match(A8)){var e=n.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?ad("n",e,t):"("+ad("n",e,-t)+")"}if(n.charCodeAt(n.length-1)===44)return ore(i,n,t);if(n.indexOf("%")!==-1)return sre(i,n,t);if(n.indexOf("E")!==-1)return F8(n,t);if(n.charCodeAt(0)===36)return"$"+ad(i,n.substr(n.charAt(1)==" "?2:1),t);var r,a,c,d,u=Math.abs(t),h=t<0?"-":"";if(n.match(/^00+$/))return h+xc(u,n.length);if(n.match(/^[#?]+$/))return r=""+t,t===0&&(r=""),r.length>n.length?r:is(n.substr(0,n.length-r.length))+r;if(a=n.match(k8))return nre(a,u,h);if(n.match(/^#+0+$/))return h+xc(u,n.length-n.indexOf("0"));if(a=n.match(M8))return r=(""+t).replace(/^([^\.]+)$/,"$1."+is(a[1])).replace(/\.$/,"."+is(a[1])),r=r.replace(/\.(\d*)$/,function(A,D){return"."+D+ra("0",is(a[1]).length-D.length)}),n.indexOf("0.")!==-1?r:r.replace(/^0\./,".");if(n=n.replace(/^#+([0.])/,"$1"),a=n.match(/^(0*)\.(#*)$/))return h+(""+u).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=n.match(/^#{1,3},##0(\.?)$/))return h+pu(""+u);if(a=n.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+ad(i,n,-t):pu(""+t)+"."+ra("0",a[1].length);if(a=n.match(/^#,#*,#0/))return ad(i,n.replace(/^#,#*,/,""),t);if(a=n.match(/^([0#]+)(\\?-([0#]+))+$/))return r=bf(ad(i,n.replace(/[\\-]/g,""),t)),c=0,bf(bf(n.replace(/\\/g,"")).replace(/[0#]/g,function(A){return c<r.length?r.charAt(c++):A==="0"?"0":""}));if(n.match(P8))return r=ad(i,"##########",t),"("+r.substr(0,3)+") "+r.substr(3,3)+"-"+r.substr(6);var f="";if(a=n.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return c=Math.min(a[4].length,7),d=O2(u,Math.pow(10,c)-1,!1),r=""+h,f=em("n",a[1],d[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),r+=f+a[2]+"/"+a[3],f=F2(d[2],c),f.length<a[4].length&&(f=is(a[4].substr(a[4].length-f.length))+f),r+=f,r;if(a=n.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return c=Math.min(Math.max(a[1].length,a[4].length),7),d=O2(u,Math.pow(10,c)-1,!0),h+(d[0]||(d[1]?"":"0"))+" "+(d[1]?$D(d[1],c)+a[2]+"/"+a[3]+F2(d[2],c):ra(" ",2*c+1+a[2].length+a[3].length));if(a=n.match(/^[#0?]+$/))return r=""+t,n.length<=r.length?r:is(n.substr(0,n.length-r.length))+r;if(a=n.match(/^([#0]+)\.([#0]+)$/)){r=""+t.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),c=r.indexOf(".");var v=n.indexOf(".")-c,C=n.length-r.length-v;return is(n.substr(0,v)+r+n.substr(n.length-C))}if(a=n.match(/^00,000\.([#0]*0)$/))return t<0?"-"+ad(i,n,-t):pu(""+t).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(A){return"00,"+(A.length<3?xc(0,3-A.length):"")+A})+"."+xc(0,a[1].length);switch(n){case"###,###":case"##,###":case"#,###":var y=pu(""+u);return y!=="0"?h+y:"";default:if(n.match(/\.[0#?]*$/))return ad(i,n.slice(0,n.lastIndexOf(".")),t)+is(n.slice(n.lastIndexOf(".")))}throw new Error("unsupported format |"+n+"|")}function em(i,n,t){return(t|0)===t?ad(i,n,t):Vl(i,n,t)}function lre(i){for(var n=[],t=!1,e=0,r=0;e<i.length;++e)switch(i.charCodeAt(e)){case 34:t=!t;break;case 95:case 42:case 92:++e;break;case 59:n[n.length]=i.substr(r,e-r),r=e+1}if(n[n.length]=i.substr(r),t===!0)throw new Error("Format |"+i+"| unterminated string ");return n}var R8=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function O8(i){for(var n=0,t="",e="";n<i.length;)switch(t=i.charAt(n)){case"G":R2(i,n)&&(n+=6),n++;break;case'"':for(;i.charCodeAt(++n)!==34&&n<i.length;);++n;break;case"\\":n+=2;break;case"_":n+=2;break;case"@":++n;break;case"B":case"b":if(i.charAt(n+1)==="1"||i.charAt(n+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"\u4E0A":if(i.substr(n,3).toUpperCase()==="A/P"||i.substr(n,5).toUpperCase()==="AM/PM"||i.substr(n,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348")return!0;++n;break;case"[":for(e=t;i.charAt(n++)!=="]"&&n<i.length;)e+=i.charAt(n);if(e.match(R8))return!0;break;case".":case"0":case"#":for(;n<i.length&&("0#?.,E+-%".indexOf(t=i.charAt(++n))>-1||t=="\\"&&i.charAt(n+1)=="-"&&"0#".indexOf(i.charAt(n+2))>-1););break;case"?":for(;i.charAt(++n)===t;);break;case"*":++n,(i.charAt(n)==" "||i.charAt(n)=="*")&&++n;break;case"(":case")":++n;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;n<i.length&&"0123456789".indexOf(i.charAt(++n))>-1;);break;case" ":++n;break;default:++n;break}return!1}function cre(i,n,t,e){for(var r=[],a="",c=0,d="",u="t",h,f,v,C="H";c<i.length;)switch(d=i.charAt(c)){case"G":if(!R2(i,c))throw new Error("unrecognized character "+d+" in "+i);r[r.length]={t:"G",v:"General"},c+=7;break;case'"':for(a="";(v=i.charCodeAt(++c))!==34&&c<i.length;)a+=String.fromCharCode(v);r[r.length]={t:"t",v:a},++c;break;case"\\":var y=i.charAt(++c),A=y==="("||y===")"?y:"t";r[r.length]={t:A,v:y},++c;break;case"_":r[r.length]={t:"t",v:" "},c+=2;break;case"@":r[r.length]={t:"T",v:n},++c;break;case"B":case"b":if(i.charAt(c+1)==="1"||i.charAt(c+1)==="2"){if(h==null&&(h=T2(n,t,i.charAt(c+1)==="2"),h==null))return"";r[r.length]={t:"X",v:i.substr(c,2)},u=d,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":d=d.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(n<0||h==null&&(h=T2(n,t),h==null))return"";for(a=d;++c<i.length&&i.charAt(c).toLowerCase()===d;)a+=d;d==="m"&&u.toLowerCase()==="h"&&(d="M"),d==="h"&&(d=C),r[r.length]={t:d,v:a},u=d;break;case"A":case"a":case"\u4E0A":var D={t:d,v:d};if(h==null&&(h=T2(n,t)),i.substr(c,3).toUpperCase()==="A/P"?(h!=null&&(D.v=h.H>=12?"P":"A"),D.t="T",C="h",c+=3):i.substr(c,5).toUpperCase()==="AM/PM"?(h!=null&&(D.v=h.H>=12?"PM":"AM"),D.t="T",c+=5,C="h"):i.substr(c,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348"?(h!=null&&(D.v=h.H>=12?"\u4E0B\u5348":"\u4E0A\u5348"),D.t="T",c+=5,C="h"):(D.t="t",++c),h==null&&D.t==="T")return"";r[r.length]=D,u=d;break;case"[":for(a=d;i.charAt(c++)!=="]"&&c<i.length;)a+=i.charAt(c);if(a.slice(-1)!=="]")throw'unterminated "[" block: |'+a+"|";if(a.match(R8)){if(h==null&&(h=T2(n,t),h==null))return"";r[r.length]={t:"Z",v:a.toLowerCase()},u=a.charAt(1)}else a.indexOf("$")>-1&&(a=(a.match(/\$([^-\[\]]*)/)||[])[1]||"$",O8(i)||(r[r.length]={t:"t",v:a}));break;case".":if(h!=null){for(a=d;++c<i.length&&(d=i.charAt(c))==="0";)a+=d;r[r.length]={t:"s",v:a};break}case"0":case"#":for(a=d;++c<i.length&&"0#?.,E+-%".indexOf(d=i.charAt(c))>-1;)a+=d;r[r.length]={t:"n",v:a};break;case"?":for(a=d;i.charAt(++c)===d;)a+=d;r[r.length]={t:d,v:a},u=d;break;case"*":++c,(i.charAt(c)==" "||i.charAt(c)=="*")&&++c;break;case"(":case")":r[r.length]={t:e===1?"t":d,v:d},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(a=d;c<i.length&&"0123456789".indexOf(i.charAt(++c))>-1;)a+=i.charAt(c);r[r.length]={t:"D",v:a};break;case" ":r[r.length]={t:d,v:d},++c;break;case"$":r[r.length]={t:"t",v:"$"},++c;break;default:if(",$-+/():!^&'~{}<>=\u20ACacfijklopqrtuvwxzP".indexOf(d)===-1)throw new Error("unrecognized character "+d+" in "+i);r[r.length]={t:"t",v:d},++c;break}var F=0,R=0,L;for(c=r.length-1,u="t";c>=0;--c)switch(r[c].t){case"h":case"H":r[c].t=C,u="h",F<1&&(F=1);break;case"s":(L=r[c].v.match(/\.0+$/))&&(R=Math.max(R,L[0].length-1)),F<3&&(F=3);case"d":case"y":case"M":case"e":u=r[c].t;break;case"m":u==="s"&&(r[c].t="M",F<2&&(F=2));break;case"X":break;case"Z":F<1&&r[c].v.match(/[Hh]/)&&(F=1),F<2&&r[c].v.match(/[Mm]/)&&(F=2),F<3&&r[c].v.match(/[Ss]/)&&(F=3)}switch(F){case 0:break;case 1:h.u>=.5&&(h.u=0,++h.S),h.S>=60&&(h.S=0,++h.M),h.M>=60&&(h.M=0,++h.H);break;case 2:h.u>=.5&&(h.u=0,++h.S),h.S>=60&&(h.S=0,++h.M);break}var H="",se;for(c=0;c<r.length;++c)switch(r[c].t){case"t":case"T":case" ":case"D":break;case"X":r[c].v="",r[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":r[c].v=Qne(r[c].t.charCodeAt(0),r[c].v,h,R),r[c].t="t";break;case"n":case"?":for(se=c+1;r[se]!=null&&((d=r[se].t)==="?"||d==="D"||(d===" "||d==="t")&&r[se+1]!=null&&(r[se+1].t==="?"||r[se+1].t==="t"&&r[se+1].v==="/")||r[c].t==="("&&(d===" "||d==="n"||d===")")||d==="t"&&(r[se].v==="/"||r[se].v===" "&&r[se+1]!=null&&r[se+1].t=="?"));
vendor: 19,023 bytes, line 157
157)r[c].v+=r[se].v,r[se]={v:"",t:";"},++se;H+=r[c].v,c=se-1;break;case"G":r[c].t="t",r[c].v=jD(n,t);break}var Ce="",Ue,re;if(H.length>0){H.charCodeAt(0)==40?(Ue=n<0&&H.charCodeAt(0)===45?-n:n,re=em("n",H,Ue)):(Ue=n<0&&e>1?-n:n,re=em("n",H,Ue),Ue<0&&r[0]&&r[0].t=="t"&&(re=re.substr(1),r[0].v="-"+r[0].v)),se=re.length-1;var ae=r.length;for(c=0;c<r.length;++c)if(r[c]!=null&&r[c].t!="t"&&r[c].v.indexOf(".")>-1){ae=c;break}var ve=r.length;if(ae===r.length&&re.indexOf("E")===-1){for(c=r.length-1;c>=0;--c)r[c]==null||"n?".indexOf(r[c].t)===-1||(se>=r[c].v.length-1?(se-=r[c].v.length,r[c].v=re.substr(se+1,r[c].v.length)):se<0?r[c].v="":(r[c].v=re.substr(0,se+1),se=-1),r[c].t="t",ve=c);se>=0&&ve<r.length&&(r[ve].v=re.substr(0,se+1)+r[ve].v)}else if(ae!==r.length&&re.indexOf("E")===-1){for(se=re.indexOf(".")-1,c=ae;c>=0;--c)if(!(r[c]==null||"n?".indexOf(r[c].t)===-1)){for(f=r[c].v.indexOf(".")>-1&&c===ae?r[c].v.indexOf(".")-1:r[c].v.length-1,Ce=r[c].v.substr(f+1);f>=0;--f)se>=0&&(r[c].v.charAt(f)==="0"||r[c].v.charAt(f)==="#")&&(Ce=re.charAt(se--)+Ce);r[c].v=Ce,r[c].t="t",ve=c}for(se>=0&&ve<r.length&&(r[ve].v=re.substr(0,se+1)+r[ve].v),se=re.indexOf(".")+1,c=ae;c<r.length;++c)if(!(r[c]==null||"n?(".indexOf(r[c].t)===-1&&c!==ae)){for(f=r[c].v.indexOf(".")>-1&&c===ae?r[c].v.indexOf(".")+1:0,Ce=r[c].v.substr(0,f);f<r[c].v.length;++f)se<re.length&&(Ce+=re.charAt(se++));r[c].v=Ce,r[c].t="t",ve=c}}}for(c=0;c<r.length;++c)r[c]!=null&&"n?".indexOf(r[c].t)>-1&&(Ue=e>1&&n<0&&c>0&&r[c-1].v==="-"?-n:n,r[c].v=em(r[c].t,r[c].v,Ue),r[c].t="t");var Me="";for(c=0;c!==r.length;++c)r[c]!=null&&(Me+=r[c].v);return Me}var $N=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function zN(i,n){if(n==null)return!1;var t=parseFloat(n[2]);switch(n[1]){case"=":if(i==t)return!0;break;case">":if(i>t)return!0;break;case"<":if(i<t)return!0;break;case"<>":if(i!=t)return!0;break;case">=":if(i>=t)return!0;break;case"<=":if(i<=t)return!0;break}return!1}function dre(i,n){var t=lre(i),e=t.length,r=t[e-1].indexOf("@");if(e<4&&r>-1&&--e,t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if(typeof n!="number")return[4,t.length===4||r>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=r>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=r>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=r>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"];break;case 4:break}var a=n>0?t[0]:n<0?t[1]:t[2];if(t[0].indexOf("[")===-1&&t[1].indexOf("[")===-1)return[e,a];if(t[0].match(/\[[=<>]/)!=null||t[1].match(/\[[=<>]/)!=null){var c=t[0].match($N),d=t[1].match($N);return zN(n,c)?[e,t[0]]:zN(n,d)?[e,t[1]]:[e,t[c!=null&&d!=null?2:1]]}return[e,a]}function hu(i,n,t){t==null&&(t={});var e="";switch(typeof i){case"string":i=="m/d/yy"&&t.dateNF?e=t.dateNF:e=i;break;case"number":i==14&&t.dateNF?e=t.dateNF:e=(t.table!=null?t.table:aa)[i],e==null&&(e=t.table&&t.table[WN[i]]||aa[WN[i]]),e==null&&(e=$ne[i]||"General");break}if(R2(e,0))return jD(n,t);n instanceof Date&&(n=T8(n,t.date1904));var r=dre(e,n);if(R2(r[1]))return jD(n,t);if(n===!0)n="TRUE";else if(n===!1)n="FALSE";else if(n===""||n==null)return"";return cre(r[1],n,t,r[0])}function N8(i,n){if(typeof n!="number"){n=+n||-1;for(var t=0;t<392;++t){if(aa[t]==null){n<0&&(n=t);continue}if(aa[t]==i){n=t;break}}n<0&&(n=391)}return aa[n]=i,n}function Y2(i){for(var n=0;n!=392;++n)i[n]!==void 0&&N8(i[n],n)}function q2(){aa=Gne()}var L8=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function mre(i){var n=typeof i=="number"?aa[i]:i;return n=n.replace(L8,"(\\d+)"),new RegExp("^"+n+"$")}function ure(i,n,t){var e=-1,r=-1,a=-1,c=-1,d=-1,u=-1;(n.match(L8)||[]).forEach(function(v,C){var y=parseInt(t[C+1],10);switch(v.toLowerCase().charAt(0)){case"y":e=y;break;case"d":a=y;break;case"h":c=y;break;case"s":u=y;break;case"m":c>=0?d=y:r=y;break}}),u>=0&&d==-1&&r>=0&&(d=r,r=-1);var h=(""+(e>=0?e:new Date().getFullYear())).slice(-4)+"-"+("00"+(r>=1?r:1)).slice(-2)+"-"+("00"+(a>=1?a:1)).slice(-2);h.length==7&&(h="0"+h),h.length==8&&(h="20"+h);var f=("00"+(c>=0?c:0)).slice(-2)+":"+("00"+(d>=0?d:0)).slice(-2)+":"+("00"+(u>=0?u:0)).slice(-2);return c==-1&&d==-1&&u==-1?h:e==-1&&r==-1&&a==-1?f:h+"T"+f}var pre=function(){var i={};i.version="1.2.0";function n(){for(var re=0,ae=new Array(256),ve=0;ve!=256;++ve)re=ve,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,re=re&1?-306674912^re>>>1:re>>>1,ae[ve]=re;return typeof Int32Array<"u"?new Int32Array(ae):ae}var t=n();function e(re){var ae=0,ve=0,Me=0,W=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(Me=0;Me!=256;++Me)W[Me]=re[Me];for(Me=0;Me!=256;++Me)for(ve=re[Me],ae=256+Me;ae<4096;ae+=256)ve=W[ae]=ve>>>8^re[ve&255];var J=[];for(Me=1;Me!=16;++Me)J[Me-1]=typeof Int32Array<"u"?W.subarray(Me*256,Me*256+256):W.slice(Me*256,Me*256+256);return J}var r=e(t),a=r[0],c=r[1],d=r[2],u=r[3],h=r[4],f=r[5],v=r[6],C=r[7],y=r[8],A=r[9],D=r[10],F=r[11],R=r[12],L=r[13],H=r[14];function se(re,ae){for(var ve=ae^-1,Me=0,W=re.length;Me<W;)ve=ve>>>8^t[(ve^re.charCodeAt(Me++))&255];return~ve}function Ce(re,ae){for(var ve=ae^-1,Me=re.length-15,W=0;W<Me;)ve=H[re[W++]^ve&255]^L[re[W++]^ve>>8&255]^R[re[W++]^ve>>16&255]^F[re[W++]^ve>>>24]^D[re[W++]]^A[re[W++]]^y[re[W++]]^C[re[W++]]^v[re[W++]]^f[re[W++]]^h[re[W++]]^u[re[W++]]^d[re[W++]]^c[re[W++]]^a[re[W++]]^t[re[W++]];for(Me+=15;W<Me;)ve=ve>>>8^t[(ve^re[W++])&255];return~ve}function Ue(re,ae){for(var ve=ae^-1,Me=0,W=re.length,J=0,Ee=0;Me<W;)J=re.charCodeAt(Me++),J<128?ve=ve>>>8^t[(ve^J)&255]:J<2048?(ve=ve>>>8^t[(ve^(192|J>>6&31))&255],ve=ve>>>8^t[(ve^(128|J&63))&255]):J>=55296&&J<57344?(J=(J&1023)+64,Ee=re.charCodeAt(Me++)&1023,ve=ve>>>8^t[(ve^(240|J>>8&7))&255],ve=ve>>>8^t[(ve^(128|J>>2&63))&255],ve=ve>>>8^t[(ve^(128|Ee>>6&15|(J&3)<<4))&255],ve=ve>>>8^t[(ve^(128|Ee&63))&255]):(ve=ve>>>8^t[(ve^(224|J>>12&15))&255],ve=ve>>>8^t[(ve^(128|J>>6&63))&255],ve=ve>>>8^t[(ve^(128|J&63))&255]);return~ve}return i.table=t,i.bstr=se,i.buf=Ce,i.str=Ue,i}(),xr=function(){var n={};n.version="1.2.1";function t(ie,Ie){for(var ge=ie.split("/"),be=Ie.split("/"),De=0,ke=0,lt=Math.min(ge.length,be.length);De<lt;++De){if(ke=ge[De].length-be[De].length)return ke;if(ge[De]!=be[De])return ge[De]<be[De]?-1:1}return ge.length-be.length}function e(ie){if(ie.charAt(ie.length-1)=="/")return ie.slice(0,-1).indexOf("/")===-1?ie:e(ie.slice(0,-1));var Ie=ie.lastIndexOf("/");return Ie===-1?ie:ie.slice(0,Ie+1)}function r(ie){if(ie.charAt(ie.length-1)=="/")return r(ie.slice(0,-1));var Ie=ie.lastIndexOf("/");return Ie===-1?ie:ie.slice(Ie+1)}function a(ie,Ie){typeof Ie=="string"&&(Ie=new Date(Ie));var ge=Ie.getHours();ge=ge<<6|Ie.getMinutes(),ge=ge<<5|Ie.getSeconds()>>>1,ie.write_shift(2,ge);var be=Ie.getFullYear()-1980;be=be<<4|Ie.getMonth()+1,be=be<<5|Ie.getDate(),ie.write_shift(2,be)}function c(ie){var Ie=ie.read_shift(2)&65535,ge=ie.read_shift(2)&65535,be=new Date,De=ge&31;ge>>>=5;var ke=ge&15;ge>>>=4,be.setMilliseconds(0),be.setFullYear(ge+1980),be.setMonth(ke-1),be.setDate(De);var lt=Ie&31;Ie>>>=5;var xt=Ie&63;return Ie>>>=6,be.setHours(Ie),be.setMinutes(xt),be.setSeconds(lt<<1),be}function d(ie){ll(ie,0);for(var Ie={},ge=0;ie.l<=ie.length-4;){var be=ie.read_shift(2),De=ie.read_shift(2),ke=ie.l+De,lt={};switch(be){case 21589:ge=ie.read_shift(1),ge&1&&(lt.mtime=ie.read_shift(4)),De>5&&(ge&2&&(lt.atime=ie.read_shift(4)),ge&4&&(lt.ctime=ie.read_shift(4))),lt.mtime&&(lt.mt=new Date(lt.mtime*1e3));break}ie.l=ke,Ie[be]=lt}return Ie}var u;function h(){return u||(u={})}function f(ie,Ie){if(ie[0]==80&&ie[1]==75)return Fr(ie,Ie);if((ie[0]|32)==109&&(ie[1]|32)==105)return hl(ie,Ie);if(ie.length<512)throw new Error("CFB file size "+ie.length+" < 512");var ge=3,be=512,De=0,ke=0,lt=0,xt=0,dt=0,ft=[],yt=ie.slice(0,512);ll(yt,0);var zt=v(yt);switch(ge=zt[0],ge){case 3:be=512;break;case 4:be=4096;break;case 0:if(zt[1]==0)return Fr(ie,Ie);default:throw new Error("Major Version: Expected 3 or 4 saw "+ge)}be!==512&&(yt=ie.slice(0,be),ll(yt,28));var ei=ie.slice(0,be);C(yt,ge);var bi=yt.read_shift(4,"i");if(ge===3&&bi!==0)throw new Error("# Directory Sectors: Expected 0 saw "+bi);yt.l+=4,lt=yt.read_shift(4,"i"),yt.l+=4,yt.chk("00100000","Mini Stream Cutoff Size: "),xt=yt.read_shift(4,"i"),De=yt.read_shift(4,"i"),dt=yt.read_shift(4,"i"),ke=yt.read_shift(4,"i");for(var ti=-1,li=0;li<109&&(ti=yt.read_shift(4,"i"),!(ti<0));++li)ft[li]=ti;var nn=y(ie,be);F(dt,ke,nn,be,ft);var Gn=L(nn,lt,ft,be);Gn[lt].name="!Directory",De>0&&xt!==Ee&&(Gn[xt].name="!MiniFAT"),Gn[ft[0]].name="!FAT",Gn.fat_addrs=ft,Gn.ssz=be;var Fa={},Br=[],Ra=[],dd=[];H(lt,Gn,nn,Br,De,Fa,Ra,xt),A(Ra,dd,Br),Br.shift();var Tc={FileIndex:Ra,FullPaths:dd};return Ie&&Ie.raw&&(Tc.raw={header:ei,sectors:nn}),Tc}function v(ie){if(ie[ie.l]==80&&ie[ie.l+1]==75)return[0,0];ie.chk(Fe,"Header Signature: "),ie.l+=16;var Ie=ie.read_shift(2,"u");return[ie.read_shift(2,"u"),Ie]}function C(ie,Ie){var ge=9;switch(ie.l+=2,ge=ie.read_shift(2)){case 9:if(Ie!=3)throw new Error("Sector Shift: Expected 9 saw "+ge);break;case 12:if(Ie!=4)throw new Error("Sector Shift: Expected 12 saw "+ge);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+ge)}ie.chk("0600","Mini Sector Shift: "),ie.chk("000000000000","Reserved: ")}function y(ie,Ie){for(var ge=Math.ceil(ie.length/Ie)-1,be=[],De=1;De<ge;++De)be[De-1]=ie.slice(De*Ie,(De+1)*Ie);return be[ge-1]=ie.slice(ge*Ie),be}function A(ie,Ie,ge){for(var be=0,De=0,ke=0,lt=0,xt=0,dt=ge.length,ft=[],yt=[];be<dt;++be)ft[be]=yt[be]=be,Ie[be]=ge[be];for(;xt<yt.length;++xt)be=yt[xt],De=ie[be].L,ke=ie[be].R,lt=ie[be].C,ft[be]===be&&(De!==-1&&ft[De]!==De&&(ft[be]=ft[De]),ke!==-1&&ft[ke]!==ke&&(ft[be]=ft[ke])),lt!==-1&&(ft[lt]=be),De!==-1&&be!=ft[be]&&(ft[De]=ft[be],yt.lastIndexOf(De)<xt&&yt.push(De)),ke!==-1&&be!=ft[be]&&(ft[ke]=ft[be],yt.lastIndexOf(ke)<xt&&yt.push(ke));for(be=1;be<dt;++be)ft[be]===be&&(ke!==-1&&ft[ke]!==ke?ft[be]=ft[ke]:De!==-1&&ft[De]!==De&&(ft[be]=ft[De]));for(be=1;be<dt;++be)if(ie[be].type!==0){if(xt=be,xt!=ft[xt])do xt=ft[xt],Ie[be]=Ie[xt]+"/"+Ie[be];while(xt!==0&&ft[xt]!==-1&&xt!=ft[xt]);ft[be]=-1}for(Ie[0]+="/",be=1;be<dt;++be)ie[be].type!==2&&(Ie[be]+="/")}function D(ie,Ie,ge){for(var be=ie.start,De=ie.size,ke=[],lt=be;ge&&De>0&<>=0;)ke.push(Ie.slice(lt*J,lt*J+J)),De-=J,lt=K0(ge,lt*4);return ke.length===0?Tt(0):fo(ke).slice(0,ie.size)}function F(ie,Ie,ge,be,De){var ke=Ee;if(ie===Ee){if(Ie!==0)throw new Error("DIFAT chain shorter than expected")}else if(ie!==-1){var lt=ge[ie],xt=(be>>>2)-1;if(!lt)return;for(var dt=0;dt<xt&&(ke=K0(lt,dt*4))!==Ee;++dt)De.push(ke);F(K0(lt,be-4),Ie-1,ge,be,De)}}function R(ie,Ie,ge,be,De){var ke=[],lt=[];De||(De=[]);var xt=be-1,dt=0,ft=0;for(dt=Ie;dt>=0;){De[dt]=!0,ke[ke.length]=dt,lt.push(ie[dt]);var yt=ge[Math.floor(dt*4/be)];if(ft=dt*4&xt,be<4+ft)throw new Error("FAT boundary crossed: "+dt+" 4 "+be);if(!ie[yt])break;dt=K0(ie[yt],ft)}return{nodes:ke,data:e8([lt])}}function L(ie,Ie,ge,be){var De=ie.length,ke=[],lt=[],xt=[],dt=[],ft=be-1,yt=0,zt=0,ei=0,bi=0;for(yt=0;yt<De;++yt)if(xt=[],ei=yt+Ie,ei>=De&&(ei-=De),!lt[ei]){dt=[];var ti=[];for(zt=ei;zt>=0;){ti[zt]=!0,lt[zt]=!0,xt[xt.length]=zt,dt.push(ie[zt]);var li=ge[Math.floor(zt*4/be)];if(bi=zt*4&ft,be<4+bi)throw new Error("FAT boundary crossed: "+zt+" 4 "+be);if(!ie[li]||(zt=K0(ie[li],bi),ti[zt]))break}ke[ei]={nodes:xt,data:e8([dt])}}return ke}function H(ie,Ie,ge,be,De,ke,lt,xt){for(var dt=0,ft=be.length?2:0,yt=Ie[ie].data,zt=0,ei=0,bi;zt<yt.length;zt+=128){var ti=yt.slice(zt,zt+128);ll(ti,64),ei=ti.read_shift(2),bi=J2(ti,0,ei-ft),be.push(bi);var li={name:bi,type:ti.read_shift(1),color:ti.read_shift(1),L:ti.read_shift(4,"i"),R:ti.read_shift(4,"i"),C:ti.read_shift(4,"i"),clsid:ti.read_shift(16),state:ti.read_shift(4,"i"),start:0,size:0},nn=ti.read_shift(2)+ti.read_shift(2)+ti.read_shift(2)+ti.read_shift(2);nn!==0&&(li.ct=se(ti,ti.l-8));var Gn=ti.read_shift(2)+ti.read_shift(2)+ti.read_shift(2)+ti.read_shift(2);Gn!==0&&(li.mt=se(ti,ti.l-8)),li.start=ti.read_shift(4,"i"),li.size=ti.read_shift(4,"i"),li.size<0&&li.start<0&&(li.size=li.type=0,li.start=Ee,li.name=""),li.type===5?(dt=li.start,De>0&&dt!==Ee&&(Ie[dt].name="!StreamData")):li.size>=4096?(li.storage="fat",Ie[li.start]===void 0&&(Ie[li.start]=R(ge,li.start,Ie.fat_addrs,Ie.ssz)),Ie[li.start].name=li.name,li.content=Ie[li.start].data.slice(0,li.size)):(li.storage="minifat",li.size<0?li.size=0:dt!==Ee&&li.start!==Ee&&Ie[dt]&&(li.content=D(li,Ie[dt].data,(Ie[xt]||{}).data))),li.content&&ll(li.content,0),ke[bi]=li,lt.push(li)}}function se(ie,Ie){return new Date((to(ie,Ie+4)/1e7*Math.pow(2,32)+to(ie,Ie)/1e7-11644473600)*1e3)}function Ce(ie,Ie){return h(),f(u.readFileSync(ie),Ie)}function Ue(ie,Ie){var ge=Ie&&Ie.type;switch(ge||tr&&Buffer.isBuffer(ie)&&(ge="buffer"),ge||"base64"){case"file":return Ce(ie,Ie);case"base64":return f(bc(nm(ie)),Ie);case"binary":return f(bc(ie),Ie)}return f(ie,Ie)}function re(ie,Ie){var ge=Ie||{},be=ge.root||"Root Entry";if(ie.FullPaths||(ie.FullPaths=[]),ie.FileIndex||(ie.FileIndex=[]),ie.FullPaths.length!==ie.FileIndex.length)throw new Error("inconsistent CFB structure");ie.FullPaths.length===0&&(ie.FullPaths[0]=be+"/",ie.FileIndex[0]={name:be,type:5}),ge.CLSID&&(ie.FileIndex[0].clsid=ge.CLSID),ae(ie)}function ae(ie){var Ie="�Sh33tJ5";if(!xr.find(ie,"/"+Ie)){var ge=Tt(4);ge[0]=55,ge[1]=ge[3]=50,ge[2]=54,ie.FileIndex.push({name:Ie,type:2,content:ge,size:4,L:69,R:69,C:69}),ie.FullPaths.push(ie.FullPaths[0]+Ie),ve(ie)}}function ve(ie,Ie){re(ie);for(var ge=!1,be=!1,De=ie.FullPaths.length-1;De>=0;--De){var ke=ie.FileIndex[De];switch(ke.type){case 0:be?ge=!0:(ie.FileIndex.pop(),ie.FullPaths.pop());break;case 1:case 2:case 5:be=!0,isNaN(ke.R*ke.L*ke.C)&&(ge=!0),ke.R>-1&&ke.L>-1&&ke.R==ke.L&&(ge=!0);break;default:ge=!0;break}}if(!(!ge&&!Ie)){var lt=new Date(1987,1,19),xt=0,dt=Object.create?Object.create(null):{},ft=[];for(De=0;De<ie.FullPaths.length;++De)dt[ie.FullPaths[De]]=!0,ie.FileIndex[De].type!==0&&ft.push([ie.FullPaths[De],ie.FileIndex[De]]);for(De=0;De<ft.length;++De){var yt=e(ft[De][0]);be=dt[yt],be||(ft.push([yt,{name:r(yt).replace("/",""),type:1,clsid:Qe,ct:lt,mt:lt,content:null}]),dt[yt]=!0)}for(ft.sort(function(bi,ti){return t(bi[0],ti[0])}),ie.FullPaths=[],ie.FileIndex=[],De=0;De<ft.length;++De)ie.FullPaths[De]=ft[De][0],ie.FileIndex[De]=ft[De][1];for(De=0;De<ft.length;++De){var zt=ie.FileIndex[De],ei=ie.FullPaths[De];if(zt.name=r(ei).replace("/",""),zt.L=zt.R=zt.C=-(zt.color=1),zt.size=zt.content?zt.content.length:0,zt.start=0,zt.clsid=zt.clsid||Qe,De===0)zt.C=ft.length>1?1:-1,zt.size=0,zt.type=5;else if(ei.slice(-1)=="/"){for(xt=De+1;xt<ft.length&&e(ie.FullPaths[xt])!=ei;++xt);for(zt.C=xt>=ft.length?-1:xt,xt=De+1;xt<ft.length&&e(ie.FullPaths[xt])!=e(ei);++xt);zt.R=xt>=ft.length?-1:xt,zt.type=1}else e(ie.FullPaths[De+1]||"")==e(ei)&&(zt.R=De+1),zt.type=2}}}function Me(ie,Ie){var ge=Ie||{};if(ge.fileType=="mad")return zi(ie,ge);switch(ve(ie),ge.fileType){case"zip":return Hl(ie,ge)}var be=function(bi){for(var ti=0,li=0,nn=0;nn<bi.FileIndex.length;++nn){var Gn=bi.FileIndex[nn];if(Gn.content){var Fa=Gn.content.length;Fa>0&&(Fa<4096?ti+=Fa+63>>6:li+=Fa+511>>9)}}for(var Br=bi.FullPaths.length+3>>2,Ra=ti+7>>3,dd=ti+127>>7,Tc=Ra+li+Br+dd,Gl=Tc+127>>7,Dc=Gl<=109?0:Math.ceil((Gl-109)/127);Tc+Gl+Dc+127>>7>Gl;)Dc=++Gl<=109?0:Math.ceil((Gl-109)/127);var Gs=[1,Dc,Gl,dd,Br,li,ti,0];return bi.FileIndex[0].size=ti<<6,Gs[7]=(bi.FileIndex[0].start=Gs[0]+Gs[1]+Gs[2]+Gs[3]+Gs[4]+Gs[5])+(Gs[6]+7>>3),Gs}(ie),De=Tt(be[7]<<9),ke=0,lt=0;{for(ke=0;ke<8;++ke)De.write_shift(1,$e[ke]);for(ke=0;ke<8;++ke)De.write_shift(2,0);for(De.write_shift(2,62),De.write_shift(2,3),De.write_shift(2,65534),De.write_shift(2,9),De.write_shift(2,6),ke=0;ke<3;++ke)De.write_shift(2,0);for(De.write_shift(4,0),De.write_shift(4,be[2]),De.write_shift(4,be[0]+be[1]+be[2]+be[3]-1),De.write_shift(4,0),De.write_shift(4,4096),De.write_shift(4,be[3]?be[0]+be[1]+be[2]-1:Ee),De.write_shift(4,be[3]),De.write_shift(-4,be[1]?be[0]-1:Ee),De.write_shift(4,be[1]),ke=0;ke<109;++ke)De.write_shift(-4,ke<be[2]?be[1]+ke:-1)}if(be[1])for(lt=0;lt<be[1];++lt){for(;ke<236+lt*127;++ke)De.write_shift(-4,ke<be[2]?be[1]+ke:-1);De.write_shift(-4,lt===be[1]-1?Ee:lt+1)}var xt=function(bi){for(lt+=bi;ke<lt-1;++ke)De.write_shift(-4,ke+1);bi&&(++ke,De.write_shift(-4,Ee))};for(lt=ke=0,lt+=be[1];ke<lt;++ke)De.write_shift(-4,ot.DIFSECT);for(lt+=be[2];ke<lt;++ke)De.write_shift(-4,ot.FATSECT);xt(be[3]),xt(be[4]);for(var dt=0,ft=0,yt=ie.FileIndex[0];dt<ie.FileIndex.length;++dt)yt=ie.FileIndex[dt],yt.content&&(ft=yt.content.length,!(ft<4096)&&(yt.start=lt,xt(ft+511>>9)));for(xt(be[6]+7>>3);De.l&511;)De.write_shift(-4,ot.ENDOFCHAIN);for(lt=ke=0,dt=0;dt<ie.FileIndex.length;++dt)yt=ie.FileIndex[dt],yt.content&&(ft=yt.content.length,!(!ft||ft>=4096)&&(yt.start=lt,xt(ft+63>>6)));for(;De.l&511;)De.write_shift(-4,ot.ENDOFCHAIN);for(ke=0;ke<be[4]<<2;++ke){var zt=ie.FullPaths[ke];if(!zt||zt.length===0){for(dt=0;dt<17;++dt)De.write_shift(4,0);for(dt=0;dt<3;++dt)De.write_shift(4,-1);for(dt=0;dt<12;++dt)De.write_shift(4,0);continue}yt=ie.FileIndex[ke],ke===0&&(yt.start=yt.size?yt.start-1:Ee);var ei=ke===0&&ge.root||yt.name;if(ft=2*(ei.length+1),De.write_shift(64,ei,"utf16le"),De.write_shift(2,ft),De.write_shift(1,yt.type),De.write_shift(1,yt.color),De.write_shift(-4,yt.L),De.write_shift(-4,yt.R),De.write_shift(-4,yt.C),yt.clsid)De.write_shift(16,yt.clsid,"hex");else for(dt=0;dt<4;++dt)De.write_shift(4,0);De.write_shift(4,yt.state||0),De.write_shift(4,0),De.write_shift(4,0),De.write_shift(4,0),De.write_shift(4,0),De.write_shift(4,yt.start),De.write_shift(4,yt.size),De.write_shift(4,0)}for(ke=1;ke<ie.FileIndex.length;++ke)if(yt=ie.FileIndex[ke],yt.size>=4096)if(De.l=yt.start+1<<9,tr&&Buffer.isBuffer(yt.content))yt.content.copy(De,De.l,0,yt.size),De.l+=yt.size+511&-512;else{for(dt=0;dt<yt.size;++dt)De.write_shift(1,yt.content[dt]);for(;dt&511;++dt)De.write_shift(1,0)}for(ke=1;ke<ie.FileIndex.length;++ke)if(yt=ie.FileIndex[ke],yt.size>0&&yt.size<4096)if(tr&&Buffer.isBuffer(yt.content))yt.content.copy(De,De.l,0,yt.size),De.l+=yt.size+63&-64;else{for(dt=0;dt<yt.size;++dt)De.write_shift(1,yt.content[dt]);for(;dt&63;++dt)De.write_shift(1,0)}if(tr)De.l=De.length;else for(;De.l<De.length;)De.write_shift(1,0);return De}function W(ie,Ie){var ge=ie.FullPaths.map(function(dt){return dt.toUpperCase()}),be=ge.map(function(dt){var ft=dt.split("/");return ft[ft.length-(dt.slice(-1)=="/"?2:1)]}),De=!1;Ie.charCodeAt(0)===47?(De=!0,Ie=ge[0].slice(0,-1)+Ie):De=Ie.indexOf("/")!==-1;var ke=Ie.toUpperCase(),lt=De===!0?ge.indexOf(ke):be.indexOf(ke);if(lt!==-1)return ie.FileIndex[lt];var xt=!ke.match(w2);for(ke=ke.replace(Sf,""),xt&&(ke=ke.replace(w2,"!")),lt=0;lt<ge.length;++lt)if((xt?ge[lt].replace(w2,"!"):ge[lt]).replace(Sf,"")==ke||(xt?be[lt].replace(w2,"!"):be[lt]).replace(Sf,"")==ke)return ie.FileIndex[lt];return null}var J=64,Ee=-2,Fe="d0cf11e0a1b11ae1",$e=[208,207,17,224,161,177,26,225],Qe="00000000000000000000000000000000",ot={MAXREGSECT
157:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:Ee,FREESECT:-1,HEADER_SIGNATURE:Fe,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:Qe,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function et(ie,Ie,ge){h();var be=Me(ie,ge);u.writeFileSync(Ie,be)}function gt(ie){for(var Ie=new Array(ie.length),ge=0;ge<ie.length;++ge)Ie[ge]=String.fromCharCode(ie[ge]);return Ie.join("")}function vt(ie,Ie){var ge=Me(ie,Ie);switch(Ie&&Ie.type||"buffer"){case"file":return h(),u.writeFileSync(Ie.filename,ge),ge;case"binary":return typeof ge=="string"?ge:gt(ge);case"base64":return Mv(typeof ge=="string"?ge:gt(ge));case"buffer":if(tr)return Buffer.isBuffer(ge)?ge:am(ge);case"array":return typeof ge=="string"?bc(ge):ge}return ge}var Kt;function O(ie){try{var Ie=ie.InflateRaw,ge=new Ie;if(ge._processChunk(new Uint8Array([3,0]),ge._finishFlushFlag),ge.bytesRead)Kt=ie;else throw new Error("zlib does not expose bytesRead")}catch(be){console.error("cannot use native zlib: "+(be.message||be))}}function Q(ie,Ie){if(!Kt)return Ln(ie,Ie);var ge=Kt.InflateRaw,be=new ge,De=be._processChunk(ie.slice(ie.l),be._finishFlushFlag);return ie.l+=be.bytesRead,De}function V(ie){return Kt?Kt.deflateRawSync(ie):bn(ie)}var Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],we=[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],Ve=[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];function Ge(ie){var Ie=(ie<<1|ie<<11)&139536|(ie<<5|ie<<15)&558144;return(Ie>>16|Ie>>8|Ie)&255}for(var je=typeof Uint8Array<"u",it=je?new Uint8Array(256):[],It=0;It<256;++It)it[It]=Ge(It);function Nt(ie,Ie){var ge=it[ie&255];return Ie<=8?ge>>>8-Ie:(ge=ge<<8|it[ie>>8&255],Ie<=16?ge>>>16-Ie:(ge=ge<<8|it[ie>>16&255],ge>>>24-Ie))}function qt(ie,Ie){var ge=Ie&7,be=Ie>>>3;return(ie[be]|(ge<=6?0:ie[be+1]<<8))>>>ge&3}function ni(ie,Ie){var ge=Ie&7,be=Ie>>>3;return(ie[be]|(ge<=5?0:ie[be+1]<<8))>>>ge&7}function bt(ie,Ie){var ge=Ie&7,be=Ie>>>3;return(ie[be]|(ge<=4?0:ie[be+1]<<8))>>>ge&15}function Ae(ie,Ie){var ge=Ie&7,be=Ie>>>3;return(ie[be]|(ge<=3?0:ie[be+1]<<8))>>>ge&31}function Lt(ie,Ie){var ge=Ie&7,be=Ie>>>3;return(ie[be]|(ge<=1?0:ie[be+1]<<8))>>>ge&127}function hi(ie,Ie,ge){var be=Ie&7,De=Ie>>>3,ke=(1<<ge)-1,lt=ie[De]>>>be;return ge<8-be||(lt|=ie[De+1]<<8-be,ge<16-be)||(lt|=ie[De+2]<<16-be,ge<24-be)||(lt|=ie[De+3]<<24-be),lt&ke}function Wt(ie,Ie,ge){var be=Ie&7,De=Ie>>>3;return be<=5?ie[De]|=(ge&7)<<be:(ie[De]|=ge<<be&255,ie[De+1]=(ge&7)>>8-be),Ie+3}function Xt(ie,Ie,ge){var be=Ie&7,De=Ie>>>3;return ge=(ge&1)<<be,ie[De]|=ge,Ie+1}function ri(ie,Ie,ge){var be=Ie&7,De=Ie>>>3;return ge<<=be,ie[De]|=ge&255,ge>>>=8,ie[De+1]=ge,Ie+8}function di(ie,Ie,ge){var be=Ie&7,De=Ie>>>3;return ge<<=be,ie[De]|=ge&255,ge>>>=8,ie[De+1]=ge&255,ie[De+2]=ge>>>8,Ie+16}function Mi(ie,Ie){var ge=ie.length,be=2*ge>Ie?2*ge:Ie+5,De=0;if(ge>=Ie)return ie;if(tr){var ke=VN(be);if(ie.copy)ie.copy(ke);else for(;De<ie.length;++De)ke[De]=ie[De];return ke}else if(je){var lt=new Uint8Array(be);if(lt.set)lt.set(ie);else for(;De<ge;++De)lt[De]=ie[De];return lt}return ie.length=be,ie}function Li(ie){for(var Ie=new Array(ie),ge=0;ge<ie;++ge)Ie[ge]=0;return Ie}function Ji(ie,Ie,ge){var be=1,De=0,ke=0,lt=0,xt=0,dt=ie.length,ft=je?new Uint16Array(32):Li(32);for(ke=0;ke<32;++ke)ft[ke]=0;for(ke=dt;ke<ge;++ke)ie[ke]=0;dt=ie.length;var yt=je?new Uint16Array(dt):Li(dt);for(ke=0;ke<dt;++ke)ft[De=ie[ke]]++,be<De&&(be=De),yt[ke]=0;for(ft[0]=0,ke=1;ke<=be;++ke)ft[ke+16]=xt=xt+ft[ke-1]<<1;for(ke=0;ke<dt;++ke)xt=ie[ke],xt!=0&&(yt[ke]=ft[xt+16]++);var zt=0;for(ke=0;ke<dt;++ke)if(zt=ie[ke],zt!=0)for(xt=Nt(yt[ke],be)>>be-zt,lt=(1<<be+4-zt)-1;lt>=0;--lt)Ie[xt|lt<<zt]=zt&15|ke<<4;return be}var ln=je?new Uint16Array(512):Li(512),Sn=je?new Uint16Array(32):Li(32);if(!je){for(var wn=0;wn<512;++wn)ln[wn]=0;for(wn=0;wn<32;++wn)Sn[wn]=0}(function(){for(var ie=[],Ie=0;Ie<32;Ie++)ie.push(5);Ji(ie,Sn,32);var ge=[];for(Ie=0;Ie<=143;Ie++)ge.push(8);for(;Ie<=255;Ie++)ge.push(9);for(;Ie<=279;Ie++)ge.push(7);for(;Ie<=287;Ie++)ge.push(8);Ji(ge,ln,288)})();var Zi=function(){for(var Ie=je?new Uint8Array(32768):[],ge=0,be=0;ge<Ve.length-1;++ge)for(;be<Ve[ge+1];++be)Ie[be]=ge;for(;be<32768;++be)Ie[be]=29;var De=je?new Uint8Array(259):[];for(ge=0,be=0;ge<we.length-1;++ge)for(;be<we[ge+1];++be)De[be]=ge;function ke(xt,dt){for(var ft=0;ft<xt.length;){var yt=Math.min(65535,xt.length-ft),zt=ft+yt==xt.length;for(dt.write_shift(1,+zt),dt.write_shift(2,yt),dt.write_shift(2,~yt&65535);yt-- >0;)dt[dt.l++]=xt[ft++]}return dt.l}function lt(xt,dt){for(var ft=0,yt=0,zt=je?new Uint16Array(32768):[];yt<xt.length;){var ei=Math.min(65535,xt.length-yt);if(ei<10){for(ft=Wt(dt,ft,+(yt+ei==xt.length)),ft&7&&(ft+=8-(ft&7)),dt.l=ft/8|0,dt.write_shift(2,ei),dt.write_shift(2,~ei&65535);ei-- >0;)dt[dt.l++]=xt[yt++];ft=dt.l*8;continue}ft=Wt(dt,ft,+(yt+ei==xt.length)+2);for(var bi=0;ei-- >0;){var ti=xt[yt];bi=(bi<<5^ti)&32767;var li=-1,nn=0;if((li=zt[bi])&&(li|=yt&-32768,li>yt&&(li-=32768),li<yt))for(;xt[li+nn]==xt[yt+nn]&&nn<250;)++nn;if(nn>2){ti=De[nn],ti<=22?ft=ri(dt,ft,it[ti+1]>>1)-1:(ri(dt,ft,3),ft+=5,ri(dt,ft,it[ti-23]>>5),ft+=3);var Gn=ti<8?0:ti-4>>2;Gn>0&&(di(dt,ft,nn-we[ti]),ft+=Gn),ti=Ie[yt-li],ft=ri(dt,ft,it[ti]>>3),ft-=3;var Fa=ti<4?0:ti-2>>1;Fa>0&&(di(dt,ft,yt-li-Ve[ti]),ft+=Fa);for(var Br=0;Br<nn;++Br)zt[bi]=yt&32767,bi=(bi<<5^xt[yt])&32767,++yt;ei-=nn-1}else ti<=143?ti=ti+48:ft=Xt(dt,ft,1),ft=ri(dt,ft,it[ti]),zt[bi]=yt&32767,++yt}ft=ri(dt,ft,0)-1}return dt.l=(ft+7)/8|0,dt.l}return function(dt,ft){return dt.length<8?ke(dt,ft):lt(dt,ft)}}();function bn(ie){var Ie=Tt(50+Math.floor(ie.length*1.1)),ge=Zi(ie,Ie);return Ie.slice(0,ge)}var fi=je?new Uint16Array(32768):Li(32768),Aa=je?new Uint16Array(32768):Li(32768),Pn=je?new Uint16Array(128):Li(128),as=1,ir=1;function kr(ie,Ie){var ge=Ae(ie,Ie)+257;Ie+=5;var be=Ae(ie,Ie)+1;Ie+=5;var De=bt(ie,Ie)+4;Ie+=4;for(var ke=0,lt=je?new Uint8Array(19):Li(19),xt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dt=1,ft=je?new Uint8Array(8):Li(8),yt=je?new Uint8Array(8):Li(8),zt=lt.length,ei=0;ei<De;++ei)lt[Y[ei]]=ke=ni(ie,Ie),dt<ke&&(dt=ke),ft[ke]++,Ie+=3;var bi=0;for(ft[0]=0,ei=1;ei<=dt;++ei)yt[ei]=bi=bi+ft[ei-1]<<1;for(ei=0;ei<zt;++ei)(bi=lt[ei])!=0&&(xt[ei]=yt[bi]++);var ti=0;for(ei=0;ei<zt;++ei)if(ti=lt[ei],ti!=0){bi=it[xt[ei]]>>8-ti;for(var li=(1<<7-ti)-1;li>=0;--li)Pn[bi|li<<ti]=ti&7|ei<<3}var nn=[];for(dt=1;nn.length<ge+be;)switch(bi=Pn[Lt(ie,Ie)],Ie+=bi&7,bi>>>=3){case 16:for(ke=3+qt(ie,Ie),Ie+=2,bi=nn[nn.length-1];ke-- >0;)nn.push(bi);break;case 17:for(ke=3+ni(ie,Ie),Ie+=3;
157ke-- >0;)nn.push(0);break;case 18:for(ke=11+Lt(ie,Ie),Ie+=7;ke-- >0;)nn.push(0);break;default:nn.push(bi),dt<bi&&(dt=bi);break}var Gn=nn.slice(0,ge),Fa=nn.slice(ge);for(ei=ge;ei<286;++ei)Gn[ei]=0;for(ei=be;ei<30;++ei)Fa[ei]=0;return as=Ji(Gn,fi,286),ir=Ji(Fa,Aa,30),Ie}function ul(ie,Ie){if(ie[0]==3&&!(ie[1]&3))return[Z0(Ie),2];for(var ge=0,be=0,De=VN(Ie||1<<18),ke=0,lt=De.length>>>0,xt=0,dt=0;(be&1)==0;){if(be=ni(ie,ge),ge+=3,be>>>1)be>>1==1?(xt=9,dt=5):(ge=kr(ie,ge),xt=as,dt=ir);else{ge&7&&(ge+=8-(ge&7));var ft=ie[ge>>>3]|ie[(ge>>>3)+1]<<8;if(ge+=32,ft>0)for(!Ie&<<ke+ft&&(De=Mi(De,ke+ft),lt=De.length);ft-- >0;)De[ke++]=ie[ge>>>3],ge+=8;continue}for(;;){!Ie&<<ke+32767&&(De=Mi(De,ke+32767),lt=De.length);var yt=hi(ie,ge,xt),zt=be>>>1==1?ln[yt]:fi[yt];if(ge+=zt&15,zt>>>=4,(zt>>>8&255)===0)De[ke++]=zt;else{if(zt==256)break;zt-=257;var ei=zt<8?0:zt-4>>2;ei>5&&(ei=0);var bi=ke+we[zt];ei>0&&(bi+=hi(ie,ge,ei),ge+=ei),yt=hi(ie,ge,dt),zt=be>>>1==1?Sn[yt]:Aa[yt],ge+=zt&15,zt>>>=4;var ti=zt<4?0:zt-2>>1,li=Ve[zt];for(ti>0&&(li+=hi(ie,ge,ti),ge+=ti),!Ie&<<bi&&(De=Mi(De,bi+100),lt=De.length);ke<bi;)De[ke]=De[ke-li],++ke}}}return Ie?[De,ge+7>>>3]:[De.slice(0,ke),ge+7>>>3]}function Ln(ie,Ie){var ge=ie.slice(ie.l||0),be=ul(ge,Ie);return ie.l+=be[1],be[0]}function wc(ie,Ie){if(ie)typeof console<"u"&&console.error(Ie);else throw new Error(Ie)}function Fr(ie,Ie){var ge=ie;ll(ge,0);var be=[],De=[],ke={FileIndex:be,FullPaths:De};re(ke,{root:Ie.root});for(var lt=ge.length-4;(ge[lt]!=80||ge[lt+1]!=75||ge[lt+2]!=5||ge[lt+3]!=6)&<>=0;)--lt;ge.l=lt+4,ge.l+=4;var xt=ge.read_shift(2);ge.l+=6;var dt=ge.read_shift(4);for(ge.l=dt,lt=0;lt<xt;++lt){ge.l+=20;var ft=ge.read_shift(4),yt=ge.read_shift(4),zt=ge.read_shift(2),ei=ge.read_shift(2),bi=ge.read_shift(2);ge.l+=8;var ti=ge.read_shift(4),li=d(ge.slice(ge.l+zt,ge.l+zt+ei));ge.l+=zt+ei+bi;var nn=ge.l;ge.l=ti+4,Ws(ge,ft,yt,ke,li),ge.l=nn}return ke}function Ws(ie,Ie,ge,be,De){ie.l+=2;var ke=ie.read_shift(2),lt=ie.read_shift(2),xt=c(ie);if(ke&8257)throw new Error("Unsupported ZIP encryption");for(var dt=ie.read_shift(4),ft=ie.read_shift(4),yt=ie.read_shift(4),zt=ie.read_shift(2),ei=ie.read_shift(2),bi="",ti=0;ti<zt;++ti)bi+=String.fromCharCode(ie[ie.l++]);if(ei){var li=d(ie.slice(ie.l,ie.l+ei));(li[21589]||{}).mt&&(xt=li[21589].mt),((De||{})[21589]||{}).mt&&(xt=De[21589].mt)}ie.l+=ei;var nn=ie.slice(ie.l,ie.l+ft);switch(lt){case 8:nn=Q(ie,yt);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+lt)}var Gn=!1;ke&8&&(dt=ie.read_shift(4),dt==134695760&&(dt=ie.read_shift(4),Gn=!0),ft=ie.read_shift(4),yt=ie.read_shift(4)),ft!=Ie&&wc(Gn,"Bad compressed size: "+Ie+" != "+ft),yt!=ge&&wc(Gn,"Bad uncompressed size: "+ge+" != "+yt),os(be,bi,nn,{unsafe:!0,mt:xt})}function Hl(ie,Ie){var ge=Ie||{},be=[],De=[],ke=Tt(1),lt=ge.compression?8:0,xt=0,dt=!1;dt&&(xt|=8);var ft=0,yt=0,zt=0,ei=0,bi=ie.FullPaths[0],ti=bi,li=ie.FileIndex[0],nn=[],Gn=0;for(ft=1;ft<ie.FullPaths.length;++ft)if(ti=ie.FullPaths[ft].slice(bi.length),li=ie.FileIndex[ft],!(!li.size||!li.content||ti=="�Sh33tJ5")){var Fa=zt,Br=Tt(ti.length);for(yt=0;yt<ti.length;++yt)Br.write_shift(1,ti.charCodeAt(yt)&127);Br=Br.slice(0,Br.l),nn[ei]=pre.buf(li.content,0);var Ra=li.content;lt==8&&(Ra=V(Ra)),ke=Tt(30),ke.write_shift(4,67324752),ke.write_shift(2,20),ke.write_shift(2,xt),ke.write_shift(2,lt),li.mt?a(ke,li.mt):ke.write_shift(4,0),ke.write_shift(-4,xt&8?0:nn[ei]),ke.write_shift(4,xt&8?0:Ra.length),ke.write_shift(4,xt&8?0:li.content.length),ke.write_shift(2,Br.length),ke.write_shift(2,0),zt+=ke.length,be.push(ke),zt+=Br.length,be.push(Br),zt+=Ra.length,be.push(Ra),xt&8&&(ke=Tt(12),ke.write_shift(-4,nn[ei]),ke.write_shift(4,Ra.length),ke.write_shift(4,li.content.length),zt+=ke.l,be.push(ke)),ke=Tt(46),ke.write_shift(4,33639248),ke.write_shift(2,0),ke.write_shift(2,20),ke.write_shift(2,xt),ke.write_shift(2,lt),ke.write_shift(4,0),ke.write_shift(-4,nn[ei]),ke.write_shift(4,Ra.length),ke.write_shift(4,li.content.length),ke.write_shift(2,Br.length),ke.write_shift(2,0),ke.write_shift(2,0),ke.write_shift(2,0),ke.write_shift(2,0),ke.write_shift(4,0),ke.write_shift(4,Fa),Gn+=ke.l,De.push(ke),Gn+=Br.length,De.push(Br),++ei}return ke=Tt(22),ke.write_shift(4,101010256),ke.write_shift(2,0),ke.write_shift(2,0),ke.write_shift(2,ei),ke.write_shift(2,ei),ke.write_shift(4,Gn),ke.write_shift(4,zt),ke.write_shift(2,0),fo([fo(be),fo(De),ke])}var Cr={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function an(ie,Ie){if(ie.ctype)return ie.ctype;var ge=ie.name||"",be=ge.match(/\.([^\.]+)$/);return be&&Cr[be[1]]||Ie&&(be=(ge=Ie).match(/[\.\\]([^\.\\])+$/),be&&Cr[be[1]])?Cr[be[1]]:"application/octet-stream"}function Hn(ie){for(var Ie=Mv(ie),ge=[],be=0;be<Ie.length;be+=76)ge.push(Ie.slice(be,be+76));return ge.join(`\r 158`)+`\r 159`}function cd(ie){var Ie=ie.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(ft){var yt=ft.charCodeAt(0).toString(16).toUpperCase();return"="+(yt.length==1?"0"+yt:yt)});Ie=Ie.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),Ie.charAt(0)==` 160`&&(Ie="=0D"+Ie.slice(1)),Ie=Ie.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,` 161=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var ge=[],be=Ie.split(`\r 162`),De=0;De<be.length;++De){var ke=be[De];if(ke.length==0){ge.push("");continue}for(var lt=0;lt<ke.length;
162){var xt=76,dt=ke.slice(lt,lt+xt);dt.charAt(xt-1)=="="?xt--:dt.charAt(xt-2)=="="?xt-=2:dt.charAt(xt-3)=="="&&(xt-=3),dt=ke.slice(lt,lt+xt),lt+=xt,lt<ke.length&&(dt+="="),ge.push(dt)}}return ge.join(`\r 163`)}function Pa(ie){for(var Ie=[],ge=0;ge<ie.length;++ge){for(var be=ie[ge];ge<=ie.length&&be.charAt(be.length-1)=="=";)be=be.slice(0,be.length-1)+ie[++ge];Ie.push(be)}for(var De=0;De<Ie.length;++De)Ie[De]=Ie[De].replace(/[=][0-9A-Fa-f]{2}/g,function(ke){return String.fromCharCode(parseInt(ke.slice(1),16))});return bc(Ie.join(`\r 164`))}function pl(ie,Ie,ge){for(var be="",De="",ke="",lt,xt=0;xt<10;++xt){var dt=Ie[xt];if(!dt||dt.match(/^\s*$/))break;var ft=dt.match(/^(.*?):\s*([^\s].*)$/);if(ft)switch(ft[1].toLowerCase()){case"content-location":be=ft[2].trim();break;case"content-type":ke=ft[2].trim();break;case"content-transfer-encoding":De=ft[2].trim();break}}switch(++xt,De.toLowerCase()){case"base64":lt=bc(nm(Ie.slice(xt).join("")));break;case"quoted-printable":lt=Pa(Ie.slice(xt));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+De)}var yt=os(ie,be.slice(ge.length),lt,{unsafe:!0});ke&&(yt.ctype=ke)}function hl(ie,Ie){if(gt(ie.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var ge=Ie&&Ie.root||"",be=(tr&&Buffer.isBuffer(ie)?ie.toString("binary"):gt(ie)).split(`\r 165`),De=0,ke="";for(De=0;De<be.length;++De)if(ke=be[De],!!/^Content-Location:/i.test(ke)&&(ke=ke.slice(ke.indexOf("file")),ge||(ge=ke.slice(0,ke.lastIndexOf("/")+1)),ke.slice(0,ge.length)!=ge))for(;ge.length>0&&(ge=ge.slice(0,ge.length-1),ge=ge.slice(0,ge.lastIndexOf("/")+1),ke.slice(0,ge.length)!=ge););var lt=(be[1]||"").match(/boundary="(.*?)"/);if(!lt)throw new Error("MAD cannot find boundary");var xt="--"+(lt[1]||""),dt=[],ft=[],yt={FileIndex:dt,FullPaths:ft};re(yt);var zt,ei=0;for(De=0;De<be.length;++De){var bi=be[De];bi!==xt&&bi!==xt+"--"||(ei++&&pl(yt,be.slice(zt,De),ge),zt=De)}return yt}function zi(ie,Ie){var ge=Ie||{},be=ge.boundary||"SheetJS";be="------="+be;for(var De=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+be.slice(2)+'"',"","",""],ke=ie.FullPaths[0],lt=ke,xt=ie.FileIndex[0],dt=1;dt<ie.FullPaths.length;++dt)if(lt=ie.FullPaths[dt].slice(ke.length),xt=ie.FileIndex[dt],!(!xt.size||!xt.content||lt=="�Sh33tJ5")){lt=lt.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(nn){return"_x"+nn.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(nn){return"_u"+nn.charCodeAt(0).toString(16)+"_"});for(var ft=xt.content,yt=tr&&Buffer.isBuffer(ft)?ft.toString("binary"):gt(ft),zt=0,ei=Math.min(1024,yt.length),bi=0,ti=0;ti<=ei;++ti)(bi=yt.charCodeAt(ti))>=32&&bi<128&&++zt;var li=zt>=ei*4/5;De.push(be),De.push("Content-Location: "+(ge.root||"file:///C:/SheetJS/")+lt),De.push("Content-Transfer-Encoding: "+(li?"quoted-printable":"base64")),De.push("Content-Type: "+an(xt,lt)),De.push(""),De.push(li?cd(yt):Hn(yt))}return De.push(be+`--\r 166`),De.join(`\r 167`)}function Hs(ie){var Ie={};return re(Ie,ie),Ie}function os(ie,Ie,ge,be){var De=be&&be.unsafe;De||re(ie);var ke=!De&&xr.find(ie,Ie);if(!ke){var lt=ie.FullPaths[0];Ie.slice(0,lt.length)==lt?lt=Ie:(lt.slice(-1)!="/"&&(lt+="/"),lt=(lt+Ie).replace("//","/")),ke={name:r(Ie),type:2},ie.FileIndex.push(ke),ie.FullPaths.push(lt),De||xr.utils.cfb_gc(ie)}return ke.content=ge,ke.size=ge?ge.length:0,be&&(be.CLSID&&(ke.clsid=be.CLSID),be.mt&&(ke.mt=be.mt),be.ct&&(ke.ct=be.ct)),ke}function yo(ie,Ie){re(ie);var ge=xr.find(ie,Ie);if(ge){for(var be=0;be<ie.FileIndex.length;++be)if(ie.FileIndex[be]==ge)return ie.FileIndex.splice(be,1),ie.FullPaths.splice(be,1),!0}return!1}function oa(ie,Ie,ge){re(ie);var be=xr.find(ie,Ie);if(be){for(var De=0;De<ie.FileIndex.length;++De)if(ie.FileIndex[De]==be)return ie.FileIndex[De].name=r(ge),ie.FullPaths[De]=ge,!0}return!1}function Xr(ie){ve(ie,!0)}return n.find=W,n.read=Ue,n.parse=f,n.write=vt,n.writeFile=et,n.utils={cfb_new:Hs,cfb_add:os,cfb_del:yo,cfb_mov:oa,cfb_gc:Xr,ReadShift:Ev,CheckField:X8,prep_blob:ll,bconcat:fo,use_zlib:O,_deflateRaw:bn,_inflateRaw:Ln,consts:ot},n}(),D2;function hre(i){return typeof i=="string"?z2(i):Array.isArray(i)?Une(i):i}function Nv(i,n,t){if(typeof D2<"u"&&D2.writeFileSync)return t?D2.writeFileSync(i,n,t):D2.writeFileSync(i,n);if(typeof Deno<"u"){if(t&&typeof n=="string")switch(t){case"utf8":n=new TextEncoder(t).encode(n);break;case"binary":n=z2(n);break;default:throw new Error("Unsupported encoding "+t)}return Deno.writeFileSync(i,n)}var e=t=="utf8"?Qd(n):n;
167if(typeof IE_SaveFile<"u")return IE_SaveFile(e,i);if(typeof Blob<"u"){var r=new Blob([hre(e)],{type:"application/octet-stream"});if(typeof navigator<"u"&&navigator.msSaveBlob)return navigator.msSaveBlob(r,i);if(typeof saveAs<"u")return saveAs(r,i);if(typeof URL<"u"&&typeof document<"u"&&document.createElement&&URL.createObjectURL){var a=URL.createObjectURL(r);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(a)},6e4),chrome.downloads.download({url:a,filename:i,saveAs:!0});var c=document.createElement("a");if(c.download!=null)return c.download=i,c.href=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(a)},6e4),a}}if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var d=File(i);return d.open("w"),d.encoding="binary",Array.isArray(n)&&(n=Ov(n)),d.write(n),d.close(),n}catch(u){if(!u.message||!u.message.match(/onstruct/))throw u}throw new Error("cannot save file "+i)}function _o(i){for(var n=Object.keys(i),t=[],e=0;e<n.length;++e)Object.prototype.hasOwnProperty.call(i,n[e])&&t.push(n[e]);return t}function YN(i,n){for(var t=[],e=_o(i),r=0;r!==e.length;++r)t[i[e[r]][n]]==null&&(t[i[e[r]][n]]=e[r]);return t}function YD(i){for(var n=[],t=_o(i),e=0;e!==t.length;++e)n[i[t[e]]]=t[e];return n}function K2(i){for(var n=[],t=_o(i),e=0;e!==t.length;++e)n[i[t[e]]]=parseInt(t[e],10);return n}function fre(i){for(var n=[],t=_o(i),e=0;e!==t.length;++e)n[i[t[e]]]==null&&(n[i[t[e]]]=[]),n[i[t[e]]].push(t[e]);return n}var N2=new Date(1899,11,30,0,0,0);function ks(i,n){var t=i.getTime();n&&(t-=1462*24*60*60*1e3);var e=N2.getTime()+(i.getTimezoneOffset()-N2.getTimezoneOffset())*6e4;return(t-e)/(24*60*60*1e3)}var B8=new Date,gre=N2.getTime()+(B8.getTimezoneOffset()-N2.getTimezoneOffset())*6e4,qN=B8.getTimezoneOffset();function V8(i){var n=new Date;return n.setTime(i*24*60*60*1e3+gre),n.getTimezoneOffset()!==qN&&n.setTime(n.getTime()+(n.getTimezoneOffset()-qN)*6e4),n}var KN=new Date("2017-02-19T19:06:09.000Z"),U8=isNaN(KN.getFullYear())?new Date("2/19/17"):KN,vre=U8.getFullYear()==2017;function rs(i,n){var t=new Date(i);if(vre)return n>0?t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3):n<0&&t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3),t;if(i instanceof Date)return i;if(U8.getFullYear()==1917&&!isNaN(t.getFullYear())){var e=t.getFullYear();return i.indexOf(""+e)>-1||t.setFullYear(t.getFullYear()+100),t}var r=i.match(/\d+/g)||["2017","2","19","0","0","0"],a=new Date(+r[0],+r[1]-1,+r[2],+r[3]||0,+r[4]||0,+r[5]||0);return i.indexOf("Z")>-1&&(a=new Date(a.getTime()-a.getTimezoneOffset()*60*1e3)),a}function X2(i,n){if(tr&&Buffer.isBuffer(i)){if(n){if(i[0]==255&&i[1]==254)return Qd(i.slice(2).toString("utf16le"));if(i[1]==254&&i[2]==255)return Qd(Vne(i.slice(2).toString("binary")))}return i.toString("binary")}if(typeof TextDecoder<"u")try{if(n){if(i[0]==255&&i[1]==254)return Qd(new TextDecoder("utf-16le").decode(i.slice(2)));if(i[0]==254&&i[1]==255)return Qd(new TextDecoder("utf-16be").decode(i.slice(2)))}var t={"\u20AC":"\x80","\u201A":"\x82",\u0192:"\x83","\u201E":"\x84","\u2026":"\x85","\u2020":"\x86","\u2021":"\x87","\u02C6":"\x88","\u2030":"\x89",\u0160:"\x8A","\u2039":"\x8B",\u0152:"\x8C",\u017D:"\x8E","\u2018":"\x91","\u2019":"\x92","\u201C":"\x93","\u201D":"\x94","\u2022":"\x95","\u2013":"\x96","\u2014":"\x97","\u02DC":"\x98","\u2122":"\x99",\u0161:"\x9A","\u203A":"\x9B",\u0153:"\x9C",\u017E:"\x9E",\u0178:"\x9F"};return Array.isArray(i)&&(i=new Uint8Array(i)),new TextDecoder("latin1").decode(i).replace(/[â¬âÆââ¦â â¡Ëâ°Å â¹ÅŽâââââ¢ââËâ¢Å¡âºÅžŸ]/g,function(a){return t[a]||a})}catch{}for(var e=[],r=0;r!=i.length;++r)e.push(String.fromCharCode(i[r]));return e.join("")}function Ms(i){if(typeof JSON<"u"&&!Array.isArray(i))return JSON.parse(JSON.stringify(i));if(typeof i!="object"||i==null)return i;if(i instanceof Date)return new Date(i.getTime());var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(n[t]=Ms(i[t]));return n}function ra(i,n){for(var t="";t.length<n;)t+=i;return t}function tm(i){var n=Number(i);if(!isNaN(n))return isFinite(n)?n:NaN;if(!/\d/.test(i))return n;var t=1,e=i.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return t*=100,""});return!isNaN(n=Number(e))||(e=e.replace(/[(](.*)[)]/,function(r,a){return t=-t,a}),!isNaN(n=Number(e)))?n/t:n}var _re=["january","february","march","april","may","june","july","august","september","october","november","december"];function Av(i){var n=new Date(i),t=new Date(NaN),e=n.getYear(),r=n.getMonth(),a=n.getDate();if(isNaN(a))return t;var c=i.toLowerCase();if(c.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(c=c.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),c.length>3&&_re.indexOf(c)==-1)return t}else if(c.match(/[a-z]/))return t;return e<0||e>8099?t:(r>0||a>1)&&e!=101?n:i.match(/[^-0-9:,\/\\]/)?t:n}function En(i,n,t){if(i.FullPaths){if(typeof t=="string"){var e;return tr?e=am(t):e=jne(t),xr.utils.cfb_add(i,n,e)}xr.utils.cfb_add(i,n,t)}else i.file(n,t)}function qD(){return xr.utils.cfb_new()}var ka=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r 168`;var yre={""":'"',"'":"'",">":">","<":"<","&":"&"},KD=YD(yre);var XD=/[&<>'"]/g,Sre=/[\u0000-\u0008\u000b-\u001f]/g;function ur(i){var n=i+"";return n.replace(XD,function(t){return KD[t]}).replace(Sre,function(t){return"_x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+"_"})}function XN(i){return ur(i).replace(/ /g,"_x0020_")}var j8=/[\u0000-\u001f]/g;function bre(i){var n=i+"";return n.replace(XD,function(t){return KD[t]}).replace(/\n/g,"<br/>").replace(j8,function(t){return"&#x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+";"})}function xre(i){var n=i+"";return n.replace(XD,function(t){return KD[t]}).replace(j8,function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"})}function Cre(i){return i.replace(/(\r\n|[\r\n])/g," ")}function Ere(i){switch(i){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}
168function RD(i){for(var n="",t=0,e=0,r=0,a=0,c=0,d=0;t<i.length;){if(e=i.charCodeAt(t++),e<128){n+=String.fromCharCode(e);continue}if(r=i.charCodeAt(t++),e>191&&e<224){c=(e&31)<<6,c|=r&63,n+=String.fromCharCode(c);continue}if(a=i.charCodeAt(t++),e<240){n+=String.fromCharCode((e&15)<<12|(r&63)<<6|a&63);continue}c=i.charCodeAt(t++),d=((e&7)<<18|(r&63)<<12|(a&63)<<6|c&63)-65536,n+=String.fromCharCode(55296+(d>>>10&1023)),n+=String.fromCharCode(56320+(d&1023))}return n}function JN(i){var n=Z0(2*i.length),t,e,r=1,a=0,c=0,d;for(e=0;e<i.length;e+=r)r=1,(d=i.charCodeAt(e))<128?t=d:d<224?(t=(d&31)*64+(i.charCodeAt(e+1)&63),r=2):d<240?(t=(d&15)*4096+(i.charCodeAt(e+1)&63)*64+(i.charCodeAt(e+2)&63),r=3):(r=4,t=(d&7)*262144+(i.charCodeAt(e+1)&63)*4096+(i.charCodeAt(e+2)&63)*64+(i.charCodeAt(e+3)&63),t-=65536,c=55296+(t>>>10&1023),t=56320+(t&1023)),c!==0&&(n[a++]=c&255,n[a++]=c>>>8,c=0),n[a++]=t%256,n[a++]=t>>>8;return n.slice(0,a).toString("ucs2")}function ZN(i){return am(i,"binary").toString("utf8")}var I2="foo bar baz\xE2\x98\x83\xF0\x9F\x8D\xA3",Cv=tr&&(ZN(I2)==RD(I2)&&ZN||JN(I2)==RD(I2)&&JN)||RD,Qd=tr?function(i){return am(i,"utf8").toString("binary")}:function(i){for(var n=[],t=0,e=0,r=0;t<i.length;)switch(e=i.charCodeAt(t++),!0){case e<128:n.push(String.fromCharCode(e));break;case e<2048:n.push(String.fromCharCode(192+(e>>6))),n.push(String.fromCharCode(128+(e&63)));break;case(e>=55296&&e<57344):e-=55296,r=i.charCodeAt(t++)-56320+(e<<10),n.push(String.fromCharCode(240+(r>>18&7))),n.push(String.fromCharCode(144+(r>>12&63))),n.push(String.fromCharCode(128+(r>>6&63))),n.push(String.fromCharCode(128+(r&63)));break;default:n.push(String.fromCharCode(224+(e>>12))),n.push(String.fromCharCode(128+(e>>6&63))),n.push(String.fromCharCode(128+(e&63)))}return n.join("")};var wre=function(){var i=[["nbsp"," "],["middot","\xB7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(n){return[new RegExp("&"+n[0]+";","ig"),n[1]]});return function(t){for(var e=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,` 169`).replace(/<[^>]*>/g,""),r=0;r<i.length;++r)e=e.replace(i[r][0],i[r][1]);return e}}();var W8=/(^\s|\s$|\n)/;function go(i,n){return"<"+i+(n.match(W8)?' xml:space="preserve"':"")+">"+n+"</"+i+">"}function Pv(i){return _o(i).map(function(n){return" "+n+'="'+i[n]+'"'}).join("")}function ii(i,n,t){return"<"+i+(t!=null?Pv(t):"")+(n!=null?(n.match(W8)?' xml:space="preserve"':"")+">"+n+"</"+i:"/")+">"}function WD(i,n){try{return i.toISOString().replace(/\.\d*/,"")}catch(t){if(n)throw t}return""}function Tre(i,n){switch(typeof i){case"string":var t=ii("vt:lpwstr",ur(i));return n&&(t=t.replace(/"/g,"_x0022_")),t;case"number":return ii((i|0)==i?"vt:i4":"vt:r8",ur(String(i)));case"boolean":return ii("vt:bool",i?"true":"false")}if(i instanceof Date)return ii("vt:filetime",WD(i));throw new Error("Unable to serialize "+i)}var io={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},Df=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],
169cl={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function Dre(i,n){for(var t=1-2*(i[n+7]>>>7),e=((i[n+7]&127)<<4)+(i[n+6]>>>4&15),r=i[n+6]&15,a=5;a>=0;--a)r=r*256+i[n+a];return e==2047?r==0?t*(1/0):NaN:(e==0?e=-1022:(e-=1023,r+=Math.pow(2,52)),t*Math.pow(2,e-52)*r)}function Ire(i,n,t){var e=(n<0||1/n==-1/0?1:0)<<7,r=0,a=0,c=e?-n:n;isFinite(c)?c==0?r=a=0:(r=Math.floor(Math.log(c)/Math.LN2),a=c*Math.pow(2,52-r),r<=-1023&&(!isFinite(a)||a<Math.pow(2,52))?r=-1022:(a-=Math.pow(2,52),r+=1023)):(r=2047,a=isNaN(n)?26985:0);for(var d=0;d<=5;++d,a/=256)i[t+d]=a&255;i[t+6]=(r&15)<<4|a&15,i[t+7]=r>>4|e}var QN=function(i){for(var n=[],t=10240,e=0;e<i[0].length;++e)if(i[0][e])for(var r=0,a=i[0][e].length;r<a;r+=t)n.push.apply(n,i[0][e].slice(r,r+t));return n},e8=tr?function(i){return i[0].length>0&&Buffer.isBuffer(i[0][0])?Buffer.concat(i[0].map(function(n){return Buffer.isBuffer(n)?n:am(n)})):QN(i)}:QN,t8=function(i,n,t){for(var e=[],r=n;r<t;r+=2)e.push(String.fromCharCode(xv(i,r)));return e.join("").replace(Sf,"")},J2=tr?function(i,n,t){return Buffer.isBuffer(i)?i.toString("utf16le",n,t).replace(Sf,""):t8(i,n,t)}:t8,i8=function(i,n,t){for(var e=[],r=n;r<n+t;++r)e.push(("0"+i[r].toString(16)).slice(-2));return e.join("")},H8=tr?function(i,n,t){return Buffer.isBuffer(i)?i.toString("hex",n,n+t):i8(i,n,t)}:i8,n8=function(i,n,t){for(var e=[],r=n;r<t;r++)e.push(String.fromCharCode(_f(i,r)));return e.join("")},If=tr?function(n,t,e){return Buffer.isBuffer(n)?n.toString("utf8",t,e):n8(n,t,e)}:n8,G8=function(i,n){var t=to(i,n);return t>0?If(i,n+4,n+4+t-1):""},JD=G8,$8=function(i,n){var t=to(i,n);return t>0?If(i,n+4,n+4+t-1):""},ZD=$8,z8=function(i,n){var t=2*to(i,n);return t>0?If(i,n+4,n+4+t-1):""},QD=z8,Y8=function(n,t){var e=to(n,t);return e>0?J2(n,t+4,t+4+e):""},eI=Y8,q8=function(i,n){var t=to(i,n);return t>0?If(i,n+4,n+4+t):""},tI=q8,K8=function(i,n){return Dre(i,n)},L2=K8,iI=function(n){return Array.isArray(n)||typeof Uint8Array<"u"&&n instanceof Uint8Array};tr&&(JD=function(n,t){if(!Buffer.isBuffer(n))return G8(n,t);var e=n.readUInt32LE(t);return e>0?n.toString("utf8",t+4,t+4+e-1):""},ZD=function(n,t){if(!Buffer.isBuffer(n))return $8(n,t);var e=n.readUInt32LE(t);return e>0?n.toString("utf8",t+4,t+4+e-1):""},QD=function(n,t){if(!Buffer.isBuffer(n))return z8(n,t);var e=2*n.readUInt32LE(t);return n.toString("utf16le",t+4,t+4+e-1)},eI=function(n,t){if(!Buffer.isBuffer(n))return Y8(n,t);var e=n.readUInt32LE(t);return n.toString("utf16le",t+4,t+4+e)},tI=function(n,t){if(!Buffer.isBuffer(n))return q8(n,t);var e=n.readUInt32LE(t);return n.toString("utf8",t+4,t+4+e)},L2=function(n,t){return Buffer.isBuffer(n)?n.readDoubleLE(t):K8(n,t)},iI=function(n){return Buffer.isBuffer(n)||Array.isArray(n)||typeof Uint8Array<"u"&&n instanceof Uint8Array});function kre(){J2=function(i,n,t){return Ir.utils.decode(1200,i.slice(n,t)).replace(Sf,"")},If=function(i,n,t){return Ir.utils.decode(65001,i.slice(n,t))},JD=function(i,n){var t=to(i,n);return t>0?Ir.utils.decode(wf,i.slice(n+4,n+4+t-1)):""},ZD=function(i,n){var t=to(i,n);return t>0?Ir.utils.decode(X0,i.slice(n+4,n+4+t-1)):""},QD=function(i,n){var t=2*to(i,n);return t>0?Ir.utils.decode(1200,i.slice(n+4,n+4+t-1)):""},eI=function(i,n){var t=to(i,n);return t>0?Ir.utils.decode(1200,i.slice(n+4,n+4+t)):""},tI=function(i,n){var t=to(i,n);return t>0?Ir.utils.decode(65001,i.slice(n+4,n+4+t)):""}}typeof Ir<"u"&&kre();var _f=function(i,n){return i[n]},xv=function(i,n){return i[n+1]*256+i[n]},Mre=function(i,n){var t=i[n+1]*256+i[n];return t<32768?t:(65535-t+1)*-1},to=function(i,n){return i[n+3]*(1<<24)+(i[n+2]<<16)+(i[n+1]<<8)+i[n]},K0=function(i,n){return i[n+3]<<24|i[n+2]<<16|i[n+1]<<8|i[n]},Are=function(i,n){return i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]};function Ev(i,n){var t="",e,r,a=[],c,d,u,h;switch(n){case"dbcs":if(h=this.l,tr&&Buffer.isBuffer(this))t=this.slice(this.l,this.l+2*i).toString("utf16le");else for(u=0;
169u<i;++u)t+=String.fromCharCode(xv(this,h)),h+=2;i*=2;break;case"utf8":t=If(this,this.l,this.l+i);break;case"utf16le":i*=2,t=J2(this,this.l,this.l+i);break;case"wstr":if(typeof Ir<"u")t=Ir.utils.decode(X0,this.slice(this.l,this.l+2*i));else return Ev.call(this,i,"dbcs");i=2*i;break;case"lpstr-ansi":t=JD(this,this.l),i=4+to(this,this.l);break;case"lpstr-cp":t=ZD(this,this.l),i=4+to(this,this.l);break;case"lpwstr":t=QD(this,this.l),i=4+2*to(this,this.l);break;case"lpp4":i=4+to(this,this.l),t=eI(this,this.l),i&2&&(i+=2);break;case"8lpp4":i=4+to(this,this.l),t=tI(this,this.l),i&3&&(i+=4-(i&3));break;case"cstr":for(i=0,t="";(c=_f(this,this.l+i++))!==0;)a.push(E2(c));t=a.join("");break;case"_wstr":for(i=0,t="";(c=xv(this,this.l+i))!==0;)a.push(E2(c)),i+=2;i+=2,t=a.join("");break;case"dbcs-cont":for(t="",h=this.l,u=0;u<i;++u){if(this.lens&&this.lens.indexOf(h)!==-1)return c=_f(this,h),this.l=h+1,d=Ev.call(this,i-u,c?"dbcs-cont":"sbcs-cont"),a.join("")+d;a.push(E2(xv(this,h))),h+=2}t=a.join(""),i*=2;break;case"cpstr":if(typeof Ir<"u"){t=Ir.utils.decode(X0,this.slice(this.l,this.l+i));break}case"sbcs-cont":for(t="",h=this.l,u=0;u!=i;++u){if(this.lens&&this.lens.indexOf(h)!==-1)return c=_f(this,h),this.l=h+1,d=Ev.call(this,i-u,c?"dbcs-cont":"sbcs-cont"),a.join("")+d;a.push(E2(_f(this,h))),h+=1}t=a.join("");break;default:switch(i){case 1:return e=_f(this,this.l),this.l++,e;case 2:return e=(n==="i"?Mre:xv)(this,this.l),this.l+=2,e;case 4:case-4:return n==="i"||(this[this.l+3]&128)===0?(e=(i>0?K0:Are)(this,this.l),this.l+=4,e):(r=to(this,this.l),this.l+=4,r);case 8:case-8:if(n==="f")return i==8?r=L2(this,this.l):r=L2([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,r;i=8;case 16:t=H8(this,this.l,i);break}}return this.l+=i,t}var Pre=function(i,n,t){i[t]=n&255,i[t+1]=n>>>8&255,i[t+2]=n>>>16&255,i[t+3]=n>>>24&255},Fre=function(i,n,t){i[t]=n&255,i[t+1]=n>>8&255,i[t+2]=n>>16&255,i[t+3]=n>>24&255},Rre=function(i,n,t){i[t]=n&255,i[t+1]=n>>>8&255};function Ore(i,n,t){var e=0,r=0;if(t==="dbcs"){for(r=0;r!=n.length;++r)Rre(this,n.charCodeAt(r),this.l+2*r);e=2*n.length}else if(t==="sbcs"){if(typeof Ir<"u"&&wf==874)for(r=0;r!=n.length;++r){var a=Ir.utils.encode(wf,n.charAt(r));this[this.l+r]=a[0]}else for(n=n.replace(/[^\x00-\x7F]/g,"_"),r=0;r!=n.length;++r)this[this.l+r]=n.charCodeAt(r)&255;e=n.length}else if(t==="hex"){for(;r<i;++r)this[this.l++]=parseInt(n.slice(2*r,2*r+2),16)||0;return this}else if(t==="utf16le"){var c=Math.min(this.l+i,this.length);for(r=0;r<Math.min(n.length,i);++r){var d=n.charCodeAt(r);this[this.l++]=d&255,this[this.l++]=d>>8}for(;this.l<c;)this[this.l++]=0;return this}else switch(i){case 1:e=1,this[this.l]=n&255;break;case 2:e=2,this[this.l]=n&255,n>>>=8,this[this.l+1]=n&255;break;case 3:e=3,this[this.l]=n&255,n>>>=8,this[this.l+1]=n&255,n>>>=8,this[this.l+2]=n&255;break;case 4:e=4,Pre(this,n,this.l);break;case 8:if(e=8,t==="f"){Ire(this,n,this.l);break}case 16:break;case-4:e=4,Fre(this,n,this.l);break}return this.l+=e,this}function X8(i,n){var t=H8(this,this.l,i.length>>1);if(t!==i)throw new Error(n+"Expected "+i+" saw "+t);this.l+=i.length>>1}function ll(i,n){i.l=n,i.read_shift=Ev,i.chk=X8,i.write_shift=Ore}function ld(i,n){i.l+=n}function Tt(i){var n=Z0(i);return ll(n,0),n}function Is(){var i=[],n=tr?256:2048,t=function(h){var f=Tt(h);return ll(f,0),f},e=t(n),r=function(){e&&(e.length>e.l&&(e=e.slice(0,e.l),e.l=e.length),e.length>0&&i.push(e),e=null)},a=function(h){return e&&h<e.length-e.l?e:(r(),e=t(Math.max(h+1,n)))},c=function(){return r(),fo(i)},d=function(h){r(),e=h,e.l==null&&(e.l=e.length),a(n)};return{next:a,push:d,end:c,_bufs:i}}function Ut(i,n,t,e){var r=+n,a;if(!isNaN(r)){e||(e=Ide[r].p||(t||[]).length||0),a=1+(r>=128?1:0)+1,e>=128&&++a,e>=16384&&++a,e>=2097152&&++a;var c=i.next(a);r<=127?c.write_shift(1,r):(c.write_shift(1,(r&127)+128),c.write_shift(1,r>>7));for(var d=0;d!=4;++d)if(e>=128)c.write_shift(1,(e&127)+128),e>>=7;else{c.write_shift(1,e);break}e>0&&iI(t)&&i.push(t)}}function wv(i,n,t){var e=Ms(i);if(n.s?(e.cRel&&(e.c+=n.s.c),e.rRel&&(e.r+=n.s.r)):(e.cRel&&(e.c+=n.c),e.rRel&&(e.r+=n.r)),!t||t.biff<12){for(;e.c>=256;)e.c-=256;for(;e.r>=65536;)e.r-=65536}return e}function r8(i,n,t){var e=Ms(i);return e.s=wv(e.s,n.s,t),e.e=wv(e.e,n.s,t),e}
169function Tv(i,n){if(i.cRel&&i.c<0)for(i=Ms(i);i.c<0;)i.c+=n>8?16384:256;if(i.rRel&&i.r<0)for(i=Ms(i);i.r<0;)i.r+=n>8?1048576:n>5?65536:16384;var t=pr(i);return!i.cRel&&i.cRel!=null&&(t=Bre(t)),!i.rRel&&i.rRel!=null&&(t=Nre(t)),t}function OD(i,n){return i.s.r==0&&!i.s.rRel&&i.e.r==(n.biff>=12?1048575:n.biff>=8?65536:16384)&&!i.e.rRel?(i.s.cRel?"":"$")+Bo(i.s.c)+":"+(i.e.cRel?"":"$")+Bo(i.e.c):i.s.c==0&&!i.s.cRel&&i.e.c==(n.biff>=12?16383:255)&&!i.e.cRel?(i.s.rRel?"":"$")+vo(i.s.r)+":"+(i.e.rRel?"":"$")+vo(i.e.r):Tv(i.s,n.biff)+":"+Tv(i.e,n.biff)}function nI(i){return parseInt(Lre(i),10)-1}function vo(i){return""+(i+1)}function Nre(i){return i.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function Lre(i){return i.replace(/\$(\d+)$/,"$1")}function rI(i){for(var n=Vre(i),t=0,e=0;e!==n.length;++e)t=26*t+n.charCodeAt(e)-64;return t-1}function Bo(i){if(i<0)throw new Error("invalid column "+i);var n="";for(++i;i;i=Math.floor((i-1)/26))n=String.fromCharCode((i-1)%26+65)+n;return n}function Bre(i){return i.replace(/^([A-Z])/,"$$$1")}function Vre(i){return i.replace(/^\$([A-Z])/,"$1")}function Ure(i){return i.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function no(i){for(var n=0,t=0,e=0;e<i.length;++e){var r=i.charCodeAt(e);r>=48&&r<=57?n=10*n+(r-48):r>=65&&r<=90&&(t=26*t+(r-64))}return{c:t-1,r:n-1}}function pr(i){for(var n=i.c+1,t="";n;n=(n-1)/26|0)t=String.fromCharCode((n-1)%26+65)+t;return t+(i.r+1)}function dl(i){var n=i.indexOf(":");return n==-1?{s:no(i),e:no(i)}:{s:no(i.slice(0,n)),e:no(i.slice(n+1))}}function Ia(i,n){return typeof n>"u"||typeof n=="number"?Ia(i.s,i.e):(typeof i!="string"&&(i=pr(i)),typeof n!="string"&&(n=pr(n)),i==n?i:i+":"+n)}function Lr(i){var n={s:{c:0,r:0},e:{c:0,r:0}},t=0,e=0,r=0,a=i.length;for(t=0;e<a&&!((r=i.charCodeAt(e)-64)<1||r>26);++e)t=26*t+r;for(n.s.c=--t,t=0;e<a&&!((r=i.charCodeAt(e)-48)<0||r>9);++e)t=10*t+r;if(n.s.r=--t,e===a||r!=10)return n.e.c=n.s.c,n.e.r=n.s.r,n;for(++e,t=0;e!=a&&!((r=i.charCodeAt(e)-64)<1||r>26);++e)t=26*t+r;for(n.e.c=--t,t=0;e!=a&&!((r=i.charCodeAt(e)-48)<0||r>9);++e)t=10*t+r;return n.e.r=--t,n}function a8(i,n){var t=i.t=="d"&&n instanceof Date;if(i.z!=null)try{return i.w=hu(i.z,t?ks(n):n)}catch{}try{return i.w=hu((i.XF||{}).numFmtId||(t?14:0),t?ks(n):n)}catch{return""+n}}function rm(i,n,t){return i==null||i.t==null||i.t=="z"?"":i.w!==void 0?i.w:(i.t=="d"&&!i.z&&t&&t.dateNF&&(i.z=t.dateNF),i.t=="e"?Lv[i.v]||i.v:n==null?a8(i,i.v):a8(i,n))}function tp(i,n){var t=n&&n.sheet?n.sheet:"Sheet1",e={};return e[t]=i,{SheetNames:[t],Sheets:e}}function J8(i,n,t){var e=t||{},r=i?Array.isArray(i):e.dense;sd!=null&&r==null&&(r=sd);var a=i||(r?[]:{}),c=0,d=0;if(a&&e.origin!=null){if(typeof e.origin=="number")c=e.origin;else{var u=typeof e.origin=="string"?no(e.origin):e.origin;c=u.r,d=u.c}a["!ref"]||(a["!ref"]="A1:A1")}var h={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(a["!ref"]){var f=Lr(a["!ref"]);h.s.c=f.s.c,h.s.r=f.s.r,h.e.c=Math.max(h.e.c,f.e.c),h.e.r=Math.max(h.e.r,f.e.r),c==-1&&(h.e.r=c=f.e.r+1)}for(var v=0;v!=n.length;++v)if(n[v]){if(!Array.isArray(n[v]))throw new Error("aoa_to_sheet expects an array of arrays");for(var C=0;C!=n[v].length;++C)if(!(typeof n[v][C]>"u")){var y={v:n[v][C]},A=c+v,D=d+C;if(h.s.r>A&&(h.s.r=A),h.s.c>D&&(h.s.c=D),h.e.r<A&&(h.e.r=A),h.e.c<D&&(h.e.c=D),n[v][C]&&typeof n[v][C]=="object"&&!Array.isArray(n[v][C])&&!(n[v][C]instanceof Date))y=n[v][C];else if(Array.isArray(y.v)&&(y.f=n[v][C][1],y.v=y.v[0]),y.v===null)if(y.f)y.t="n";else if(e.nullError)y.t="e",y.v=0;else if(e.sheetStubs)y.t="z";else continue;else typeof y.v=="number"?y.t="n":typeof y.v=="boolean"?y.t="b":y.v instanceof Date?(y.z=e.dateNF||aa[14],e.cellDates?(y.t="d",y.w=hu(y.z,ks(y.v))):(y.t="n",y.v=ks(y.v),y.w=hu(y.z,
169y.v))):y.t="s";if(r)a[A]||(a[A]=[]),a[A][D]&&a[A][D].z&&(y.z=a[A][D].z),a[A][D]=y;else{var F=pr({c:D,r:A});a[F]&&a[F].z&&(y.z=a[F].z),a[F]=y}}}return h.s.c<1e7&&(a["!ref"]=Ia(h)),a}function kf(i,n){return J8(null,i,n)}function jre(i){return i.read_shift(4,"i")}function Cc(i,n){return n||(n=Tt(4)),n.write_shift(4,i),n}function Vo(i){var n=i.read_shift(4);return n===0?"":i.read_shift(n,"dbcs")}function ro(i,n){var t=!1;return n==null&&(t=!0,n=Tt(4+2*i.length)),n.write_shift(4,i.length),i.length>0&&n.write_shift(0,i,"dbcs"),t?n.slice(0,n.l):n}function Wre(i){return{ich:i.read_shift(2),ifnt:i.read_shift(2)}}function Hre(i,n){return n||(n=Tt(4)),n.write_shift(2,i.ich||0),n.write_shift(2,i.ifnt||0),n}function aI(i,n){var t=i.l,e=i.read_shift(1),r=Vo(i),a=[],c={t:r,h:r};if((e&1)!==0){for(var d=i.read_shift(4),u=0;u!=d;++u)a.push(Wre(i));c.r=a}else c.r=[{ich:0,ifnt:0}];return i.l=t+n,c}function Gre(i,n){var t=!1;return n==null&&(t=!0,n=Tt(15+4*i.t.length)),n.write_shift(1,0),ro(i.t,n),t?n.slice(0,n.l):n}var $re=aI;function zre(i,n){var t=!1;return n==null&&(t=!0,n=Tt(23+4*i.t.length)),n.write_shift(1,1),ro(i.t,n),n.write_shift(4,1),Hre({ich:0,ifnt:0},n),t?n.slice(0,n.l):n}function jl(i){var n=i.read_shift(4),t=i.read_shift(2);return t+=i.read_shift(1)<<16,i.l++,{c:n,iStyleRef:t}}function ip(i,n){return n==null&&(n=Tt(8)),n.write_shift(-4,i.c),n.write_shift(3,i.iStyleRef||i.s),n.write_shift(1,0),n}function np(i){var n=i.read_shift(2);return n+=i.read_shift(1)<<16,i.l++,{c:-1,iStyleRef:n}}function rp(i,n){return n==null&&(n=Tt(4)),n.write_shift(3,i.iStyleRef||i.s),n.write_shift(1,0),n}var Yre=Vo,Z8=ro;function oI(i){var n=i.read_shift(4);return n===0||n===4294967295?"":i.read_shift(n,"dbcs")}function B2(i,n){var t=!1;return n==null&&(t=!0,n=Tt(127)),n.write_shift(4,i.length>0?i.length:4294967295),i.length>0&&n.write_shift(0,i,"dbcs"),t?n.slice(0,n.l):n}var qre=Vo,HD=oI,sI=B2;function Q8(i){var n=i.slice(i.l,i.l+4),t=n[0]&1,e=n[0]&2;i.l+=4;var r=e===0?L2([0,0,0,0,n[0]&252,n[1],n[2],n[3]],0):K0(n,0)>>2;return t?r/100:r}function e7(i,n){n==null&&(n=Tt(4));var t=0,e=0,r=i*100;if(i==(i|0)&&i>=-(1<<29)&&i<1<<29?e=1:r==(r|0)&&r>=-(1<<29)&&r<1<<29&&(e=1,t=1),e)n.write_shift(-4,((t?r:i)<<2)+(t+2));else throw new Error("unsupported RkNumber "+i)}function t7(i){var n={s:{},e:{}};return n.s.r=i.read_shift(4),n.e.r=i.read_shift(4),n.s.c=i.read_shift(4),n.e.c=i.read_shift(4),n}function Kre(i,n){return n||(n=Tt(16)),n.write_shift(4,i.s.r),n.write_shift(4,i.e.r),n.write_shift(4,i.s.c),n.write_shift(4,i.e.c),n}var ap=t7,Mf=Kre;function Af(i){if(i.length-i.l<8)throw"XLS Xnum Buffer underflow";return i.read_shift(8,"f")}function Q0(i,n){return(n||Tt(8)).write_shift(8,i,"f")}function Xre(i){var n={},t=i.read_shift(1),e=t>>>1,r=i.read_shift(1),a=i.read_shift(2,"i"),c=i.read_shift(1),d=i.read_shift(1),u=i.read_shift(1);switch(i.l++,e){case 0:n.auto=1;break;case 1:n.index=r;var h=aae[r];h&&(n.rgb=g8(h));break;case 2:n.rgb=g8([c,d,u]);break;case 3:n.theme=r;break}return a!=0&&(n.tint=a>0?a/32767:a/32768),n}function V2(i,n){if(n||(n=Tt(8)),!i||i.auto)return n.write_shift(4,0),n.write_shift(4,0),n;i.index!=null?(n.write_shift(1,2),n.write_shift(1,i.index)):i.theme!=null?(n.write_shift(1,6),n.write_shift(1,i.theme)):(n.write_shift(1,5),n.write_shift(1,0));var t=i.tint||0;if(t>0?t*=32767:t<0&&(t*=32768),n.write_shift(2,t),!i.rgb||i.theme!=null)n.write_shift(2,0),n.write_shift(1,0),n.write_shift(1,0);else{var e=i.rgb||"FFFFFF";typeof e=="number"&&(e=("000000"+e.toString(16)).slice(-6)),n.write_shift(1,parseInt(e.slice(0,2),16)),n.write_shift(1,parseInt(e.slice(2,4),16)),n.write_shift(1,parseInt(e.slice(4,6),16)),n.write_shift(1,255)}return n}function Jre(i){var n=i.read_shift(1);i.l++;var t={fBold:n&1,fItalic:n&2,fUnderline:n&4,fStrikeout:n&8,fOutline:n&16,fShadow:n&32,fCondense:n&64,fExtend:n&128};return t}function Zre(i,n){n||(n=Tt(2));var t=(i.italic?2:0)|(i.strike?8:0)|(i.outline?16:0)|(i.shadow?32:0)|(i.condense?64:0)|(i.extend?128:0);return n.write_shift(1,t),n.write_shift(1,0),n}var i7=2,sl=3,k2=11;var U2=19;var M2=64,Qre=65,eae=71;var tae=4108,iae=4126,ho=80;var o8={1:{n:"CodePage",t:i7},2:{n:"Category",t:ho},3:{n:"PresentationFormat",t:ho},4:{n:"ByteCount",t:sl},5:{n:"LineCount",t:sl},6:{n:"ParagraphCount",t:sl},7:{n:"SlideCount",t:sl},8:{n:"NoteCount",t:sl},9:{n:"HiddenCount",t:sl}
169,10:{n:"MultimediaClipCount",t:sl},11:{n:"ScaleCrop",t:k2},12:{n:"HeadingPairs",t:tae},13:{n:"TitlesOfParts",t:iae},14:{n:"Manager",t:ho},15:{n:"Company",t:ho},16:{n:"LinksUpToDate",t:k2},17:{n:"CharacterCount",t:sl},19:{n:"SharedDoc",t:k2},22:{n:"HyperlinksChanged",t:k2},23:{n:"AppVersion",t:sl,p:"version"},24:{n:"DigSig",t:Qre},26:{n:"ContentType",t:ho},27:{n:"ContentStatus",t:ho},28:{n:"Language",t:ho},29:{n:"Version",t:ho},255:{},2147483648:{n:"Locale",t:U2},2147483651:{n:"Behavior",t:U2},1919054434:{}},s8={1:{n:"CodePage",t:i7},2:{n:"Title",t:ho},3:{n:"Subject",t:ho},4:{n:"Author",t:ho},5:{n:"Keywords",t:ho},6:{n:"Comments",t:ho},7:{n:"Template",t:ho},8:{n:"LastAuthor",t:ho},9:{n:"RevNumber",t:ho},10:{n:"EditTime",t:M2},11:{n:"LastPrinted",t:M2},12:{n:"CreatedDate",t:M2},13:{n:"ModifiedDate",t:M2},14:{n:"PageCount",t:sl},15:{n:"WordCount",t:sl},16:{n:"CharCount",t:sl},17:{n:"Thumbnail",t:eae},18:{n:"Application",t:ho},19:{n:"DocSecurity",t:sl},255:{},2147483648:{n:"Locale",t:U2},2147483651:{n:"Behavior",t:U2},1919054434:{}};function nae(i){return i.map(function(n){return[n>>16&255,n>>8&255,n&255]})}var rae=nae([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),aae=Ms(rae),Lv={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"};var oae={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},A2={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"}
169,comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function n7(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function r7(i,n){var t=fre(oae),e=[],r;e[e.length]=ka,e[e.length]=ii("Types",null,{xmlns:io.CT,"xmlns:xsd":io.xsd,"xmlns:xsi":io.xsi}),e=e.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["t
169if","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(u){return ii("Default",null,{Extension:u[0],ContentType:u[1]})}));var a=function(u){i[u]&&i[u].length>0&&(r=i[u][0],e[e.length]=ii("Override",null,{PartName:(r[0]=="/"?"":"/")+r,ContentType:A2[u][n.bookType]||A2[u].xlsx}))},c=function(u){(i[u]||[]).forEach(function(h){e[e.length]=ii("Override",null,{PartName:(h[0]=="/"?"":"/")+h,ContentType:A2[u][n.bookType]||A2[u].xlsx})})},d=function(u){(i[u]||[]).forEach(function(h){e[e.length]=ii("Override",null,{PartName:(h[0]=="/"?"":"/")+h,ContentType:t[u][0]})})};return a("workbooks"),c("sheets"),c("charts"),d("themes"),["strs","styles"].forEach(a),["coreprops","extprops","custprops"].forEach(d),d("vba"),d("comments"),d("threadedcomments"),d("drawings"),c("metadata"),d("people"),e.length>2&&(e[e.length]="</Types>",e[1]=e[1].replace("/>",">")),e.join("")}var z
vendor: 2,400 bytes, line 169
169n={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",
169VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function a7(i){var n=i.lastIndexOf("/");return i.slice(0,n+1)+"_rels/"+i.slice(n+1)+".rels"}function xf(i){var n=[ka,ii("Relationships",null,{xmlns:io.RELS})];return _o(i["!id"]).forEach(function(t){n[n.length]=ii("Relationship",null,i["!id"][t])}),n.length>2&&(n[n.length]="</Relationships>",n[1]=n[1].replace("/>",">")),n.join("")}function mr(i,n,t,e,r,a){if(r||(r={}),i["!id"]||(i["!id"]={}),i["!idx"]||(i["!idx"]=1),n<0)for(n=i["!idx"];i["!id"]["rId"+n];++n);if(i["!idx"]=n+1,r.Id="rId"+n,r.Type=e,r.Target=t,a?r.TargetMode=a:[zn.HLINK,zn.XPATH,zn.XMISS].indexOf(r.Type)>-1&&(r.TargetMode="External"),i["!id"][r.Id])throw new Error("Cannot rewrite rId "+n);return i["!id"][r.Id]=r,i[("/"+r.Target).replace("//","/")]=r,n}function sae(i){var n=[ka];n.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2"> 170`),n.push(` <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/> 171`);for(var t=0;t<i.length;++t)n.push(' <manifest:file-entry manifest:full-path="'+i[t][0]+'" manifest:media-type="'+i[t][1]+`"/> 172`);return n.push("</manifest:manifest>"),n.join("")}function l8(i,n,t){return[' <rdf:Description rdf:about="'+i+`"> 173`,' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(t||"odf")+"#"+n+`"/>
173 174`,` </rdf:Description> 175`].join("")}function lae(i,n){return[' <rdf:Description rdf:about="'+i+`"> 176`,' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+n+`"/> 177`,` </rdf:Description> 178`].join("")}function cae(i){var n=[ka];n.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 179`);for(var t=0;t!=i.length;++t)n.push(l8(i[t][0],i[t][1])),n.push(lae("",i[t][0]));return n.push(l8("","Document","pkg")),n.push("</rdf:RDF>"),n.join("")}function o7(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+Iv.version+"</meta:generator></office:meta></office:document-meta>"}var J0=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function ND(i,n,t,e,r){r[i]!=null||n==null||n===""||(r[i]=n,n=ur(n),e[e.length]=t?ii(i,n,t):go(i,n))}function s7(i,n){var t=n||{},e=[ka,ii("cp:coreProperties",null,{"xmlns:cp":io.CORE_PROPS,"xmlns:dc":io.dc,"xmlns:dcterms":io.dcterms,"xmlns:dcmitype":io.dcmitype,"xmlns:xsi":io.xsi})],r={};if(!i&&!t.Props)return e.join("");i&&(i.CreatedDate!=null&&ND("dcterms:created",typeof i.CreatedDate=="string"?i.CreatedDate:WD(i.CreatedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},e,r),i.ModifiedDate!=null&&ND("dcterms:modified",typeof i.ModifiedDate=="string"?i.ModifiedDate:WD(i.ModifiedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},e,r));for(var a=0;a!=J0.length;++a){var c=J0[a],d=t.Props&&t.Props[c[1]]!=null?t.Props[c[1]]:i?i[c[1]]:null;d===!0?d="1":d===!1?d="0":typeof d=="number"&&(d=String(d)),d!=null&&ND(c[0],d,null,e,r)}return e.length>2&&(e[e.length]="</cp:coreProperties>",e[1]=e[1].replace("/>",">")),e.join("")}var Cf=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],l7=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function c7(i){var n=[],t=ii;return i||(i={}),i.Application="SheetJS",n[n.length]=ka,n[n.length]=ii("Properties",null,{xmlns:io.EXT_PROPS,"xmlns:vt":io.vt}),Cf.forEach(function(e){if(i[e[1]]!==void 0){var r;switch(e[2]){case"string":r=ur(String(i[e[1]]));break;case"bool":r=i[e[1]]?"true":"false";break}r!==void 0&&(n[n.length]=t(e[0],r))}}),n[n.length]=t("HeadingPairs",t("vt:vector",t("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+t("vt:variant",t("vt:i4",String(i.Worksheets))),{size:2,baseType:"variant"})),n[n.length]=t("TitlesOfParts",t("vt:vector",i.SheetNames.map(function(e){return"<vt:lpstr>"+ur(e)+"</vt:lpstr>"}).join(""),{size:i.Worksheets,baseType:"lpstr"})),n.length>2&&(n[n.length]="</Properties>",n[1]=n[1].replace("/>",">")),n.join("")}function d7(i){var n=[ka,ii("Properties",null,{xmlns:io.CUST_PROPS,"xmlns:vt":io.vt})];if(!i)return n.join("");var t=1;
179return _o(i).forEach(function(r){++t,n[n.length]=ii("property",Tre(i[r],!0),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t,name:ur(r)})}),n.length>2&&(n[n.length]="</Properties>",n[1]=n[1].replace("/>",">")),n.join("")}var c8={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function dae(i,n){var t=[];return _o(c8).map(function(e){for(var r=0;r<J0.length;++r)if(J0[r][1]==e)return J0[r];for(r=0;r<Cf.length;++r)if(Cf[r][1]==e)return Cf[r];throw e}).forEach(function(e){if(i[e[1]]!=null){var r=n&&n.Props&&n.Props[e[1]]!=null?n.Props[e[1]]:i[e[1]];switch(e[2]){case"date":r=new Date(r).toISOString().replace(/\.\d*Z/,"Z");break}typeof r=="number"?r=String(r):r===!0||r===!1?r=r?"1":"0":r instanceof Date&&(r=new Date(r).toISOString().replace(/\.\d*Z/,"")),t.push(go(c8[e[1]]||e[1],r))}}),ii("DocumentProperties",t.join(""),{xmlns:cl.o})}function mae(i,n){var t=["Worksheets","SheetNames"],e="CustomDocumentProperties",r=[];
179return i&&_o(i).forEach(function(a){if(Object.prototype.hasOwnProperty.call(i,a)){for(var c=0;c<J0.length;++c)if(a==J0[c][1])return;for(c=0;c<Cf.length;++c)if(a==Cf[c][1])return;for(c=0;c<t.length;++c)if(a==t[c])return;var d=i[a],u="string";typeof d=="number"?(u="float",d=String(d)):d===!0||d===!1?(u="boolean",d=d?"1":"0"):d=String(d),r.push(ii(XN(a),d,{"dt:dt":u}))}}),n&&_o(n).forEach(function(a){if(Object.prototype.hasOwnProperty.call(n,a)&&!(i&&Object.prototype.hasOwnProperty.call(i,a))){var c=n[a],d="string";typeof c=="number"?(d="float",c=String(c)):c===!0||c===!1?(d="boolean",c=c?"1":"0"):c instanceof Date?(d="dateTime.tz",c=c.toISOString()):c=String(c),r.push(ii(XN(a),c,{"dt:dt":d}))}}),"<"+e+' xmlns="'+cl.o+'">'+r.join("")+"</"+e+">"}function uae(i){var n=typeof i=="string"?new Date(Date.parse(i)):i,t=n.getTime()/1e3+11644473600,e=t%Math.pow(2,32),r=(t-e)/Math.pow(2,32);e*=1e7,r*=1e7;var a=e/Math.pow(2,32)|0;a>0&&(e=e%Math.pow(2,32),r+=a);var c=Tt(8);return c.write_shift(4,e),c.write_shift(4,r),c}function d8(i,n){var t=Tt(4),e=Tt(4);switch(t.write_shift(4,i==80?31:i),i){case 3:e.write_shift(-4,n);break;case 5:e=Tt(8),e.write_shift(8,n,"f");break;case 11:e.write_shift(4,n?1:0);break;case 64:e=uae(n);break;case 31:case 80:for(e=Tt(4+2*(n.length+1)+(n.length%2?0:2)),e.write_shift(4,n.length+1),e.write_shift(0,n,"dbcs");e.l!=e.length;)e.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+i+" "+n)}return fo([t,e])}var m7=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function pae(i){switch(typeof i){case"boolean":return 11;case"number":return(i|0)==i?3:5;case"string":return 31;case"object":if(i instanceof Date)return 64;break}return-1}function m8(i,n,t){var e=Tt(8),r=[],a=[],c=8,d=0,u=Tt(8),h=Tt(8);if(u.write_shift(4,2),u.write_shift(4,1200),h.write_shift(4,1),a.push(u),r.push(h),c+=8+u.length,!n){h=Tt(8),h.write_shift(4,0),r.unshift(h);var f=[Tt(4)];for(f[0].write_shift(4,i.length),d=0;d<i.length;++d){var v=i[d][0];for(u=Tt(8+2*(v.length+1)+(v.length%2?0:2)),u.write_shift(4,d+2),u.write_shift(4,v.length+1),u.write_shift(0,v,"dbcs");u.l!=u.length;)u.write_shift(1,0);f.push(u)}u=fo(f),a.unshift(u),c+=8+u.length}for(d=0;d<i.length;++d)if(!(n&&!n[i[d][0]])&&!(m7.indexOf(i[d][0])>-1||l7.indexOf(i[d][0])>-1)&&i[d][1]!=null){var C=i[d][1],y=0;if(n){y=+n[i[d][0]];var A=t[y];if(A.p=="version"&&typeof C=="string"){var D=C.split(".");C=(+D[0]<<16)+(+D[1]||0)}u=d8(A.t,C)}else{var F=pae(C);F==-1&&(F=31,C=String(C)),u=d8(F,C)}a.push(u),h=Tt(8),h.write_shift(4,n?y:2+d),r.push(h),c+=8+u.length}var R=8*(a.length+1);for(d=0;d<a.length;++d)r[d].write_shift(4,R),R+=a[d].length;return e.write_shift(4,c),e.write_shift(4,a.length),fo([e].concat(r).concat(a))}function u8(i,n,t,e,r,a){var c=Tt(r?68:48),d=[c];c.write_shift(2,65534),c.write_shift(2,0),c.write_shift(4,842412599),c.write_shift(16,xr.utils.consts.HEADER_CLSID,"hex"),c.write_shift(4,r?2:1),c.write_shift(16,n,"hex"),c.write_shift(4,r?68:48);var u=m8(i,t,e);if(d.push(u),r){var h=m8(r,null,null);c.write_shift(16,a,"hex"),c.write_shift(4,68+u.length),d.push(h)}return fo(d)}function hae(i,n){n||(n=Tt(i));for(var t=0;t<i;++t)n.write_shift(1,0);return n}function fae(i,n){return i.read_shift(n)===1}function ns(i,n){return n||(n=Tt(2)),n.write_shift(2,+!!i),n}function u7(i){return i.read_shift(2,"u")}function Ul(i,n){return n||(n=Tt(2)),n.write_shift(2,i),n}function p7(i,n,t){return t||(t=Tt(2)),t.write_shift(1,n=="e"?+i:+!!i),t.write_shift(1,n=="e"?1:0),t}function h7(i,n,t){var e=i.read_shift(t&&t.biff>=12?2:1),r="sbcs-cont",a=X0;if(t&&t.biff>=8&&(X0=1200),!t||t.biff==8){var c=i.read_shift(1);c&&(r="dbcs-cont")}else t.biff==12&&(r="wstr");t.biff>=2&&t.biff<=5&&(r="cpstr");var d=e?i.read_shift(e,r):"";return X0=a,d}function gae(i){var n=i.t||"",t=1,e=Tt(3+(t>1?2:0));e.write_shift(2,n.length),e.write_shift(1,(t>1?8:0)|1),t>1&&e.write_shift(2,t);var r=Tt(2*n.length);r.write_shift(2*n.length,n,"utf16le");var a=[e,r];return fo(a)}function vae(i,n,t){var e;if(t){if(t.biff>=2&&t.biff<=5)return i.read_shift(n,"cpstr");if(t.biff>=12)return i.read_shift(n,"dbcs-cont")}var r=i.read_shift(1);return r===0?e=i.read_shift(n,"sbcs-cont"):e=i.read_shift(n,"dbcs-cont"),e}function _ae(i,n,t){var e=i.read_shift(t&&t.biff==2?1:2);return e===0?(i.l++,""):vae(i,e,t)}function yae(i,n,t){if(t.biff>5)return _ae(i,n,t);var e=i.read_shift(1);return e===0?(i.l++,""):i.read_shift(e,t.biff<=4||!i.lens?"cpstr":"sbcs-cont")}function f7(i,n,t){return t||(t=Tt(3+2*i.length)),t.write_shift(2,i.length),t.write_shift(1,1),t.write_shift(31,i,"utf16le"),t}function p8(i,n){n||(n=Tt(6+i.length*2)),n.write_shift(4,1+i.length);for(var t=0;t<i.length;
179++t)n.write_shift(2,i.charCodeAt(t));return n.write_shift(2,0),n}function Sae(i){var n=Tt(512),t=0,e=i.Target;e.slice(0,7)=="file://"&&(e=e.slice(7));var r=e.indexOf("#"),a=r>-1?31:23;switch(e.charAt(0)){case"#":a=28;break;case".":a&=-3;break}n.write_shift(4,2),n.write_shift(4,a);var c=[8,6815827,6619237,4849780,83];for(t=0;t<c.length;++t)n.write_shift(4,c[t]);if(a==28)e=e.slice(1),p8(e,n);else if(a&2){for(c="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),t=0;t<c.length;++t)n.write_shift(1,parseInt(c[t],16));var d=r>-1?e.slice(0,r):e;for(n.write_shift(4,2*(d.length+1)),t=0;t<d.length;++t)n.write_shift(2,d.charCodeAt(t));n.write_shift(2,0),a&8&&p8(r>-1?e.slice(r+1):"",n)}else{for(c="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),t=0;t<c.length;++t)n.write_shift(1,parseInt(c[t],16));for(var u=0;e.slice(u*3,u*3+3)=="../"||e.slice(u*3,u*3+3)=="..\\";)++u;for(n.write_shift(2,u),n.write_shift(4,e.length-3*u+1),t=0;t<e.length-3*u;++t)n.write_shift(1,e.charCodeAt(t+3*u)&255);for(n.write_shift(1,0),n.write_shift(2,65535),n.write_shift(2,57005),t=0;t<6;++t)n.write_shift(4,0)}return n.slice(0,n.l)}function ep(i,n,t,e){return e||(e=Tt(6)),e.write_shift(2,i),e.write_shift(2,n),e.write_shift(2,t||0),e}function bae(i,n,t){var e=t.biff>8?4:2,r=i.read_shift(e),a=i.read_shift(e,"i"),c=i.read_shift(e,"i");return[r,a,c]}function xae(i){var n=i.read_shift(2),t=i.read_shift(2),e=i.read_shift(2),r=i.read_shift(2);return{s:{c:e,r:n},e:{c:r,r:t}}}function g7(i,n){return n||(n=Tt(8)),n.write_shift(2,i.s.r),n.write_shift(2,i.e.r),n.write_shift(2,i.s.c),n.write_shift(2,i.e.c),n}function lI(i,n,t){var e=1536,r=16;switch(t.bookType){case"biff8":break;case"biff5":e=1280,r=8;break;case"biff4":e=4,r=6;break;case"biff3":e=3,r=6;break;case"biff2":e=2,r=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var a=Tt(r);return a.write_shift(2,e),a.write_shift(2,n),r>4&&a.write_shift(2,29282),r>6&&a.write_shift(2,1997),r>8&&(a.write_shift(2,49161),a.write_shift(2,1),a.write_shift(2,1798),a.write_shift(2,0)),a}function Cae(i,n){var t=!n||n.biff==8,e=Tt(t?112:54);for(e.write_shift(n.biff==8?2:1,7),t&&e.write_shift(1,0),e.write_shift(4,859007059),e.write_shift(4,5458548|(t?0:536870912));e.l<e.length;)e.write_shift(1,t?0:32);return e}function Eae(i,n){var t=!n||n.biff>=8?2:1,e=Tt(8+t*i.name.length);e.write_shift(4,i.pos),e.write_shift(1,i.hs||0),e.write_shift(1,i.dt),e.write_shift(1,i.name.length),n.biff>=8&&e.write_shift(1,1),e.write_shift(t*i.name.length,i.name,n.biff<8?"sbcs":"utf16le");var r=e.slice(0,e.l);return r.l=e.l,r}function wae(i,n){var t=Tt(8);t.write_shift(4,i.Count),t.write_shift(4,i.Unique);for(var e=[],r=0;r<i.length;++r)e[r]=gae(i[r],n);var a=fo([t].concat(e));return a.parts=[t.length].concat(e.map(function(c){return c.length})),a}function Tae(){var i=Tt(18);return i.write_shift(2,0),i.write_shift(2,0),i.write_shift(2,29280),i.write_shift(2,17600),i.write_shift(2,56),i.write_shift(2,0),i.write_shift(2,0),i.write_shift(2,1),i.write_shift(2,500),i}function Dae(i){var n=Tt(18),t=1718;return i&&i.RTL&&(t|=64),n.write_shift(2,t),n.write_shift(4,0),n.write_shift(4,64),n.write_shift(4,0),n.write_shift(4,0),n}function Iae(i,n){var t=i.name||"Arial",e=n&&n.biff==5,r=e?15+t.length:16+2*t.length,a=Tt(r);return a.write_shift(2,(i.sz||12)*20),a.write_shift(4,0),a.write_shift(2,400),a.write_shift(4,0),a.write_shift(2,0),a.write_shift(1,t.length),e||a.write_shift(1,1),a.write_shift((e?1:2)*t.length,t,e?"sbcs":"utf16le"),a}function kae(i,n,t,e){var r=Tt(10);return ep(i,n,e,r),r.write_shift(4,t),r}function Mae(i,n,t,e,r){var a=!r||r.biff==8,c=Tt(8+ +a+(1+a)*t.length);return ep(i,n,e,c),c.write_shift(2,t.length),a&&c.write_shift(1,1),c.write_shift((1+a)*t.length,t,a?"utf16le":"sbcs"),c}function Aae(i,n,t,e){var r=t&&t.biff==5;e||(e=Tt(r?3+n.length:5+2*n.length)),e.write_shift(2,i),e.write_shift(r?1:2,n.length),r||e.write_shift(1,1),e.write_shift((r?1:2)*n.length,n,r?"sbcs":"utf16le");var a=e.length>e.l?e.slice(0,e.l):e;return a.l==null&&(a.l=a.length),a}function Pae(i,n){var t=n.biff==8||!n.biff?4:2,e=Tt(2*t+6);return e.write_shift(t,i.s.r),e.write_shift(t,i.e.r+1),e.write_shift(2,i.s.c),e.write_shift(2,i.e.c+1),e.write_shift(2,0),e}function h8(i,n,t,e){var r=t&&t.biff==5;e||(e=Tt(r?16:20)),e.write_shift(2,0),i.style?(e.write_shift(2,i.numFmtId||0),e.write_shift(2,65524)):(e.write_shift(2,i.numFmtId||0),e.write_shift(2,n<<4));var a=0;return i.numFmtId>
vendor: 6,609 bytes, line 179
1790&&r&&(a|=1024),e.write_shift(4,a),e.write_shift(4,0),r||e.write_shift(4,0),e.write_shift(2,0),e}function Fae(i){var n=Tt(8);return n.write_shift(4,0),n.write_shift(2,i[0]?i[0]+1:0),n.write_shift(2,i[1]?i[1]+1:0),n}function Rae(i,n,t,e,r,a){var c=Tt(8);return ep(i,n,e,c),p7(t,a,c),c}function Oae(i,n,t,e){var r=Tt(14);return ep(i,n,e,r),Q0(t,r),r}function Nae(i,n,t){if(t.biff<8)return Lae(i,n,t);for(var e=[],r=i.l+n,a=i.read_shift(t.biff>8?4:2);a--!==0;)e.push(bae(i,t.biff>8?12:6,t));if(i.l!=r)throw new Error("Bad ExternSheet: "+i.l+" != "+r);return e}function Lae(i,n,t){i[i.l+1]==3&&i[i.l]++;var e=h7(i,n,t);return e.charCodeAt(0)==3?e.slice(1):e}function Bae(i){var n=Tt(2+i.length*8);n.write_shift(2,i.length);for(var t=0;t<i.length;++t)g7(i[t],n);return n}function Vae(i){var n=Tt(24),t=no(i[0]);n.write_shift(2,t.r),n.write_shift(2,t.r),n.write_shift(2,t.c),n.write_shift(2,t.c);for(var e="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<16;++r)n.write_shift(1,parseInt(e[r],16));return fo([n,Sae(i[1])])}function Uae(i){var n=i[1].Tooltip,t=Tt(10+2*(n.length+1));t.write_shift(2,2048);var e=no(i[0]);t.write_shift(2,e.r),t.write_shift(2,e.r),t.write_shift(2,e.c),t.write_shift(2,e.c);for(var r=0;r<n.length;++r)t.write_shift(2,n.charCodeAt(r));return t.write_shift(2,0),t}function jae(i){return i||(i=Tt(4)),i.write_shift(2,1),i.write_shift(2,1),i}function Wae(i,n,t){if(!t.cellStyles)return ld(i,n);var e=t&&t.biff>=12?4:2,r=i.read_shift(e),a=i.read_shift(e),c=i.read_shift(e),d=i.read_shift(e),u=i.read_shift(2);e==2&&(i.l+=2);var h={s:r,e:a,w:c,ixfe:d,flags:u};return(t.biff>=5||!t.biff)&&(h.level=u>>8&7),h}function Hae(i,n){var t=Tt(12);t.write_shift(2,n),t.write_shift(2,n),t.write_shift(2,i.width*256),t.write_shift(2,0);var e=0;return i.hidden&&(e|=1),t.write_shift(1,e),e=i.level||0,t.write_shift(1,e),t.write_shift(2,0),t}function Gae(i){for(var n=Tt(2*i),t=0;t<i;++t)n.write_shift(2,t+1);return n}function $ae(i,n,t){var e=Tt(15);return Vv(e,i,n),e.write_shift(8,t,"f"),e}function zae(i,n,t){var e=Tt(9);return Vv(e,i,n),e.write_shift(2,t),e}var Yae=function(){var i={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},n=YD({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function t(d,u){var h=[],f=Z0(1);switch(u.type){case"base64":f=bc(nm(d));break;case"binary":f=bc(d);break;case"buffer":case"array":f=d;break}ll(f,0);var v=f.read_shift(1),C=!!(v&136),y=!1,A=!1;switch(v){case 2:break;case 3:break;case 48:y=!0,C=!0;break;case 49:y=!0,C=!0;break;case 131:break;case 139:break;case 140:A=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+v.toString(16))}var D=0,F=521;v==2&&(D=f.read_shift(2)),f.l+=3,v!=2&&(D=f.read_shift(4)),D>1048576&&(D=1e6),v!=2&&(F=f.read_shift(2));var R=f.read_shift(2),L=u.codepage||1252;v!=2&&(f.l+=16,f.read_shift(1),f[f.l]!==0&&(L=i[f[f.l]]),f.l+=1,f.l+=2),A&&(f.l+=36);for(var H=[],se={},Ce=Math.min(f.length,v==2?521:F-10-(y?264:0)),Ue=A?32:11;f.l<Ce&&f[f.l]!=13;)switch(se={},se.name=Ir.utils.decode(L,f.slice(f.l,f.l+Ue)).replace(/[\u0000\r\n].*$/g,""),f.l+=Ue,se.type=String.fromCharCode(f.read_shift(1)),v!=2&&!A&&(se.offset=f.read_shift(4)),se.len=f.read_shift(1),v==2&&(se.offset=f.read_shift(2)),se.dec=f.read_shift(1),se.name.length&&H.push(se),v!=2&&(f.l+=A?13:14),se.type){case"B":(!y||se.len!=8)&&u.WTF&&console.log("Skipping "+se.name+":"+se.type);break;case"G":case"P":u.WTF&&console.log("Skipping "+se.name+":"+se.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+se.type)}if(f[f.l]!==13&&(f.l=F-1),f.read_shift(1)!==13)throw new Error("DBF Terminator not found "+f.l+" "+f[f.l]);f.l=F;var re=0,ae=0;for(h[0]=[],ae=0;ae!=H.length;++ae)h[0][ae]=H[ae].name;for(;D-- >0;){if(f[f.l]===42){f.l+=R;continue}for(++f.l,h[++re]=[],ae=0,ae=0;ae!=H.length;++ae){var ve=f.slice(f.l,f.l+H[ae].len);f.l+=H[ae].len,ll(ve,0);var Me=Ir.utils.decode(L,ve);switch(H[ae].type){case"C":Me.trim().length&&(h[re][ae]=Me.replace(/\s+$/,""));break;case"D":Me.length===8?h[re][ae]=new Date(+Me.slice(0,4),+Me.slice(4,6)-1,+Me.slice(6,8)):h[re][ae]=Me;break;case"F":h[re][ae]=parseFloat(Me.trim());break;case"+":case"I":h[re][ae]=A?ve.read_shift(-4,"i")^2147483648:ve.read_shift(4,"i");break;case"L":switch(Me.trim().toUpperCase()){case"Y":case"T":h[re][ae]=!0;break;case"N":case"F":h[re][ae]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+Me+"|")}break;case"M":if(!C)throw new Error("DBF Unexpected MEMO for type "+v.toString(16));h[re][ae]="##MEMO##"+(A?parseInt(Me.trim(),10):ve.read_shift(4));break;case"N":Me=Me.replace(/\u0000/g,"").trim(),Me&&Me!="."&&(h[re][ae]=+Me||0);break;case"@":h[re][ae]=new Date(ve.read_shift(-8,"f")-621356832e5);break;case"T":h[re][ae]=new Date((ve.read_shift(4)-2440588)*864e5+ve.read_shift(4));break;case"Y":h[re][ae]=ve.read_shift(4,"i")/1e4+ve.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":h[re][ae]=-ve.read_shift(-8,"f");break;case"B":if(y&&H[ae].len==8){h[re][ae]=ve.read_shift(8,"f");break}case"G":case"P":ve.l+=H[ae].len;break;case"0":if(H[ae].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+H[ae].type)}}}if(v!=2&&f.l<f.length&&f[f.l++]!=26)throw new Error("DBF EOF Marker missing "+(f.l-1)+" of "+f.length+" "+f[f.l-1].toString(16));return u&&u.sheetRows&&(h=h.slice(0,u.sheetRows)),u.DBF=H,h}function e(d,u){var h=u||{};h.dateNF||(h.dateNF="yyyymmdd");var f=kf(t(d,h),h);return f["!cols"]=h.DBF.map(function(v){return{wch:v.len,DBF:v}}),delete h.DBF,f}function r(d,u){try{return tp(e(d,u),u)}catch(h){if(u&&u.WTF)throw h}return{SheetNames:[],Sheets:{}}}var a={B:8,C:250,L:1,D:8,"?":0,"":0};function c(d,u){var h=u||{};if(+h.codepage>=0&&kv(+h.codepage),h.type=="string")throw new Error("Cannot write DBF to JS string");var f=Is(),v=$2(d,{header:1,raw:!0,cellDates:!0}),C=v[0],y=v.slice(1),A=d["!cols"]||[],D=0,F=0,R=0,L=1;for(D=0;D<C.length;
179++D){if(((A[D]||{}).DBF||{}).name){C[D]=A[D].DBF.name,++R;continue}if(C[D]!=null){if(++R,typeof C[D]=="number"&&(C[D]=C[D].toString(10)),typeof C[D]!="string")throw new Error("DBF Invalid column name "+C[D]+" |"+typeof C[D]+"|");if(C.indexOf(C[D])!==D){for(F=0;F<1024;++F)if(C.indexOf(C[D]+"_"+F)==-1){C[D]+="_"+F;break}}}}var H=Lr(d["!ref"]),se=[],Ce=[],Ue=[];for(D=0;D<=H.e.c-H.s.c;++D){var re="",ae="",ve=0,Me=[];for(F=0;F<y.length;++F)y[F][D]!=null&&Me.push(y[F][D]);if(Me.length==0||C[D]==null){se[D]="?";continue}for(F=0;F<Me.length;++F){switch(typeof Me[F]){case"number":ae="B";break;case"string":ae="C";break;case"boolean":ae="L";break;case"object":ae=Me[F]instanceof Date?"D":"C";break;default:ae="C"}ve=Math.max(ve,String(Me[F]).length),re=re&&re!=ae?"C":ae}ve>250&&(ve=250),ae=((A[D]||{}).DBF||{}).type,ae=="C"&&A[D].DBF.len>ve&&(ve=A[D].DBF.len),re=="B"&&ae=="N"&&(re="N",Ue[D]=A[D].DBF.dec,ve=A[D].DBF.len),Ce[D]=re=="C"||ae=="N"?ve:a[re]||0,L+=Ce[D],se[D]=re}var W=f.next(32);for(W.write_shift(4,318902576),W.write_shift(4,y.length),W.write_shift(2,296+32*R),W.write_shift(2,L),D=0;D<4;++D)W.write_shift(4,0);for(W.write_shift(4,0|(+n[wf]||3)<<8),D=0,F=0;D<C.length;++D)if(C[D]!=null){var J=f.next(32),Ee=(C[D].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);J.write_shift(1,Ee,"sbcs"),J.write_shift(1,se[D]=="?"?"C":se[D],"sbcs"),J.write_shift(4,F),J.write_shift(1,Ce[D]||a[se[D]]||0),J.write_shift(1,Ue[D]||0),J.write_shift(1,2),J.write_shift(4,0),J.write_shift(1,0),J.write_shift(4,0),J.write_shift(4,0),F+=Ce[D]||a[se[D]]||0}var Fe=f.next(264);for(Fe.write_shift(4,13),D=0;D<65;++D)Fe.write_shift(4,0);for(D=0;D<y.length;++D){var $e=f.next(L);for($e.write_shift(1,0),F=0;F<C.length;++F)if(C[F]!=null)switch(se[F]){case"L":$e.write_shift(1,y[D][F]==null?63:y[D][F]?84:70);break;case"B":$e.write_shift(8,y[D][F]||0,"f");break;case"N":var Qe="0";for(typeof y[D][F]=="number"&&(Qe=y[D][F].toFixed(Ue[F]||0)),R=0;R<Ce[F]-Qe.length;++R)$e.write_shift(1,32);$e.write_shift(1,Qe,"sbcs");break;case"D":y[D][F]?($e.write_shift(4,("0000"+y[D][F].getFullYear()).slice(-4),"sbcs"),$e.write_shift(2,("00"+(y[D][F].getMonth()+1)).slice(-2),"sbcs"),$e.write_shift(2,("00"+y[D][F].getDate()).slice(-2),"sbcs")):$e.write_shift(8,"00000000","sbcs");break;case"C":var ot=String(y[D][F]!=null?y[D][F]:"").slice(0,Ce[F]);for($e.write_shift(1,ot,"sbcs"),R=0;R<Ce[F]-ot.length;++R)$e.write_shift(1,32);break}}return f.next(1).write_shift(1,26),f.end()}return{to_workbook:r,to_sheet:e,from_sheet:c}}(),qae=function(){var i={AA:"\xC0",BA:"\xC1",CA:"\xC2",DA:195,HA:"\xC4",JA:197,AE:"\xC8",BE:"\xC9",CE:"\xCA",HE:"\xCB",AI:"\xCC",BI:"\xCD",CI:"\xCE",HI:"\xCF",AO:"\xD2",BO:"\xD3",CO:"\xD4",DO:213,HO:"\xD6",AU:"\xD9",BU:"\xDA",CU:"\xDB",HU:"\xDC",Aa:"\xE0",Ba:"\xE1",Ca:"\xE2",Da:227,Ha:"\xE4",Ja:229,Ae:"\xE8",Be:"\xE9",Ce:"\xEA",He:"\xEB",Ai:"\xEC",Bi:"\xED",Ci:"\xEE",Hi:"\xEF",Ao:"\xF2",Bo:"\xF3",Co:"\xF4",Do:245,Ho:"\xF6",Au:"\xF9",Bu:"\xFA",Cu:"\xFB",Hu:"\xFC",KC:"\xC7",Kc:"\xE7",q:"\xE6",z:"\u0153",a:"\xC6",j:"\u0152",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},n=new RegExp("\x1BN("+_o(i).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),t=function(C,y){var A=i[y];return typeof A=="number"?BN(A):A},e=function(C,y,A){var D=y.charCodeAt(0)-32<<4|A.charCodeAt(0)-48;return D==59?C:BN(D)};i["|"]=254;function r(C,y){switch(y.type){case"base64":return a(nm(C),y);case"binary":return a(C,y);case"buffer":return a(tr&&Buffer.isBuffer(C)?C.toString("binary"):Ov(C),y);case"array":return a(X2(C),y)}throw new Error("Unrecognized type "+y.type)}function a(C,y){var A=C.split(/[\n\r]+/),D=-1,F=-1,R=0,L=0,H=[],se=[],Ce=null,Ue={},re=[],ae=[],ve=[],Me=0,W;for(+y.codepage>=0&&kv(+y.codepage);R!==A.length;++R){Me=0;
179var J=A[R].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,e).replace(n,t),Ee=J.replace(/;;/g,"\0").split(";").map(function(Y){return Y.replace(/\u0000/g,";")}),Fe=Ee[0],$e;if(J.length>0)switch(Fe){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":Ee[1].charAt(0)=="P"&&se.push(J.slice(3).replace(/;;/g,";"));break;case"C":var Qe=!1,ot=!1,et=!1,gt=!1,vt=-1,Kt=-1;for(L=1;L<Ee.length;++L)switch(Ee[L].charAt(0)){case"A":break;case"X":F=parseInt(Ee[L].slice(1))-1,ot=!0;break;case"Y":for(D=parseInt(Ee[L].slice(1))-1,ot||(F=0),W=H.length;W<=D;++W)H[W]=[];break;case"K":$e=Ee[L].slice(1),$e.charAt(0)==='"'?$e=$e.slice(1,$e.length-1):$e==="TRUE"?$e=!0:$e==="FALSE"?$e=!1:isNaN(tm($e))?isNaN(Av($e).getDate())||($e=rs($e)):($e=tm($e),Ce!==null&&O8(Ce)&&($e=V8($e))),typeof Ir<"u"&&typeof $e=="string"&&(y||{}).type!="string"&&(y||{}).codepage&&($e=Ir.utils.decode(y.codepage,$e)),Qe=!0;break;case"E":gt=!0;var O=zoe(Ee[L].slice(1),{r:D,c:F});H[D][F]=[H[D][F],O];break;case"S":et=!0,H[D][F]=[H[D][F],"S5S"];break;case"G":break;case"R":vt=parseInt(Ee[L].slice(1))-1;break;case"C":Kt=parseInt(Ee[L].slice(1))-1;break;default:if(y&&y.WTF)throw new Error("SYLK bad record "+J)}if(Qe&&(H[D][F]&&H[D][F].length==2?H[D][F][0]=$e:H[D][F]=$e,Ce=null),et){if(gt)throw new Error("SYLK shared formula cannot have own formula");var Q=vt>-1&&H[vt][Kt];if(!Q||!Q[1])throw new Error("SYLK shared formula cannot find base");H[D][F][1]=Yoe(Q[1],{r:D-vt,c:F-Kt})}break;case"F":var V=0;for(L=1;L<Ee.length;++L)switch(Ee[L].charAt(0)){case"X":F=parseInt(Ee[L].slice(1))-1,++V;break;case"Y":for(D=parseInt(Ee[L].slice(1))-1,W=H.length;W<=D;++W)H[W]=[];break;case"M":Me=parseInt(Ee[L].slice(1))/20;break;case"F":break;case"G":break;case"P":Ce=se[parseInt(Ee[L].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(ve=Ee[L].slice(1).split(" "),W=parseInt(ve[0],10);W<=parseInt(ve[1],10);++W)Me=parseInt(ve[2],10),ae[W-1]=Me===0?{hidden:!0}:{wch:Me},cI(ae[W-1]);break;case"C":F=parseInt(Ee[L].slice(1))-1,ae[F]||(ae[F]={});break;case"R":D=parseInt(Ee[L].slice(1))-1,re[D]||(re[D]={}),Me>0?(re[D].hpt=Me,re[D].hpx=b7(Me)):Me===0&&(re[D].hidden=!0);break;default:if(y&&y.WTF)throw new Error("SYLK bad record "+J)}V<1&&(Ce=null);break;default:if(y&&y.WTF)throw new Error("SYLK bad record "+J)}}return re.length>0&&(Ue["!rows"]=re),ae.length>0&&(Ue["!cols"]=ae),y&&y.sheetRows&&(H=H.slice(0,y.sheetRows)),[H,Ue]}function c(C,y){var A=r(C,y),D=A[0],F=A[1],R=kf(D,y);return _o(F).forEach(function(L){R[L]=F[L]}),R}function d(C,y){return tp(c(C,y),y)}function u(C,y,A,D){var F="C;Y"+(A+1)+";X"+(D+1)+";K";switch(C.t){case"n":F+=C.v||0,C.f&&!C.F&&(F+=";E"+mI(C.f,{r:A,c:D}));break;case"b":F+=C.v?"TRUE":"FALSE";break;case"e":F+=C.w||C.v;break;case"d":F+='"'+(C.w||C.v)+'"';break;case"s":F+='"'+C.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return F}function h(C,y){y.forEach(function(A,D){var F="F;W"+(D+1)+" "+(D+1)+" ";A.hidden?F+="0":(typeof A.width=="number"&&!A.wpx&&(A.wpx=j2(A.width)),typeof A.wpx=="number"&&!A.wch&&(A.wch=W2(A.wpx)),typeof A.wch=="number"&&(F+=Math.round(A.wch))),F.charAt(F.length-1)!=" "&&C.push(F)})}function f(C,y){y.forEach(function(A,D){var F="F;";A.hidden?F+="M0;":A.hpt?F+="M"+20*A.hpt+";":A.hpx&&(F+="M"+20*H2(A.hpx)+";"),F.length>2&&C.push(F+"R"+(D+1))})}function v(C,y){var A=["ID;PWXL;N;E"],D=[],F=Lr(C["!ref"]),R,L=Array.isArray(C),H=`\r 180`;A.push("P;PGeneral"),A.push("F;P0;DG0G8;M255"),C["!cols"]&&h(A,C["!cols"]),C["!rows"]&&f(A,C["!rows"]),A.push("B;Y"+(F.e.r-F.s.r+1)+";X"+(F.e.c-F.s.c+1)+";D"+[F.s.c,F.s.r,F.e.c,F.e.r].join(" "));for(var se=F.s.r;se<=F.e.r;++se)for(var Ce=F.s.c;Ce<=F.e.c;++Ce){var Ue=pr({r:se,c:Ce});R=L?(C[se]||[])[Ce]:C[Ue],!(!R||R.v==null&&(!R.f||R.F))&&D.push(u(R,C,se,Ce,y))}return A.join(H)+H+D.join(H)+H+"E"+H}return{to_workbook:d,to_sheet:c,from_sheet:v}}(),Kae=function(){function i(a,c){switch(c.type){case"base64":return n(nm(a),c);case"binary":return n(a,c);case"buffer":return n(tr&&Buffer.isBuffer(a)?a.toString("binary"):Ov(a),c);case"array":return n(X2(a),c)}throw new Error("Unrecognized type "+c.type)}function n(a,c){for(var d=a.split(` 181`),u=-1,h=-1,f=0,v=[];f!==d.length;++f){if(d[f].trim()==="BOT"){v[++u]=[],h=0;continue}if(!(u<0)){var C=d[f].trim().split(","),y=C[0],A=C[1];++f;for(var D=d[f]||"";(D.match(/["]/g)||[]).length&1&&f<d.length-1;)D+=` 182`+d[++f];switch(D=D.trim(),+y){case-1:if(D==="BOT"){v[++u]=[],h=0;continue}else if(D!=="EOD")throw new Error("Unrecognized DIF special command "+D);break;case 0:D==="TRUE"?v[u][h]=!0:D==="FALSE"?v[u][h]=!1:isNaN(tm(A))?isNaN(Av(A).getDate())?v[u][h]=A:v[u][h]=rs(A):v[u][h]=tm(A),++h;break;case 1:D=D.slice(1,D.length-1),D=D.replace(/""/g,'"'),Sv&&D&&D.match(/^=".*"$/)&&(D=D.slice(2,-1)),v[u][h++]=D!==""?D:null;break}if(D==="EOD")break}}return c&&c.sheetRows&&(v=v.slice(0,c.sheetRows)),v}function t(a,c){return kf(i(a,c),c)}function e(a,c){return tp(t(a,c),c)}var r=function(){var a=function(u,h,f,v,C){u.push(h),u.push(f+","+v),u.push('"'+C.replace(/"/g,'""')+'"')},c=function(u,h,f,v){u.push(h+","+f),u.push(h==1?'"'+v.replace(/"/g,'""')+'"':v)};return function(u){var h=[],f=Lr(u["!ref"]),v,C=Array.isArray(u);a(h,"TABLE",0,1,"sheetjs"),a(h,"VECTORS",0,f.e.r-f.s.r+1,""),a(h,"TUPLES",0,f.e.c-f.s.c+1,""),a(h,"DATA",0,0,"");for(var y=f.s.r;y<=f.e.r;++y){c(h,-1,0,"BOT");for(var A=f.s.c;A<=f.e.c;++A){var D=pr({r:y,c:A});if(v=C?(u[y]||[])[A]:u[D],!v){c(h,1,0,"");continue}switch(v.t){case"n":var F=Sv?v.w:v.v;!F&&v.v!=null&&(F=v.v),F==null?Sv&&v.f&&!v.F?c(h,1,0,"="+v.f):c(h,1,0,""):c(h,0,F,"V");break;case"b":c(h,0,v.v?1:0,v.v?"TRUE":"FALSE");break;case"s":c(h,1,0,!Sv||isNaN(v.v)?v.v:'="'+v.v+'"');break;case"d":v.w||(v.w=hu(v.z||aa[14],ks(rs(v.v)))),Sv?c(h,0,v.w,"V"):c(h,1,0,v.w);break;default:c(h,1,0,"")}}}c(h,-1,0,"EOD");var R=`\r 183`,L=h.join(R);return L}}();return{to_workbook:e,to_sheet:t,from_sheet:r}}(),v7=function(){function i(v){return v.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n
vendor: 4,478 bytes, lines 183-192
183/g,` 184`)}function n(v){return v.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(v,C){for(var y=v.split(` 185`),A=-1,D=-1,F=0,R=[];F!==y.length;++F){var L=y[F].trim().split(":");if(L[0]==="cell"){var H=no(L[1]);if(R.length<=H.r)for(A=R.length;A<=H.r;++A)R[A]||(R[A]=[]);switch(A=H.r,D=H.c,L[2]){case"t":R[A][D]=i(L[3]);break;case"v":R[A][D]=+L[3];break;case"vtf":var se=L[L.length-1];case"vtc":switch(L[3]){case"nl":R[A][D]=!!+L[4];break;default:R[A][D]=+L[4];break}L[2]=="vtf"&&(R[A][D]=[R[A][D],se])}}}return C&&C.sheetRows&&(R=R.slice(0,C.sheetRows)),R}function e(v,C){return kf(t(v,C),C)}function r(v,C){return tp(e(v,C),C)}var a=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(` 186`),c=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(` 187`)+` 188`,d=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(` 189`),u="--SocialCalcSpreadsheetControlSave--";function h(v){if(!v||!v["!ref"])return"";for(var C=[],y=[],A,D="",F=dl(v["!ref"]),R=Array.isArray(v),L=F.s.r;L<=F.e.r;++L)for(var H=F.s.c;H<=F.e.c;++H)if(D=pr({r:L,c:H}),A=R?(v[L]||[])[H]:v[D],!(!A||A.v==null||A.t==="z")){switch(y=["cell",D,"t"],A.t){case"s":case"str":y.push(n(A.v));break;case"n":A.f?(y[2]="vtf",y[3]="n",y[4]=A.v,y[5]=n(A.f)):(y[2]="v",y[3]=A.v);break;case"b":y[2]="vt"+(A.f?"f":"c"),y[3]="nl",y[4]=A.v?"1":"0",y[5]=n(A.f||(A.v?"TRUE":"FALSE"));break;case"d":var se=ks(rs(A.v));y[2]="vtc",y[3]="nd",y[4]=""+se,y[5]=A.w||hu(A.z||aa[14],se);break;case"e":continue}C.push(y.join(":"))}return C.push("sheet:c:"+(F.e.c-F.s.c+1)+":r:"+(F.e.r-F.s.r+1)+":tvf:1"),C.push("valueformat:1:text-wiki"),C.join(` 190`)}function f(v){return[a,c,d,c,h(v),u].join(` 191`)}return{to_workbook:r,to_sheet:e,from_sheet:f}}(),Xae=function(){function i(f,v,C,y,A){A.raw?v[C][y]=f:f===""||(f==="TRUE"?v[C][y]=!0:f==="FALSE"?v[C][y]=!1:isNaN(tm(f))?isNaN(Av(f).getDate())?v[C][y]=f:v[C][y]=rs(f):v[C][y]=tm(f))}function n(f,v){var C=v||{},y=[];if(!f||f.length===0)return y;for(var A=f.split(/[\r\n]/),D=A.length-1;D>=0&&A[D].length===0;)--D;for(var F=10,R=0,L=0;L<=D;++L)R=A[L].indexOf(" "),R==-1?R=A[L].length:R++,F=Math.max(F,R);for(L=0;L<=D;++L){y[L]=[];var H=0;for(i(A[L].slice(0,F).trim(),y,L,H,C),H=1;H<=(A[L].length-F)/10+1;++H)i(A[L].slice(F+(H-1)*10,F+H*10).trim(),y,L,H,C)}return C.sheetRows&&(y=y.slice(0,C.sheetRows)),y}var t={44:",",9:" ",59:";",124:"|"},e={44:3,9:2,59:1,124:0};function r(f){for(var v={},C=!1,y=0,A=0;y<f.length;++y)(A=f.charCodeAt(y))==34?C=!C:!C&&A in t&&(v[A]=(v[A]||0)+1);A=[];for(y in v)Object.prototype.hasOwnProperty.call(v,y)&&A.push([v[y],y]);if(!A.length){v=e;for(y in v)Object.prototype.hasOwnProperty.call(v,y)&&A.push([v[y],y])}return A.sort(function(D,F){return D[0]-F[0]||e[D[1]]-e[F[1]]}),t[A.pop()[1]]||44}function a(f,v){var C=v||{},y="";sd!=null&&C.dense==null&&(C.dense=sd);var A=C.dense?[]:{},D={s:{c:0,r:0},e:{c:0,r:0}};f.slice(0,4)=="sep="?f.charCodeAt(5)==13&&f.charCodeAt(6)==10?(y=f.charAt(4),f=f.slice(7)):f.charCodeAt(5)==13||f.charCodeAt(5)==10?(y=f.charAt(4),f=f.slice(6)):y=r(f.slice(0,1024)):C&&C.FS?y=C.FS:y=r(f.slice(0,1024));var F=0,R=0,L=0,H=0,se=0,Ce=y.charCodeAt(0),Ue=!1,re=0,ae=f.charCodeAt(0);f=f.replace(/\r\n/mg,` 192`);var ve=C.dateNF!=null?mre(C.dateNF):null;function Me(){var W=f.slice(H,se),J={};if(W.charAt(0)=='"'&&W.charAt(W.length-1)=='"'&&(W=W.slice(1,-1).replace(/""/g,'"')),W.length===0)J.t="z";else if(C.raw)J.t="s",J.v=W;else if(W.trim().length===0)J.t="s",J.v=W;else if(W.charCodeAt(0)==61)W.charCodeAt(1)==34&&W.charCodeAt(W.length-1)==34?(J.t="s",J.v=W.slice(2,-1).replace(/""/g,'"')):qoe(W)?(J.t="n",J.f=W.slice(1)):(J.t="s",J.v=W);else if(W=="TRUE")J.t="b",J.v=!0;else if(W=="FALSE")J.t="b",J.v=!1;else if(!isNaN(L=tm(W)))J.t="n",C.cellText!==!1&&(J.w=W),J.v=L;else if(!isNaN(Av(W).getDate())||ve&&W.match(ve)){J.z=C.dateNF||aa[14];var Ee=0;ve&&W.match(ve)&&(W=ure(W,C.dateNF,W.match(ve)||[]),Ee=1),C.cellDates?(J.t="d",J.v=rs(W,Ee)):(J.t="n",J.v=ks(rs(W,Ee))),C.cellText!==!1&&(J.w=hu(J.z,J.v instanceof Date?ks(J.v):J.v)),C.cellNF||delete J.z}else J.t="s",J.v=W;if(J.t=="z"||(C.dense?(A[F]||(A[F]=[]),A[F][R]=J):A[pr({c:R,r:F})]=J),H=se+1,ae=f.charCodeAt(H),D.e.c<R&&(D.e.c=R),D.e.r<F&&(D.e.r=F),re==Ce)++R;else if(R=0,++F,C.sheetRows&&C.sheetRows<=F)return!0}e:for(;se<f.length;++se)switch(re=f.charCodeAt(se)){case 34:ae===34&&(Ue=!Ue);break;case Ce:case 10:case 13:if(!Ue&&Me())break e;break;default:break}
vendor: 6,710 bytes, lines 192-193
192return se-H>0&&Me(),A["!ref"]=Ia(D),A}function c(f,v){return!(v&&v.PRN)||v.FS||f.slice(0,4)=="sep="||f.indexOf(" ")>=0||f.indexOf(",")>=0||f.indexOf(";")>=0?a(f,v):kf(n(f,v),v)}function d(f,v){var C="",y=v.type=="string"?[0,0,0,0]:lme(f,v);switch(v.type){case"base64":C=nm(f);break;case"binary":C=f;break;case"buffer":v.codepage==65001?C=f.toString("utf8"):v.codepage&&typeof Ir<"u"?C=Ir.utils.decode(v.codepage,f):C=tr&&Buffer.isBuffer(f)?f.toString("binary"):Ov(f);break;case"array":C=X2(f);break;case"string":C=f;break;default:throw new Error("Unrecognized type "+v.type)}return y[0]==239&&y[1]==187&&y[2]==191?C=Cv(C.slice(3)):v.type!="string"&&v.type!="buffer"&&v.codepage==65001?C=Cv(C):v.type=="binary"&&typeof Ir<"u"&&v.codepage&&(C=Ir.utils.decode(v.codepage,Ir.utils.encode(28591,C))),C.slice(0,19)=="socialcalc:version:"?v7.to_sheet(v.type=="string"?C:Cv(C),v):c(C,v)}function u(f,v){return tp(d(f,v),v)}function h(f){for(var v=[],C=Lr(f["!ref"]),y,A=Array.isArray(f),D=C.s.r;D<=C.e.r;++D){for(var F=[],R=C.s.c;R<=C.e.c;++R){var L=pr({r:D,c:R});if(y=A?(f[D]||[])[R]:f[L],!y||y.v==null){F.push(" ");continue}for(var H=(y.w||(rm(y),y.w)||"").slice(0,10);H.length<10;)H+=" ";F.push(H+(R===0?" ":""))}v.push(F.join(""))}return v.join(` 193`)}return{to_workbook:u,to_sheet:d,from_sheet:h}}();var f8=function(){function i(O,Q,V){if(O){ll(O,O.l||0);for(var Y=V.Enum||vt;O.l<O.length;){var we=O.read_shift(2),Ve=Y[we]||Y[65535],Ge=O.read_shift(2),je=O.l+Ge,it=Ve.f&&Ve.f(O,Ge,V);if(O.l=je,Q(it,Ve,we))return}}}function n(O,Q){switch(Q.type){case"base64":return t(bc(nm(O)),Q);case"binary":return t(bc(O),Q);case"buffer":case"array":return t(O,Q)}throw"Unsupported type "+Q.type}function t(O,Q){if(!O)return O;var V=Q||{};sd!=null&&V.dense==null&&(V.dense=sd);var Y=V.dense?[]:{},we="Sheet1",Ve="",Ge=0,je={},it=[],It=[],Nt={s:{r:0,c:0},e:{r:0,c:0}},qt=V.sheetRows||0;if(O[2]==0&&(O[3]==8||O[3]==9)&&O.length>=16&&O[14]==5&&O[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(O[2]==2)V.Enum=vt,i(O,function(Lt,hi,Wt){switch(Wt){case 0:V.vers=Lt,Lt>=4096&&(V.qpro=!0);break;case 6:Nt=Lt;break;case 204:Lt&&(Ve=Lt);break;case 222:Ve=Lt;break;case 15:case 51:V.qpro||(Lt[1].v=Lt[1].v.slice(1));case 13:case 14:case 16:Wt==14&&(Lt[2]&112)==112&&(Lt[2]&15)>1&&(Lt[2]&15)<15&&(Lt[1].z=V.dateNF||aa[14],V.cellDates&&(Lt[1].t="d",Lt[1].v=V8(Lt[1].v))),V.qpro&&Lt[3]>Ge&&(Y["!ref"]=Ia(Nt),je[we]=Y,it.push(we),Y=V.dense?[]:{},Nt={s:{r:0,c:0},e:{r:0,c:0}},Ge=Lt[3],we=Ve||"Sheet"+(Ge+1),Ve="");var Xt=V.dense?(Y[Lt[0].r]||[])[Lt[0].c]:Y[pr(Lt[0])];if(Xt){Xt.t=Lt[1].t,Xt.v=Lt[1].v,Lt[1].z!=null&&(Xt.z=Lt[1].z),Lt[1].f!=null&&(Xt.f=Lt[1].f);break}V.dense?(Y[Lt[0].r]||(Y[Lt[0].r]=[]),Y[Lt[0].r][Lt[0].c]=Lt[1]):Y[pr(Lt[0])]=Lt[1];break;default:}},V);else if(O[2]==26||O[2]==14)V.Enum=Kt,O[2]==14&&(V.qpro=!0,O.l=0),i(O,function(Lt,hi,Wt){switch(Wt){case 204:we=Lt;break;case 22:Lt[1].v=Lt[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(Lt[3]>Ge&&(Y["!ref"]=Ia(Nt),je[we]=Y,it.push(we),Y=V.dense?[]:{},Nt={s:{r:0,c:0},e:{r:0,c:0}},Ge=Lt[3],we="Sheet"+(Ge+1)),qt>0&&Lt[0].r>=qt)break;V.dense?(Y[Lt[0].r]||(Y[Lt[0].r]=[]),Y[Lt[0].r][Lt[0].c]=Lt[1]):Y[pr(Lt[0])]=Lt[1],Nt.e.c<Lt[0].c&&(Nt.e.c=Lt[0].c),Nt.e.r<Lt[0].r&&(Nt.e.r=Lt[0].r);break;case 27:Lt[14e3]&&(It[Lt[14e3][0]]=Lt[14e3][1]);break;case 1537:It[Lt[0]]=Lt[1],Lt[0]==Ge&&(we=Lt[1]);break;default:break}},V);else throw new Error("Unrecognized LOTUS BOF "+O[2]);if(Y["!ref"]=Ia(Nt),je[Ve||we]=Y,it.push(Ve||we),!It.length)return{SheetNames:it,Sheets:je};for(var ni={},bt=[],Ae=0;Ae<It.length;++Ae)je[it[Ae]]?(bt.push(It[Ae]||it[Ae]),ni[It[Ae]]=je[It[Ae]]||je[it[Ae]]):(bt.push(It[Ae]),ni[It[Ae]]={"!ref":"A1"});return{SheetNames:bt,Sheets:ni}}function e(O,Q){var V=Q||{};if(+V.codepage>=0&&kv(+V.codepage),V.type=="string")throw new Error("Cannot write WK1 to JS string");var Y=Is(),we=Lr(O["!ref"]),Ve=Array.isArray(O),Ge=[];si(Y,0,a(1030)),si(Y,6,u(we));for(var je=Math.min(we.e.r,8191),it=we.s.r;it<=je;++it)for(var It=vo(it),Nt=we.s.c;Nt<=we.e.c;++Nt){it===we.s.r&&(Ge[Nt]=Bo(Nt));var qt=Ge[Nt]+It,ni=Ve?(O[it]||[])[Nt]:O[qt];if(!(!ni||ni.t=="z"))if(ni.t=="n")(ni.v|0)==ni.v&&ni.v>=-32768&&ni.v<=32767?si(Y,13,y(it,Nt,ni.v)):si(Y,14,D(it,Nt,ni.v));else{var bt=rm(ni);si(Y,15,v(it,Nt,bt.slice(0,239)))}}return si(Y,1),Y.end()}function r(O,Q){var V=Q||{};if(+V.codepage>=0&&kv(+V.codepage),V.type=="string")throw new Error("Cannot write WK3 to JS string");var Y=Is();si(Y,0,c(O));for(var we=0,Ve=0;we<O.SheetNames.length;++we)(O.Sheets[O.SheetNames[we]]||{})["!ref"]&&si(Y,27,gt(O.SheetNames[we],Ve++));var Ge=0;for(we=0;we<O.SheetNames.length;++we){var je=O.Sheets[O.SheetNames[we]];if(!(!je||!je["!ref"])){for(var it=Lr(je["!ref"]),It=Array.isArray(je),Nt=[],qt=Math.min(it.e.r,8191),ni=it.s.r;ni<=qt;++ni)for(var bt=vo(ni),Ae=it.s.c;Ae<=it.e.c;++Ae){ni===it.s.r&&(Nt[Ae]=Bo(Ae));var Lt=Nt[Ae]+bt,hi=It?(je[ni]||[])[Ae]:je[Lt];if(!(!hi||hi.t=="z"))if(hi.t=="n")si(Y,23,Me(ni,Ae,Ge,hi.v));else{var Wt=rm(hi);si(Y,22,re(ni,Ae,Ge,Wt.slice(0,239)))}}++Ge}}return si(Y,1),Y.end()}function a(O){var Q=Tt(2);return Q.write_shift(2,O),Q}function c(O){var Q=Tt(26);Q.write_shift(2,4096),Q.write_shift(2,4),Q.write_shift(4,0);for(var V=0,Y=0,we=0,Ve=0;Ve<O.SheetNames.length;++Ve){var Ge=O.SheetNames[Ve],je=O.Sheets[Ge];if(!(!je||!je["!ref"])){++we;var it=dl(je["!ref"]);V<it.e.r&&(V=it.e.r),Y<it.e.c&&(Y=it.e.c)}}return V>8191&&(V=8191),Q.write_shift(2,V),Q.write_shift(1,we),Q.write_shift(1,Y),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(1,1),Q.write_shift(1,2),Q.write_shift(4,0),Q.write_shift(4,0),Q}function d(O,Q,V){var Y={s:{c:0,r:0},e:{c:0,r:0}};return Q==8&&V.qpro?(Y.s.c=O.read_shift(1),O.l++,Y.s.r=O.read_shift(2),Y.e.c=O.read_shift(1),O.l++,Y.e.r=O.read_shift(2),Y):(Y.s.c=O.read_shift(2),Y.s.r=O.read_shift(2),Q==12&&V.qpro&&(O.l+=2),Y.e.c=O.read_shift(2),Y.e.r=O.read_shift(2),Q==12&&V.qpro&&(O.l+=2),Y.s.c==65535&&(Y.s.c=Y.e.c=Y.s.r=Y.e.r=0),Y)}function u(O){var Q=Tt(8);return Q.write_shift(2,O.s.c),Q.write_shift(2,O.s.r),Q.write_shift(2,O.e.c),Q.write_shift(2,O.e.r),Q}function h(O,Q,V){var Y=[{c:0,r:0},{t:"n",v:0},0,0];return V.qpro&&V.vers!=20768?(Y[0].c=O.read_shift(1),Y[3]=O.read_shift(1),Y[0].r=O.read_shift(2),O.l+=2):(Y[2]=O.read_shift(1),Y[0].c=O.read_shift(2),Y[0].r=O.read_shift(2)),Y}function f(O,Q,V){var Y=O.l+Q,we=h(O,Q,V);if(we[1].t="s",V.vers==20768){O.l++;var Ve=O.read_shift(1);return we[1].v=O.read_shift(Ve,"utf8"),we}return V.qpro&&O.l++,we[1].v=O.read_shift(Y-O.l,"cstr"),we}function v(O,Q,V){var Y=Tt(7+V.length);Y.write_shift(1,255),Y.write_shift(2,Q),Y.write_shift(2,O),Y.write_shift(1,39);for(var we=0;we<Y.length;++we){var Ve=V.charCodeAt(we);Y.write_shift(1,Ve>=128?95:Ve)}
193return Y.write_shift(1,0),Y}function C(O,Q,V){var Y=h(O,Q,V);return Y[1].v=O.read_shift(2,"i"),Y}function y(O,Q,V){var Y=Tt(7);return Y.write_shift(1,255),Y.write_shift(2,Q),Y.write_shift(2,O),Y.write_shift(2,V,"i"),Y}function A(O,Q,V){var Y=h(O,Q,V);return Y[1].v=O.read_shift(8,"f"),Y}function D(O,Q,V){var Y=Tt(13);return Y.write_shift(1,255),Y.write_shift(2,Q),Y.write_shift(2,O),Y.write_shift(8,V,"f"),Y}function F(O,Q,V){var Y=O.l+Q,we=h(O,Q,V);if(we[1].v=O.read_shift(8,"f"),V.qpro)O.l=Y;else{var Ve=O.read_shift(2);se(O.slice(O.l,O.l+Ve),we),O.l+=Ve}return we}function R(O,Q,V){var Y=Q&32768;return Q&=-32769,Q=(Y?O:0)+(Q>=8192?Q-16384:Q),(Y?"":"$")+(V?Bo(Q):vo(Q))}var L={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},H=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function se(O,Q){ll(O,0);for(var V=[],Y=0,we="",Ve="",Ge="",je="";O.l<O.length;){var it=O[O.l++];switch(it){case 0:V.push(O.read_shift(8,"f"));break;case 1:Ve=R(Q[0].c,O.read_shift(2),!0),we=R(Q[0].r,O.read_shift(2),!1),V.push(Ve+we);break;case 2:{var It=R(Q[0].c,O.read_shift(2),!0),Nt=R(Q[0].r,O.read_shift(2),!1);Ve=R(Q[0].c,O.read_shift(2),!0),we=R(Q[0].r,O.read_shift(2),!1),V.push(It+Nt+":"+Ve+we)}break;case 3:if(O.l<O.length){console.error("WK1 premature formula end");return}break;case 4:V.push("("+V.pop()+")");break;case 5:V.push(O.read_shift(2));break;case 6:{for(var qt="";it=O[O.l++];)qt+=String.fromCharCode(it);V.push('"'+qt.replace(/"/g,'""')+'"')}break;case 8:V.push("-"+V.pop());break;case 23:V.push("+"+V.pop());break;case 22:V.push("NOT("+V.pop()+")");break;case 20:case 21:je=V.pop(),Ge=V.pop(),V.push(["AND","OR"][it-20]+"("+Ge+","+je+")");break;default:if(it<32&&H[it])je=V.pop(),Ge=V.pop(),V.push(Ge+H[it]+je);else if(L[it]){if(Y=L[it][1],Y==69&&(Y=O[O.l++]),Y>V.length){console.error("WK1 bad formula parse 0x"+it.toString(16)+":|"+V.join("|")+"|");return}var ni=V.slice(-Y);V.length-=Y,V.push(L[it][0]+"("+ni.join(",")+")")}else return it<=7?console.error("WK1 invalid opcode "+it.toString(16)):it<=24?console.error("WK1 unsupported op "+it.toString(16)):it<=30?console.error("WK1 invalid opcode "+it.toString(16)):it<=115?console.error("WK1 unsupported function opcode "+it.toString(16)):console.error("WK1 unrecognized opcode "+it.toString(16))}}V.length==1?Q[1].f=""+V[0]:console.error("WK1 bad formula parse |"+V.join("|")+"|")}function Ce(O){var Q=[{c:0,r:0},{t:"n",v:0},0];return Q[0].r=O.read_shift(2),Q[3]=O[O.l++],Q[0].c=O[O.l++],Q}function Ue(O,Q){var V=Ce(O,Q);return V[1].t="s",V[1].v=O.read_shift(Q-4,"cstr"),V}function re(O,Q,V,Y){var we=Tt(6+Y.length);we.write_shift(2,O),we.write_shift(1,V),we.write_shift(1,Q),we.write_shift(1,39);for(var Ve=0;Ve<Y.length;++Ve){var Ge=Y.charCodeAt(Ve);we.write_shift(1,Ge>=128?95:Ge)}return we.write_shift(1,0),we}function ae(O,Q){var V=Ce(O,Q);V[1].v=O.read_shift(2);var Y=V[1].v>>1;if(V[1].v&1)switch(Y&7){case 0:Y=(Y>>3)*5e3;break;case 1:Y=(Y>>3)*500;break;case 2:Y=(Y>>3)/20;break;case 3:Y=(Y>>3)/200;break;case 4:Y=(Y>>3)/2e3;break;case 5:Y=(Y>>3)/2e4;break;case 6:Y=(Y>>3)/16;break;case 7:Y=(Y>>3)/64;break}return V[1].v=Y,V}function ve(O,Q){var V=Ce(O,Q),Y=O.read_shift(4),we=O.read_shift(4),Ve=O.read_shift(2);if(Ve==65535)return Y===0&&we===3221225472?(V[1].t="e",V[1].v=15):Y===0&&we===3489660928?(V[1].t="e",V[1].v=42):V[1].v=0,V;var Ge=Ve&32768;return Ve=(Ve&32767)-16446,V[1].v=(1-Ge*2)*(we*Math.pow(2,Ve+32)+Y*Math.pow(2,Ve)),V}function Me(O,Q,V,Y){var we=Tt(14);if(we.write_shift(2,O),we.write_shift(1,V),we.write_shift(1,Q),Y==0)return we.write_shift(4,0),we.write_shift(4,0),we.write_shift(2,65535),we;var Ve=0,Ge=0,je=0,it=0;return Y<0&&(Ve=1,Y=-Y),Ge=Math.log2(Y)|0,Y/=Math.pow(2,Ge-31),it=Y>>>0,(it&2147483648)==0&&(Y/=2,++Ge,it=Y>>>0),Y-=it,it|=2147483648,it>>>=0,Y*=Math.pow(2,32),je=Y>>>0,we.write_shift(4,je),we.write_shift(4,it),Ge+=16383+(Ve?32768:0),we.write_shift(2,Ge),we}function W(O,Q){var V=ve(O,14);return O.l+=Q-14,V}function J(O,Q){var V=Ce(O,Q),Y=O.read_shift(4);return V[1].v=Y>>6,V}function Ee(O,Q){var V=Ce(O,Q),Y=O.read_shift(8,"f");return V[1].v=Y,V}function Fe(O,Q){var V=Ee(O,14);return O.l+=Q-10,V}function $e(O,Q){return O[O.l+Q-1]==0?O.read_shift(Q,"cstr"):""}function Qe(O,Q){var V=O[O.l++];V>Q-1&&(V=Q-1);for(var Y="";Y.length<V;)Y+=String.fromCharCode(O[O.l++]);return Y}function ot(O,Q,V){if(!(!V.qpro||Q<21)){var Y=O.read_shift(1);O.l+=17,O.l+=1,O.l+=2;var we=O.read_shift(Q-21,"cstr");return[Y,we]}}function et(O,Q){for(var V={},Y=O.l+Q;O.l<Y;){var we=O.read_shift(2);if(we==14e3){for(V[we]=[0,""],V[we][0]=O.read_shift(2);O[O.l];)V[we][1]+=String.fromCharCode(O[O.l]),O.l++;O.l++}}return V}function gt(O,Q){var V=Tt(5+O.length);V.write_shift(2,14e3),V.write_shift(2,Q);for(var Y=0;Y<O.length;++Y){var we=O.charCodeAt(Y);
193V[V.l++]=we>127?95:we}return V[V.l++]=0,V}var vt={0:{n:"BOF",f:u7},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:d},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:C},14:{n:"NUMBER",f:A},15:{n:"LABEL",f},16:{n:"FORMULA",f:F},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:$e},222:{n:"SHEETNAMELP",f:Qe},65535:{n:""}},Kt={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:Ue},23:{n:"NUMBER17",f:ve},24:{n:"NUMBER18",f:ae},25:{n:"FORMULA19",f:W},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:et},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:J},38:{n:"??"},39:{n:"NUMBER27",f:Ee},40:{n:"FORMULA28",f:Fe},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:$e},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:ot},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:e,book_to_wk3:r,to_workbook:n}}();var Jae=/^\s|\s$|[\t\n\r]/;function _7(i,n){if(!n.bookSST)return"";var t=[ka];t[t.length]=ii("sst",null,{xmlns:Df[0],count:i.Count,uniqueCount:i.Unique});for(var e=0;e!=i.length;++e)if(i[e]!=null){var r=i[e],a="<si>";r.r?a+=r.r:(a+="<t",r.t||(r.t=""),r.t.match(Jae)&&(a+=' xml:space="preserve"'),a+=">"+ur(r.t)+"</t>"),a+="</si>",t[t.length]=a}return t.length>2&&(t[t.length]="</sst>",t[1]=t[1].replace("/>",">")),t.join("")}function Zae(i){return[i.read_shift(4),i.read_shift(4)]}function Qae(i,n){return n||(n=Tt(8)),n.write_shift(4,i.Count),n.write_shift(4,i.Unique),n}var eoe=Gre;function toe(i){var n=Is();Ut(n,159,Qae(i));for(var t=0;t<i.length;++t)Ut(n,19,eoe(i[t]));return Ut(n,160),n.end()}function ioe(i){if(typeof Ir<"u")return Ir.utils.encode(wf,i);for(var n=[],t=i.split(""),e=0;e<t.length;++e)n[e]=t[e].charCodeAt(0);return n}function y7(i){var n=0,t,e=ioe(i),r=e.length+1,a,c,d,u,h;for(t=Z0(r),t[0]=e.length,a=1;a!=r;++a)t[a]=e[a-1];for(a=r-1;a>=0;--a)c=t[a],d=(n&16384)===0?0:1,u=n<<1&32767,h=d|u,n=h^c;return n^52811}var noe=function(){function i(r,a){switch(a.type){case"base64":return n(nm(r),a);case"binary":return n(r,a);case"buffer":return n(tr&&Buffer.isBuffer(r)?r.toString("binary"):Ov(r),a);case"array":return n(X2(r),a)}throw new Error("Unrecognized type "+a.type)}function n(r,a){var c=a||{},d=c.dense?[]:{},u=r.match(/\\trowd.*?\\row\b/g);
193if(!u.length)throw new Error("RTF missing table");var h={s:{c:0,r:0},e:{c:0,r:u.length-1}};return u.forEach(function(f,v){Array.isArray(d)&&(d[v]=[]);for(var C=/\\\w+\b/g,y=0,A,D=-1;A=C.exec(f);){switch(A[0]){case"\\cell":var F=f.slice(y,C.lastIndex-A[0].length);if(F[0]==" "&&(F=F.slice(1)),++D,F.length){var R={v:F,t:"s"};Array.isArray(d)?d[v][D]=R:d[pr({r:v,c:D})]=R}break}y=C.lastIndex}D>h.e.c&&(h.e.c=D)}),d["!ref"]=Ia(h),d}function t(r,a){return tp(i(r,a),a)}function e(r){for(var a=["{\\rtf1\\ansi"],c=Lr(r["!ref"]),d,u=Array.isArray(r),h=c.s.r;h<=c.e.r;++h){a.push("\\trowd\\trautofit1");for(var f=c.s.c;f<=c.e.c;++f)a.push("\\cellx"+(f+1));for(a.push("\\pard\\intbl"),f=c.s.c;f<=c.e.c;++f){var v=pr({r:h,c:f});d=u?(r[h]||[])[f]:r[v],!(!d||d.v==null&&(!d.f||d.F))&&(a.push(" "+(d.w||(rm(d),d.w))),a.push("\\cell"))}a.push("\\pard\\intbl\\row")}return a.join("")+"}"}return{to_workbook:t,to_sheet:i,from_sheet:e}}();function g8(i){for(var n=0,t=1;n!=3;++n)t=t*256+(i[n]>255?255:i[n]<0?0:i[n]);return t.toString(16).toUpperCase().slice(1)}var roe=6;var im=roe;function j2(i){return Math.floor((i+Math.round(128/im)/256)*im)}function W2(i){return Math.floor((i-5)/im*100+.5)/100}function GD(i){return Math.round((i*im+5)/im*256)/256}function cI(i){i.width?(i.wpx=j2(i.width),i.wch=W2(i.wpx),i.MDW=im):i.wpx?(i.wch=W2(i.wpx),i.width=GD(i.wch),i.MDW=im):typeof i.wch=="number"&&(i.width=GD(i.wch),i.wpx=j2(i.width),i.MDW=im),i.customWidth&&delete i.customWidth}var aoe=96,S7=aoe;function H2(i){return i*96/S7}function b7(i){return i*S7/96}function ooe(i){var n=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var e=t[0];e<=t[1];++e)i[e]!=null&&(n[n.length]=ii("numFmt",null,{numFmtId:e,formatCode:ur(i[e])}))}),n.length===1?"":(n[n.length]="</numFmts>",n[0]=ii("numFmts",null,{count:n.length-2}).replace("/>",">"),n.join(""))}function soe(i){var n=[];return n[n.length]=ii("cellXfs",null),i.forEach(function(t){n[n.length]=ii("xf",null,t)}),n[n.length]="</cellXfs>",n.length===2?"":(n[0]=ii("cellXfs",null,{count:n.length-2}).replace("/>",">"),n.join(""))}function x7(i,n){var t=[ka,ii("styleSheet",null,{xmlns:Df[0],"xmlns:vt":io.vt})],e;return i.SSF&&(e=ooe(i.SSF))!=null&&(t[t.length]=e),t[t.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',t[t.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',t[t.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',t[t.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(e=soe(n.cellXfs))&&(t[t.length]=e),t[t.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',t[t.length]='<dxfs count="0"/>',t[t.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',t.length>2&&(t[t.length]="</styleSheet>",t[1]=t[1].replace("/>",">")),t.join("")}function loe(i,n){var t=i.read_shift(2),e=Vo(i,n-2);return[t,e]}function coe(i,n,t){t||(t=Tt(6+4*n.length)),t.write_shift(2,i),ro(n,t);var e=t.length>t.l?t.slice(0,t.l):t;return t.l==null&&(t.l=t.length),e}function doe(i,n,t){var e={};e.sz=i.read_shift(2)/20;var r=Jre(i,2,t);r.fItalic&&(e.italic=1),r.fCondense&&(e.condense=1),r.fExtend&&(e.extend=1),r.fShadow&&(e.shadow=1),r.fOutline&&(e.outline=1),r.fStrikeout&&(e.strike=1);var a=i.read_shift(2);switch(a===700&&(e.bold=1),i.read_shift(2)){case 1:e.vertAlign="superscript";break;case 2:e.vertAlign="subscript";break}var c=i.read_shift(1);c!=0&&(e.underline=c);var d=i.read_shift(1);d>0&&(e.family=d);var u=i.read_shift(1);switch(u>0&&(e.charset=u),i.l++,e.color=Xre(i,8),i.read_shift(1)){case 1:e.scheme="major";break;case 2:e.scheme="minor";break}return e.name=Vo(i,n-21),e}function moe(i,n){n||(n=Tt(25+4*32)),n.write_shift(2,i.sz*20),Zre(i,n),n.write_shift(2,i.bold?700:400);var t=0;i.vertAlign=="superscript"?t=1:i.vertAlign=="subscript"&&(t=2),n.write_shift(2,t),n.write_shift(1,i.underline||0),n.write_shift(1,i.family||0),n.write_shift(1,i.charset||0),n.write_shift(1,0),V2(i.color,n);var e=0;return i.scheme=="major"&&(e=1),i.scheme=="minor"&&(e=2),n.write_shift(1,e),ro(i.name,n),n.length>n.l?n.slice(0,n.l):n}var uoe=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","dar
193kVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],LD,poe=ld;function v8(i,n){n||(n=Tt(4*3+8*7+16*1)),LD||(LD=YD(uoe));var t=LD[i.patternType];t==null&&(t=40),n.write_shift(4,t);var e=0;if(t!=40)for(V2({auto:1},n),V2({auto:1},n);e<12;++e)n.write_shift(4,0);else{for(;e<4;++e)n.write_shift(4,0);for(;e<12;++e)n.write_shift(4,0)}return n.length>n.l?n.slice(0,n.l):n}function hoe(i,n){var t=i.l+n,e=i.read_shift(2),r=i.read_shift(2);return i.l=t,{ixfe:e,numFmtId:r}}function C7(i,n,t){t||(t=Tt(16)),t.write_shift(2,n||0),t.write_shift(2,i.numFmtId||0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);var e=0;return t.write_shift(1,e),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(1,0),t}function bv(i,n){return n||(n=Tt(10)),n.write_shift(1,0),n.write_shift(1,0),n.write_shift(4,0),n.write_shift(4,0),n}var foe=ld;function goe(i,n){return n||(n=Tt(51)),n.write_shift(1,0),bv(null,n),bv(null,n),bv(null,n),bv(null,n),bv(null,n),n.length>n.l?n.slice(0,n.l):n}function voe(i,n){return n||(n=Tt(12+4*10)),n.write_shift(4,i.xfId),n.write_shift(2,1),n.write_shift(1,+i.builtinId),n.write_shift(1,0),B2(i.name||"",n),n.length>n.l?n.slice(0,n.l):n}function _oe(i,n,t){var e=Tt(2052);return e.write_shift(4,i),B2(n,e),B2(t,e),e.length>e.l?e.slice(0,e.l):e}function yoe(i,n){if(n){var t=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(e){for(var r=e[0];r<=e[1];++r)n[r]!=null&&++t}),t!=0&&(Ut(i,615,Cc(t)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(e){for(var r=e[0];r<=e[1];++r)n[r]!=null&&Ut(i,44,coe(r,n[r]))}),Ut(i,616))}}function Soe(i){var n=1;n!=0&&(Ut(i,611,Cc(n)),Ut(i,43,moe({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"})),Ut(i,612))}function boe(i){var n=2;n!=0&&(Ut(i,603,Cc(n)),Ut(i,45,v8({patternType:"none"})),Ut(i,45,v8({patternType:"gray125"})),Ut(i,604))}function xoe(i){var n=1;n!=0&&(Ut(i,613,Cc(n)),Ut(i,46,goe({})),Ut(i,614))}function Coe(i){var n=1;Ut(i,626,Cc(n)),Ut(i,47,C7({numFmtId:0,fontId:0,fillId:0,borderId:0},65535)),Ut(i,627)}function Eoe(i,n){Ut(i,617,Cc(n.length)),n.forEach(function(t){Ut(i,47,C7(t,0))}),Ut(i,618)}function woe(i){var n=1;Ut(i,619,Cc(n)),Ut(i,48,voe({xfId:0,builtinId:0,name:"Normal"})),Ut(i,620)}function Toe(i){var n=0;Ut(i,505,Cc(n)),Ut(i,506)}function Doe(i){var n=0;Ut(i,508,_oe(n,"TableStyleMedium9","PivotStyleMedium4")),Ut(i,509)}function Ioe(i,n){var t=Is();return Ut(t,278),yoe(t,i.SSF),Soe(t,i),boe(t,i),xoe(t,i),Coe(t,i),Eoe(t,n.cellXfs),woe(t,i),Toe(t,i),Doe(t,i),Ut(t,279),t.end()}function E7(i,n){if(n&&n.themeXLSX)return n.themeXLSX;if(i&&typeof i.raw=="string")return i.raw;var t=[ka];return t[t.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',t[t.length]="<a:themeElements>",t[t.length]='<a:clrScheme name="Office">',t[t.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',t[t.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',t[t.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',t[t.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',t[t.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',t[t.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',t[t.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',t[t.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',t[t.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',t[t.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',t[t.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',t[t.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',t[t.length]="</a:clrScheme>",t[t.length]='<a:fontScheme name="Office">',t[t.length]="<a:majorFont>",t[t.length]='<a:latin typeface="Cambria"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/>',t[t.length]='<a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/>',t[t.length]='<a:font script="Hans" typeface="\u5B8B\u4F53"/>
193',t[t.length]='<a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/>',t[t.length]='<a:font script="Arab" typeface="Times New Roman"/>',t[t.length]='<a:font script="Hebr" typeface="Times New Roman"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="MoolBoran"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Times New Roman"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:majorFont>",t[t.length]="<a:minorFont>",t[t.length]='<a:latin typeface="Calibri"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/>',t[t.length]='<a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/>',t[t.length]='<a:font script="Hans" typeface="\u5B8B\u4F53"/>',t[t.length]='<a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/>',t[t.length]='<a:font script="Arab" typeface="Arial"/>',t[t.length]='<a:font script="Hebr" typeface="Arial"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="DaunPenh"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Arial"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:minorFont>",t[t.length]="</a:fontScheme>",t[t.length]='<a:fmtScheme name="Office">',t[t.length]="<a:fillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>
193',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="1"/>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="0"/>',t[t.length]="</a:gradFill>",t[t.length]="</a:fillStyleLst>",t[t.length]="<a:lnStyleLst>",t[t.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]="</a:lnStyleLst>",t[t.length]="<a:effectStyleLst>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',t[t.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',t[t.length]="</a:effectStyle>",t[t.length]="</a:effectStyleLst>",t[t.length]="<a:bgFillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]="</a:bgFillStyleLst>",t[t.length]="</a:fmtScheme>",t[t.length]="</a:themeElements>",t[t.length]="<a:objectDefaults>",t[t.length]="<a:spDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',t[t.length]="</a:spDef>",t[t.length]="<a:lnDef>
193",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',t[t.length]="</a:lnDef>",t[t.length]="</a:objectDefaults>",t[t.length]="<a:extraClrSchemeLst/>",t[t.length]="</a:theme>",t.join("")}function koe(i,n){return{flags:i.read_shift(4),version:i.read_shift(4),name:Vo(i,n-8)}}function Moe(i){var n=Tt(12+2*i.name.length);return n.write_shift(4,i.flags),n.write_shift(4,i.version),ro(i.name,n),n.slice(0,n.l)}function Aoe(i){for(var n=[],t=i.read_shift(4);t-- >0;)n.push([i.read_shift(4),i.read_shift(4)]);return n}function Poe(i){var n=Tt(4+8*i.length);n.write_shift(4,i.length);for(var t=0;t<i.length;++t)n.write_shift(4,i[t][0]),n.write_shift(4,i[t][1]);return n}function Foe(i,n){var t=Tt(8+2*n.length);return t.write_shift(4,i),ro(n,t),t.slice(0,t.l)}function Roe(i){return i.l+=4,i.read_shift(4)!=0}function Ooe(i,n){var t=Tt(8);return t.write_shift(4,i),t.write_shift(4,n?1:0),t}function Noe(){var i=Is();return Ut(i,332),Ut(i,334,Cc(1)),Ut(i,335,Moe({name:"XLDAPR",version:12e4,flags:3496657072})),Ut(i,336),Ut(i,339,Foe(1,"XLDAPR")),Ut(i,52),Ut(i,35,Cc(514)),Ut(i,4096,Cc(0)),Ut(i,4097,Ul(1)),Ut(i,36),Ut(i,53),Ut(i,340),Ut(i,337,Ooe(1,!0)),Ut(i,51,Poe([[1,0]])),Ut(i,338),Ut(i,333),i.end()}function w7(){var i=[ka];return i.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"> 194 <metadataTypes count="1"> 195 <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/> 196 </metadataTypes> 197 <futureMetadata name="XLDAPR" count="1"> 198 <bk> 199 <extLst> 200 <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"> 201 <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/> 202 </ext> 203 </extLst> 204 </bk> 205 </futureMetadata> 206 <cellMetadata count="1"> 207 <bk> 208 <rc t="1" v="0"/> 209 </bk> 210 </cellMetadata> 211</metadata>`),i.join("")}function Loe(i){var n={};n.i=i.read_shift(4);var t={};t.r=i.read_shift(4),t.c=i.read_shift(4),n.r=pr(t);var e=i.read_shift(1);return e&2&&(n.l="1"),e&8&&(n.a="1"),n}var yf=1024;function T7(i,n){for(var t=[21600,21600],e=["m0,0l0",t[1],t[0],t[1],t[0],"0xe"].join(","),r=[ii("xml",null,{"xmlns:v":cl.v,"xmlns:o":cl.o,"xmlns:x":cl.x,"xmlns:mv":cl.mv}).replace(/\/>/,">"),ii("o:shapelayout",ii("o:idmap",null,{"v:ext":"edit",data:i}),{"v:ext":"edit"}),ii("v:shapetype",[ii("v:stroke",null,{joinstyle:"miter"}),ii("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:t.join(","),path:e})];yf<i*1e3;)yf+=1e3;return n.forEach(function(a){var c=no(a[0]),d={color2:"#BEFF82",type:"gradient"};d.type=="gradient"&&(d.angle="-180");var u=d.type=="gradient"?ii("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,h=ii("v:fill",u,d),f={on:"t",obscured:"t"};++yf,r=r.concat(["<v:shape"+Pv({id:"_x0000_s"+yf,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(a[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",h,ii("v:shadow",null,f),ii("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",go("x:Anchor",[c.c+1,0,c.r+1,0,c.c+3,20,c.r+5,20].join(",")),go("x:AutoFill","False"),go("x:Row",String(c.r)),go("x:Column",String(c.c)),a[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),r.push("</xml>"),r.join("")}function D7(i){var n=[ka,ii("comments",null,{xmlns:Df[0]})],t=[];return n.push("<authors>
211"),i.forEach(function(e){e[1].forEach(function(r){var a=ur(r.a);t.indexOf(a)==-1&&(t.push(a),n.push("<author>"+a+"</author>")),r.T&&r.ID&&t.indexOf("tc="+r.ID)==-1&&(t.push("tc="+r.ID),n.push("<author>tc="+r.ID+"</author>"))})}),t.length==0&&(t.push("SheetJ5"),n.push("<author>SheetJ5</author>")),n.push("</authors>"),n.push("<commentList>"),i.forEach(function(e){var r=0,a=[];if(e[1][0]&&e[1][0].T&&e[1][0].ID?r=t.indexOf("tc="+e[1][0].ID):e[1].forEach(function(u){u.a&&(r=t.indexOf(ur(u.a))),a.push(u.t||"")}),n.push('<comment ref="'+e[0]+'" authorId="'+r+'"><text>'),a.length<=1)n.push(go("t",ur(a[0]||"")));else{for(var c=`Comment: 212 `+a[0]+` 213`,d=1;d<a.length;++d)c+=`Reply: 214 `+a[d]+` 215`;n.push(go("t",ur(c)))}n.push("</text></comment>")}),n.push("</commentList>"),n.length>2&&(n[n.length]="</comments>",n[1]=n[1].replace("/>",">")),n.join("")}function Boe(i,n,t){var e=[ka,ii("ThreadedComments",null,{xmlns:io.TCMNT}).replace(/[\/]>/,">")];return i.forEach(function(r){var a="";(r[1]||[]).forEach(function(c,d){if(!c.T){delete c.ID;return}c.a&&n.indexOf(c.a)==-1&&n.push(c.a);var u={ref:r[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+t.tcid++).slice(-12)+"}"};d==0?a=u.id:u.parentId=a,c.ID=u.id,c.a&&(u.personId="{54EE7950-7262-4200-6969-"+("000000000000"+n.indexOf(c.a)).slice(-12)+"}"),e.push(ii("threadedComment",go("text",c.t||""),u))})}),e.push("</ThreadedComments>"),e.join("")}function Voe(i){var n=[ka,ii("personList",null,{xmlns:io.TCMNT,"xmlns:x":Df[0]}).replace(/[\/]>/,">")];return i.forEach(function(t,e){n.push(ii("person",null,{displayName:t,id:"{54EE7950-7262-4200-6969-"+("000000000000"+e).slice(-12)+"}",userId:t,providerId:"None"}))}),n.push("</personList>"),n.join("")}function Uoe(i){var n={};n.iauthor=i.read_shift(4);var t=ap(i,16);return n.rfx=t.s,n.ref=pr(t.s),i.l+=16,n}function joe(i,n){return n==null&&(n=Tt(36)),n.write_shift(4,i[1].iauthor),Mf(i[0],n),n.write_shift(4,0),n.write_shift(4,0),n.write_shift(4,0),n.write_shift(4,0),n}var Woe=Vo;function Hoe(i){return ro(i.slice(0,54))}function Goe(i){var n=Is(),t=[];
215return Ut(n,628),Ut(n,630),i.forEach(function(e){e[1].forEach(function(r){t.indexOf(r.a)>-1||(t.push(r.a.slice(0,54)),Ut(n,632,Hoe(r.a)))})}),Ut(n,631),Ut(n,633),i.forEach(function(e){e[1].forEach(function(r){r.iauthor=t.indexOf(r.a);var a={s:no(e[0]),e:no(e[0])};Ut(n,635,joe([a,r])),r.t&&r.t.length>0&&Ut(n,637,zre(r)),Ut(n,636),delete r.iauthor})}),Ut(n,634),Ut(n,629),n.end()}function $oe(i,n){n.FullPaths.forEach(function(t,e){if(e!=0){var r=t.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");r.slice(-1)!=="/"&&xr.utils.cfb_add(i,r,n.FileIndex[e].content)}})}var I7=["xlsb","xlsm","xlam","biff8","xla"];var zoe=function(){var i=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,n={r:0,c:0};function t(e,r,a,c){var d=!1,u=!1;a.length==0?u=!0:a.charAt(0)=="["&&(u=!0,a=a.slice(1,-1)),c.length==0?d=!0:c.charAt(0)=="["&&(d=!0,c=c.slice(1,-1));var h=a.length>0?parseInt(a,10)|0:0,f=c.length>0?parseInt(c,10)|0:0;return d?f+=n.c:--f,u?h+=n.r:--h,r+(d?"":"$")+Bo(f)+(u?"":"$")+vo(h)}return function(r,a){return n=a,r.replace(i,t)}}(),dI=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,mI=function(){return function(n,t){return n.replace(dI,function(e,r,a,c,d,u){var h=rI(c)-(a?0:t.c),f=nI(u)-(d?0:t.r),v=f==0?"":d?f+1:"["+f+"]",C=h==0?"":a?h+1:"["+h+"]";return r+"R"+v+"C"+C})}}();function Yoe(i,n){return i.replace(dI,function(t,e,r,a,c,d){return e+(r=="$"?r+a:Bo(rI(a)+n.c))+(c=="$"?c+d:vo(nI(d)+n.r))})}function qoe(i){return i.length!=1}function Da(i){i.l+=1}function fu(i,n){var t=i.read_shift(n==1?1:2);return[t&16383,t>>14&1,t>>15&1]}function k7(i,n,t){var e=2;if(t){if(t.biff>=2&&t.biff<=5)return M7(i,n,t);t.biff==12&&(e=4)}var r=i.read_shift(e),a=i.read_shift(e),c=fu(i,2),d=fu(i,2);return{s:{r,c:c[0],cRel:c[1],rRel:c[2]},e:{r:a,c:d[0],cRel:d[1],rRel:d[2]}}}function M7(i){var n=fu(i,2),t=fu(i,2),e=i.read_shift(1),r=i.read_shift(1);return{s:{r:n[0],c:e,cRel:n[1],rRel:n[2]},e:{r:t[0],c:r,cRel:t[1],rRel:t[2]}}}function Koe(i,n,t){if(t.biff<8)return M7(i,n,t);var e=i.read_shift(t.biff==12?4:2),r=i.read_shift(t.biff==12?4:2),a=fu(i,2),c=fu(i,2);return{s:{r:e,c:a[0],cRel:a[1],rRel:a[2]},e:{r,c:c[0],cRel:c[1],rRel:c[2]}}}function A7(i,n,t){if(t&&t.biff>=2&&t.biff<=5)return Xoe(i,n,t);var e=i.read_shift(t&&t.biff==12?4:2),r=fu(i,2);return{r:e,c:r[0],cRel:r[1],rRel:r[2]}}function Xoe(i){var n=fu(i,2),t=i.read_shift(1);return{r:n[0],c:t,cRel:n[1],rRel:n[2]}}function Joe(i){var n=i.read_shift(2),t=i.read_shift(2);return{r:n,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function Zoe(i,n,t){var e=t&&t.biff?t.biff:8;if(e>=2&&e<=5)return Qoe(i,n,t);var r=i.read_shift(e>=12?4:2),a=i.read_shift(2),c=(a&16384)>>14,d=(a&32768)>>15;if(a&=16383,d==1)for(;r>524287;)r-=1048576;if(c==1)for(;a>8191;)a=a-16384;return{r,c:a,cRel:c,rRel:d}}function Qoe(i){var n=i.read_shift(2),t=i.read_shift(1),e=(n&32768)>>15,r=(n&16384)>>14;return n&=16383,e==1&&n>=8192&&(n=n-16384),r==1&&t>=128&&(t=t-256),{r:n,c:t,cRel:r,rRel:e}}function ese(i,n,t){var e=(i[i.l++]&96)>>5,r=k7(i,t.biff>=2&&t.biff<=5?6:8,t);return[e,r]}function tse(i,n,t){var e=(i[i.l++]&96)>>5,r=i.read_shift(2,"i"),a=8;if(t)switch(t.biff){case 5:i.l+=12,a=6;break;case 12:a=12;break}var c=k7(i,a,t);return[e,r,c]}function ise(i,n,t){var e=(i[i.l++]&96)>>5;return i.l+=t&&t.biff>8?12:t.biff<8?6:8,[e]}function nse(i,n,t){var e=(i[i.l++]&96)>>5,r=i.read_shift(2),a=8;if(t)switch(t.biff){case 5:i.l+=12,a=6;break;case 12:a=12;break}return i.l+=a,[e,r]}function rse(i,n,t){var e=(i[i.l++]&96)>>5,r=Koe(i,n-1,t);return[e,r]}function ase(i,n,t){var e=(i[i.l++]&96)>>5;return i.l+=t.biff==2?6:t.biff==12?14:7,[e]}function _8(i){var n=i[i.l+1]&1,t=1;return i.l+=4,[n,t]}function ose(i,n,t){i.l+=2;for(var e=i.read_shift(t&&t.biff==2?1:2),r=[],a=0;a<=e;++a)r.push(i.read_shift(t&&t.biff==2?1:2));return r}function sse(i,n,t){var e=i[i.l+1]&255?1:0;return i.l+=2,[e,i.read_shift(t&&t.biff==2?1:2)]}function lse(i,n,t){var e=i[i.l+1]&255?1:0;return i.l+=2,[e,i.read_shift(t&&t.biff==2?1:2)]}function cse(i){var n=i[i.l+1]&255?1:0;return i.l+=2,[n,i.read_shift(2)]}function dse(i,n,t){var e=i[i.l+1]&255?1:0;return i.l+=t&&t.biff==2?3:4,[e]}function P7(i){var n=i.read_shift(1),t=i.read_shift(1);return[n,t]}function mse(i){return i.read_shift(2),P7(i,2)}function use(i){return i.read_shift(2),P7(i,2)}function pse(i,n,t){var e=(i[i.l]&96)>>5;i.l+=1;var r=A7(i,0,t);return[e,r]}function hse(i,n,t){var e=(i[i.l]&96)>>5;i.l+=1;var r=Zoe(i,0,t);return[e,r]}function fse(i,n,t){var e=(i[i.l]&96)>>5;i.l+=1;var r=i.read_shift(2);
215t&&t.biff==5&&(i.l+=12);var a=A7(i,0,t);return[e,r,a]}function gse(i,n,t){var e=(i[i.l]&96)>>5;i.l+=1;var r=i.read_shift(t&&t.biff<=3?1:2);return[gle[r],O7[r],e]}function vse(i,n,t){var e=i[i.l++],r=i.read_shift(1),a=t&&t.biff<=3?[e==88?-1:0,i.read_shift(1)]:_se(i);return[r,(a[0]===0?O7:fle)[a[1]]]}function _se(i){return[i[i.l+1]>>7,i.read_shift(2)&32767]}function yse(i,n,t){i.l+=t&&t.biff==2?3:4}function Sse(i,n,t){if(i.l++,t&&t.biff==12)return[i.read_shift(4,"i"),0];var e=i.read_shift(2),r=i.read_shift(t&&t.biff==2?1:2);return[e,r]}function bse(i){return i.l++,Lv[i.read_shift(1)]}function xse(i){return i.l++,i.read_shift(2)}function Cse(i){return i.l++,i.read_shift(1)!==0}function Ese(i){return i.l++,Af(i,8)}function wse(i,n,t){return i.l++,h7(i,n-1,t)}function Tse(i,n){var t=[i.read_shift(1)];if(n==12)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2;break}switch(t[0]){case 4:t[1]=fae(i,1)?"TRUE":"FALSE",n!=12&&(i.l+=7);break;case 37:case 16:t[1]=Lv[i[i.l]],i.l+=n==12?4:8;break;case 0:i.l+=8;break;case 1:t[1]=Af(i,8);break;case 2:t[1]=yae(i,0,{biff:n>0&&n<8?2:n});break;default:throw new Error("Bad SerAr: "+t[0])}return t}function Dse(i,n,t){for(var e=i.read_shift(t.biff==12?4:2),r=[],a=0;a!=e;++a)r.push((t.biff==12?ap:xae)(i,8));return r}function Ise(i,n,t){var e=0,r=0;t.biff==12?(e=i.read_shift(4),r=i.read_shift(4)):(r=1+i.read_shift(1),e=1+i.read_shift(2)),t.biff>=2&&t.biff<8&&(--e,--r==0&&(r=256));for(var a=0,c=[];a!=e&&(c[a]=[]);++a)for(var d=0;d!=r;++d)c[a][d]=Tse(i,t.biff);return c}function kse(i,n,t){var e=i.read_shift(1)>>>5&3,r=!t||t.biff>=8?4:2,a=i.read_shift(r);switch(t.biff){case 2:i.l+=5;break;case 3:case 4:i.l+=8;break;case 5:i.l+=12;break}return[e,0,a]}function Mse(i,n,t){if(t.biff==5)return Ase(i,n,t);var e=i.read_shift(1)>>>5&3,r=i.read_shift(2),a=i.read_shift(4);return[e,r,a]}function Ase(i){var n=i.read_shift(1)>>>5&3,t=i.read_shift(2,"i");i.l+=8;var e=i.read_shift(2);return i.l+=12,[n,t,e]}function Pse(i,n,t){var e=i.read_shift(1)>>>5&3;i.l+=t&&t.biff==2?3:4;var r=i.read_shift(t&&t.biff==2?1:2);return[e,r]}function Fse(i,n,t){var e=i.read_shift(1)>>>5&3,r=i.read_shift(t&&t.biff==2?1:2);return[e,r]}function Rse(i,n,t){var e=i.read_shift(1)>>>5&3;return i.l+=4,t.biff<8&&i.l--,t.biff==12&&(i.l+=2),[e]}function Ose(i,n,t){var e=(i[i.l++]&96)>>5,r=i.read_shift(2),a=4;if(t)switch(t.biff){case 5:a=15;break;case 12:a=6;break}return i.l+=a,[e,r]}var Nse=ld,Lse=ld,Bse=ld;function Bv(i,n,t){return i.l+=2,[Joe(i,4,t)]}function uI(i){return i.l+=6,[]}var Vse=Bv,Use=uI,jse=uI,Wse=Bv;function F7(i){return i.l+=2,[u7(i),i.read_shift(2)&1]}var Hse=Bv,Gse=F7,$se=uI,zse=Bv,Yse=Bv,qse=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function Kse(i){i.l+=2;var n=i.read_shift(2),t=i.read_shift(2),e=i.read_shift(4),r=i.read_shift(2),a=i.read_shift(2),c=qse[t>>2&31];return{ixti:n,coltype:t&3,rt:c,idx:e,c:r,C:a}}function Xse(i){return i.l+=2,[i.read_shift(4)]}function Jse(i,n,t){return i.l+=5,i.l+=2,i.l+=t.biff==2?1:4,["PTGSHEET"]}function Zse(i,n,t){return i.l+=t.biff==2?4:5,["PTGENDSHEET"]}function Qse(i){var n=i.read_shift(1)>>>5&3,t=i.read_shift(2);return[n,t]}function ele(i){var n=i.read_shift(1)>>>5&3,t=i.read_shift(2);return[n,t]}function tle(i){return i.l+=4,[0,0]}var y8={1:{n:"PtgExp",f:Sse},2:{n:"PtgTbl",f:Bse},3:{n:"PtgAdd",f:Da},4:{n:"PtgSub",f:Da},5:{n:"PtgMul",f:Da},6:{n:"PtgDiv",f:Da},7:{n:"PtgPower",f:Da},8:{n:"PtgConcat",f:Da},9:{n:"PtgLt",f:Da},10:{n:"PtgLe",f:Da},11:{n:"PtgEq",f:Da},12:{n:"PtgGe",f:Da},13:{n:"PtgGt",f:Da},14:{n:"PtgNe",f:Da},15:{n:"PtgIsect",f:Da},16:{n:"PtgUnion",f:Da},17:{n:"PtgRange",f:Da},18:{n:"PtgUplus",f:Da},19:{n:"PtgUminus",f:Da},20:{n:"PtgPercent",f:Da},21:{n:"PtgParen",f:Da},22:{n:"PtgMissArg",f:Da},23:{n:"PtgStr",f:wse},26:{n:"PtgSheet",f:Jse},27:{n:"PtgEndSheet",f:Zse},28:{n:"PtgErr",f:bse},29:{n:"PtgBool",f:Cse},30:{n:"PtgInt",f:xse},31:{n:"PtgNum",f:Ese},32:{n:"PtgArray",f:ase},33:{n:"PtgFunc",f:gse},34:{n:"PtgFuncVar",f:vse},35:{n:"PtgName",f:kse},36:{n:"PtgRef",f:pse},37:{n:"PtgArea",f:ese},38:{n:"PtgMemArea",f:Pse},39:{n:"PtgMemErr",f:Nse},40:{n:"PtgMemNoMem",f:Lse},41:{n:"PtgMemFunc",f:Fse}
215,42:{n:"PtgRefErr",f:Rse},43:{n:"PtgAreaErr",f:ise},44:{n:"PtgRefN",f:hse},45:{n:"PtgAreaN",f:rse},46:{n:"PtgMemAreaN",f:Qse},47:{n:"PtgMemNoMemN",f:ele},57:{n:"PtgNameX",f:Mse},58:{n:"PtgRef3d",f:fse},59:{n:"PtgArea3d",f:tse},60:{n:"PtgRefErr3d",f:Ose},61:{n:"PtgAreaErr3d",f:nse},255:{}},ile={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},nle={1:{n:"PtgElfLel",f:F7},2:{n:"PtgElfRw",f:zse},3:{n:"PtgElfCol",f:Vse},6:{n:"PtgElfRwV",f:Yse},7:{n:"PtgElfColV",f:Wse},10:{n:"PtgElfRadical",f:Hse},11:{n:"PtgElfRadicalS",f:$se},13:{n:"PtgElfColS",f:Use},15:{n:"PtgElfColSV",f:jse},16:{n:"PtgElfRadicalLel",f:Gse},25:{n:"PtgList",f:Kse},29:{n:"PtgSxName",f:Xse},255:{}},rle={0:{n:"PtgAttrNoop",f:tle},1:{n:"PtgAttrSemi",f:dse},2:{n:"PtgAttrIf",f:lse},4:{n:"PtgAttrChoose",f:ose},8:{n:"PtgAttrGoto",f:sse},16:{n:"PtgAttrSum",f:yse},32:{n:"PtgAttrBaxcel",f:_8},33:{n:"PtgAttrBaxcel",f:_8},64:{n:"PtgAttrSpace",f:mse},65:{n:"PtgAttrSpaceSemi",f:use},128:{n:"PtgAttrIfError",f:cse},255:{}};function ale(i,n,t,e){if(e.biff<8)return ld(i,n);for(var r=i.l+n,a=[],c=0;c!==t.length;++c)switch(t[c][0]){case"PtgArray":t[c][1]=Ise(i,0,e),a.push(t[c][1]);break;case"PtgMemArea":t[c][2]=Dse(i,t[c][1],e),a.push(t[c][2]);break;case"PtgExp":e&&e.biff==12&&(t[c][1][1]=i.read_shift(4),a.push(t[c][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+t[c][0];default:break}return n=r-i.l,n!==0&&a.push(ld(i,n)),a}function ole(i,n,t){for(var e=i.l+n,r,a,c=[];e!=i.l;)n=e-i.l,a=i[i.l],r=y8[a]||y8[ile[a]],(a===24||a===25)&&(r=(a===24?nle:rle)[i[i.l+1]]),!r||!r.f?ld(i,n):c.push([r.n,r.f(i,n,t)]);return c}function sle(i){for(var n=[],t=0;t<i.length;++t){for(var e=i[t],r=[],a=0;a<e.length;++a){var c=e[a];if(c)switch(c[0]){case 2:r.push('"'+c[1].replace(/"/g,'""')+'"');break;default:r.push(c[1])}else r.push("")}n.push(r.join(","))}return n.join(";")}var lle={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};
vendor: 3,537 bytes, line 215
215function cle(i,n){if(!i&&!(n&&n.biff<=5&&n.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(i)?"'"+i+"'":i}function R7(i,n,t){if(!i)return"SH33TJSERR0";if(t.biff>8&&(!i.XTI||!i.XTI[n]))return i.SheetNames[n];if(!i.XTI)return"SH33TJSERR6";var e=i.XTI[n];if(t.biff<8)return n>1e4&&(n-=65536),n<0&&(n=-n),n==0?"":i.XTI[n-1];if(!e)return"SH33TJSERR1";var r="";if(t.biff>8)switch(i[e[0]][0]){case 357:return r=e[1]==-1?"#REF":i.SheetNames[e[1]],e[1]==e[2]?r:r+":"+i.SheetNames[e[2]];case 358:return t.SID!=null?i.SheetNames[t.SID]:"SH33TJSSAME"+i[e[0]][0];case 355:default:return"SH33TJSSRC"+i[e[0]][0]}switch(i[e[0]][0][0]){case 1025:return r=e[1]==-1?"#REF":i.SheetNames[e[1]]||"SH33TJSERR3",e[1]==e[2]?r:r+":"+i.SheetNames[e[2]];case 14849:return i[e[0]].slice(1).map(function(a){return a.Name}).join(";;");default:return i[e[0]][0][3]?(r=e[1]==-1?"#REF":i[e[0]][0][3][e[1]]||"SH33TJSERR4",e[1]==e[2]?r:r+":"+i[e[0]][0][3][e[2]]):"SH33TJSERR2"}}function S8(i,n,t){var e=R7(i,n,t);return e=="#REF"?e:cle(e,t)}function Tf(i,n,t,e,r){var a=r&&r.biff||8,c={s:{c:0,r:0},e:{c:0,r:0}},d=[],u,h,f,v=0,C=0,y,A="";if(!i[0]||!i[0][0])return"";for(var D=-1,F="",R=0,L=i[0].length;R<L;++R){var H=i[0][R];switch(H[0]){case"PtgUminus":d.push("-"+d.pop());break;case"PtgUplus":d.push("+"+d.pop());break;case"PtgPercent":d.push(d.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(u=d.pop(),h=d.pop(),D>=0){switch(i[0][D][1][0]){case 0:F=ra(" ",i[0][D][1][1]);break;case 1:F=ra("\r",i[0][D][1][1]);break;default:if(F="",r.WTF)throw new Error("Unexpected PtgAttrSpaceType "+i[0][D][1][0])}h=h+F,D=-1}d.push(h+lle[H[0]]+u);break;case"PtgIsect":u=d.pop(),h=d.pop(),d.push(h+" "+u);break;case"PtgUnion":u=d.pop(),h=d.pop(),d.push(h+","+u);break;case"PtgRange":u=d.pop(),h=d.pop(),d.push(h+":"+u);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":f=wv(H[1][1],c,r),d.push(Tv(f,a));break;case"PtgRefN":f=t?wv(H[1][1],t,r):H[1][1],d.push(Tv(f,a));break;case"PtgRef3d":v=H[1][1],f=wv(H[1][2],c,r),A=S8(e,v,r);var se=A;d.push(A+"!"+Tv(f,a));break;case"PtgFunc":case"PtgFuncVar":var Ce=H[1][0],Ue=H[1][1];Ce||(Ce=0),Ce&=127;var re=Ce==0?[]:d.slice(-Ce);d.length-=Ce,Ue==="User"&&(Ue=re.shift()),d.push(Ue+"("+re.join(",")+")");break;case"PtgBool":d.push(H[1]?"TRUE":"FALSE");break;case"PtgInt":d.push(H[1]);break;case"PtgNum":d.push(String(H[1]));break;case"PtgStr":d.push('"'+H[1].replace(/"/g,'""')+'"');break;case"PtgErr":d.push(H[1]);break;case"PtgAreaN":y=r8(H[1][1],t?{s:t}:c,r),d.push(OD(y,r));break;case"PtgArea":y=r8(H[1][1],c,r),d.push(OD(y,r));break;case"PtgArea3d":v=H[1][1],y=H[1][2],A=S8(e,v,r),d.push(A+"!"+OD(y,r));break;case"PtgAttrSum":d.push("SUM("+d.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":C=H[1][2];var ae=(e.names||[])[C-1]||(e[0]||[])[C],ve=ae?ae.Name:"SH33TJSNAME"+String(C);ve&&ve.slice(0,6)=="_xlfn."&&!r.xlfn&&(ve=ve.slice(6)),d.push(ve);break;case"PtgNameX":var Me=H[1][1];C=H[1][2];var W;if(r.biff<=5)Me<0&&(Me=-Me),e[Me]&&(W=e[Me][C]);else{var J="";if(((e[Me]||[])[0]||[])[0]==14849||(((e[Me]||[])[0]||[])[0]==1025?e[Me][C]&&e[Me][C].itab>0&&(J=e.SheetNames[e[Me][C].itab-1]+"!"):J=e.SheetNames[C-1]+"!"),e[Me]&&e[Me][C])J+=e[Me][C].Name;else if(e[0]&&e[0][C])J+=e[0][C].Name;else{var Ee=(R7(e,Me,r)||"").split(";;");Ee[C-1]?J=Ee[C-1]:J+="SH33TJSERRX"}d.push(J);break}
215W||(W={Name:"SH33TJSERRY"}),d.push(W.Name);break;case"PtgParen":var Fe="(",$e=")";if(D>=0){switch(F="",i[0][D][1][0]){case 2:Fe=ra(" ",i[0][D][1][1])+Fe;break;case 3:Fe=ra("\r",i[0][D][1][1])+Fe;break;case 4:$e=ra(" ",i[0][D][1][1])+$e;break;case 5:$e=ra("\r",i[0][D][1][1])+$e;break;default:if(r.WTF)throw new Error("Unexpected PtgAttrSpaceType "+i[0][D][1][0])}D=-1}d.push(Fe+d.pop()+$e);break;case"PtgRefErr":d.push("#REF!");break;case"PtgRefErr3d":d.push("#REF!");break;case"PtgExp":f={c:H[1][1],r:H[1][0]};var Qe={c:t.c,r:t.r};if(e.sharedf[pr(f)]){var ot=e.sharedf[pr(f)];d.push(Tf(ot,c,Qe,e,r))}else{var et=!1;for(u=0;u!=e.arrayf.length;++u)if(h=e.arrayf[u],!(f.c<h[0].s.c||f.c>h[0].e.c)&&!(f.r<h[0].s.r||f.r>h[0].e.r)){d.push(Tf(h[1],c,Qe,e,r)),et=!0;break}et||d.push(H[1])}break;case"PtgArray":d.push("{"+sle(H[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":D=R;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":d.push("");break;case"PtgAreaErr":d.push("#REF!");break;case"PtgAreaErr3d":d.push("#REF!");break;case"PtgList":d.push("Table"+H[1].idx+"[#"+H[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(H));default:throw new Error("Unrecognized Formula Token: "+String(H))}var gt=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(r.biff!=3&&D>=0&>.indexOf(i[0][R][0])==-1){H=i[0][D];var vt=!0;switch(H[1][0]){case 4:vt=!1;case 0:F=ra(" ",H[1][1]);break;case 5:vt=!1;case 1:F=ra("\r",H[1][1]);break;default:if(F="",r.WTF)throw new Error("Unexpected PtgAttrSpaceType "+H[1][0])}d.push((vt?F:"")+d.pop()+(vt?"":F)),D=-1}}if(d.length>1&&r.WTF)throw new Error("bad formula stack");return d[0]}function dle(i){if(i==null){var n=Tt(8);return n.write_shift(1,3),n.write_shift(1,0),n.write_shift(2,0),n.write_shift(2,0),n.write_shift(2,65535),n}else if(typeof i=="number")return Q0(i);return Q0(0)}function mle(i,n,t,e,r){var a=ep(n,t,r),c=dle(i.v),d=Tt(6),u=33;d.write_shift(2,u),d.write_shift(4,0);for(var h=Tt(i.bf.length),f=0;f<i.bf.length;++f)h[f]=i.bf[f];var v=fo([a,c,d,h]);return v}function Z2(i,n,t){var e=i.read_shift(4),r=ole(i,e,t),a=i.read_shift(4),c=a>0?ale(i,a,r,t):null;return[r,c]}var ule=Z2,Q2=Z2,ple=Z2,hle=Z2,fle
vendor: 7,370 bytes, line 215
215={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},
215O7={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284
215:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},gle={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function vle(i){var n="of:="+i.replace(dI,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return n.replace(/;/g,"|").replace(/,/g,";")}function _le(i){return i.replace(/\./,"!")}var Dv=typeof Map<"u";function pI(i,n,t){var e=0,r=i.length;if(t){if(Dv?t.has(n):Object.prototype.hasOwnProperty.call(t,n)){for(var a=Dv?t.get(n):t[n];e<a.length;++e)if(i[a[e]].t===n)return i.Count++,a[e]}}else for(;e<r;++e)if(i[e].t===n)return i.Count++,e;return i[r]={t:n}
vendor: 6,955 bytes, line 215
215,i.Count++,i.Unique++,t&&(Dv?(t.has(n)||t.set(n,[]),t.get(n).push(r)):(Object.prototype.hasOwnProperty.call(t,n)||(t[n]=[]),t[n].push(r))),r}function ex(i,n){var t={min:i+1,max:i+1},e=-1;return n.MDW&&(im=n.MDW),n.width!=null?t.customWidth=1:n.wpx!=null?e=W2(n.wpx):n.wch!=null&&(e=n.wch),e>-1?(t.width=GD(e),t.customWidth=1):n.width!=null&&(t.width=n.width),n.hidden&&(t.hidden=!0),n.level!=null&&(t.outlineLevel=t.level=n.level),t}function N7(i,n){if(i){var t=[.7,.7,.75,.75,.3,.3];n=="xlml"&&(t=[1,1,1,1,.5,.5]),i.left==null&&(i.left=t[0]),i.right==null&&(i.right=t[1]),i.top==null&&(i.top=t[2]),i.bottom==null&&(i.bottom=t[3]),i.header==null&&(i.header=t[4]),i.footer==null&&(i.footer=t[5])}}function vu(i,n,t){var e=t.revssf[n.z!=null?n.z:"General"],r=60,a=i.length;if(e==null&&t.ssf){for(;r<392;++r)if(t.ssf[r]==null){N8(n.z,r),t.ssf[r]=n.z,t.revssf[n.z]=e=r;break}}for(r=0;r!=a;++r)if(i[r].numFmtId===e)return r;return i[a]={numFmtId:e,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},a}function yle(i,n,t){if(i&&i["!ref"]){var e=Lr(i["!ref"]);if(e.e.c<e.s.c||e.e.r<e.s.r)throw new Error("Bad range ("+t+"): "+i["!ref"])}}function Sle(i){if(i.length===0)return"";for(var n='<mergeCells count="'+i.length+'">',t=0;t!=i.length;++t)n+='<mergeCell ref="'+Ia(i[t])+'"/>';return n+"</mergeCells>"}function ble(i,n,t,e,r){var a=!1,c={},d=null;if(e.bookType!=="xlsx"&&n.vbaraw){var u=n.SheetNames[t];try{n.Workbook&&(u=n.Workbook.Sheets[t].CodeName||u)}catch{}a=!0,c.codeName=Qd(ur(u))}if(i&&i["!outline"]){var h={summaryBelow:1,summaryRight:1};i["!outline"].above&&(h.summaryBelow=0),i["!outline"].left&&(h.summaryRight=0),d=(d||"")+ii("outlinePr",null,h)}!a&&!d||(r[r.length]=ii("sheetPr",d,c))}var xle=["objects","scenarios","selectLockedCells","selectUnlockedCells"],Cle=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function Ele(i){var n={sheet:1};return xle.forEach(function(t){i[t]!=null&&i[t]&&(n[t]="1")}),Cle.forEach(function(t){i[t]!=null&&!i[t]&&(n[t]="0")}),i.password&&(n.password=y7(i.password).toString(16).toUpperCase()),ii("sheetProtection",null,n)}function wle(i){return N7(i),ii("pageMargins",null,i)}function Tle(i,n){for(var t=["<cols>"],e,r=0;r!=n.length;++r)(e=n[r])&&(t[t.length]=ii("col",null,ex(r,e)));return t[t.length]="</cols>",t.join("")}function Dle(i,n,t,e){var r=typeof i.ref=="string"?i.ref:Ia(i.ref);t.Workbook||(t.Workbook={Sheets:[]}),t.Workbook.Names||(t.Workbook.Names=[]);var a=t.Workbook.Names,c=dl(r);c.s.r==c.e.r&&(c.e.r=dl(n["!ref"]).e.r,r=Ia(c));for(var d=0;d<a.length;++d){var u=a[d];if(u.Name=="_xlnm._FilterDatabase"&&u.Sheet==e){u.Ref="'"+t.SheetNames[e]+"'!"+r;break}}return d==a.length&&a.push({Name:"_xlnm._FilterDatabase",Sheet:e,Ref:"'"+t.SheetNames[e]+"'!"+r}),ii("autoFilter",null,{ref:r})}function Ile(i,n,t,e){var r={workbookViewId:"0"};return(((e||{}).Workbook||{}).Views||[])[0]&&(r.rightToLeft=e.Workbook.Views[0].RTL?"1":"0"),ii("sheetViews",ii("sheetView",null,r),{})}function kle(i,n,t,e){if(i.c&&t["!comments"].push([n,i.c]),i.v===void 0&&typeof i.f!="string"||i.t==="z"&&!i.f)return"";var r="",a=i.t,c=i.v;if(i.t!=="z")switch(i.t){case"b":r=i.v?"1":"0";break;case"n":r=""+i.v;break;case"e":r=Lv[i.v];break;case"d":e&&e.cellDates?r=rs(i.v,-1).toISOString():(i=Ms(i),i.t="n",r=""+(i.v=ks(rs(i.v)))),typeof i.z>"u"&&(i.z=aa[14]);break;default:r=i.v;break}var d=go("v",ur(r)),u={r:n},h=vu(e.cellXfs,i,e);switch(h!==0&&(u.s=h),i.t){case"n":break;case"d":u.t="d";break;case"b":u.t="b";break;case"e":u.t="e";break;case"z":break;default:if(i.v==null){delete i.t;break}if(i.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(e&&e.bookSST){d=go("v",""+pI(e.Strings,i.v,e.revStrings)),u.t="s";break}u.t="str";break}if(i.t!=a&&(i.t=a,i.v=c),typeof i.f=="string"&&i.f){var f=i.F&&i.F.slice(0,n.length)==n?{t:"array",ref:i.F}:null;d=ii("f",ur(i.f),f)+(i.v!=null?d:"")}return i.l&&t["!links"].push([n,i.l]),i.D&&(u.cm=1),ii("c",d,u)}function Mle(i,n,t,e){var r=[],a=[],c=Lr(i["!ref"]),d="",u,h="",f=[],v=0,C=0,y=i["!rows"],A=Array.isArray(i),D={r:h},F,R=-1;for(C=c.s.c;C<=c.e.c;++C)f[C]=Bo(C);for(v=c.s.r;v<=c.e.r;++v){for(a=[],h=vo(v),C=c.s.c;C<=c.e.c;++C){u=f[C]+h;var L=A?(i[v]||[])[C]:i[u];L!==void 0&&(d=kle(L,u,i,n,t,e))!=null&&a.push(d)}(a.length>0||y&&y[v])&&(D={r:h},y&&y[v]&&(F=y[v],F.hidden&&(D.hidden=1),R=-1,F.hpx?R=H2(F.hpx):F.hpt&&(R=F.hpt),R>-1&&(D.ht=R,D.customHeight=1),F.level&&(D.outlineLevel=F.level)),r[r.length]=ii("row",a.join(""),D))}if(y)for(;v<y.length;++v)y&&y[v]&&(D={r:v+1},F=y[v],F.hidden&&(D.hidden=1),R=-1,F.hpx?R=H2(F.hpx):F.hpt&&(R=F.hpt),R>-1&&(D.ht=R,D.customHeight=1),F.level&&(D.outlineLevel=F.level),r[r.length]=ii("row","",D));return r.join("")}function L7(i,n,t,e){var r=[ka,ii("worksheet",null,{xmlns:Df[0],"xmlns:r":io.r})],a=t.SheetNames[i],c=0,d="",u=t.Sheets[a];u==null&&(u={});var h=u["!ref"]||"A1",f=Lr(h);if(f.e.c>16383||f.e.r>1048575){if(n.WTF)throw new Error("Range "+h+" exceeds format limit A1:XFD1048576");f.e.c=Math.min(f.e.c,16383),f.e.r=Math.min(f.e.c,1048575),h=Ia(f)}e||(e={}),u["!comments"]=[];var v=[];ble(u,t,i,n,r),r[r.length]=ii("dimension",null,{ref:h}),r[r.length]=Ile(u,n,i,t),n.sheetFormat&&(r[r.length]=ii("sheetFormatPr",null,{defaultRowHeight:n.sheetFormat.defaultRowHeight||"16",baseColWidth:n.sheetFormat.baseColWidth||"10",outlineLevelRow:n.sheetFormat.outlineLevelRow||"7"})),u["!cols"]!=null&&u["!cols"].length>0&&(r[r.length]=Tle(u,u["!cols"])),r[c=r.length]="<sheetData/>",u["!links"]=[],u["!ref"]!=null&&(d=Mle(u,n,i,t,e),d.length>0&&(r[r.length]=d)),r.length>c+1&&(r[r.length]="</sheetData>",r[c]=r[c].replace("/>",">")),u["!protect"]&&(r[r.length]=Ele(u["!protect"])),u["!autofilter"]!=null&&(r[r.length]=Dle(u["!autofilter"],u,t,i)),u["!merges"]!=null&&u["!merges"].length>0&&(r[r.length]=Sle(u["!merges"]));var C=-1,y,A=-1;return u["!links"].length>0&&(r[r.length]="<hyperlinks>",u["!links"].forEach(function(D){D[1].Target&&(y={ref:D[0]},D[1].Target.charAt(0)!="#"&&(A=mr(e,-1,ur(D[1].Target).replace(/#.*$/,""),zn.HLINK),y["r:id"]="rId"+A),(C=D[1].Target.indexOf("#"))>-1&&(y.location=ur(D[1].Target.slice(C+1))),D[1].Tooltip&&(y.tooltip=ur(D[1].Tooltip)),r[r.length]=ii("hyperlink",null,y))}),r[r.length]="</hyperlinks>"),delete u["!links"],u["!margins"]!=null&&(r[r.length]=wle(u["!margins"])),(!n||n.ignoreEC||n.ignoreEC==null)&&(r[r.length]=go("ignoredErrors",ii("ignoredError",null,{numberStoredAsText:1,sqref:h}))),v.length>0&&(A=mr(e,-1,"../drawings/drawing"+(i+1)+".xml",zn.DRAW),r[r.length]=ii("drawing",null,{"r:id":"rId"+A}),u["!drawing"]=v),u["!comments"].length>0&&(A=mr(e,-1,"../drawings/vmlDrawing"+(i+1)+".vml",zn.VML),r[r.length]=ii("legacyDrawing",null,{"r:id":"rId"+A}),u["!legacy"]=A),r.length>1&&(r[r.length]="</worksheet>",r[1]=r[1].replace("/>",">")),r.join("")}function Ale(i,n){var t={},e=i.l+n;t.r=i.read_shift(4),i.l+=4;var r=i.read_shift(2);
215i.l+=1;var a=i.read_shift(1);return i.l=e,a&7&&(t.level=a&7),a&16&&(t.hidden=!0),a&32&&(t.hpt=r/20),t}function Ple(i,n,t){var e=Tt(145),r=(t["!rows"]||[])[i]||{};e.write_shift(4,i),e.write_shift(4,0);var a=320;r.hpx?a=H2(r.hpx)*20:r.hpt&&(a=r.hpt*20),e.write_shift(2,a),e.write_shift(1,0);var c=0;r.level&&(c|=r.level),r.hidden&&(c|=16),(r.hpx||r.hpt)&&(c|=32),e.write_shift(1,c),e.write_shift(1,0);var d=0,u=e.l;e.l+=4;for(var h={r:i,c:0},f=0;f<16;++f)if(!(n.s.c>f+1<<10||n.e.c<f<<10)){for(var v=-1,C=-1,y=f<<10;y<f+1<<10;++y){h.c=y;var A=Array.isArray(t)?(t[h.r]||[])[h.c]:t[pr(h)];A&&(v<0&&(v=y),C=y)}v<0||(++d,e.write_shift(4,v),e.write_shift(4,C))}var D=e.l;return e.l=u,e.write_shift(4,d),e.l=D,e.length>e.l?e.slice(0,e.l):e}function Fle(i,n,t,e){var r=Ple(e,t,n);(r.length>17||(n["!rows"]||[])[e])&&Ut(i,0,r)}var Rle=ap,Ole=Mf;function Nle(){}function Lle(i,n){var t={},e=i[i.l];return++i.l,t.above=!(e&64),t.left=!(e&128),i.l+=18,t.name=Yre(i,n-19),t}function Ble(i,n,t){t==null&&(t=Tt(84+4*i.length));var e=192;n&&(n.above&&(e&=-65),n.left&&(e&=-129)),t.write_shift(1,e);for(var r=1;r<3;++r)t.write_shift(1,0);return V2({auto:1},t),t.write_shift(-4,-1),t.write_shift(-4,-1),Z8(i,t),t.slice(0,t.l)}function Vle(i){var n=jl(i);return[n]}function Ule(i,n,t){return t==null&&(t=Tt(8)),ip(n,t)}function jle(i){var n=np(i);return[n]}function Wle(i,n,t){return t==null&&(t=Tt(4)),rp(n,t)}function Hle(i){var n=jl(i),t=i.read_shift(1);return[n,t,"b"]}function Gle(i,n,t){return t==null&&(t=Tt(9)),ip(n,t),t.write_shift(1,i.v?1:0),t}function $le(i){var n=np(i),t=i.read_shift(1);return[n,t,"b"]}function zle(i,n,t){return t==null&&(t=Tt(5)),rp(n,t),t.write_shift(1,i.v?1:0),t}function Yle(i){var n=jl(i),t=i.read_shift(1);return[n,t,"e"]}function qle(i,n,t){return t==null&&(t=Tt(9)),ip(n,t),t.write_shift(1,i.v),t}function Kle(i){var n=np(i),t=i.read_shift(1);return[n,t,"e"]}function Xle(i,n,t){return t==null&&(t=Tt(8)),rp(n,t),t.write_shift(1,i.v),t.write_shift(2,0),t.write_shift(1,0),t}function Jle(i){var n=jl(i),t=i.read_shift(4);return[n,t,"s"]}function Zle(i,n,t){return t==null&&(t=Tt(12)),ip(n,t),t.write_shift(4,n.v),t}function Qle(i){var n=np(i),t=i.read_shift(4);return[n,t,"s"]}function ece(i,n,t){return t==null&&(t=Tt(8)),rp(n,t),t.write_shift(4,n.v),t}function tce(i){var n=jl(i),t=Af(i);return[n,t,"n"]}function ice(i,n,t){return t==null&&(t=Tt(16)),ip(n,t),Q0(i.v,t),t}function nce(i){var n=np(i),t=Af(i);return[n,t,"n"]}function rce(i,n,t){return t==null&&(t=Tt(12)),rp(n,t),Q0(i.v,t),t}function ace(i){var n=jl(i),t=Q8(i);return[n,t,"n"]}function oce(i,n,t){return t==null&&(t=Tt(12)),ip(n,t),e7(i.v,t),t}function sce(i){var n=np(i),t=Q8(i);return[n,t,"n"]}function lce(i,n,t){return t==null&&(t=Tt(8)),rp(n,t),e7(i.v,t),t}function cce(i){var n=jl(i),t=aI(i);return[n,t,"is"]}function dce(i){var n=jl(i),t=Vo(i);return[n,t,"str"]}function mce(i,n,t){return t==null&&(t=Tt(12+4*i.v.length)),ip(n,t),ro(i.v,t),t.length>t.l?t.slice(0,t.l):t}function uce(i){var n=np(i),t=Vo(i);return[n,t,"str"]}function pce(i,n,t){return t==null&&(t=Tt(8+4*i.v.length)),rp(n,t),ro(i.v,t),t.length>t.l?t.slice(0,t.l):t}function hce(i,n,t){var e=i.l+n,r=jl(i);r.r=t["!row"];var a=i.read_shift(1),c=[r,a,"b"];if(t.cellFormula){i.l+=2;var d=Q2(i,e-i.l,t);c[3]=Tf(d,null,r,t.supbooks,t)}else i.l=e;return c}function fce(i,n,t){var e=i.l+n,r=jl(i);r.r=t["!row"];var a=i.read_shift(1),c=[r,a,"e"];if(t.cellFormula){i.l+=2;var d=Q2(i,e-i.l,t);c[3]=Tf(d,null,r,t.supbooks,t)}else i.l=e;return c}function gce(i,n,t){var e=i.l+n,r=jl(i);r.r=t["!row"];var a=Af(i),c=[r,a,"n"];if(t.cellFormula){i.l+=2;var d=Q2(i,e-i.l,t);c[3]=Tf(d,null,r,t.supbooks,t)}else i.l=e;return c}function vce(i,n,t){var e=i.l+n,r=jl(i);r.r=t["!row"];var a=Vo(i),c=[r,a,"str"];if(t.cellFormula){i.l+=2;var d=Q2(i,e-i.l,t);c[3]=Tf(d,null,r,t.supbooks,t)}else i.l=e;return c}var _ce=ap,yce=Mf;function Sce(i,n){return n==null&&(n=Tt(4)),n.write_shift(4,i),n}function bce(i,n){var t=i.l+n,e=ap(i,16),r=oI(i),a=Vo(i),c=Vo(i),d=Vo(i);i.l=t;var u={rfx:e,relId:r,loc:a,display:d};return c&&(u.Tooltip=c),u}function xce(i,n){var t=Tt(50+4*(i[1].Target.length+(i[1].Tooltip||"").length));Mf({s:no(i[0]),e:no(i[0])},t),sI("rId"+n,t);var e=i[1].Target.indexOf("#"),r=e==-1?"":i[1].Target.slice(e+1);return ro(r||"",t),ro(i[1].Tooltip||"",t),ro("",t),t.slice(0,t.l)}function Cce(){}function Ece(i,n,t){var e=i.l+n,r=t7(i,16),a=i.read_shift(1),c=[r];if(c[2]=a,t.cellFormula){var d=ule(i,e-i.l,t);c[1]=d}else i.l=e;return c}function wce(i,n,t){var e=i.l+n,r=ap(i,16),a=[r];if(t.cellFormula){var c=hle(i,e-i.l,t);a[1]=c,i.l=e}else i.l=e;return a}function Tce(i,n,t){t==null&&(t=Tt(18));var e=ex(i,n);t.write_shift(-4,i),t.write_shift(-4,i),t.write_shift(4,(e.width||10)*256),t.write_shift(4,0);var r=0;return n.hidden&&(r|=1),typeof e.width=="number"&&(r|=2),n.level&&(r|=n.level<<8),t.write_shift(2,r),t}var B7=["left","right","top","bottom","header","footer"];function Dce(i){var n={};
215return B7.forEach(function(t){n[t]=Af(i,8)}),n}function Ice(i,n){return n==null&&(n=Tt(6*8)),N7(i),B7.forEach(function(t){Q0(i[t],n)}),n}function kce(i){var n=i.read_shift(2);return i.l+=28,{RTL:n&32}}function Mce(i,n,t){t==null&&(t=Tt(30));var e=924;return(((n||{}).Views||[])[0]||{}).RTL&&(e|=32),t.write_shift(2,e),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,100),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(4,0),t}function Ace(i){var n=Tt(24);return n.write_shift(4,4),n.write_shift(4,1),Mf(i,n),n}function Pce(i,n){return n==null&&(n=Tt(16*4+2)),n.write_shift(2,i.password?y7(i.password):0),n.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(t){t[1]?n.write_shift(4,i[t[0]]!=null&&!i[t[0]]?1:0):n.write_shift(4,i[t[0]]!=null&&i[t[0]]?0:1)}),n}function Fce(){}function Rce(){}function Oce(i,n,t,e,r,a,c){if(n.v===void 0)return!1;var d="";switch(n.t){case"b":d=n.v?"1":"0";break;case"d":n=Ms(n),n.z=n.z||aa[14],n.v=ks(rs(n.v)),n.t="n";break;case"n":case"e":d=""+n.v;break;default:d=n.v;break}var u={r:t,c:e};switch(u.s=vu(r.cellXfs,n,r),n.l&&a["!links"].push([pr(u),n.l]),n.c&&a["!comments"].push([pr(u),n.c]),n.t){case"s":case"str":return r.bookSST?(d=pI(r.Strings,n.v,r.revStrings),u.t="s",u.v=d,c?Ut(i,18,ece(n,u)):Ut(i,7,Zle(n,u))):(u.t="str",c?Ut(i,17,pce(n,u)):Ut(i,6,mce(n,u))),!0;case"n":return n.v==(n.v|0)&&n.v>-1e3&&n.v<1e3?c?Ut(i,13,lce(n,u)):Ut(i,2,oce(n,u)):c?Ut(i,16,rce(n,u)):Ut(i,5,ice(n,u)),!0;case"b":return u.t="b",c?Ut(i,15,zle(n,u)):Ut(i,4,Gle(n,u)),!0;case"e":return u.t="e",c?Ut(i,14,Xle(n,u)):Ut(i,3,qle(n,u)),!0}return c?Ut(i,12,Wle(n,u)):Ut(i,1,Ule(n,u)),!0}function Nce(i,n,t,e){var r=Lr(n["!ref"]||"A1"),a,c="",d=[];Ut(i,145);var u=Array.isArray(n),h=r.e.r;n["!rows"]&&(h=Math.max(r.e.r,n["!rows"].length-1));for(var f=r.s.r;f<=h;++f){c=vo(f),Fle(i,n,r,f);var v=!1;if(f<=r.e.r)for(var C=r.s.c;C<=r.e.c;++C){f===r.s.r&&(d[C]=Bo(C)),a=d[C]+c;var y=u?(n[f]||[])[C]:n[a];if(!y){v=!1;continue}v=Oce(i,y,f,C,e,n,v)}}Ut(i,146)}function Lce(i,n){!n||!n["!merges"]||(Ut(i,177,Sce(n["!merges"].length)),n["!merges"].forEach(function(t){Ut(i,176,yce(t))}),Ut(i,178))}function Bce(i,n){!n||!n["!cols"]||(Ut(i,390),n["!cols"].forEach(function(t,e){t&&Ut(i,60,Tce(e,t))}),Ut(i,391))}function Vce(i,n){!n||!n["!ref"]||(Ut(i,648),Ut(i,649,Ace(Lr(n["!ref"]))),Ut(i,650))}function Uce(i,n,t){n["!links"].forEach(function(e){if(e[1].Target){var r=mr(t,-1,e[1].Target.replace(/#.*$/,""),zn.HLINK);Ut(i,494,xce(e,r))}}),delete n["!links"]}function jce(i,n,t,e){if(n["!comments"].length>0){var r=mr(e,-1,"../drawings/vmlDrawing"+(t+1)+".vml",zn.VML);Ut(i,551,sI("rId"+r)),n["!legacy"]=r}}function Wce(i,n,t,e){if(n["!autofilter"]){var r=n["!autofilter"],a=typeof r.ref=="string"?r.ref:Ia(r.ref);t.Workbook||(t.Workbook={Sheets:[]}),t.Workbook.Names||(t.Workbook.Names=[]);var c=t.Workbook.Names,d=dl(a);d.s.r==d.e.r&&(d.e.r=dl(n["!ref"]).e.r,a=Ia(d));for(var u=0;u<c.length;++u){var h=c[u];if(h.Name=="_xlnm._FilterDatabase"&&h.Sheet==e){h.Ref="'"+t.SheetNames[e]+"'!"+a;break}}u==c.length&&c.push({Name:"_xlnm._FilterDatabase",Sheet:e,Ref:"'"+t.SheetNames[e]+"'!"+a}),Ut(i,161,Mf(Lr(a))),Ut(i,162)}}function Hce(i,n,t){Ut(i,133),Ut(i,137,Mce(n,t)),Ut(i,138),Ut(i,134)}function Gce(i,n){n["!protect"]&&Ut(i,535,Pce(n["!protect"]))}function $ce(i,n,t,e){var r=Is(),a=t.SheetNames[i],c=t.Sheets[a]||{},d=a;try{t&&t.Workbook&&(d=t.Workbook.Sheets[i].CodeName||d)}catch{}var u=Lr(c["!ref"]||"A1");if(u.e.c>16383||u.e.r>1048575){if(n.WTF)throw new Error("Range "+(c["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");u.e.c=Math.min(u.e.c,16383),u.e.r=Math.min(u.e.c,1048575)}return c["!links"]=[],c["!comments"]=[],Ut(r,129),(t.vbaraw||c["!outline"])&&Ut(r,147,Ble(d,c["!outline"])),Ut(r,148,Ole(u)),Hce(r,c,t.Workbook),Bce(r,c,i,n,t),Nce(r,c,i,n,t),Gce(r,c),Wce(r,c,t,i),Lce(r,c),Uce(r,c,e),c["!margins"]&&Ut(r,476,Ice(c["!margins"])),(!n||n.ignoreEC||n.ignoreEC==null)&&Vce(r,c),jce(r,c,i,e),Ut(r,130),r.end()}function zce(i,n){i.l+=10;var t=Vo(i,n-10);return{name:t}}var Yce=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorder
215UnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function qce(i){return!i.Workbook||!i.Workbook.WBProps?"false":Ere(i.Workbook.WBProps.date1904)?"true":"false"}var Kce="][*?/\\".split("");function V7(i,n){if(i.length>31){if(n)return!1;throw new Error("Sheet names cannot exceed 31 chars")}var t=!0;return Kce.forEach(function(e){if(i.indexOf(e)!=-1){if(!n)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");t=!1}}),t}function Xce(i,n,t){i.forEach(function(e,r){V7(e);for(var a=0;a<r;++a)if(e==i[a])throw new Error("Duplicate Sheet Name: "+e);if(t){var c=n&&n[r]&&n[r].CodeName||e;if(c.charCodeAt(0)==95&&c.length>22)throw new Error("Bad Code Name: Worksheet"+c)}})}function Jce(i){if(!i||!i.SheetNames||!i.Sheets)throw new Error("Invalid Workbook");if(!i.SheetNames.length)throw new Error("Workbook is empty");var n=i.Workbook&&i.Workbook.Sheets||[];Xce(i.SheetNames,n,!!i.vbaraw);for(var t=0;t<i.SheetNames.length;++t)yle(i.Sheets[i.SheetNames[t]],i.SheetNames[t],t)}function U7(i){var n=[ka];n[n.length]=ii("workbook",null,{xmlns:Df[0],"xmlns:r":io.r});var t=i.Workbook&&(i.Workbook.Names||[]).length>0,e={codeName:"ThisWorkbook"};i.Workbook&&i.Workbook.WBProps&&(Yce.forEach(function(d){i.Workbook.WBProps[d[0]]!=null&&i.Workbook.WBProps[d[0]]!=d[1]&&(e[d[0]]=i.Workbook.WBProps[d[0]])}),i.Workbook.WBProps.CodeName&&(e.codeName=i.Workbook.WBProps.CodeName,delete e.CodeName)),n[n.length]=ii("workbookPr",null,e);var r=i.Workbook&&i.Workbook.Sheets||[],a=0;if(r&&r[0]&&r[0].Hidden){for(n[n.length]="<bookViews>",a=0;a!=i.SheetNames.length&&!(!r[a]||!r[a].Hidden);++a);a==i.SheetNames.length&&(a=0),n[n.length]='<workbookView firstSheet="'+a+'" activeTab="'+a+'"/>',n[n.length]="</bookViews>"}for(n[n.length]="<sheets>",a=0;a!=i.SheetNames.length;++a){var c={name:ur(i.SheetNames[a].slice(0,31))};if(c.sheetId=""+(a+1),c["r:id"]="rId"+(a+1),r[a])switch(r[a].Hidden){case 1:c.state="hidden";break;case 2:c.state="veryHidden";break}n[n.length]=ii("sheet",null,c)}return n[n.length]="</sheets>",t&&(n[n.length]="<definedNames>",i.Workbook&&i.Workbook.Names&&i.Workbook.Names.forEach(function(d){var u={name:d.Name};d.Comment&&(u.comment=d.Comment),d.Sheet!=null&&(u.localSheetId=""+d.Sheet),d.Hidden&&(u.hidden="1"),d.Ref&&(n[n.length]=ii("definedName",ur(d.Ref),u))}),n[n.length]="</definedNames>"),n.length>2&&(n[n.length]="</workbook>",n[1]=n[1].replace("/>",">")),n.join("")}function Zce(i,n){var t={};return t.Hidden=i.read_shift(4),t.iTabID=i.read_shift(4),t.strRelID=HD(i,n-8),t.name=Vo(i),t}function Qce(i,n){return n||(n=Tt(127)),n.write_shift(4,i.Hidden),n.write_shift(4,i.iTabID),sI(i.strRelID,n),ro(i.name.slice(0,31),n),n.length>n.l?n.slice(0,n.l):n}function ede(i,n){var t={},e=i.read_shift(4);t.defaultThemeVersion=i.read_shift(4);var r=n>8?Vo(i):"";return r.length>0&&(t.CodeName=r),t.autoCompressPictures=!!(e&65536),t.backupFile=!!(e&64),t.checkCompatibility=!!(e&4096),t.date1904=!!(e&1),t.filterPrivacy=!!(e&8),t.hidePivotFieldList=!!(e&1024),t.promptedSolutions=!!(e&16),t.publishItems=!!(e&2048),t.refreshAllConnections=!!(e&262144),t.saveExternalLinkValues=!!(e&128),t.showBorderUnselectedTables=!!(e&4),t.showInkAnnotation=!!(e&32),t.showObjects=["all","placeholders","none"][e>>13&3],t.showPivotChartFilter=!!(e&32768),t.updateLinks=["userSet","never","always"][e>>8&3],t}function tde(i,n){n||(n=Tt(72));var t=0;return i&&i.filterPrivacy&&(t|=8),n.write_shift(4,t),n.write_shift(4,0),Z8(i&&i.CodeName||"ThisWorkbook",n),n.slice(0,n.l)}function ide(i,n,t){var e=i.l+n;i.l+=4,i.l+=1;var r=i.read_shift(4),a=qre(i),c=ple(i,0,t),d=oI(i);i.l=e;var u={Name:a,Ptg:c};return r<268435455&&(u.Sheet=r),d&&(u.Comment=d),u}function nde(i,n){Ut(i,143);for(var t=0;t!=n.SheetNames.length;++t){var e=n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[t]&&n.Workbook.Sheets[t].Hidden||0,r={Hidden:e,iTabID:t+1,strRelID:"rId"+(t+1),name:n.SheetNames[t]};Ut(i,156,Qce(r))}Ut(i,144)}function rde(i,n){n||(n=Tt(127));for(var t=0;t!=4;++t)n.write_shift(4,0);return ro("SheetJS",n),ro(Iv.version,n),ro(Iv.version,n),ro("7262",n),n.length>n.l?n.slice(0,n.l):n}function ade(i,n){n||(n=Tt(29)),n.write_shift(-4,0),n.write_shift(-4,460),n.write_shift(4,28800),n.write_shift(4,17600),n.write_shift(4,500),n.write_shift(4,i),n.write_shift(4,i);var t=120;return n.write_shift(1,t),n.length>n.l?n.slice(0,n.l):n}
215function ode(i,n){if(!(!n.Workbook||!n.Workbook.Sheets)){for(var t=n.Workbook.Sheets,e=0,r=-1,a=-1;e<t.length;++e)!t[e]||!t[e].Hidden&&r==-1?r=e:t[e].Hidden==1&&a==-1&&(a=e);a>r||(Ut(i,135),Ut(i,158,ade(r)),Ut(i,136))}}function sde(i,n){var t=Is();return Ut(t,131),Ut(t,128,rde()),Ut(t,153,tde(i.Workbook&&i.Workbook.WBProps||null)),ode(t,i,n),nde(t,i,n),Ut(t,132),t.end()}function lde(i,n,t){return(n.slice(-4)===".bin"?sde:U7)(i,t)}function cde(i,n,t,e,r){return(n.slice(-4)===".bin"?$ce:L7)(i,t,e,r)}function dde(i,n,t){return(n.slice(-4)===".bin"?Ioe:x7)(i,t)}function mde(i,n,t){return(n.slice(-4)===".bin"?toe:_7)(i,t)}function ude(i,n,t){return(n.slice(-4)===".bin"?Goe:D7)(i,t)}function pde(i){return(i.slice(-4)===".bin"?Noe:w7)()}function hde(i,n){var t=[];return i.Props&&t.push(dae(i.Props,n)),i.Custprops&&t.push(mae(i.Props,i.Custprops,n)),t.join("")}function fde(){return""}function gde(i,n){var t=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return n.cellXfs.forEach(function(e,r){var a=[];a.push(ii("NumberFormat",null,{"ss:Format":ur(aa[e.numFmtId])}));var c={"ss:ID":"s"+(21+r)};t.push(ii("Style",a.join(""),c))}),ii("Styles",t.join(""))}function j7(i){return ii("NamedRange",null,{"ss:Name":i.Name,"ss:RefersTo":"="+mI(i.Ref,{r:0,c:0})})}function vde(i){if(!((i||{}).Workbook||{}).Names)return"";for(var n=i.Workbook.Names,t=[],e=0;e<n.length;++e){var r=n[e];r.Sheet==null&&(r.Name.match(/^_xlfn\./)||t.push(j7(r)))}return ii("Names",t.join(""))}function _de(i,n,t,e){if(!i||!((e||{}).Workbook||{}).Names)return"";for(var r=e.Workbook.Names,a=[],c=0;c<r.length;++c){var d=r[c];d.Sheet==t&&(d.Name.match(/^_xlfn\./)||a.push(j7(d)))}return a.join("")}function yde(i,n,t,e){if(!i)return"";var r=[];if(i["!margins"]&&(r.push("<PageSetup>"),i["!margins"].header&&r.push(ii("Header",null,{"x:Margin":i["!margins"].header})),i["!margins"].footer&&r.push(ii("Footer",null,{"x:Margin":i["!margins"].footer})),r.push(ii("PageMargins",null,{"x:Bottom":i["!margins"].bottom||"0.75","x:Left":i["!margins"].left||"0.7","x:Right":i["!margins"].right||"0.7","x:Top":i["!margins"].top||"0.75"})),r.push("</PageSetup>")),e&&e.Workbook&&e.Workbook.Sheets&&e.Workbook.Sheets[t])if(e.Workbook.Sheets[t].Hidden)r.push(ii("Visible",e.Workbook.Sheets[t].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var a=0;a<t&&!(e.Workbook.Sheets[a]&&!e.Workbook.Sheets[a].Hidden);++a);a==t&&r.push("<Selected/>")}return((((e||{}).Workbook||{}).Views||[])[0]||{}).RTL&&r.push("<DisplayRightToLeft/>"),i["!protect"]&&(r.push(go("ProtectContents","True")),i["!protect"].objects&&r.push(go("ProtectObjects","True")),i["!protect"].scenarios&&r.push(go("ProtectScenarios","True")),i["!protect"].selectLockedCells!=null&&!i["!protect"].selectLockedCells?r.push(go("EnableSelection","NoSelection")):i["!protect"].selectUnlockedCells!=null&&!i["!protect"].selectUnlockedCells&&r.push(go("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(c){i["!protect"][c[0]]&&r.push("<"+c[1]+"/>")})),r.length==0?"":ii("WorksheetOptions",r.join(""),{xmlns:cl.x})}function Sde(i){return i.map(function(n){var t=Cre(n.t||""),e=ii("ss:Data",t,{xmlns:"http://www.w3.org/TR/REC-html40"});return ii("Comment",e,{"ss:Author":n.a})}).join("")}function bde(i,n,t,e,r,a,c){if(!i||i.v==null&&i.f==null)return"";var d={};if(i.f&&(d["ss:Formula"]="="+ur(mI(i.f,c))),i.F&&i.F.slice(0,n.length)==n){var u=no(i.F.slice(n.length+1));d["ss:ArrayRange"]="RC:R"+(u.r==c.r?"":"["+(u.r-c.r)+"]")+"C"+(u.c==c.c?"":"["+(u.c-c.c)+"]")}if(i.l&&i.l.Target&&(d["ss:HRef"]=ur(i.l.Target),i.l.Tooltip&&(d["x:HRefScreenTip"]=ur(i.l.Tooltip))),t["!merges"])for(var h=t["!merges"],f=0;f!=h.length;++f)h[f].s.c!=c.c||h[f].s.r!=c.r||(h[f].e.c>h[f].s.c&&(d["ss:MergeAcross"]=h[f].e.c-h[f].s.c),h[f].e.r>h[f].s.r&&(d["ss:MergeDown"]=h[f].e.r-h[f].s.r));var v="",C="";switch(i.t){case"z":if(!e.sheetStubs)return"";break;case"n":v="Number",C=String(i.v);break;case"b":v="Boolean",C=i.v?"1":"0";break;case"e":v="Error",C=Lv[i.v];break;case"d":v="DateTime",C=new Date(i.v).toISOString(),i.z==null&&(i.z=i.z||aa[14]);break;case"s":v="String",C=xre(i.v||"");break}var y=vu(e.cellXfs,i,e);d["ss:StyleID"]="s"+(21+y),d["ss:Index"]=c.c+1;var A=i.v!=null?C:"",D=i.t=="z"?"":'<Data ss:Type="'+v+'">'+A+"</Data>";return(i.c||[]).length>0&&(D+=Sde(i.c)),ii("Cell",D,d)}function xde(i,n){var t='<Row ss:Index="'+(i+1)+'"';return n&&(n.hpt&&!n.hpx&&(n.hpx=b7(n.hpt)),n.hpx&&(t+=' ss:AutoFitHeight="0" ss:Height="'+n.hpx+'"'),n.hidden&&(t+=' ss:Hidden="1"')),t+">"}function Cde(i,n,t,e){if(!i["!ref"])return"";var r=Lr(i["!ref"]),a=i["!merges"]||[],c=0,d=[];i["!cols"]&&i["!cols"].forEach(function(F,R){cI(F);var L=!!F.width,H=ex(R,F),se={"ss:Index":R+1};L&&(se["ss:Width"]=j2(H.width)),F.hidden&&(se["ss:Hidden"]="1"),d.push(ii("Column",null,se))});for(var u=Array.isArray(i),h=r.s.r;h<=r.e.r;++h){for(var f=[xde(h,(i["!rows"]||[])[h])],v=r.s.c;v<=r.e.c;
vendor: 5,039 bytes, line 215
215++v){var C=!1;for(c=0;c!=a.length;++c)if(!(a[c].s.c>v)&&!(a[c].s.r>h)&&!(a[c].e.c<v)&&!(a[c].e.r<h)){(a[c].s.c!=v||a[c].s.r!=h)&&(C=!0);break}if(!C){var y={r:h,c:v},A=pr(y),D=u?(i[h]||[])[v]:i[A];f.push(bde(D,A,i,n,t,e,y))}}f.push("</Row>"),f.length>2&&d.push(f.join(""))}return d.join("")}function Ede(i,n,t){var e=[],r=t.SheetNames[i],a=t.Sheets[r],c=a?_de(a,n,i,t):"";return c.length>0&&e.push("<Names>"+c+"</Names>"),c=a?Cde(a,n,i,t):"",c.length>0&&e.push("<Table>"+c+"</Table>"),e.push(yde(a,n,i,t)),e.join("")}function wde(i,n){n||(n={}),i.SSF||(i.SSF=Ms(aa)),i.SSF&&(q2(),Y2(i.SSF),n.revssf=K2(i.SSF),n.revssf[i.SSF[65535]]=0,n.ssf=i.SSF,n.cellXfs=[],vu(n.cellXfs,{},{revssf:{General:0}}));var t=[];t.push(hde(i,n)),t.push(fde(i,n)),t.push(""),t.push("");for(var e=0;e<i.SheetNames.length;++e)t.push(ii("Worksheet",Ede(e,n,i),{"ss:Name":ur(i.SheetNames[e])}));return t[2]=gde(i,n),t[3]=vde(i,n),ka+ii("Workbook",t.join(""),{xmlns:cl.ss,"xmlns:o":cl.o,"xmlns:x":cl.x,"xmlns:ss":cl.ss,"xmlns:dt":cl.dt,"xmlns:html":cl.html})}var BD={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function Tde(i,n){var t=[],e=[],r=[],a=0,c,d=YN(o8,"n"),u=YN(s8,"n");if(i.Props)for(c=_o(i.Props),a=0;a<c.length;++a)(Object.prototype.hasOwnProperty.call(d,c[a])?t:Object.prototype.hasOwnProperty.call(u,c[a])?e:r).push([c[a],i.Props[c[a]]]);if(i.Custprops)for(c=_o(i.Custprops),a=0;a<c.length;++a)Object.prototype.hasOwnProperty.call(i.Props||{},c[a])||(Object.prototype.hasOwnProperty.call(d,c[a])?t:Object.prototype.hasOwnProperty.call(u,c[a])?e:r).push([c[a],i.Custprops[c[a]]]);var h=[];for(a=0;a<r.length;++a)m7.indexOf(r[a][0])>-1||l7.indexOf(r[a][0])>-1||r[a][1]!=null&&h.push(r[a]);e.length&&xr.utils.cfb_add(n,"/�SummaryInformation",u8(e,BD.SI,u,s8)),(t.length||h.length)&&xr.utils.cfb_add(n,"/�DocumentSummaryInformation",u8(t,BD.DSI,d,o8,h.length?h:null,BD.UDI))}function Dde(i,n){var t=n||{},e=xr.utils.cfb_new({root:"R"}),r="/Workbook";switch(t.bookType||"xls"){case"xls":t.bookType="biff8";case"xla":t.bookType||(t.bookType="xla");case"biff8":r="/Workbook",t.biff=8;break;case"biff5":r="/Book",t.biff=5;break;default:throw new Error("invalid type "+t.bookType+" for XLS CFB")}return xr.utils.cfb_add(e,r,W7(i,t)),t.biff==8&&(i.Props||i.Custprops)&&Tde(i,e),t.biff==8&&i.vbaraw&&$oe(e,xr.read(i.vbaraw,{type:typeof i.vbaraw=="string"?"binary":"buffer"})),e}var Ide={0:{f:Ale},1:{f:Vle},2:{f:ace},3:{f:Yle},4:{f:Hle},5:{f:tce},6:{f:dce},7:{f:Jle},8:{f:vce},9:{f:gce},10:{f:hce},11:{f:fce},12:{f:jle},13:{f:sce},14:{f:Kle},15:{f:$le},16:{f:nce},17:{f:uce},18:{f:Qle},19:{f:aI},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:ide},40:{},42:{},43:{f:doe},44:{f:loe},45:{f:poe},46:{f:foe},47:{f:hoe},48:{},49:{f:jre},50:{},51:{f:Aoe},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:Wae},62:{f:cce},63:{f:Loe},64:{f:Fce},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:ld,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:kce},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:Lle},148:{f:Rle,p:16},151:{f:Cce},152:{},153:{f:ede},154:{},155:{},156:{f:Zce},157:{},158:{},159:{T:1,f:Zae},160:{T:-1},161:{T:1,f:ap},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:_ce},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1}
vendor: 6,492 bytes, line 215
215,322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:koe},336:{T:-1},337:{f:Roe,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:HD},357:{},358:{},359:{},360:{T:1},361:{},362:{f:Nae},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Ece},427:{f:wce},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Dce},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:Nle},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:bce},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:HD},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:Woe},633:{T:1},634:{T:-1},635:{T:1,f:Uoe},636:{T:-1},637:{f:$re},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:zce},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:Rce},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function si(i,n,t,e){var r=n;if(!isNaN(r)){var a=e||(t||[]).length||0,c=i.next(4);c.write_shift(2,r),c.write_shift(2,a),a>0&&iI(t)&&i.push(t)}}function kde(i,n,t,e){var r=e||(t||[]).length||0;if(r<=8224)return si(i,n,t,r);var a=n;if(!isNaN(a)){for(var c=t.parts||[],d=0,u=0,h=0;h+(c[d]||8224)<=8224;)h+=c[d]||8224,d++;var f=i.next(4);for(f.write_shift(2,a),f.write_shift(2,h),i.push(t.slice(u,u+h)),u+=h;u<r;){for(f=i.next(4),f.write_shift(2,60),h=0;h+(c[d]||8224)<=8224;)h+=c[d]||8224,d++;f.write_shift(2,h),i.push(t.slice(u,u+h)),u+=h}}}
215function Vv(i,n,t){return i||(i=Tt(7)),i.write_shift(2,n),i.write_shift(2,t),i.write_shift(2,0),i.write_shift(1,0),i}function Mde(i,n,t,e){var r=Tt(9);return Vv(r,i,n),p7(t,e||"b",r),r}function Ade(i,n,t){var e=Tt(8+2*t.length);return Vv(e,i,n),e.write_shift(1,t.length),e.write_shift(t.length,t,"sbcs"),e.l<e.length?e.slice(0,e.l):e}function Pde(i,n,t,e){if(n.v!=null)switch(n.t){case"d":case"n":var r=n.t=="d"?ks(rs(n.v)):n.v;r==(r|0)&&r>=0&&r<65536?si(i,2,zae(t,e,r)):si(i,3,$ae(t,e,r));return;case"b":case"e":si(i,5,Mde(t,e,n.v,n.t));return;case"s":case"str":si(i,4,Ade(t,e,(n.v||"").slice(0,255)));return}si(i,1,Vv(null,t,e))}function Fde(i,n,t,e){var r=Array.isArray(n),a=Lr(n["!ref"]||"A1"),c,d="",u=[];if(a.e.c>255||a.e.r>16383){if(e.WTF)throw new Error("Range "+(n["!ref"]||"A1")+" exceeds format limit A1:IV16384");a.e.c=Math.min(a.e.c,255),a.e.r=Math.min(a.e.c,16383),c=Ia(a)}for(var h=a.s.r;h<=a.e.r;++h){d=vo(h);for(var f=a.s.c;f<=a.e.c;++f){h===a.s.r&&(u[f]=Bo(f)),c=u[f]+d;var v=r?(n[h]||[])[f]:n[c];v&&Pde(i,v,h,f,e)}}}function Rde(i,n){var t=n||{};sd!=null&&t.dense==null&&(t.dense=sd);for(var e=Is(),r=0,a=0;a<i.SheetNames.length;++a)i.SheetNames[a]==t.sheet&&(r=a);if(r==0&&t.sheet&&i.SheetNames[0]!=t.sheet)throw new Error("Sheet not found: "+t.sheet);return si(e,t.biff==4?1033:t.biff==3?521:9,lI(i,16,t)),Fde(e,i.Sheets[i.SheetNames[r]],r,t,i),si(e,10),e.end()}function Ode(i,n,t){si(i,49,Iae({sz:12,color:{theme:1},name:"Arial",family:2,scheme:"minor"},t))}function Nde(i,n,t){n&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(e){for(var r=e[0];r<=e[1];++r)n[r]!=null&&si(i,1054,Aae(r,n[r],t))})}function Lde(i,n){var t=Tt(19);t.write_shift(4,2151),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(2,3),t.write_shift(1,1),t.write_shift(4,0),si(i,2151,t),t=Tt(39),t.write_shift(4,2152),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(2,3),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(2,1),t.write_shift(4,4),t.write_shift(2,0),g7(Lr(n["!ref"]||"A1"),t),t.write_shift(4,4),si(i,2152,t)}function Bde(i,n){for(var t=0;t<16;++t)si(i,224,h8({numFmtId:0,style:!0},0,n));n.cellXfs.forEach(function(e){si(i,224,h8(e,0,n))})}function Vde(i,n){for(var t=0;t<n["!links"].length;++t){var e=n["!links"][t];si(i,440,Vae(e)),e[1].Tooltip&&si(i,2048,Uae(e))}delete n["!links"]}function Ude(i,n){if(n){var t=0;n.forEach(function(e,r){++t<=256&&e&&si(i,125,Hae(ex(r,e),r))})}}function jde(i,n,t,e,r){var a=16+vu(r.cellXfs,n,r);if(n.v==null&&!n.bf){si(i,513,ep(t,e,a));return}if(n.bf)si(i,6,mle(n,t,e,r,a));else switch(n.t){case"d":case"n":var c=n.t=="d"?ks(rs(n.v)):n.v;si(i,515,Oae(t,e,c,a,r));break;case"b":case"e":si(i,517,Rae(t,e,n.v,a,r,n.t));break;case"s":case"str":if(r.bookSST){var d=pI(r.Strings,n.v,r.revStrings);si(i,253,kae(t,e,d,a,r))}else si(i,516,Mae(t,e,(n.v||"").slice(0,255),a,r));break;default:si(i,513,ep(t,e,a))}}function Wde(i,n,t){var e=Is(),r=t.SheetNames[i],a=t.Sheets[r]||{},c=(t||{}).Workbook||{},d=(c.Sheets||[])[i]||{},u=Array.isArray(a),h=n.biff==8,f,v="",C=[],y=Lr(a["!ref"]||"A1"),A=h?65536:16384;if(y.e.c>255||y.e.r>=A){if(n.WTF)throw new Error("Range "+(a["!ref"]||"A1")+" exceeds format limit A1:IV16384");y.e.c=Math.min(y.e.c,255),y.e.r=Math.min(y.e.c,A-1)}si(e,2057,lI(t,16,n)),si(e,13,Ul(1)),si(e,12,Ul(100)),si(e,15,ns(!0)),si(e,17,ns(!1)),si(e,16,Q0(.001)),si(e,95,ns(!0)),si(e,42,ns(!1)),si(e,43,ns(!1)),si(e,130,Ul(1)),si(e,128,Fae([0,0])),si(e,131,ns(!1)),si(e,132,ns(!1)),h&&Ude(e,a["!cols"]),si(e,512,Pae(y,n)),h&&(a["!links"]=[]);for(var D=y.s.r;D<=y.e.r;++D){v=vo(D);for(var F=y.s.c;F<=y.e.c;++F){D===y.s.r&&(C[F]=Bo(F)),f=C[F]+v;var R=u?(a[D]||[])[F]:a[f];R&&(jde(e,R,D,F,n),h&&R.l&&a["!links"].push([f,R.l]))}}var L=d.CodeName||d.name||r;return h&&si(e,574,Dae((c.Views||[])[0])),h&&(a["!merges"]||[]).length&&si(e,229,Bae(a["!merges"])),h&&Vde(e,a),si(e,442,f7(L,n)),h&&Lde(e,a),si(e,10),e.end()}function Hde(i,n,t){var e=Is(),r=(i||{}).Workbook||{},a=r.Sheets||[],c=r.WBProps||{},d=t.biff==8,u=t.biff==5;if(si(e,2057,lI(i,5,t)),t.bookType=="xla"&&si(e,135),si(e,225,d?Ul(1200):null),si(e,193,hae(2)),u&&si(e,191),u&&si(e,192),si(e,226),si(e,92,Cae("SheetJS",t)),si(e,66,Ul(d?1200:1252)),d&&si(e,353,Ul(0)),d&&si(e,448),si(e,317,Gae(i.SheetNames.length)),d&&i.vbaraw&&si(e,211),d&&i.vbaraw){var h=c.CodeName||"ThisWorkbook";si(e,442,f7(h,t))}si(e,156,Ul(17)),si(e,25,ns(!1)),si(e,18,ns(!1)),si(e,19,Ul(0)),d&&si(e,431,ns(!1)),d&&si(e,444,Ul(0)),si(e,61,Tae(t)),si(e,64,ns(!1)),si(e,141,Ul(0)),si(e,34,ns(qce(i)=="true")),si(e,14,ns(!0)),d&&si(e,439,ns(!1)),si(e,218,Ul(0)),Ode(e,i,t),Nde(e,i.SSF,t),Bde(e,t),d&&si(e,352,ns(!1));var f=e.end(),v=Is();d&&si(v,140,jae()),d&&t.Strings&&kde(v,252,wae(t.Strings,t)),si(v,10);
215var C=v.end(),y=Is(),A=0,D=0;for(D=0;D<i.SheetNames.length;++D)A+=(d?12:11)+(d?2:1)*i.SheetNames[D].length;var F=f.length+A+C.length;for(D=0;D<i.SheetNames.length;++D){var R=a[D]||{};si(y,133,Eae({pos:F,hs:R.Hidden||0,dt:0,name:i.SheetNames[D]},t)),F+=n[D].length}var L=y.end();if(A!=L.length)throw new Error("BS8 "+A+" != "+L.length);var H=[];return f.length&&H.push(f),L.length&&H.push(L),C.length&&H.push(C),fo(H)}function Gde(i,n){var t=n||{},e=[];i&&!i.SSF&&(i.SSF=Ms(aa)),i&&i.SSF&&(q2(),Y2(i.SSF),t.revssf=K2(i.SSF),t.revssf[i.SSF[65535]]=0,t.ssf=i.SSF),t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,hI(t),t.cellXfs=[],vu(t.cellXfs,{},{revssf:{General:0}}),i.Props||(i.Props={});for(var r=0;r<i.SheetNames.length;++r)e[e.length]=Wde(r,t,i);return e.unshift(Hde(i,e,t)),fo(e)}function W7(i,n){for(var t=0;t<=i.SheetNames.length;++t){var e=i.Sheets[i.SheetNames[t]];if(!(!e||!e["!ref"])){var r=dl(e["!ref"]);r.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+i.SheetNames[t]+"' extends beyond column IV (255). Data may be lost.")}}var a=n||{};switch(a.biff||2){case 8:case 5:return Gde(i,n);case 4:case 3:case 2:return Rde(i,n)}throw new Error("invalid type "+a.bookType+" for BIFF")}function $de(i,n,t,e){for(var r=i["!merges"]||[],a=[],c=n.s.c;c<=n.e.c;++c){for(var d=0,u=0,h=0;h<r.length;++h)if(!(r[h].s.r>t||r[h].s.c>c)&&!(r[h].e.r<t||r[h].e.c<c)){if(r[h].s.r<t||r[h].s.c<c){d=-1;break}d=r[h].e.r-r[h].s.r+1,u=r[h].e.c-r[h].s.c+1;break}if(!(d<0)){var f=pr({r:t,c}),v=e.dense?(i[t]||[])[c]:i[f],C=v&&v.v!=null&&(v.h||bre(v.w||(rm(v),v.w)||""))||"",y={};d>1&&(y.rowspan=d),u>1&&(y.colspan=u),e.editable?C='<span contenteditable="true">'+C+"</span>":v&&(y["data-t"]=v&&v.t||"z",v.v!=null&&(y["data-v"]=v.v),v.z!=null&&(y["data-z"]=v.z),v.l&&(v.l.Target||"#").charAt(0)!="#"&&(C='<a href="'+v.l.Target+'">'+C+"</a>")),y.id=(e.id||"sjs")+"-"+f,a.push(ii("td",C,y))}}var A="<tr>";return A+a.join("")+"</tr>"}var zde='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',Yde="</body></html>";function qde(i,n,t){var e=[];return e.join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}function H7(i,n){var t=n||{},e=t.header!=null?t.header:zde,r=t.footer!=null?t.footer:Yde,a=[e],c=dl(i["!ref"]);t.dense=Array.isArray(i),a.push(qde(i,c,t));for(var d=c.s.r;d<=c.e.r;++d)a.push($de(i,c,d,t));return a.push("</table>"+r),a.join("")}function G7(i,n,t){var e=t||{};sd!=null&&(e.dense=sd);var r=0,a=0;if(e.origin!=null)if(typeof e.origin=="number")r=e.origin;else{var c=typeof e.origin=="string"?no(e.origin):e.origin;r=c.r,a=c.c}var d=n.getElementsByTagName("tr"),u=Math.min(e.sheetRows||1e7,d.length),h={s:{r:0,c:0},e:{r,c:a}};if(i["!ref"]){var f=dl(i["!ref"]);h.s.r=Math.min(h.s.r,f.s.r),h.s.c=Math.min(h.s.c,f.s.c),h.e.r=Math.max(h.e.r,f.e.r),h.e.c=Math.max(h.e.c,f.e.c),r==-1&&(h.e.r=r=f.e.r+1)}var v=[],C=0,y=i["!rows"]||(i["!rows"]=[]),A=0,D=0,F=0,R=0,L=0,H=0;for(i["!cols"]||(i["!cols"]=[]);A<d.length&&D<u;++A){var se=d[A];if(b8(se)){if(e.display)continue;y[D]={hidden:!0}}var Ce=se.children;for(F=R=0;F<Ce.length;++F){var Ue=Ce[F];if(!(e.display&&b8(Ue))){var re=Ue.hasAttribute("data-v")?Ue.getAttribute("data-v"):Ue.hasAttribute("v")?Ue.getAttribute("v"):wre(Ue.innerHTML),ae=Ue.getAttribute("data-z")||Ue.getAttribute("z");for(C=0;C<v.length;++C){var ve=v[C];ve.s.c==R+a&&ve.s.r<D+r&&D+r<=ve.e.r&&(R=ve.e.c+1-a,C=-1)}H=+Ue.getAttribute("colspan")||1,((L=+Ue.getAttribute("rowspan")||1)>1||H>1)&&v.push({s:{r:D+r,c:R+a},e:{r:D+r+(L||1)-1,c:R+a+(H||1)-1}});var Me={t:"s",v:re},W=Ue.getAttribute("data-t")||Ue.getAttribute("t")||"";re!=null&&(re.length==0?Me.t=W||"z":e.raw||re.trim().length==0||W=="s"||(re==="TRUE"?Me={t:"b",v:!0}:re==="FALSE"?Me={t:"b",v:!1}:isNaN(tm(re))?isNaN(Av(re).getDate())||(Me={t:"d",v:rs(re)},e.cellDates||(Me={t:"n",v:ks(Me.v)}),Me.z=e.dateNF||aa[14]):Me={t:"n",v:tm(re)})),Me.z===void 0&&ae!=null&&(Me.z=ae);var J="",Ee=Ue.getElementsByTagName("A");if(Ee&&Ee.length)for(var Fe=0;Fe<Ee.length&&!(Ee[Fe].hasAttribute("href")&&(J=Ee[Fe].getAttribute("href"),J.charAt(0)!="#"));++Fe);J&&J.charAt(0)!="#"&&(Me.l={Target:J}),e.dense?(i[D+r]||(i[D+r]=[]),i[D+r][R+a]=Me):i[pr({c:R+a,r:D+r})]=Me,h.e.c<R+a&&(h.e.c=R+a),R+=H}}++D}return v.length&&(i["!merges"]=(i["!merges"]||[]).concat(v)),h.e.r=Math.max(h.e.r,D-1+r),i["!ref"]=Ia(h),D>=u&&(i["!fullref"]=Ia((h.e.r=d.length-A+D-1+r,h))),i}function $7(i,n){var t=n||{},e=t.dense?[]:{};return G7(e,i,n)}function Kde(i,n){return tp($7(i,n),n)}function b8(i){var n="",t=Xde(i);return t&&(n=t(i).getPropertyValue("display")),n||(n=i.style&&i.style.display),n==="none"}function Xde(i){return i.ownerDocument.defaultView&&typeof i.ownerDocument.defaultView.getComputedStyle=="function"?i.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var Jde=function(){var i=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),n="<office:document-styles "+Pv({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office
215:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+i+"</office:document-styles>";return function(){return ka+n}}(),x8=function(){var i=function(a){return ur(a).replace(/ +/g,function(c){return'<text:s text:c="'+c.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},n=` <table:table-cell /> 216`,t=` <table:covered-table-cell/> 217`,e=function(a,c,d){var u=[];u.push(' <table:table table:name="'+ur(c.SheetNames[d])+`" table:style-name="ta1"> 218`);var h=0,f=0,v=dl(a["!ref"]||"A1"),C=a["!merges"]||[],y=0,A=Array.isArray(a);if(a["!cols"])for(f=0;f<=v.e.c;++f)u.push(" <table:table-column"+(a["!cols"][f]?' table:style-name="co'+a["!cols"][f].ods+'"':"")+`></table:table-column> 219`);var D="",F=a["!rows"]||[];for(h=0;h<v.s.r;++h)D=F[h]?' table:style-name="ro'+F[h].ods+'"':"",u.push(" <table:table-row"+D+`></table:table-row> 220`);for(;h<=v.e.r;++h){for(D=F[h]?' table:style-name="ro'+F[h].ods+'"':"",u.push(" <table:table-row"+D+`> 221`),f=0;f<v.s.c;++f)u.push(n);for(;f<=v.e.c;++f){var R=!1,L={},H="";for(y=0;y!=C.length;++y)if(!(C[y].s.c>f)&&!(C[y].s.r>h)&&!(C[y].e.c<f)&&!(C[y].e.r<h)){(C[y].s.c!=f||C[y].s.r!=h)&&(R=!0),L["table:number-columns-spanned"]=C[y].e.c-C[y].s.c+1,L["table:number-rows-spanned"]=C[y].e.r-C[y].s.r+1;break}if(R){u.push(t);continue}var se=pr({r:h,c:f}),Ce=A?(a[h]||[])[f]:a[se];if(Ce&&Ce.f&&(L["table:formula"]=ur(vle(Ce.f)),Ce.F&&Ce.F.slice(0,se.length)==se)){var Ue=dl(Ce.F);L["table:number-matrix-columns-spanned"]=Ue.e.c-Ue.s.c+1,L["table:number-matrix-rows-spanned"]=Ue.e.r-Ue.s.r+1}if(!Ce){u.push(n);continue}switch(Ce.t){case"b":H=Ce.v?"TRUE":"FALSE",L["office:value-type"]="boolean",L["office:boolean-value"]=Ce.v?"true":"false";break;case"n":H=Ce.w||String(Ce.v||0),L["office:value-type"]="float",L["office:value"]=Ce.v||0;break;case"s":case"str":H=Ce.v==null?"":Ce.v,L["office:value-type"]="string";break;case"d":H=Ce.w||rs(Ce.v).toISOString(),L["office:value-type"]="date",L["office:date-value"]=rs(Ce.v).toISOString(),L["table:style-name"]="ce1";break;default:u.push(n);continue}var re=i(H);if(Ce.l&&Ce.l.Target){var ae=Ce.l.Target;ae=ae.charAt(0)=="#"?"#"+_le(ae.slice(1)):ae,ae.charAt(0)!="#"&&!ae.match(/^\w+:/)&&(ae="../"+ae),re=ii("text:a",re,{"xlink:href":ae.replace(/&/g,"&")})}u.push(" "+ii("table:table-cell",ii("text:p",re,{}),L)+` 222`)}u.push(` </table:table-row> 223`)}return u.push(` </table:table> 224`),u.join("")},r=function(a,c){a.push(` <office:automatic-styles> 225`),a.push(` <number:date-style style:name="N37" number:automatic-order="true"> 226`),a.push(` <number:month number:style="long"/> 227`),a.push(` <number:text>/</number:text> 228`),a.push(` <number:day number:style="long"/> 229`),a.push(` <number:text>/</number:text> 230`),a.push(` <number:year/> 231`),a.push(` </number:date-style> 232`);var d=0;c.SheetNames.map(function(h){return c.Sheets[h]}).forEach(function(h){if(h&&h["!cols"]){for(var f=0;f<h["!cols"].length;++f)if(h["!cols"][f]){var v=h["!cols"][f];if(v.width==null&&v.wpx==null&&v.wch==null)continue;cI(v),v.ods=d;var C=h["!cols"][f].wpx+"px";a.push(' <style:style style:name="co'+d+`" style:family="table-column"> 233`),a.push(' <style:table-column-properties fo:break-before="auto" style:column-width="'+C+`"/> 234`),a.push(` </style:style> 235`),++d}}});var u=0;c.SheetNames.map(function(h){return c.Sheets[h]}).forEach(function(h){if(h&&h["!rows"]){for(var f=0;f<h["!rows"].length;++f)if(h["!rows"][f]){h["!rows"][f].ods=u;var v=h["!rows"][f].hpx+"px";a.push(' <style:style style:name="ro'+u+`" style:family="table-row"> 236`),a.push(' <style:table-row-properties fo:break-before="auto" style:row-height="'+v+`"/> 237`),a.push(` </style:style> 238`),++u}}}),a.push(` <style:style style:name="ta1" style:family="table" style:master-page-name="mp1"> 239`),a.push(` <style:table-properties table:display="true" style:writing-mode="lr-tb"/> 240`),a.push(` </style:style> 241`),a.push(` <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/> 242`),a.push(` </office:automatic-styles> 243`)};return function(c,d){var u=[ka],h=Pv({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office
243:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),f=Pv({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});d.bookType=="fods"?(u.push("<office:document"+h+f+`> 244`),u.push(o7().replace(/office:document-meta/g,"office:meta"))):u.push("<office:document-content"+h+`> 245`),r(u,c),u.push(` <office:body> 246`),u.push(` <office:spreadsheet> 247`);for(var v=0;v!=c.SheetNames.length;++v)u.push(e(c.Sheets[c.SheetNames[v]],c,v,d));return u.push(` </office:spreadsheet> 248`),u.push(` </office:body> 249`),d.bookType=="fods"?u.push("</office:document>"):u.push("</office:document-content>"),u.join("")}}();function z7(i,n){if(n.bookType=="fods")return x8(i,n);var t=qD(),e="",r=[],a=[];return e="mimetype",En(t,e,"application/vnd.oasis.opendocument.spreadsheet"),e="content.xml",En(t,e,x8(i,n)),r.push([e,"text/xml"]),a.push([e,"ContentFile"]),e="styles.xml",En(t,e,Jde(i,n)),r.push([e,"text/xml"]),a.push([e,"StylesFile"]),e="meta.xml",En(t,e,ka+o7()),r.push([e,"text/xml"]),a.push([e,"MetadataFile"]),e="manifest.rdf",En(t,e,cae(a)),r.push([e,"application/rdf+xml"]),e="META-INF/manifest.xml",En(t,e,sae(r)),t}function G2(i){return new DataView(i.buffer,i.byteOffset,i.byteLength)}function Zde(i){return typeof TextEncoder<"u"?new TextEncoder().encode(i):bc(Qd(i))}function Qde(i,n){e:for(var t=0;t<=i.length-n.length;++t){for(var e=0;e<n.length;++e)if(i[t+e]!=n[e])continue e;return!0}return!1}function gu(i){var n=i.reduce(function(r,a){return r+a.length},0),t=new Uint8Array(n),e=0;return i.forEach(function(r){t.set(r,e),e+=r.length}),t}function eme(i,n,t){var e=Math.floor(t==0?0:Math.LOG10E*Math.log(Math.abs(t)))+6176-20,r=t/Math.pow(10,e-6176);i[n+15]|=e>>7,i[n+14]|=(e&127)<<1;for(var a=0;r>=1;++a,r/=256)i[n+a]=r&255;i[n+15]|=t>=0?0:128}function Fv(i,n){var t=n?n[0]:0,e=i[t]&127;e:if(i[t++]>=128&&(e|=(i[t]&127)<<7,i[t++]<128||(e|=(i[t]&127)<<14,i[t++]<128)||(e|=(i[t]&127)<<21,i[t++]<128)||(e+=(i[t]&127)*Math.pow(2,28),++t,i[t++]<128)||(e+=(i[t]&127)*Math.pow(2,35),++t,i[t++]<128)||(e+=(i[t]&127)*Math.pow(2,42),++t,i[t++]<128)))break e;return n&&(n[0]=t),e}function dr(i){var n=new Uint8Array(7);n[0]=i&127;var t=1;e:if(i>127){if(n[t-1]|=128,n[t]=i>>7&127,++t,i<=16383||(n[t-1]|=128,n[t]=i>>14&127,++t,i<=2097151)||(n[t-1]|=128,n[t]=i>>21&127,++t,i<=268435455)||(n[t-1]|=128,n[t]=i/256>>>21&127,++t,i<=34359738367)||(n[t-1]|=128,n[t]=i/65536>>>21&127,++t,i<=4398046511103))break e;n[t-1]|=128,n[t]=i/16777216>>>21&127,++t}return n.slice(0,t)}function Ef(i){var n=0,t=i[n]&127;e:if(i[n++]>=128){if(t|=(i[n]&127)<<7,i[n++]<128||(t|=(i[n]&127)<<14,i[n++]<128)||(t|=(i[n]&127)<<21,i[n++]<128))break e;t|=(i[n]&127)<<28}return t}function Wa(i){for(var n=[],t=[0];t[0]<i.length;){var e=t[0],r=Fv(i,t),a=r&7;r=Math.floor(r/8);var c=0,d;if(r==0)break;switch(a){case 0:{for(var u=t[0];i[t[0]++]>=128;);d=i.slice(u,t[0])}break;case 5:c=4,d=i.slice(t[0],t[0]+c),t[0]+=c;break;case 1:c=8,d=i.slice(t[0],t[0]+c),t[0]+=c;break;case 2:c=Fv(i,t),d=i.slice(t[0],t[0]+c),t[0]+=c;break;case 3:case 4:default:throw new Error("PB Type ".concat(a," for Field ").concat(r," at offset ").concat(e))}var h={data:d,type:a};n[r]==null?n[r]=[h]:n[r].push(h)}return n}function po(i){var n=[];
vendor: 4,393 bytes, line 249
249return i.forEach(function(t,e){t.forEach(function(r){r.data&&(n.push(dr(e*8+r.type)),r.type==2&&n.push(dr(r.data.length)),n.push(r.data))})}),gu(n)}function yc(i){for(var n,t=[],e=[0];e[0]<i.length;){var r=Fv(i,e),a=Wa(i.slice(e[0],e[0]+r));e[0]+=r;var c={id:Ef(a[1][0].data),messages:[]};a[2].forEach(function(d){var u=Wa(d.data),h=Ef(u[3][0].data);c.messages.push({meta:u,data:i.slice(e[0],e[0]+h)}),e[0]+=h}),(n=a[3])!=null&&n[0]&&(c.merge=Ef(a[3][0].data)>>>0>0),t.push(c)}return t}function gf(i){var n=[];return i.forEach(function(t){var e=[];e[1]=[{data:dr(t.id),type:0}],e[2]=[],t.merge!=null&&(e[3]=[{data:dr(+!!t.merge),type:0}]);var r=[];t.messages.forEach(function(c){r.push(c.data),c.meta[3]=[{type:0,data:dr(c.data.length)}],e[2].push({data:po(c.meta),type:2})});var a=po(e);n.push(dr(a.length)),n.push(a),r.forEach(function(c){return n.push(c)})}),gu(n)}function tme(i,n){if(i!=0)throw new Error("Unexpected Snappy chunk type ".concat(i));for(var t=[0],e=Fv(n,t),r=[];t[0]<n.length;){var a=n[t[0]]&3;if(a==0){var c=n[t[0]++]>>2;if(c<60)++c;else{var d=c-59;c=n[t[0]],d>1&&(c|=n[t[0]+1]<<8),d>2&&(c|=n[t[0]+2]<<16),d>3&&(c|=n[t[0]+3]<<24),c>>>=0,c++,t[0]+=d}r.push(n.slice(t[0],t[0]+c)),t[0]+=c;continue}else{var u=0,h=0;if(a==1?(h=(n[t[0]]>>2&7)+4,u=(n[t[0]++]&224)<<3,u|=n[t[0]++]):(h=(n[t[0]++]>>2)+1,a==2?(u=n[t[0]]|n[t[0]+1]<<8,t[0]+=2):(u=(n[t[0]]|n[t[0]+1]<<8|n[t[0]+2]<<16|n[t[0]+3]<<24)>>>0,t[0]+=4)),r=[gu(r)],u==0)throw new Error("Invalid offset 0");if(u>r[0].length)throw new Error("Invalid offset beyond length");if(h>=u)for(r.push(r[0].slice(-u)),h-=u;h>=r[r.length-1].length;)r.push(r[r.length-1]),h-=r[r.length-1].length;r.push(r[0].slice(-u,-u+h))}}var f=gu(r);if(f.length!=e)throw new Error("Unexpected length: ".concat(f.length," != ").concat(e));return f}function Sc(i){for(var n=[],t=0;t<i.length;){var e=i[t++],r=i[t]|i[t+1]<<8|i[t+2]<<16;t+=3,n.push(tme(e,i.slice(t,t+r))),t+=r}if(t!==i.length)throw new Error("data is not a valid framed stream!");return gu(n)}function vf(i){for(var n=[],t=0;t<i.length;){var e=Math.min(i.length-t,268435455),r=new Uint8Array(4);n.push(r);var a=dr(e),c=a.length;n.push(a),e<=60?(c++,n.push(new Uint8Array([e-1<<2]))):e<=256?(c+=2,n.push(new Uint8Array([240,e-1&255]))):e<=65536?(c+=3,n.push(new Uint8Array([244,e-1&255,e-1>>8&255]))):e<=16777216?(c+=4,n.push(new Uint8Array([248,e-1&255,e-1>>8&255,e-1>>16&255]))):e<=4294967296&&(c+=5,n.push(new Uint8Array([252,e-1&255,e-1>>8&255,e-1>>16&255,e-1>>>24&255]))),n.push(i.slice(t,t+e)),c+=e,r[0]=0,r[1]=c&255,r[2]=c>>8&255,r[3]=c>>16&255,t+=e}return gu(n)}function VD(i,n){var t=new Uint8Array(32),e=G2(t),r=12,a=0;switch(t[0]=5,i.t){case"n":t[1]=2,eme(t,r,i.v),a|=1,r+=16;break;case"b":t[1]=6,e.setFloat64(r,i.v?1:0,!0),a|=2,r+=8;break;case"s":if(n.indexOf(i.v)==-1)throw new Error("Value ".concat(i.v," missing from SST!"));t[1]=3,e.setUint32(r,n.indexOf(i.v),!0),a|=8,r+=4;break;default:throw"unsupported cell type "+i.t}return e.setUint32(8,a,!0),t.slice(0,r)}function UD(i,n){var t=new Uint8Array(32),e=G2(t),r=12,a=0;switch(t[0]=3,i.t){case"n":t[2]=2,e.setFloat64(r,i.v,!0),a|=32,r+=8;break;case"b":t[2]=6,e.setFloat64(r,i.v?1:0,!0),a|=32,r+=8;break;case"s":if(n.indexOf(i.v)==-1)throw new Error("Value ".concat(i.v," missing from SST!"));t[2]=3,e.setUint32(r,n.indexOf(i.v),!0),a|=16,r+=4;break;default:throw"unsupported cell type "+i.t}return e.setUint32(4,a,!0),t.slice(0,r)}function mu(i){var n=Wa(i);return Fv(n[1][0].data)}function ime(i,n,t){var e,r,a,c;if(!((e=i[6])!=null&&e[0])||!((r=i[7])!=null&&r[0]))throw"Mutation only works on post-BNC storages!";var d=((c=(a=i[8])==null?void 0:a[0])==null?void 0:c.data)&&Ef(i[8][0].data)>0||!1;if(d)throw"Math only works with normal offsets";for(var u=0,h=G2(i[7][0].data),f=0,v=[],C=G2(i[4][0].data),y=0,A=[],D=0;D<n.length;++D){if(n[D]==null){h.setUint16(D*2,65535,!0),C.setUint16(D*2,65535);continue}h.setUint16(D*2,f,!0),C.setUint16(D*2,y,!0);var F,R;switch(typeof n[D]){case"string":F=VD({t:"s",v:n[D]},t),R=UD({t:"s",v:n[D]},t);break;case"number":F=VD({t:"n",v:n[D]},t),R=UD({t:"n",v:n[D]},t);break;case"boolean":F=VD({t:"b",v:n[D]},t),R=UD({t:"b",v:n[D]},t);break;default:throw new Error("Unsupported value "+n[D])}v.push(F),f+=F.length,A.push(R),y+=R.length,++u}for(i[2][0].data=dr(u);D<i[7][0].data.length/2;++D)h.setUint16(D*2,65535,!0),C.setUint16(D*2,65535,!0);return i[6][0].data=gu(v),i[3][0].data=gu(A),u}
249function nme(i,n){if(!n||!n.numbers)throw new Error("Must pass a `numbers` option -- check the README");var t=i.Sheets[i.SheetNames[0]];i.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var e=dl(t["!ref"]);e.s.r=e.s.c=0;var r=!1;e.e.c>9&&(r=!0,e.e.c=9),e.e.r>49&&(r=!0,e.e.r=49),r&&console.error("The Numbers writer is currently limited to ".concat(Ia(e)));var a=$2(t,{range:e,header:1}),c=["~Sh33tJ5~"];a.forEach(function(V){return V.forEach(function(Y){typeof Y=="string"&&c.push(Y)})});var d={},u=[],h=xr.read(n.numbers,{type:"base64"});h.FileIndex.map(function(V,Y){return[V,h.FullPaths[Y]]}).forEach(function(V){var Y=V[0],we=V[1];if(Y.type==2&&Y.name.match(/\.iwa/)){var Ve=Y.content,Ge=Sc(Ve),je=yc(Ge);je.forEach(function(it){u.push(it.id),d[it.id]={deps:[],location:we,type:Ef(it.messages[0].meta[1][0].data)}})}}),u.sort(function(V,Y){return V-Y});var f=u.filter(function(V){return V>1}).map(function(V){return[V,dr(V)]});h.FileIndex.map(function(V,Y){return[V,h.FullPaths[Y]]}).forEach(function(V){var Y=V[0],we=V[1];if(Y.name.match(/\.iwa/)){var Ve=yc(Sc(Y.content));Ve.forEach(function(Ge){Ge.messages.forEach(function(je){f.forEach(function(it){Ge.messages.some(function(It){return Ef(It.meta[1][0].data)!=11006&&Qde(It.data,it[1])})&&d[it[0]].deps.push(Ge.id)})})})}});function v(){for(var V=927262;V<2e6;++V)if(!d[V])return V;throw new Error("Too many messages")}for(var C=xr.find(h,d[1].location),y=yc(Sc(C.content)),A,D=0;D<y.length;++D){var F=y[D];F.id==1&&(A=F)}var R=mu(Wa(A.messages[0].data)[1][0].data);for(C=xr.find(h,d[R].location),y=yc(Sc(C.content)),D=0;D<y.length;++D)F=y[D],F.id==R&&(A=F);for(R=mu(Wa(A.messages[0].data)[2][0].data),C=xr.find(h,d[R].location),y=yc(Sc(C.content)),D=0;D<y.length;++D)F=y[D],F.id==R&&(A=F);for(R=mu(Wa(A.messages[0].data)[2][0].data),C=xr.find(h,d[R].location),y=yc(Sc(C.content)),D=0;D<y.length;++D)F=y[D],F.id==R&&(A=F);var L=Wa(A.messages[0].data);{L[6][0].data=dr(e.e.r+1),L[7][0].data=dr(e.e.c+1);var H=mu(L[46][0].data),se=xr.find(h,d[H].location),Ce=yc(Sc(se.content));{for(var Ue=0;Ue<Ce.length&&Ce[Ue].id!=H;++Ue);if(Ce[Ue].id!=H)throw"Bad ColumnRowUIDMapArchive";var re=Wa(Ce[Ue].messages[0].data);re[1]=[],re[2]=[],re[3]=[];for(var ae=0;ae<=e.e.c;++ae){var ve=[];ve[1]=ve[2]=[{type:0,data:dr(ae+420690)}],re[1].push({type:2,data:po(ve)}),re[2].push({type:0,data:dr(ae)}),re[3].push({type:0,data:dr(ae)})}re[4]=[],re[5]=[],re[6]=[];for(var Me=0;Me<=e.e.r;++Me)ve=[],ve[1]=ve[2]=[{type:0,data:dr(Me+726270)}],re[4].push({type:2,data:po(ve)}),re[5].push({type:0,data:dr(Me)}),re[6].push({type:0,data:dr(Me)});Ce[Ue].messages[0].data=po(re)}se.content=vf(gf(Ce)),se.size=se.content.length,delete L[46];var W=Wa(L[4][0].data);{W[7][0].data=dr(e.e.r+1);var J=Wa(W[1][0].data),Ee=mu(J[2][0].data);se=xr.find(h,d[Ee].location),Ce=yc(Sc(se.content));{if(Ce[0].id!=Ee)throw"Bad HeaderStorageBucket";var Fe=Wa(Ce[0].messages[0].data);for(Me=0;Me<a.length;++Me){var $e=Wa(Fe[2][0].data);$e[1][0].data=dr(Me),$e[4][0].data=dr(a[Me].length),Fe[2][Me]={type:Fe[2][0].type,data:po($e)}}Ce[0].messages[0].data=po(Fe)}se.content=vf(gf(Ce)),se.size=se.content.length;var Qe=mu(W[2][0].data);se=xr.find(h,d[Qe].location),Ce=yc(Sc(se.content));{if(Ce[0].id!=Qe)throw"Bad HeaderStorageBucket";for(Fe=Wa(Ce[0].messages[0].data),ae=0;ae<=e.e.c;++ae)$e=Wa(Fe[2][0].data),$e[1][0].data=dr(ae),$e[4][0].data=dr(e.e.r+1),Fe[2][ae]={type:Fe[2][0].type,data:po($e)};Ce[0].messages[0].data=po(Fe)}se.content=vf(gf(Ce)),se.size=se.content.length;var ot=mu(W[4][0].data);(function(){for(var V=xr.find(h,d[ot].location),Y=yc(Sc(V.content)),we,Ve=0;Ve<Y.length;++Ve){var Ge=Y[Ve];Ge.id==ot&&(we=Ge)}var je=Wa(we.messages[0].data);{je[3]=[];var it=[];c.forEach(function(qt,ni){it[1]=[{type:0,data:dr(ni)}],it[2]=[{type:0,data:dr(1)}],it[3]=[{type:2,data:Zde(qt)}],je[3].push({type:2,data:po(it)})})}we.messages[0].data=po(je);var It=gf(Y),Nt=vf(It);V.content=Nt,V.size=V.content.length})();var et=Wa(W[3][0].data);{var gt=et[1][0];delete et[2];var vt=Wa(gt.data);{var Kt=mu(vt[2][0].data);(function(){for(var V=xr.find(h,d[Kt].location),Y=yc(Sc(V.content)),we,Ve=0;Ve<Y.length;++Ve){var Ge=Y[Ve];Ge.id==Kt&&(we=Ge)}var je=Wa(we.messages[0].data);{delete je[6],delete et[7];var it=new Uint8Array(je[5][0].data);je[5]=[];for(var It=0,Nt=0;Nt<=e.e.r;++Nt){var qt=Wa(it);It+=ime(qt,a[Nt],c),qt[1][0].data=dr(Nt),je[5].push({data:po(qt),type:2})}je[1]=[{type:0,data:dr(e.e.c+1)}],je[2]=[{type:0,data:dr(e.e.r+1)}],je[3]=[{type:0,data:dr(It)}],je[4]=[{type:0,data:dr(e.e.r+1)}]}we.messages[0].data=po(je);var ni=gf(Y),bt=vf(ni);V.content=bt,V.size=V.content.length})()}gt.data=po(vt)}W[3][0].data=po(et)}L[4][0].data=po(W)}A.messages[0].data=po(L);var O=gf(y),Q=vf(O);return C.content=Q,C.size=C.content.length,h}function rme(i){return function(t){for(var e=0;e!=i.length;++e){var r=i[e];t[r[0]]===void 0&&(t[r[0]]=r[1]),r[2]==="n"&&(t[r[0]]=Number(t[r[0]]))}}}function hI(i){rme([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(i)}function ame(i,n){return n.bookType=="ods"?z7(i,n):n.bookType=="numbers"?nme(i,n):n.bookType=="xlsb"?ome(i,n):sme(i,n)}function ome(i,n){yf=1024,i&&!i.SSF&&(i.SSF=Ms(aa)),i&&i.SSF&&(q2(),Y2(i.SSF),n.revssf=K2(i.SSF),n.revssf[i.SSF[65535]]=0,n.ssf=i.SSF),n.rels={},n.wbrels={},n.Strings=[],n.Strings.Count=0,n.Strings.Unique=0,Dv?n.revStrings=new Map:(n.revStrings={},n.revStrings.foo=[],delete n.revStrings.foo);var t=n.bookType=="xlsb"?"bin":"xml",e=I7.indexOf(n.bookType)>-1,r=n7();hI(n=n||{});var a=qD(),c="",d=0;if(n.cellXfs=[],vu(n.cellXfs,{},{revssf:{General:0}}),i.Props||(i.Props={}),c="docProps/core.xml",En(a,c,s7(i.Props,n)),r.coreprops.push(c),mr(n.rels,2,c,zn.CORE_PROP
vendor: 13,804 bytes, lines 249-251
249S),c="docProps/app.xml",!(i.Props&&i.Props.SheetNames))if(!i.Workbook||!i.Workbook.Sheets)i.Props.SheetNames=i.SheetNames;else{for(var u=[],h=0;h<i.SheetNames.length;++h)(i.Workbook.Sheets[h]||{}).Hidden!=2&&u.push(i.SheetNames[h]);i.Props.SheetNames=u}for(i.Props.Worksheets=i.Props.SheetNames.length,En(a,c,c7(i.Props,n)),r.extprops.push(c),mr(n.rels,3,c,zn.EXT_PROPS),i.Custprops!==i.Props&&_o(i.Custprops||{}).length>0&&(c="docProps/custom.xml",En(a,c,d7(i.Custprops,n)),r.custprops.push(c),mr(n.rels,4,c,zn.CUST_PROPS)),d=1;d<=i.SheetNames.length;++d){var f={"!id":{}},v=i.Sheets[i.SheetNames[d-1]],C=(v||{})["!type"]||"sheet";switch(C){case"chart":default:c="xl/worksheets/sheet"+d+"."+t,En(a,c,cde(d-1,c,n,i,f)),r.sheets.push(c),mr(n.wbrels,-1,"worksheets/sheet"+d+"."+t,zn.WS[0])}if(v){var y=v["!comments"],A=!1,D="";y&&y.length>0&&(D="xl/comments"+d+"."+t,En(a,D,ude(y,D,n)),r.comments.push(D),mr(f,-1,"../comments"+d+"."+t,zn.CMNT),A=!0),v["!legacy"]&&A&&En(a,"xl/drawings/vmlDrawing"+d+".vml",T7(d,v["!comments"])),delete v["!comments"],delete v["!legacy"]}f["!id"].rId1&&En(a,a7(c),xf(f))}return n.Strings!=null&&n.Strings.length>0&&(c="xl/sharedStrings."+t,En(a,c,mde(n.Strings,c,n)),r.strs.push(c),mr(n.wbrels,-1,"sharedStrings."+t,zn.SST)),c="xl/workbook."+t,En(a,c,lde(i,c,n)),r.workbooks.push(c),mr(n.rels,1,c,zn.WB),c="xl/theme/theme1.xml",En(a,c,E7(i.Themes,n)),r.themes.push(c),mr(n.wbrels,-1,"theme/theme1.xml",zn.THEME),c="xl/styles."+t,En(a,c,dde(i,c,n)),r.styles.push(c),mr(n.wbrels,-1,"styles."+t,zn.STY),i.vbaraw&&e&&(c="xl/vbaProject.bin",En(a,c,i.vbaraw),r.vba.push(c),mr(n.wbrels,-1,"vbaProject.bin",zn.VBA)),c="xl/metadata."+t,En(a,c,pde(c)),r.metadata.push(c),mr(n.wbrels,-1,"metadata."+t,zn.XLMETA),En(a,"[Content_Types].xml",r7(r,n)),En(a,"_rels/.rels",xf(n.rels)),En(a,"xl/_rels/workbook."+t+".rels",xf(n.wbrels)),delete n.revssf,delete n.ssf,a}function sme(i,n){yf=1024,i&&!i.SSF&&(i.SSF=Ms(aa)),i&&i.SSF&&(q2(),Y2(i.SSF),n.revssf=K2(i.SSF),n.revssf[i.SSF[65535]]=0,n.ssf=i.SSF),n.rels={},n.wbrels={},n.Strings=[],n.Strings.Count=0,n.Strings.Unique=0,Dv?n.revStrings=new Map:(n.revStrings={},n.revStrings.foo=[],delete n.revStrings.foo);var t="xml",e=I7.indexOf(n.bookType)>-1,r=n7();hI(n=n||{});var a=qD(),c="",d=0;if(n.cellXfs=[],vu(n.cellXfs,{},{revssf:{General:0}}),i.Props||(i.Props={}),c="docProps/core.xml",En(a,c,s7(i.Props,n)),r.coreprops.push(c),mr(n.rels,2,c,zn.CORE_PROPS),c="docProps/app.xml",!(i.Props&&i.Props.SheetNames))if(!i.Workbook||!i.Workbook.Sheets)i.Props.SheetNames=i.SheetNames;else{for(var u=[],h=0;h<i.SheetNames.length;++h)(i.Workbook.Sheets[h]||{}).Hidden!=2&&u.push(i.SheetNames[h]);i.Props.SheetNames=u}i.Props.Worksheets=i.Props.SheetNames.length,En(a,c,c7(i.Props,n)),r.extprops.push(c),mr(n.rels,3,c,zn.EXT_PROPS),i.Custprops!==i.Props&&_o(i.Custprops||{}).length>0&&(c="docProps/custom.xml",En(a,c,d7(i.Custprops,n)),r.custprops.push(c),mr(n.rels,4,c,zn.CUST_PROPS));var f=["SheetJ5"];for(n.tcid=0,d=1;d<=i.SheetNames.length;++d){var v={"!id":{}},C=i.Sheets[i.SheetNames[d-1]],y=(C||{})["!type"]||"sheet";switch(y){case"chart":default:c="xl/worksheets/sheet"+d+"."+t,En(a,c,L7(d-1,n,i,v)),r.sheets.push(c),mr(n.wbrels,-1,"worksheets/sheet"+d+"."+t,zn.WS[0])}if(C){var A=C["!comments"],D=!1,F="";if(A&&A.length>0){var R=!1;A.forEach(function(L){L[1].forEach(function(H){H.T==!0&&(R=!0)})}),R&&(F="xl/threadedComments/threadedComment"+d+"."+t,En(a,F,Boe(A,f,n)),r.threadedcomments.push(F),mr(v,-1,"../threadedComments/threadedComment"+d+"."+t,zn.TCMNT)),F="xl/comments"+d+"."+t,En(a,F,D7(A,n)),r.comments.push(F),mr(v,-1,"../comments"+d+"."+t,zn.CMNT),D=!0}C["!legacy"]&&D&&En(a,"xl/drawings/vmlDrawing"+d+".vml",T7(d,C["!comments"])),delete C["!comments"],delete C["!legacy"]}v["!id"].rId1&&En(a,a7(c),xf(v))}return n.Strings!=null&&n.Strings.length>0&&(c="xl/sharedStrings."+t,En(a,c,_7(n.Strings,n)),r.strs.push(c),mr(n.wbrels,-1,"sharedStrings."+t,zn.SST)),c="xl/workbook."+t,En(a,c,U7(i,n)),r.workbooks.push(c),mr(n.rels,1,c,zn.WB),c="xl/theme/theme1.xml",En(a,c,E7(i.Themes,n)),r.themes.push(c),mr(n.wbrels,-1,"theme/theme1.xml",zn.THEME),c="xl/styles."+t,En(a,c,x7(i,n)),r.styles.push(c),mr(n.wbrels,-1,"styles."+t,zn.STY),i.vbaraw&&e&&(c="xl/vbaProject.bin",En(a,c,i.vbaraw),r.vba.push(c),mr(n.wbrels,-1,"vbaProject.bin",zn.VBA)),c="xl/metadata."+t,En(a,c,w7()),r.metadata.push(c),mr(n.wbrels,-1,"metadata."+t,zn.XLMETA),f.length>1&&(c="xl/persons/person.xml",En(a,c,Voe(f,n)),r.people.push(c),mr(n.wbrels,-1,"persons/person.xml",zn.PEOPLE)),En(a,"[Content_Types].xml",r7(r,n)),En(a,"_rels/.rels",xf(n.rels)),En(a,"xl/_rels/workbook."+t+".rels",xf(n.wbrels)),delete n.revssf,delete n.ssf,a}function lme(i,n){var t="";switch((n||{}).type||"base64"){case"buffer":return[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]];case"base64":t=nm(i.slice(0,12));break;case"binary":t=i;break;case"array":return[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]];default:throw new Error("Unrecognized type "+(n&&n.type||"undefined"))}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function Y7(i,n){switch(n.type){case"base64":case"binary":break;case"buffer":case"array":n.type="";break;case"file":return Nv(n.file,xr.write(i,{type:tr?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+n.bookType+"' files");default:throw new Error("Unrecognized type "+n.type)}return xr.write(i,n)}function cme(i,n){var t=Ms(n||{}),e=ame(i,t);return dme(e,t)}function dme(i,n){var t={},e=tr?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(n.compression&&(t.compression="DEFLATE"),n.password)t.type=e;else switch(n.type){case"base64":t.type="base64";break;case"binary":t.type="string";break;case"string":throw new Error("'string' output type invalid for '"+n.bookType+"' files");case"buffer":case"file":t.type=e;break;default:throw new Error("Unrecognized type "+n.type)}var r=i.FullPaths?xr.write(i,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[t.type]||t.type,compression:!!n.compression}):i.generate(t);if(typeof Deno<"u"&&typeof r=="string"){if(n.type=="binary"||n.type=="base64")return r;r=new Uint8Array(z2(r))}return n.password&&typeof encrypt_agile<"u"?Y7(encrypt_agile(r,n.password),n):n.type==="file"?Nv(n.file,r):n.type=="string"?Cv(r):r}function mme(i,n){var t=n||{},e=Dde(i,t);return Y7(e,t)}function od(i,n,t){t||(t="");var e=t+i;switch(n.type){case"base64":return Mv(Qd(e));case"binary":return Qd(e);case"string":return i;case"file":return Nv(n.file,e,"utf8");case"buffer":return tr?am(e,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(e):od(e,{type:"binary"}).split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+n.type)}function ume(i,n){switch(n.type){case"base64":return Mv(i);case"binary":return i;case"string":return i;case"file":return Nv(n.file,i,"binary");case"buffer":return tr?am(i,"binary"):i.split("").map(function(t){return t.charCodeAt(0)})}throw new Error("Unrecognized type "+n.type)}function P2(i,n){switch(n.type){case"string":case"base64":case"binary":for(var t="",e=0;e<i.length;++e)t+=String.fromCharCode(i[e]);return n.type=="base64"?Mv(t):n.type=="string"?Cv(t):t;case"file":return Nv(n.file,i);case"buffer":return i;default:throw new Error("Unrecognized type "+n.type)}}function Ec(i,n){Bne(),Jce(i);var t=Ms(n||{});if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),t.type=="array"){t.type="binary";var e=Ec(i,t);return t.type="array",z2(e)}var r=0;if(t.sheet&&(typeof t.sheet=="number"?r=t.sheet:r=i.SheetNames.indexOf(t.sheet),!i.SheetNames[r]))throw new Error("Sheet not found: "+t.sheet+" : "+typeof t.sheet);switch(t.bookType||"xlsb"){case"xml":case"xlml":return od(wde(i,t),t);case"slk":case"sylk":return od(qae.from_sheet(i.Sheets[i.SheetNames[r]],t),t);case"htm":case"html":return od(H7(i.Sheets[i.SheetNames[r]],t),t);case"txt":return ume(q7(i.Sheets[i.SheetNames[r]],t),t);case"csv":return od(fI(i.Sheets[i.SheetNames[r]],t),t,"\uFEFF");case"dif":return od(Kae.from_sheet(i.Sheets[i.SheetNames[r]],t),t);case"dbf":return P2(Yae.from_sheet(i.Sheets[i.SheetNames[r]],t),t);case"prn":return od(Xae.from_sheet(i.Sheets[i.SheetNames[r]],t),t);case"rtf":return od(noe.from_sheet(i.Sheets[i.SheetNames[r]],t),t);case"eth":return od(v7.from_sheet(i.Sheets[i.SheetNames[r]],t),t);case"fods":return od(z7(i,t),t);case"wk1":return P2(f8.sheet_to_wk1(i.Sheets[i.SheetNames[r]],t),t);case"wk3":return P2(f8.book_to_wk3(i,t),t);case"biff2":t.biff||(t.biff=2);case"biff3":t.biff||(t.biff=3);case"biff4":return t.biff||(t.biff=4),P2(W7(i,t),t);case"biff5":t.biff||(t.biff=5);case"biff8":case"xla":case"xls":return t.biff||(t.biff=8),mme(i,t);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return cme(i,t);default:throw new Error("Unrecognized bookType |"+t.bookType+"|")}}function pme(i,n,t,e,r,a,c,d){var u=vo(t),h=d.defval,f=d.raw||!Object.prototype.hasOwnProperty.call(d,"raw"),v=!0,C=r===1?[]:{};if(r!==1)if(Object.defineProperty)try{Object.defineProperty(C,"__rowNum__",{value:t,enumerable:!1})}catch{C.__rowNum__=t}else C.__rowNum__=t;if(!c||i[t])for(var y=n.s.c;y<=n.e.c;++y){var A=c?i[t][y]:i[e[y]+u];if(A===void 0||A.t===void 0){if(h===void 0)continue;a[y]!=null&&(C[a[y]]=h);continue}var D=A.v;switch(A.t){case"z":if(D==null)break;continue;case"e":D=D==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+A.t)}if(a[y]!=null){if(D==null)if(A.t=="e"&&D===null)C[a[y]]=null;else if(h!==void 0)C[a[y]]=h;else if(f&&D===null)C[a[y]]=null;else continue;else C[a[y]]=f&&(A.t!=="n"||A.t==="n"&&d.rawNumbers!==!1)?D:rm(A,D,d);D!=null&&(v=!1)}}return{row:C,isempty:v}}function $2(i,n){if(i==null||i["!ref"]==null)return[];var t={t:"n",v:0},e=0,r=1,a=[],c=0,d="",u={s:{r:0,c:0},e:{r:0,c:0}},h=n||{},f=h.range!=null?h.range:i["!ref"];switch(h.header===1?e=1:h.header==="A"?e=2:Array.isArray(h.header)?e=3:h.header==null&&(e=0),typeof f){case"string":u=Lr(f);break;case"number":u=Lr(i["!ref"]),u.s.r=f;break;default:u=f}e>0&&(r=0);var v=vo(u.s.r),C=[],y=[],A=0,D=0,F=Array.isArray(i),R=u.s.r,L=0,H={};F&&!i[R]&&(i[R]=[]);var se=h.skipHidden&&i["!cols"]||[],Ce=h.skipHidden&&i["!rows"]||[];for(L=u.s.c;L<=u.e.c;++L)if(!(se[L]||{}).hidden)switch(C[L]=Bo(L),t=F?i[R][L]:i[C[L]+v],e){case 1:a[L]=L-u.s.c;break;case 2:a[L]=C[L];break;case 3:a[L]=h.header[L-u.s.c];break;default:if(t==null&&(t={w:"__EMPTY",t:"s"}),d=c=rm(t,null,h),D=H[c]||0,!D)H[c]=1;else{do d=c+"_"+D++;while(H[d]);H[c]=D,H[d]=1}a[L]=d}for(R=u.s.r+r;R<=u.e.r;++R)if(!(Ce[R]||{}).hidden){var Ue=pme(i,u,R,C,e,a,F,h);(Ue.isempty===!1||(e===1?h.blankrows!==!1:h.blankrows))&&(y[A++]=Ue.row)}return y.length=A,y}var C8=/"/g;function hme(i,n,t,e,r,a,c,d){for(var u=!0,h=[],f="",v=vo(t),C=n.s.c;C<=n.e.c;++C)if(e[C]){var y=d.dense?(i[t]||[])[C]:i[e[C]+v];if(y==null)f="";else if(y.v!=null){u=!1,f=""+(d.rawNumbers&&y.t=="n"?y.v:rm(y,null,d));for(var A=0,D=0;A!==f.length;++A)if((D=f.charCodeAt(A))===r||D===a||D===34||d.forceQuotes){f='"'+f.replace(C8,'""')+'"';break}f=="ID"&&(f='"ID"')}else y.f!=null&&!y.F?(u=!1,f="="+y.f,f.indexOf(",")>=0&&(f='"'+f.replace(C8,'""')+'"')):f="";h.push(f)}return d.blankrows===!1&&u?null:h.join(c)}function fI(i,n){var t=[],e=n??{};if(i==null||i["!ref"]==null)return"";var r=Lr(i["!ref"]),a=e.FS!==void 0?e.FS:",",c=a.charCodeAt(0),d=e.RS!==void 0?e.RS:` 250`,u=d.charCodeAt(0),h=new RegExp((a=="|"?"\\|":a)+"+$"),f="",v=[];e.dense=Array.isArray(i);for(var C=e.skipHidden&&i["!cols"]||[],y=e.skipHidden&&i["!rows"]||[],A=r.s.c;A<=r.e.c;++A)(C[A]||{}).hidden||(v[A]=Bo(A));for(var D=0,F=r.s.r;F<=r.e.r;++F)(y[F]||{}).hidden||(f=hme(i,r,F,v,c,u,a,e),f!=null&&(e.strip&&(f=f.replace(h,"")),(f||e.blankrows!==!1)&&t.push((D++?d:"")+f)));return delete e.dense,t.join("")}function q7(i,n){n||(n={}),n.FS=" ",n.RS=` 251`;var t=fI(i,n);if(typeof Ir>"u"||n.type=="string")return t;var e=Ir.utils.encode(1200,t,"str");return"\xFF\xFE"+e}function fme(i){var n="",t,e="";if(i==null||i["!ref"]==null)return[];var r=Lr(i["!ref"]),a="",c=[],d,u=[],h=Array.isArray(i);for(d=r.s.c;d<=r.e.c;++d)c[d]=Bo(d);for(var f=r.s.r;f<=r.e.r;++f)for(a=vo(f),d=r.s.c;d<=r.e.c;++d)if(n=c[d]+a,t=h?(i[f]||[])[d]:i[n],e="",t!==void 0){if(t.F!=null){if(n=t.F,!t.f)continue;e=t.f,n.indexOf(":")==-1&&(n=n+":"+n)}if(t.f!=null)e=t.f;else{if(t.t=="z")continue;if(t.t=="n"&&t.v!=null)e=""+t.v;else if(t.t=="b")e=t.v?"TRUE":"FALSE";else if(t.w!==void 0)e="'"+t.w;else{if(t.v===void 0)continue;t.t=="s"?e="'"+t.v:e=""+t.v}}u[u.length]=n+"="+e}return u}function K7(i,n,t){var e=t||{},r=+!e.skipHeader,a=i||{},c=0,d=0;if(a&&e.origin!=null)if(typeof e.origin=="number")c=e.origin;else{var u=typeof e.origin=="string"?no(e.origin):e.origin;c=u.r,d=u.c}var h,f={s:{c:0,r:0},e:{c:d,r:c+n.length-1+r}};if(a["!ref"]){var v=Lr(a["!ref"]);f.e.c=Math.max(f.e.c,v.e.c),f.e.r=Math.max(f.e.r,v.e.r),c==-1&&(c=v.e.r+1,f.e.r=c+n.length-1+r)}else c==-1&&(c=0,f.e.r=n.length-1+r);var C=e.header||[],y=0;n.forEach(function(D,F){_o(D).forEach(function(R){(y=C.indexOf(R))==-1&&(C[y=C.length]=R);var L=D[R],H="z",se="",Ce=pr({c:d+y,r:c+F+r});h=Rv(a,Ce),L&&typeof L=="object"&&!(L instanceof Date)?a[Ce]=L:(typeof L=="number"?H="n":typeof L=="boolean"?H="b":typeof L=="string"?H="s":L instanceof Date?(H="d",e.cellDates||(H="n",L=ks(L)),se=e.dateNF||aa[14]):L===null&&e.nullError&&(H="e",L=0),h?(h.t=H,h.v=L,delete h.w,delete h.R,se&&(h.z=se)):a[Ce]=h={t:H,v:L},se&&(h.z=se))})}),f.e.c=Math.max(f.e.c,d+C.length-1);var A=vo(c);if(r)for(y=0;y<C.length;++y)a[Bo(y+d)+A]={t:"s",v:C[y]};return a["!ref"]=Ia(f),a}function gme(i,n){return K7(null,i,n)}function Rv(i,n,t){if(typeof n=="string"){if(Array.isArray(i)){var e=no(n);return i[e.r]||(i[e.r]=[]),i[e.r][e.c]||(i[e.r][e.c]={t:"z"})}return i[n]||(i[n]={t:"z"})}return typeof n!="number"?Rv(i,pr(n)):Rv(i,pr({r:n,c:t||0}))}
251function vme(i,n){if(typeof n=="number"){if(n>=0&&i.SheetNames.length>n)return n;throw new Error("Cannot find sheet # "+n)}else if(typeof n=="string"){var t=i.SheetNames.indexOf(n);if(t>-1)return t;throw new Error("Cannot find sheet name |"+n+"|")}else throw new Error("Cannot find sheet |"+n+"|")}function _me(){return{SheetNames:[],Sheets:{}}}function yme(i,n,t,e){var r=1;if(!t)for(;r<=65535&&i.SheetNames.indexOf(t="Sheet"+r)!=-1;++r,t=void 0);if(!t||i.SheetNames.length>=65535)throw new Error("Too many worksheets");if(e&&i.SheetNames.indexOf(t)>=0){var a=t.match(/(^.*?)(\d+)$/);r=a&&+a[2]||0;var c=a&&a[1]||t;for(++r;r<=65535&&i.SheetNames.indexOf(t=c+r)!=-1;++r);}if(V7(t),i.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");return i.SheetNames.push(t),i.Sheets[t]=n,t}function Sme(i,n,t){i.Workbook||(i.Workbook={}),i.Workbook.Sheets||(i.Workbook.Sheets=[]);var e=vme(i,n);switch(i.Workbook.Sheets[e]||(i.Workbook.Sheets[e]={}),t){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+t)}i.Workbook.Sheets[e].Hidden=t}function bme(i,n){return i.z=n,i}function X7(i,n,t){return n?(i.l={Target:n},t&&(i.l.Tooltip=t)):delete i.l,i}function xme(i,n,t){return X7(i,"#"+n,t)}function Cme(i,n,t){i.c||(i.c=[]),i.c.push({t:n,a:t||"SheetJS"})}function Eme(i,n,t,e){for(var r=typeof n!="string"?n:Lr(n),a=typeof n=="string"?n:Ia(n),c=r.s.r;c<=r.e.r;++c)for(var d=r.s.c;d<=r.e.c;++d){var u=Rv(i,c,d);u.t="n",u.F=a,delete u.v,c==r.s.r&&d==r.s.c&&(u.f=t,e&&(u.D=!0))}return i}var Nn={encode_col:Bo,encode_row:vo,encode_cell:pr,encode_range:Ia,decode_col:rI,decode_row:nI,split_cell:Ure,decode_cell:no,decode_range:dl,format_cell:rm,sheet_add_aoa:J8,sheet_add_json:K7,sheet_add_dom:G7,aoa_to_sheet:kf,json_to_sheet:gme,table_to_sheet:$7,table_to_book:Kde,sheet_to_csv:fI,sheet_to_txt:q7,sheet_to_json:$2,sheet_to_html:H7,sheet_to_formulae:fme,sheet_to_row_object_array:$2,sheet_get_cell:Rv,book_new:_me,book_append_sheet:yme,book_set_sheet_visibility:Sme,cell_set_number_format:bme,cell_set_hyperlink:X7,cell_set_internal_link:xme,cell_add_comment:Cme,sheet_set_array_formula:Eme,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};var qtt=Iv.version;var Z7=Di(Ti());var J7=Di(Ti());var As=(()=>{let n=class n{constructor(e,r){this.http=e,this.toastr=r,this.publicUrl=ui.ambuluwawaBackendPublicUrl,this.updatePriceUrl=ui.ambuluwawaBackendUrl+"/price",this.apiKey=ui.PUBLIC_API_KEY,this.privateUrl=ui.ambuluwawaBackendUrl,this.analyticsUrl=ui.ambuluwawaBackendUrl+"/analytics"}preShootPhotoShootReport(e,r,a){let c=new xe({"Content-Type":"application/json",path:"sales-pre-shoot"}),d={frequency:a,fromDate:e,toDate:r};return this.http.post(this.analyticsUrl,d,{headers:c})}getPhotoShootTickets(e,r){let a=new xe({"Content-Type":"application/json",path:"pre-shoot/get"}),c={filterByUser:!1,keyword:"",page:e,pageLimit:r};return this.http.post(this.privateUrl,c,{headers:a})}getItemPrice(){let e=new xe({"Content-Type":"application/json","x-api-key":this.apiKey,path:"pre-shoot/get-price-for-mobile"});return this.http.post(this.publicUrl,{},{headers:e})}updateItemPrice(e,r,a){let c=new xe({"Content-Type":"application/json",path:"update-pre-shoot-price"}),d={id:e,typeid:r,cost:a};return this.http.post(this.updatePriceUrl,d,{headers:c})}getMonthlySalesReport(e,r){let a=new xe({"Content-Type":"application/json",path:"pre-shoot/monthly-sales"}),c={month:e,year:r};return this.http.post(this.privateUrl,c,{headers:a})}getMonthlySalesExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"pre-shoot/monthly-sales-excel"}),c={month:e,year:r};return this.http.post(this.privateUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Excel){let u=d.data.base64Excel;return this.convertBase64ToBlob(u,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading Excel:",d),this.toastr.error("Failed to generate Excel:","Error"),fr(d))))}convertBase64ToBlob(e,r){return new za(a=>{try{let c=e.replace(/^data:.*;base64,/,"");if(!/^[A-Za-z0-9+/]+={0,2}$/.test(c))throw new Error("Invalid Base64 string");let u=atob(c),h=new ArrayBuffer(u.length),f=new Uint8Array(h);for(let C=0;C<u.length;C++)f[C]=u.charCodeAt(C);let v=new Blob([f],{type:r});a.next(v),a.complete()}catch(c){console.error("Error decoding base64 string:",c),this.toastr.error("Failed to download file","Error"),a.error(c)}})}downloadFile(e,r){(0,J7.default)(e,r)}getMonthlySalesPDF(e,r){let a=new xe({"Content-Type":"application/json",path:"pre-shoot/monthly-sales-pdf"}),c={month:e,year:r};return this.http.post(this.privateUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Pdf){let u=d.data.base64Pdf;return this.convertBase64ToBlob(u,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading PDF:",d),this.toastr.error("Failed to generate PDF:","Error"),fr(d))))}getDailySales(e){let r=new xe({"Content-Type":"application/json",path:"pre-shoot/daily-sales"}),a={date:e};return this.http.post(this.privateUrl,a,{headers:r})}getDailySalesPDF(e){let r=new xe({"Content-Type":"application/json",path:"pre-shoot/get-daily-pdf"}),a={date:e};return this.http.post(this.privateUrl,a,{headers:r,responseType:"json"}).pipe(Tn(c=>{if(c.status==="success"&&c.data?.base64Pdf){let d=c.data.base64Pdf;return this.convertBase64ToBlob(d,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(c=>(console.error("Error downloading PDF:",c),this.toastr.error("Failed to generate PDF:","Error"),fr(c))))}getDailySalesExcel(e){let r=new xe({"Content-Type":"application/json",path:"pre-shoot/get-daily-excel"}),a={date:e};return this.http.post(this.privateUrl,a,{headers:r,responseType:"json"}).pipe(Tn(c=>{if(c.status==="success"&&c.data?.base64Excel){let d=c.data.base64Excel;return this.convertBase64ToBlob(d,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(c=>(console.error("Error downloading Excel:",c),this.toastr.error("Failed to generate Excel:","Error"),fr(c))))}getDailyTransactionsToVerify(e,r){let a=new xe({"Content-Type":"application/json",path:"pre-shoot/get-daily-confirmation"}),c={month:e,year:r};return this.http.post(this.privateUrl,c,{headers:a})}confirmDailyTransactions(e){let r=new xe({"Content-Type":"application/json",path:"pre-shoot/save-daily-confirmation"});return this.http.post(this.privateUrl,e,{headers:r})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi),kt(me))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var wme=i=>({collapsed:i}),Q7=(()=>{let n=class n{constructor(e,r,a,c,d){this.sidebarService=e,this.admissionService=r,this.photoShootService=a,this.spinner=c,this.toastr=d,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.selectedFrequency="daily",this.ticketType="onsite",this.frequency="",this.SalesAndCountData=[],this.LocalForeginData=[],this.Visitors
251Data=[],this.VehicalsData=[],this.EntranceTicketingReport=[],this.TourGuideReport=[],this.PrePhotoShoot=[],this.SalesByNationality=[],this.TopTenNations=[],this.PeakOffPeakData=[],this.DonationData=[],this.isCollapsed=!1,this.selectedOption="a",this.searchTerm="",this.tableData=[{rank:1,userId:"U001",totalIncome:1e4,totalSales:150},{rank:2,userId:"U002",totalIncome:12e3,totalSales:160},{rank:3,userId:"U003",totalIncome:9e3,totalSales:130},{rank:4,userId:"U004",totalIncome:8e3,totalSales:100},{rank:5,userId:"U005",totalIncome:11e3,totalSales:140}],this.donations=[{donorId:"D001",totalDonation:5e3,totalDonors:3},{donorId:"D002",totalDonation:3e3,totalDonors:2},{donorId:"D003",totalDonation:7e3,totalDonors:5},{donorId:"D004",totalDonation:1500,totalDonors:1}]}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.loadCharts()}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onFrequencyChange(){console.log(this.selectedFrequency),this.selectedFrequency=this.selectedFrequency,console.log("selected frequency",this.selectedFrequency)}onTicketTpypeChange(){console.log(this.ticketType),this.ticketType=this.ticketType,console.log("selected frequency",this.ticketType)}onPressGenerateExcel(){this.generateExcel()}applyFilter(){console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate,this.selectedFrequency),this.loadCharts()}totalSalesValuesAndCount(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.getSalesReportData(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.SalesAndCountData=e.data,this.SalesAndCountData.length!=0?(this.initLineChart1(this.SalesAndCountData),this.initLineChart2(this.SalesAndCountData)):this.toastr.warning("No records found for selected Range"),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}totalVisitorAndVehicalsSales(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.spinner.show(),this.admissionService.getVisitorAndVehicalsSales(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.LocalForeginData=e.data.visitorsGroupedByMainTypes,this.Visitors
251Data=e.data.visitorsGroupedByAllTypes,this.VehicalsData=e.data.vehiclesGroupedByAllTypes,this.LocalForeginData.length!=0&&this.VisitorsData.length!=0&&this.VehicalsData.length!=0?(console.log(this.LocalForeginData),console.log(this.VisitorsData),console.log(this.VehicalsData),this.initBarChart(this.LocalForeginData),this.initBarChartVisitorAmount(this.LocalForeginData),this.initPieChart1(this.VisitorsData),this.initPieChart2(this.VehicalsData)):this.toastr.warning("No records found for selected range."),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}generateExcel(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.admissionService.getSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{if(e&&e.status==="success"){let a=e.data.flatMap(f=>f.entries).map(f=>({Date:f.issueddate,"Local Value (LKR)":f.local_cost,"No. Of Locals":f.local_count,"Tourist Value (LKR)":f.tourist_cost,"No. Of Tourists":f.tourist_count})),c=Nn.json_to_sheet(a),d=Nn.book_new();Nn.book_append_sheet(d,c,"Sales Data");let u=Ec(d,{bookType:"xlsx",type:"array"}),h=new Blob([u],{type:"application/octet-stream"});(0,Z7.saveAs)(h,"SalesData.xlsx"),this.toastr.success("File Generated Successfully!")}else this.toastr.warning("No data available for the selected period.","Warning");console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getPreshootReport(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.photoShootService.preShootPhotoShootReport(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.PrePhotoShoot=e.data,this.PrePhotoShoot.length!=0?(this.initLineChart5(this.PrePhotoShoot),this.initLineChart6(this.PrePhotoShoot)):this.toastr.warning("No records found for selected Range"),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getEntranceTicketingdata(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.entranceTicketingReport(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency,this.ticketType).subscribe({next:e=>{this.EntranceTicketingReport=e.data,this.EntranceTicketingReport.length!=0?(this.initLineChart7(this.EntranceTicketingReport),this.initLineChart8(this.EntranceTicketingReport)):this.toastr.warning("No records found for selected Range"),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getSalesByNationality(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.salesByNationality(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.SalesByNationality=e.data,this.SalesByNationality.length!=0?this.initSalesByNationalityChart(this.SalesByNationality):this.toastr.warning("No records found for selected Range"),console.log("API Response list of nationality:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getTopTenNations(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.topTenNations(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.TopTenNations=e.data,this.TopTenNations.length!=0?this.initTop10NationalitiesChart(this.TopTenNations):this.toastr.warning("No records found for selected Range"),console.log("API Response list of top ten:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getTimelySales(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.getTimelySales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.PeakOffPeakData=e.data,this.PeakOffPeakData.length!=0?this.initTicketSalesVolumeChart(this.PeakOffPeakData):this.toastr.warning("No records foun
251d for selected Range"),console.log("API Response peak and off peak sales:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getDonationdata(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.getDonationData(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.DonationData=e.data,this.DonationData.length!=0?(this.initLineChart9(this.DonationData),this.initLineChart10(this.DonationData)):this.toastr.warning("No records found for selected Range"),console.log("API Response list of top ten:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onOptionChange(){console.log("Option changed to:",this.selectedOption),this.loadCharts()}loadCharts(){this.clearCharts(),this.selectedOption==="a"?this.totalSalesValuesAndCount():this.selectedOption==="b"?this.totalVisitorAndVehicalsSales():this.selectedOption==="c"?this.getPreshootReport():this.selectedOption==="d"?(this.getEntranceTicketingdata(),this.get
251SalesByNationality(),this.getTopTenNations(),this.getTimelySales()):this.selectedOption==="e"?this.getDonationdata():this.selectedOption==="f"?(this.getTourGuideReport(),this.loadTable()):this.selectedOption==="g"&&(this.initLineChart11(),this.initLineChart12(),this.initLineChart13())}clearCharts(){["chartingBox1","chartingBox2","barChart","barChartVisitorAmount","pieChart","pieChart1","chartingBox3","chartingBox4","chartingBox5","chartingBox6","chartingBox7","chartingBox8","chartingBox9","chartingBox10","chartingBox11","chartingBox12","chartingBox13","chartingBox14","chartingBox15"].forEach(r=>{let a=document.getElementById(r);if(a){let c=Oc(a);c&&c.dispose(),a.innerHTML=""}else console.warn(`No element found with ID: ${r}`)})}initLineChart1(e){let r=document.getElementById("chartingBox1");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.date),u=e.map(f=>f.amount),h={title:{text:"Total Sales Values (LKR)"},tooltip:{trigger:"axis",formatter:function(f){return`${f[0].name}<br/> 252 Amount: LKR ${f[0].value.toLocaleString()}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount (LKR)",axisLabel:{formatter:f=>`${f.toLocaleString()}`}},series:[{data:u,type:"bar",smooth:!0,name:"Sales Amount"}],dataZoom:[{type:"slider",xAxisIndex:0,start:0,end:50,height:12,bottom:30},{type:"inside",xAxisIndex:0,start:0,end:50}]};c.setOption(h)}}initLineChart2(e){let r=document.getElementById("chartingBox2");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.date),u=e.map(f=>f.totalcount),h={title:{text:"Total Sales Count"},tooltip:{trigger:"axis",formatter:function(f){return`${f[0].name}<br/> 253 Count: ${f[0].value}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Count",minInterval:1},series:[{data:u,type:"bar",smooth:!0,name:"Sales Count"}],dataZoom:[{type:"slider",xAxisIndex:0,start:0,end:50,height:12,bottom:30},{type:"inside",xAxisIndex:0,start:0,end:50}]};c.setOption(h)}}initBarChart(e){let r=document.getElementById("barChart");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(C=>C.issueddate),u=e.map(C=>C.local_count),h=e.map(C=>C.tourist_count),f=C=>isNaN(C)?"0":C.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),v={title:{text:"Visitors"},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:[{type:"value",name:"Visitor Count",position:"left"}],legend:{data:["Local","Foreign"],bottom:-5},series:[{name:"Local",data:u,type:"bar",stack:"count",color:"#5c7bd9",yAxisIndex:0},{name:"Foreign",data:h,type:"bar",stack:"count",color:"#ff7070",yAxisIndex:0}],tooltip:{trigger:"axis",formatter:function(C){let y=C[0].axisValue,A=f(e[C[0].dataIndex].local_count||0),D=f(e[C[0].dataIndex].tourist_count||0);return` 254 <div style="font-size: 14px; font-weight: bold; margin-bottom: 5px;">Visitors</div> 255 <div style="font-size: 12px; margin-bottom: 8px;"><strong>${y}</strong></div> 256 <div style="display: flex; align-items: center; margin-bottom: 5px;"> 257 <span style="width: 12px; height: 12px; background-color: #5c7bd9; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 258 <span style="flex-grow: 1;">Local:</span> 259 <span style="text-align: right; width: 70px;">${A}</span> 260 </div> 261 <div style="display: flex; align-items: center;"> 262 <span style="width: 12px; height: 12px; background-color: #ff7070; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 263 <span style="flex-grow: 1;">Foreign:</span> 264 <span style="text-align: right; width: 70px;">${D}</span> 265 </div> 266 `},backgroundColor:"rgba(255, 255, 255, 0.9)",borderColor:"#ccc",borderWidth:1,textStyle:{color:"#333"},extraCssText:"box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;"},dataZoom:[{type:"slider",xAxisIndex:0,start:0,end:50,height:12,bottom:30},{type:"inside",xAxisIndex:0,start:0,end:50}]};c.setOption(v)}}initBarChartVisitorAmount(e){let r=document.getElementById("barChartVisitorAmount");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(C=>C.issueddate),u=e.map(C=>C.local_cost),h=e.map(C=>C.tourist_cost),f=C=>
266isNaN(C)?"0":C.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),v={title:{text:"Revenue"},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:[{type:"value",name:"Amount (LKR)",position:"left"}],legend:{data:["Local","Foreign"],bottom:-5},series:[{name:"Local",data:u,type:"bar",stack:"cost",color:"orange",yAxisIndex:0},{name:"Foreign",data:h,type:"bar",stack:"cost",color:"green",yAxisIndex:0}],tooltip:{trigger:"axis",formatter:function(C){let y=C[0].axisValue,A=C.find(L=>L.seriesName==="Local"),D=C.find(L=>L.seriesName==="Foreign"),F=A?f(e[C[0].dataIndex].local_cost):"0",R=D?f(e[C[0].dataIndex].tourist_cost):"0";return` 267 <div style="font-size: 14px; font-weight: bold; margin-bottom: 5px;">Revenue</div> 268 <div style="font-size: 12px; margin-bottom: 8px;"><strong>${y}</strong></div> 269 <div style="display: flex; align-items: center; margin-bottom: 5px;"> 270 <span style="width: 12px; height: 12px; background-color: orange; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 271 <span style="flex-grow: 1;">Local:</span> 272 <span style="text-align: right; width: 70px;">${F}</span> 273 </div> 274 <div style="display: flex; align-items: center;"> 275 <span style="width: 12px; height: 12px; background-color: green; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 276 <span style="flex-grow: 1;">Foreign:</span> 277 <span style="text-align: right; width: 70px;">${R}</span> 278 </div> 279 `},backgroundColor:"rgba(255, 255, 255, 0.9)",borderColor:"#ccc",borderWidth:1,textStyle:{color:"#333"},extraCssText:"box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;"},dataZoom:[{type:"slider",xAxisIndex:0,start:0,end:50,height:12,bottom:30},{type:"inside",xAxisIndex:0,start:0,end:50}]};c.setOption(v)}}initPieChart1(e){let r=document.getElementById("pieChart");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>({name:f.visitor,value:f.counts,costs:f.costs})),u=f=>isNaN(f)?"0":f.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),h={title:{text:"Visitors %",left:"center"},tooltip:{trigger:"item",formatter:function(f){let v=f.name,C=f.value,y=u(f.data.costs);return` 280 <strong>${v}</strong><br/> 281 Counts: ${C}<br/> 282 Costs: LKR ${y} 283 `}},series:[{name:"Visitor Breakdown",type:"pie",radius:"50%",data:d,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};c.setOption(h)}}initPieChart2(e){let r=document.getElementById("pieChart1");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>({name:f.vehicle,value:f.counts,costs:f.costs})),u=f=>isNaN(f)?"0":f.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),h={title:{text:"Vehicles %",left:"center"},tooltip:{trigger:"item",formatter:function(f){let v=f.name,C=f.value,y=u(f.data.costs);return` 284 <strong>${v}</strong><br/> 285 Counts: ${C}<br/> 286 Costs: LKR ${y} 287 `}},series:[{name:"Vehicle Breakdown",type:"pie",radius:"50%",data:d,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};c.setOption(h)}}initLineChart5(e){let r=document.getElementById("chartingBox3");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(v=>v.issueddate),u=e.map(v=>v.amount),h=e.map(v=>v.totalcount),f={title:{text:"Total Pre-shoot/Photo-shoot Sales Amount (LKR)"},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount (LKR)"},series:[{name:"Sales",data:u,type:"line",smooth:!0}],tooltip:{trigger:"axis",formatter:function(v){let C=v[0];return`Date: ${C.name}<br>AmountL(LKR): ${C.value}`}}};c.setOption(f)}}initLineChart6(e){let r=document.getElementById("chartingBox4");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.issueddate),u=e.map(f=>f.totalcount),h={title:{text:"Total Pre-shoot/Photo-shoot Sales Count"},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Total Count"},series:[{name:"Sales",data:u,type:"line",smooth:!0}],tooltip:{trigger:"axis",formatter:function(f){let v=f[0];return`Date: ${v.name}<br>Count: ${v.value}`}}};c.setOption(h)}}initLineChart7(e){let r=document.getElementById("chartingBox5");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=e.map(v=>v.date),d=e.map(v=>v.amount),u=v=>
287isNaN(v)?"0":v.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),h=Qi(a),f={title:{text:"Total Sales Values (LKR)",left:"center"},tooltip:{trigger:"axis",formatter:function(v){let C=v[0],y=u(C.value);return`Date: ${C.name}<br>Amount (LKR): ${y}`}},xAxis:{type:"category",data:c,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount (LKR)"},series:[{name:"Sales",data:d,type:"bar",smooth:!0}],dataZoom:[{type:"slider",xAxisIndex:0,start:0,end:50,height:12,bottom:30},{type:"inside",xAxisIndex:0,start:0,end:50}]};h.setOption(f)}}initLineChart8(e){let r=document.getElementById("chartingBox6");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(v=>v.date),u=e.map(v=>v.amount),h=e.map(v=>v.totalcount),f={title:{text:"Total Sales Count",left:"center"},tooltip:{trigger:"axis",formatter:function(v){let C=v[0];return`Date: ${C.name}<br>Total Count: ${C.value}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Count"},series:[{data:h,type:"bar",smooth:!0}],dataZoom:[{type:"slider",xAxisIndex:0,start:0,end:50,height:12,bottom:30},{type:"inside",xAxisIndex:0,start:0,end:50}]};c.setOption(f)}}initSalesByNationalityChart(e){let r=document.getElementById("chartingBox7");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(C=>C.nationality),u=e.map(C=>C.costs),h=e.map(C=>C.counts),f=["#FF8A80","#FFCC80","#FFEB99","#A5D6A7","#90CAF9","#B39DDB","#FF80AB","#B2FF59","#FF4081","#D1C4E9"],v={title:{text:"Sales by Nationalities"},tooltip:{trigger:"item",formatter:function(C){let y=C.dataIndex,A=d[y],D=u[y],F=h[y];return` 288 <strong>Nationality:</strong> ${A}<br/> 289 <strong>Total Sales:</strong> LKR ${D.toLocaleString()}<br/> 290 <strong>Number of Transactions:</strong> ${F} 291 `}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Countries"},yAxis:{type:"value",name:"Amount"},series:[{data:u,type:"bar",itemStyle:{color:function(C){return f[C.dataIndex%f.length]}}}]};c.setOption(v)}}initTop10NationalitiesChart(e){let r=document.getElementById("chartingBox8");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.nationality),u=e.map(f=>f.counts),h={title:{text:"Top 10 Visited Nationalities"},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(f){let v=f[0].dataIndex,C=d[v],y=u[v];return` 292 <strong>Nationality:</strong> ${C}<br/> 293 <strong>Visitor Count:</strong> ${y} 294 `}},xAxis:{type:"value",name:"Visitor Count"},yAxis:{type:"category",data:d,name:"Nationality"},series:[{data:u,type:"bar",itemStyle:{color:function(f){let v=["#FFCCE5","#FFD400","#B2F2B2","#B3D9FF","#FFB3E6","#D1FFFF","#E0E0E0","#FFB366","#C2F0C2","#FFCC99"];return v[f.dataIndex%v.length]}},label:{show:!0,position:"right",formatter:"{c}"}}]};c.setOption(h)}}initTicketSalesVolumeChart(e){let r=document.getElementById("chartingBox9");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),u=e.map(v=>{let[C,y]=v.groupedhour.split(":").map(Number),A=C+5,D=y+30;D>=60&&(A+=1,D-=60),A>=24&&(A-=24);let F=A>=12?"PM":"AM",L=(A%12||12).toString().padStart(2,"0"),H=D.toString().padStart(2,"0");return{groupedhour:`${L}:${H} ${F}`,totalticketcount:v.totalticketcount}}).map(v=>v.groupedhour),h=e.map(v=>v.totalticketcount),f={title:{text:"Ticket Sales Volume Over Time (Peak & Off-Peak Hours)"},tooltip:{trigger:"item",formatter:function(v){return`${v.name}: ${v.value} visitors`}},xAxis:{type:"category",data:u,name:"Time"},yAxis:{type:"value",name:"Total Count"},series:[{data:h,type:"line",areaStyle:{}}]};c.setOption(f)}}initLineChart9(e){let r=document.getElementById("chartingBox10");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.receiveddate),u=e.map(f=>f.totalearnings),h={title:{text:"Total Donation Amount (LKR)"},tooltip:{trigger:"axis",formatter:function(f){let v=f[0];return`Date: ${v.name}<br>AmountL(LKR): ${v.value}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount"},series:[{data:u,type:"line"}]};c.setOption(h)}}initLineChart10(e){let r=document.getElementById("chartingBox11");if(r){let a=document.createElement("div");a.style.width="1000px",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>
294f.receiveddate),u=e.map(f=>f.totaldonations),h={title:{text:"Total Donation Count"},tooltip:{trigger:"axis",formatter:function(f){let v=f[0];return`Date: ${v.name}<br>Count: ${v.value}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Total Count"},series:[{data:u,type:"line"}]};c.setOption(h)}}initLineChart11(){let e=document.getElementById("chartingBox12");if(e){let r=document.createElement("div");r.style.width="1000px",r.style.height="400px",e.appendChild(r);let a=Qi(r),c={title:{text:"Historical Rate of Vehicles"},xAxis:{type:"category",data:["Jan","Feb","Mar","Apr","May"]},yAxis:{type:"value"},series:[{data:[120,150,220,140,250],type:"line"}]};a.setOption(c)}}initLineChart12(){let e=document.getElementById("chartingBox13");if(e){let r=document.createElement("div");r.style.width="1000px",r.style.height="400px",e.appendChild(r);let a=Qi(r),c={title:{text:"Historical Rate of Visitors"},xAxis:{type:"category",data:["Jan","Feb","Mar","Apr","May"]},yAxis:{type:"value"},series:[{data:[120,150,220,140,250],type:"line"}]};a.setOption(c)}}initLineChart13(){let e=document.getElementById("chartingBox14");if(e){let r=document.createElement("div");r.style.width="1000px",r.style.height="400px",e.appendChild(r);let a=Qi(r),c={title:{text:"Historical Rate of Pre-Shoot/Photo-Shoot"},xAxis:{type:"category",data:["Jan","Feb","Mar","Apr","May"]},yAxis:{type:"value"},series:[{data:[120,150,220,140,250],type:"line"}]};a.setOption(c)}}get filteredTableData(){return this.searchTerm.trim()?this.TourGuideReport.filter(e=>{let r=e.userid.toString(),a=this.searchTerm.trim();return r.includes(a)}):this.TourGuideReport}getTourGuideReport(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.admissionService.tourGuideReport(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.TourGuideReport=e.data,this.loadTable(),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}loadTable(){let e=document.getElementById("chartingBox15");if(e){e.innerHTML="";let r=document.createElement("div"),a=document.getElementById("searchInput");a||(a=document.createElement("input"),a.id="searchInput",a.type="text",a.placeholder="Search by User Id",a.className="form-control mb-3",a.value=this.searchTerm||"",a.addEventListener("input",d=>{this.searchTerm=d.target.value,this.updateTable()})),r.appendChild(a);let c=this.createTable();r.appendChild(c),e.appendChild(r)}}updateTable(){let e=document.querySelector("#chartingBox15 table tbody");e&&(e.innerHTML=this.filteredTableData.map(r=>` 295 <tr> 296 <td>${r.userid}</td> 297 <td>${r.totalincome}</td> 298 <td>${r.totalsales}</td> 299 </tr>`).join(""),this.filteredTableData.length===0&&(e.innerHTML=` 300 <tr> 301 <td colspan="3" class="text-center">No results found.</td> 302 </tr>`))}createTable(){let e=document.createElement("table");return e.className="table table-bordered table-striped",e.innerHTML=` 303 <thead> 304 <tr> 305 <th>User Id</th> 306 <th>Total Income</th> 307 <th>Total Sales</th> 308 </tr> 309 </thead> 310 <tbody> 311 ${this.filteredTableData.map(r=>` 312 <tr> 313 <td>${r.userid}</td> 314 <td>${r.totalincome}</td> 315 <td>${r.totalsales}</td> 316 </tr>`).join("")} 317 </tbody> 318 `,e}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(Hr),x(As),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-admmission-analytics"]],standalone:!1,features:[Ii([Be])],decls:85,vars:10,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","chartSelect",1,"form-select",3,"ngModelChange","change","ngModel"],["value","a"],["value","b"],["value","c"],["value","d"],["value","e"],["value","f"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","daily"],["value","weekly"],["value","onsite"],["value","onsite-guide"],["value","onsite-paid"],["value","onsite-pay-at-gate"],["value","onsite-guide-paid"],["value","onsite-guide-pay-at-gate"],["type","date",1,"form-control",3,"ngModelChange","ngModel"],["type","button",1,"btn","btn-outline-primary",3,"click"],[1,"exportBtns"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],["id","chartingBox1",1,"chart-container"],["id","chartingBox2",1,"chart-container"],["id","barChart",1,"chart-container"],["id","barChartVisitorAmount",1,"chart-container"],["id","pieChart",1,"chart-container"],["id","pieChart1",1,"chart-container"],["id","chartingBox3",1,"chart-container"],["id","chartingBox4",1,"chart-container"],["id","chartingBox5",1,"chart-container"],["id","chartingBox6",1,"chart-container"],["id","chartingBox7",1,"chart-container"],["id","chartingBox8",1,"chart-container"],["id","chartingBox9",1,"chart-container"],["id","chartingBox10",1,"chart-container"],["id","chartingBox11",1,"chart-container"],["id","chartingBox12",1,"chart-container"],["id","chartingBox13",1,"chart-container"],["id","chartingBox14",1,"chart-container"],["id","chartingBox15",1,"chart-container"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Analytics"),o(),s(5,"div",3),l(6,"Transaction Analytics"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Report Type"),o(),s(12,"select",8),X("ngModelChange",function(d){return K(a.selectedOption,d)||(a.selectedOption=d),d}),S("change",function(){return a.onOptionChange()}),s(13,"option",9),l(14,"Sales Report"),o(),s(15,"option",10),l(16,"Visitors Report"),o(),s(17,"option",11),l(18,"Pre-Shoots/Photo-Shoots Report"),o(),s(19,"option",12),l(20,"Entrance Ticketing Report"),o(),s(21,"option",13),l(22,"Donation Report"),o(),s(23,"option",14),l(24,"TourGuide Report"),o()()(),s(25,"div",6)(26,"label",7),l(27,"Frequency"),o(),s(28,"select",15),X("ngModelChange",function(d){return K(a.selectedFrequency,d)||(a.selectedFrequency=d),d}),S("change",function(){return a.onFrequencyChange()}),s(29,"option",16),l(30,"Daily Sales"),o(),s(31,"option",17),l(32,"Weekly Sales"),o()()(),s(33,"div",6)(34,"label",7),l(35,"Ticket Type"),o(),s(36,"select",15),X("ngModelChange",function(d){return K(a.ticketType,d)||(a.ticketType=d),d}),S("change",function(){return a.onTicketTpypeChange()}),s(37,"option",18),l(38,"onsite"),o(),s(39,"option",19),l(40,"onsite-guide"),o(),s(41,"option",20),l(42,"onsite-paid"),o(),s(43,"option",21),l(44,"onsite-pay-at-gate"),o(),s(45,"option",22),l(46,"onsite-guide-paid"),o(),s(47,"option",23),l(48," onsite-guide-pay-at-gate "),o()()(),s(49,"div",6)(50,"label",7),l(51,"Date From"),o(),s(52,"input",24),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(53,"div",6)(54,"label",7),l(55,"Date To"),o(),s(56,"input",24),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(57,"button",25),S("click",function(){return a.applyFilter()}),l(58," Generate "),o()(),s(59,"div",26)(60,"button",27),S("click",function(){return a.onPressGenerateExcel()}),s(61,"span",28),l(62,"description"),o(),l(63,"EXCEL "),o()()(),s(64,"div",29)(65,"div",30),B(66,"div",31)(67,"div",32)(68,"div",33)(69,"div",34)(70,"div",35)(71,"div",36)(72,"div",37)(73,"div",38)(74,"div",39)(75,"div",40)(76,"div",41)(77,"div",42)(78,"div",43)(79,"div",44)(80,"div",45)(81,"div",46)(82,"div",47)(83,"div",48)(84,"div",49),o()()()),r&2&&(p("ngClass",Z(8,wme,a.isCollapsed)),m(12),q("ngModel",a.selectedOption),m(16),q("ngModel",a.selectedFrequency),m(8),q("ngModel",a.ticketType),m(16),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate))},dependencies:[ue,Bt,Vt,Ke,Ot,Ne,Le],styles:["table[_ngcontent-%COMP%]{width:100%;margin-top:20px;border-collapse:collapse}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px;text-align:center;border:1px solid #ddd}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#333;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#000;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#111}input[type=text][_ngcontent-%COMP%]{width:100%;margin-bottom:10px;padding:10px;font-size:14px;border:1px solid #ccc;border-radius:4px}input[type=text][_ngcontent-%COMP%]:focus{outline:none;border-color:#2873ff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#444;cursor:pointer}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-family:Arial,sans-serif}"]});let i=n;return i})();var eL=Di(Ti());var Tme=i=>({collapsed:i}),tL=(()=>{let n=class n{constructor(e,r,a,c){this.sidebarService=e,this.admissionService=r,this.spinner=a,this.toastr=c,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.selectedFrequency="daily",this.ticketType="onsite",this.frequency="",this.isCollapsed=!1,this.SalesAndCountData=[]}
318ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.totalSalesValuesAndCount()}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onFrequencyChange(){console.log(this.selectedFrequency),this.selectedFrequency=this.selectedFrequency,console.log("selected frequency",this.selectedFrequency)}onTicketTpypeChange(){console.log(this.ticketType),this.ticketType=this.ticketType,console.log("selected frequency",this.ticketType)}onPressGenerateExcel(){this.generateExcel()}applyFilter(){console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate,this.selectedFrequency),this.clearCharts(),this.totalSalesValuesAndCount()}totalSalesValuesAndCount(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.getSalesReportData(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.SalesAndCountData=e.data,this.SalesAndCountData.length!=0?(this.initLineChart1(this.SalesAndCountData),this.initLineChart2(this.SalesAndCountData)):this.toastr.warning("No records found for selected Range"),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}generateExcel(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.admissionService.getSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{if(e&&e.status==="success"){let a=e.data.flatMap(v=>v.entries).map(v=>({Date:v.issueddate,"Local Value (LKR)":v.local_cost.toLocaleString(),"No. Of Locals":v.local_count,"Tourist Value (LKR)":v.tourist_cost.toLocaleString(),"No. Of Tourists":v.tourist_count})),c=[[`Sales Report from ${this.selectedStartDate} to ${this.selectedEndDate}`],[],["Date","Local Value (LKR)","No. Of Locals","Tourist Value (LKR)","No. Of Tourists"],...a.map(v=>Object.values(v))],d=Nn.aoa_to_sheet(c),u=Nn.book_new();Nn.book_append_sheet(u,d,"Sales Report");let h=Ec(u,{bookType:"xlsx",type:"array"}),f=new Blob([h],{type:"application/octet-stream"});(0,eL.saveAs)(f,`Sales_Report_${this.selectedStartDate}_to_${this.selectedEndDate}.xlsx`),this.toastr.success("File Generated Successfully!")}else this.toastr.warning("No data available for the selected period.","Warning");console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}clearCharts(){["chartingBox1","chartingBox2","barChart","barChartVisitorAmount","pieChart","pieChart1","chartingBox3","chartingBox4","chartingBox5","chartingBox6","chartingBox7","chartingBox8","chartingBox9","chartingBox10","chartingBox11","chartingBox12","chartingBox13","chartingBox14","chartingBox15"].forEach(r=>{let a=document.getElementById(r);if(a){let c=Oc(a);c&&c.dispose(),a.innerHTML=""}else console.warn(`No element found with ID: ${r}`)})}initLineChart1(e){let r=document.getElementById("chartingBox1");if(r){let a=document.createElement("div");a.style.width="100%",a.style.minHeight="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.date),u=e.map(f=>f.amount),h={tooltip:{trigger:"axis",formatter:function(f){return`${f[0].name}<br/> 319 Amount: LKR ${f[0].value.toLocaleString()}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount (LKR)",axisLabel:{formatter:f=>
319`${f.toLocaleString()}`}},series:[{data:u,type:"bar",smooth:!0,name:"Sales Amount"}]};c.setOption(h)}}initLineChart2(e){let r=document.getElementById("chartingBox2");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.date),u=e.map(f=>f.totalcount),h={tooltip:{trigger:"axis",formatter:function(f){return`${f[0].name}<br/> 320 Count: ${f[0].value.toLocaleString()}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Count",minInterval:1},series:[{data:u,type:"bar",smooth:!0,name:"Sales Count"}]};c.setOption(h)}}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(Hr),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-sales-report-analytics"]],standalone:!1,decls:72,vars:8,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","daily"],["value","weekly"],["value","monthly"],["type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"row"],[1,"col-md-6"],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["id","chartingBox1",1,"chart-container"],["id","chartingBox2",1,"chart-container"],["id","barChart",1,"chart-container"],["id","barChartVisitorAmount",1,"chart-container"],["id","pieChart",1,"chart-container"],["id","pieChart1",1,"chart-container"],["id","chartingBox3",1,"chart-container"],["id","chartingBox4",1,"chart-container"],["id","chartingBox5",1,"chart-container"],["id","chartingBox6",1,"chart-container"],["id","chartingBox7",1,"chart-container"],["id","chartingBox8",1,"chart-container"],["id","chartingBox9",1,"chart-container"],["id","chartingBox10",1,"chart-container"],["id","chartingBox11",1,"chart-container"],["id","chartingBox12",1,"chart-container"],["id","chartingBox13",1,"chart-container"],["id","chartingBox14",1,"chart-container"],["id","chartingBox15",1,"chart-container"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sales Reports Analytics"),o(),s(5,"div",3),l(6,"Transaction Analytics"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Frequency"),o(),s(12,"select",8),X("ngModelChange",function(d){return K(a.selectedFrequency,d)||(a.selectedFrequency=d),d}),S("change",function(){return a.onFrequencyChange()}),s(13,"option",9),l(14,"Daily Sales"),o(),s(15,"option",10),l(16,"Weekly Sales"),o(),s(17,"option",11),l(18,"Monthly Sales"),o()()(),s(19,"div",6)(20,"label",7),l(21,"Date From"),o(),s(22,"input",12),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(23,"div",6)(24,"label",7),l(25,"Date To"),o(),s(26,"input",12),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(27,"div",13)(28,"button",14),S("click",function(){return a.applyFilter()}),s(29,"span",15),l(30,"search"),o(),l(31," Generate "),o()()(),s(32,"div",13)(33,"button",16),S("click",function(){return a.onPressGenerateExcel()}),s(34,"span",15),l(35,"description"),o(),l(36,"EXCEL "),o()()(),s(37,"div",17)(38,"div",18)(39,"div",19)(40,"div",20)(41,"div",21)(42,"div",22)(43,"div",23)(44,"div",24),l(45,"Total Sales Values (LKR)"),o()(),s(46,"div",25),B(47,"div",26),o()()(),s(48,"div",21)(49,"div",22)(50,"div",23)(51,"div",24),l(52,"Total Sales Count"),o()(),s(53,"div",25),B(54,"div",27),o()()()()(),B(55,"div",28)(56,"div",29)(57,"div",30)(58,"div",31)(59,"div",32)(60,"div",33)(61,"div",34)(62,"div",35)(63,"div",36)(64,"div",37)(65,"div",38)(66,"div",39)(67,"div",40)(68,"div",41)(69,"div",42)(70,"div",43)(71,"div",44),o()()()),r&2&&(p("ngClass",Z(6,Tme,a.isCollapsed)),m(12),q("ngModel",a.selectedFrequency),m(10),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate))},dependencies:[ue,Bt,Vt,Ke,Ot,Ne,Le],styles:["table[_ngcontent-%COMP%]{width:100%;margin-top:20px;border-collapse:collapse}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px;text-align:center;border:1px solid #ddd}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#333;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#000;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#111}input[type=text][_ngcontent-%COMP%]{width:100%;margin-bottom:10px;padding:10px;font-size:14px;border:1px solid #ccc;border-radius:4px}input[type=text][_ngcontent-%COMP%]:focus{outline:none;border-color:#2873ff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#444;cursor:pointer}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-family:Arial,sans-serif}"]});let i=n;return i})();var iL=Di(Ti());var Dme=i=>({collapsed:i}),nL=(()=>{let n=class n{constructor(e,r,a,c){this.sidebarService=e,this.admissionService=r,this.spinner=a,this.toastr=c,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.selectedFrequency="daily",this.ticketType="onsite",this.frequency="",this.isCollapsed=!1,this.LocalForeginData=[],this.Visitors
320Data=[],this.VehicalsData=[]}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.totalVisitorAndVehicalsSales()}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onFrequencyChange(){console.log(this.selectedFrequency),this.selectedFrequency=this.selectedFrequency,console.log("selected frequency",this.selectedFrequency)}onTicketTpypeChange(){console.log(this.ticketType),this.ticketType=this.ticketType,console.log("selected frequency",this.ticketType)}onPressGenerateExcel(){this.generateExcel()}applyFilter(){console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate,this.selectedFrequency),this.clearCharts(),this.totalVisitorAndVehicalsSales()}totalVisitorAndVehicalsSales(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.spinner.show(),this.admissionService.getVisitorAndVehicalsSales(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.LocalForeginData=e.data.visitorsGroupedByMainTypes,this.Visitors
320Data=e.data.visitorsGroupedByAllTypes,this.VehicalsData=e.data.vehiclesGroupedByAllTypes,this.LocalForeginData.length!=0||this.VisitorsData.length!=0||this.VehicalsData.length!=0?(console.log(this.LocalForeginData),console.log(this.VisitorsData),console.log(this.VehicalsData),this.initBarChart(this.LocalForeginData),this.initBarChartVisitorAmount(this.LocalForeginData),this.initPieChart1(this.VisitorsData),this.initPieChart2(this.VehicalsData)):this.toastr.warning("No records found for selected range."),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}generateExcel(){try{console.log("Generating Excel with local data...");let e=this.LocalForeginData.length>0,r=this.VisitorsData.length>0,a=this.VehicalsData.length>0;if(!e&&!r&&!a){this.toastr.warning("No records found to generate the Excel file.","Warning");return}let c=this.LocalForeginData.map(C=>({"Issued Date":C.issueddate,"Local Count":C.local_count,"Local Cost (LKR)":C.local_cost.toLocaleString("en-US"),"Tourist Count":C.tourist_count,"Tourist Cost (LKR)":C.tourist_cost.toLocaleString("en-US")}
320)),d=this.VisitorsData.map(C=>({Visitor:C.visitor,"Visitor Count":C.counts,"Visitor Cost (LKR)":C.costs.toLocaleString("en-US")})),u=this.VehicalsData.map(C=>({Vehicle:C.vehicle,"Vehicle Count":C.counts,"Vehicle Cost (LKR)":C.costs.toLocaleString("en-US")})),h=Nn.book_new();if(e){let C=[[`Visitor Report from ${this.selectedStartDate} to ${this.selectedEndDate}`]],y=Nn.aoa_to_sheet(C);Nn.sheet_add_json(y,c,{origin:"A3"}),Nn.book_append_sheet(h,y,"Local & Foreign Data")}if(r){let C=[[`Visitor Report from ${this.selectedStartDate} to ${this.selectedEndDate}`]],y=Nn.aoa_to_sheet(C);Nn.sheet_add_json(y,d,{origin:"A3"}),Nn.book_append_sheet(h,y,"Visitors Data")}if(a){let C=[[`Visitor Report from ${this.selectedStartDate} to ${this.selectedEndDate}`]],y=Nn.aoa_to_sheet(C);Nn.sheet_add_json(y,u,{origin:"A3"}),Nn.book_append_sheet(h,y,"Vehicles Data")}let f=Ec(h,{bookType:"xlsx",type:"array"}),v=new Blob([f],{type:"application/octet-stream"});(0,iL.saveAs)(v,`VisitorsReport_${this.selectedStartDate}_to_${this.selectedEndDate}.xlsx`),this.toastr.success("File generated successfully!","Success")}catch(e){console.error("Error generating Excel file:",e),this.toastr.error("Something went wrong while generating the file.","Error")}}clearCharts(){["chartingBox1","chartingBox2","barChart","barChartVisitorAmount","pieChart","pieChart1","chartingBox3","chartingBox4","chartingBox5","chartingBox6","chartingBox7","chartingBox8","chartingBox9","chartingBox10","chartingBox11","chartingBox12","chartingBox13","chartingBox14","chartingBox15"].forEach(r=>{let a=document.getElementById(r);if(a){let c=Oc(a);c&&c.dispose(),a.innerHTML=""}else console.warn(`No element found with ID: ${r}`)})}initBarChart(e){let r=document.getElementById("barChart");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(C=>C.issueddate),u=e.map(C=>C.local_count),h=e.map(C=>C.tourist_count),f=C=>isNaN(C)?"0":C.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),v={xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:[{type:"value",name:"Visitor Count",position:"left"}],legend:{data:["Local","Foreign"],top:10,left:"right"},series:[{name:"Local",data:u,type:"bar",stack:"count",color:"#5c7bd9",yAxisIndex:0},{name:"Foreign",data:h,type:"bar",stack:"count",color:"#ff7070",yAxisIndex:0}],tooltip:{trigger:"axis",formatter:function(C){let y=C[0].axisValue,A=f(e[C[0].dataIndex].local_count||0),D=f(e[C[0].dataIndex].tourist_count||0),F=f(e[C[0].dataIndex].local_count+e[C[0].dataIndex].tourist_count);return` 321 <div style="font-size: 14px; font-weight: bold; margin-bottom: 5px;">Visitors</div> 322 <div style="font-size: 12px; margin-bottom: 8px;"><strong>${y}</strong></div> 323 <div style="display: flex; align-items: center; margin-bottom: 5px;"> 324 <span style="width: 12px; height: 12px; background-color: #5c7bd9; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 325 <span style="flex-grow: 1;">Local:</span> 326 <span style="text-align: right; width: 70px;">${A}</span> 327 </div> 328 <div style="display: flex; align-items: center;"> 329 <span style="width: 12px; height: 12px; background-color: #ff7070; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 330 <span style="flex-grow: 1;">Foreign:</span> 331 <span style="text-align: right; width: 70px;">${D}</span> 332 </div> 333 334 <div style="display: flex; align-items: center; margin-top:5px;"> 335 <span style="flex-grow: 1;">Total:</span> 336 <span style="text-align: right; width: 70px;">${F}</span> 337 </div> 338 `},backgroundColor:"rgba(255, 255, 255, 0.9)",borderColor:"#ccc",borderWidth:1,textStyle:{color:"#333"},extraCssText:"box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;"}};c.setOption(v)}}initBarChartVisitorAmount(e){let r=document.getElementById("barChartVisitorAmount");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(C=>C.issueddate),u=e.map(C=>C.local_cost),h=e.map(C=>C.tourist_cost),f=C=>
338isNaN(C)?"0":C.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),v={xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:[{type:"value",name:"Amount (LKR)",position:"left"}],legend:{data:["Local","Foreign"],top:10,left:"right"},series:[{name:"Local",data:u,type:"bar",stack:"cost",color:"orange",yAxisIndex:0},{name:"Foreign",data:h,type:"bar",stack:"cost",color:"green",yAxisIndex:0}],tooltip:{trigger:"axis",formatter:function(C){let y=C[0].axisValue,A=C.find(H=>H.seriesName==="Local"),D=C.find(H=>H.seriesName==="Foreign"),F=A?f(e[C[0].dataIndex].local_cost):"0",R=D?f(e[C[0].dataIndex].tourist_cost):"0",L=f(e[C[0].dataIndex].local_cost+e[C[0].dataIndex].tourist_cost);return` 339 <div style="font-size: 14px; font-weight: bold; margin-bottom: 5px;">Revenue</div> 340 <div style="font-size: 12px; margin-bottom: 8px;"><strong>${y}</strong></div> 341 <div style="display: flex; align-items: center; margin-bottom: 5px;"> 342 <span style="width: 12px; height: 12px; background-color: orange; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 343 <span style="flex-grow: 1;">Local:</span> 344 <span style="text-align: right; width: 70px;">${F}</span> 345 </div> 346 <div style="display: flex; align-items: center;"> 347 <span style="width: 12px; height: 12px; background-color: green; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 348 <span style="flex-grow: 1;">Foreign:</span> 349 <span style="text-align: right; width: 70px;">${R}</span> 350 </div> 351 352 <div style="display: flex; align-items: center; margin-top:5px;"> 353 <span style="flex-grow: 1;">Total:</span> 354 <span style="text-align: right; width: 70px;">${L}</span> 355 </div> 356 `},backgroundColor:"rgba(255, 255, 255, 0.9)",borderColor:"#ccc",borderWidth:1,textStyle:{color:"#333"},extraCssText:"box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;"}};c.setOption(v)}}initPieChart1(e){let r=document.getElementById("pieChart");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=v=>v.split("-").map(C=>C.charAt(0).toUpperCase()+C.slice(1)).join(" "),u=e.map(v=>({name:d(v.visitor),value:v.counts,costs:v.costs})),h=v=>isNaN(v)?"0":v.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),f={tooltip:{trigger:"item",formatter:function(v){let C=v.name,y=v.value,A=h(v.data.costs);return` 357 <strong>${C}</strong><br/> 358 Count: ${y.toLocaleString()}<br/> 359 Revenue: LKR ${A} 360 `}},series:[{name:"Visitor Breakdown",type:"pie",radius:"50%",data:u,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};c.setOption(f)}}initPieChart2(e){let r=document.getElementById("pieChart1");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>({name:f.vehicle,value:f.counts,costs:f.costs})),u=f=>isNaN(f)?"0":f.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),h={tooltip:{trigger:"item",formatter:function(f){let v=f.name,C=f.value,y=u(f.data.costs);return` 361 <strong>${v}</strong><br/> 362 Count: ${C.toLocaleString()}<br/> 363 Revenue: LKR ${y} 364 `}},series:[{name:"Vehicle Breakdown",type:"pie",radius:"50%",data:d,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};c.setOption(h)}}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(Hr),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-visitors-report-analytics"]],standalone:!1,decls:85,vars:8,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","daily"],["value","weekly"],["value","monthly"],["type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"row"],[1,"col-md-6"],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["id","barChart",1,"chart-container"],["id","barChartVisitorAmount",1,"chart-container"],["id","pieChart",1,"chart-container"],["id","pieChart1",1,"chart-container"],["id","chartingBox1",1,"chart-container"],["id","chartingBox2",1,"chart-container"],["id","chartingBox3",1,"chart-container"],["id","chartingBox4",1,"chart-container"],["id","chartingBox5",1,"chart-container"],["id","chartingBox6",1,"chart-container"],["id","chartingBox7",1,"chart-container"],["id","chartingBox8",1,"chart-container"],["id","chartingBox9",1,"chart-container"],["id","chartingBox10",1,"chart-container"],["id","chartingBox11",1,"chart-container"],["id","chartingBox12",1,"chart-container"],["id","chartingBox13",1,"chart-container"],["id","chartingBox14",1,"chart-container"],["id","chartingBox15",1,"chart-container"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Visitors Analytics"),o(),s(5,"div",3),l(6,"Transaction Analytics"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Frequency"),o(),s(12,"select",8),X("ngModelChange",function(d){return K(a.selectedFrequency,d)||(a.selectedFrequency=d),d}),S("change",function(){return a.onFrequencyChange()}),s(13,"option",9),l(14,"Daily Sales"),o(),s(15,"option",10),l(16,"Weekly Sales"),o(),s(17,"option",11),l(18,"Monthly Sales"),o()()(),s(19,"div",6)(20,"label",7),l(21,"Date From"),o(),s(22,"input",12),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(23,"div",6)(24,"label",7),l(25,"Date To"),o(),s(26,"input",12),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(27,"div",13)(28,"button",14),S("click",function(){return a.applyFilter()}),s(29,"span",15),l(30,"search"),o(),l(31," Generate "),o()()(),s(32,"div",13)(33,"button",16),S("click",function(){return a.onPressGenerateExcel()}),s(34,"span",15),l(35,"description"),o(),l(36,"EXCEL "),o()()(),s(37,"div",17)(38,"div",18)(39,"div",19)(40,"div",20)(41,"div",21)(42,"div",22)(43,"div",23)(44,"div",24),l(45,"Visitors"),o()(),s(46,"div",25),B(47,"div",26),o()()(),s(48,"div",21)(49,"div",22)(50,"div",23)(51,"div",24),l(52,"Revenue"),o()(),s(53,"div",25),B(54,"div",27),o()()(),s(55,"div",21)(56,"div",22)(57,"div",23)(58,"div",24),l(59,"Visitors"),o()(),s(60,"div",25),B(61,"div",28),o()()(),s(62,"div",21)(63,"div",22)(64,"div",23)(65,"div",24),l(66,"Vehicles"),o()(),s(67,"div",25),B(68,"div",29),o()()()()(),B(69,"div",30)(70,"div",31)(71,"div",28)(72,"div",32)(73,"div",33)(74,"div",34)(75,"div",35)(76,"div",36)(77,"div",37)(78,"div",38)(79,"div",39)(80,"div",40)(81,"div",41)(82,"div",42)(83,"div",43)(84,"div",44),o()()()),r&2&&(p("ngClass",Z(6,Dme,a.isCollapsed)),m(12),q("ngModel",a.selectedFrequency),m(10),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate))},dependencies:[ue,Bt,Vt,Ke,Ot,Ne,Le],styles:["table[_ngcontent-%COMP%]{width:100%;margin-top:20px;border-collapse:collapse}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px;text-align:center;border:1px solid #ddd}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#333;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#000;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#111}input[type=text][_ngcontent-%COMP%]{width:100%;margin-bottom:10px;padding:10px;font-size:14px;border:1px solid #ccc;border-radius:4px}input[type=text][_ngcontent-%COMP%]:focus{outline:none;border-color:#2873ff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#444;cursor:pointer}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-family:Arial,sans-serif}"]});let i=n;return i})();var rL=Di(Ti());var Ime=i=>({collapsed:i}),aL=(()=>{let n=class n{constructor(e,r,a,c){this.sidebarService=e,this.admissionService=r,this.spinner=a,this.toastr=c,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.selectedFrequency="daily",this.ticketType="onsite",this.frequency="",this.isCollapsed=!1,this.EntranceTicketingReport=[],this.SalesByNationality=[],this.TopTenNations=[],this.PeakOffPeakData=[]}
364ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.getEntranceTicketingdata(),this.getSalesByNationality(),this.getTimelySales(),this.getTopTenNations()}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onFrequencyChange(){console.log(this.selectedFrequency),this.selectedFrequency=this.selectedFrequency,console.log("selected frequency",this.selectedFrequency)}onTicketTpypeChange(){console.log(this.ticketType),this.ticketType=this.ticketType,console.log("selected frequency",this.ticketType)}onPressGenerateExcel(){this.generateExcel()}applyFilter(){console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate,this.selectedFrequency),this.clearCharts(),this.getEntranceTicketingdata(),this.get
364SalesByNationality(),this.getTimelySales(),this.getTopTenNations()}generateExcel(){try{console.log("Generating Excel with entrance ticketing data...");let e=this.EntranceTicketingReport.length>0,r=this.SalesByNationality.length>0,a=this.TopTenNations.length>0,c=this.PeakOffPeakData.length>0;if(!e&&!r&&!a&&!c){this.toastr.warning("No records found to generate the Excel file.","Warning");return}let d=Nn.book_new();if(e){let f=["Date","Total Amount (LKR)","Total Count"],v=[[`Entrance Ticketing Report (${this.selectedStartDate} to ${this.selectedEndDate})`],[],f,...this.EntranceTicketingReport.map(y=>[y.date,y.amount.toLocaleString(),y.totalcount])],C=Nn.aoa_to_sheet(v);Nn.book_append_sheet(d,C,"Entrance Ticketing Report")}if(r){let f=["Nationality","Ticket Count","Total Cost (LKR)"],v=[[`Sales by Nationality (${this.selectedStartDate} to ${this.selectedEndDate})`],[],f,...this.SalesByNationality.map(y=>[y.nationality,y.counts,y.costs.toLocaleString()])],C=Nn.aoa_to_sheet(v);Nn.book_append_sheet(d,C,"Sales by Nationality")}if(a){let f=["Nationality","Ticket Count","Total Cost (LKR)"],v=[[`Top 10 Nations (${this.selectedStartDate} to ${this.selectedEndDate})`],[],f,...this.TopTenNations.map(y=>[y.nationality,y.counts,y.costs.toLocaleString()])],C=Nn.aoa_to_sheet(v);Nn.book_append_sheet(d,C,"Top 10 Nations")}if(c){let f=["Time (IST)","Total Ticket Count"],v=[[`Peak/Off-Peak Data (${this.selectedStartDate} to ${this.selectedEndDate})`],[],f,...this.PeakOffPeakData.map(y=>{let A=new Date(`1970-01-01T${y.groupedhour}Z`),D=new Date(A.getTime()+5.5*60*60*1e3),F=D.getHours(),R=D.getMinutes().toString().padStart(2,"0"),L=F>=12?"PM":"AM";return[`${F%12||12}:${R} ${L}`,y.totalticketcount]})],C=Nn.aoa_to_sheet(v);Nn.book_append_sheet(d,C,"Peak Off-Peak Data")}d.SheetNames=d.SheetNames.map(f=>f.replace(/[:\\/?*[\]]/g,"_"));let u=Ec(d,{bookType:"xlsx",type:"array"}),h=new Blob([u],{type:"application/octet-stream"});(0,rL.saveAs)(h,`EntranceTicketingReport_${this.selectedStartDate}_to_${this.selectedEndDate}.xlsx`),this.toastr.success("File generated successfully!","Success")}catch(e){console.error("Error generating Excel file:",e),this.toastr.error("Something went wrong while generating the file.","Error")}}clearCharts(){["chartingBox1","chartingBox2","barChart","barChartVisitorAmount","pieChart","pieChart1","chartingBox3","chartingBox4","chartingBox5","chartingBox6","chartingBox7","chartingBox8","chartingBox9","chartingBox10","chartingBox11","chartingBox12","chartingBox13","chartingBox14","chartingBox15"].forEach(r=>{let a=document.getElementById(r);if(a){let c=Oc(a);c&&c.dispose(),a.innerHTML=""}else console.warn(`No element found with ID: ${r}`)})}getEntranceTicketingdata(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.entranceTicketingReport(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency,this.ticketType).subscribe({next:e=>{this.EntranceTicketingReport=e.data,this.EntranceTicketingReport.length!=0?(this.initLineChart7(this.EntranceTicketingReport),this.initLineChart8(this.EntranceTicketingReport)):this.toastr.warning("No records found for selected Range"),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getSalesByNationality(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.salesByNationality(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.SalesByNationality=e.data,this.SalesByNationality.length!=0?this.initSalesByNationalityChart(this.SalesByNationality):this.toastr.warning("No records found for selected Range"),console.log("API Response list of nationality:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getTopTenNations(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.topTenNations(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.TopTenNations=e.data,this.TopTenNations.length!=0?this.initTop10NationalitiesChart(this.TopTenNations):this.toastr.warning("No records foun
364d for selected Range"),console.log("API Response list of top ten:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getTimelySales(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.admissionService.getTimelySales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.PeakOffPeakData=e.data,this.PeakOffPeakData.length!=0?this.initTicketSalesVolumeChart(this.PeakOffPeakData):this.toastr.warning("No records found for selected Range"),console.log("API Response peak and off peak sales:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}initLineChart7(e){let r=document.getElementById("chartingBox5");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=e.map(v=>v.date),d=e.map(v=>v.amount),u=v=>isNaN(v)?"0":v.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),h=Qi(a),f={tooltip:{trigger:"axis",formatter:function(v){let C=v[0],y=u(C.value);return`Date: ${C.name}<br>Amount (LKR): ${y}`}},xAxis:{type:"category",data:c,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount (LKR)"},series:[{name:"Sales",data:d,type:"bar",smooth:!0}]};h.setOption(f)}}initLineChart8(e){let r=document.getElementById("chartingBox6");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(v=>v.date),u=e.map(v=>v.amount),h=e.map(v=>v.totalcount),f={tooltip:{trigger:"axis",formatter:function(v){let C=v[0];return`Date: ${C.name}<br>Total Count: ${C.value.toLocaleString()}`}},xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Count"},series:[{data:h,type:"bar",smooth:!0}]};c.setOption(f)}}initSalesByNationalityChart(e){let r=document.getElementById("chartingBox7");if(r){let a=document.createElement("div"),c=400,d=30,u=15,h=e.length>u?c+(e.length-u)*d:c;a.style.width="100%",a.style.height=`${h}px`,e.length>u?(r.style.overflowY="auto",r.style.height=`${c}px`):(r.style.overflowY="hidden",r.style.height="auto"),r.appendChild(a);let f=Qi(a),v=e.sort((R,L)=>L.costs-R.costs),C=v.map(R=>R.nationality),y=v.map(R=>R.costs),A=v.map(R=>R.counts),D=["#FF8A80","#FFCC80","#FFEB99","#A5D6A7","#90CAF9","#B39DDB","#FF80AB","#B2FF59","#FF4081","#D1C4E9"],F={tooltip:{trigger:"item",formatter:function(R){let L=R.dataIndex,H=C[L],se=y[L],Ce=A[L];return` 365 <strong>Nationality:</strong> ${H}<br/> 366 <strong>Total Sales:</strong> LKR ${se.toLocaleString()}<br/> 367 <strong>Number of Transactions:</strong> ${Ce.toLocaleString()} 368 `}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",name:"Sales Amount"},yAxis:{type:"category",data:C,name:"Countries",inverse:!0},series:[{data:y,type:"bar",itemStyle:{color:function(R){return D[R.dataIndex%D.length]}},label:{show:!0,position:"right",formatter:function(R){return R.value.toLocaleString()}}}]};f.setOption(F)}}initTop10NationalitiesChart(e){let r=document.getElementById("chartingBox8");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.sort((v,C)=>C.counts-v.counts),u=d.map(v=>v.nationality),h=d.map(v=>v.counts),f={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(v){let C=v[0].dataIndex,y=u[C],A=h[C];return` 369 <strong>Nationality:</strong> ${y}<br/> 370 <strong>Visitor Count:</strong> ${A.toLocaleString()} 371 `}},xAxis:{type:"value",name:"Visitor Count"},yAxis:{type:"category",data:u,name:"Nationality",inverse:!0},series:[{data:h,type:"bar",itemStyle:{color:function(v){let C=["#FFCCE5","#FFD400","#B2F2B2","#B3D9FF","#FFB3E6","#D1FFFF","#E0E0E0","#FFB366","#C2F0C2","#FFCC99"];return C[v.dataIndex%C.length]}},label:{show:!0,position:"right",formatter:function(v){return v.value.toLocaleString()}}}]};c.setOption(f)}}initTicketSalesVolumeChart(e){let r=document.getElementById("chartingBox9");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),u=e.map(v=>{let[C,y]=v.groupedhour.split(":").map(Number),A=C+5,D=y+30;D>=60&&(A+=1,D-=60),A>=24&&(A-=24);let F=A>=12?"PM":"AM",L=(A%12||12).toString().padStart(2,"0"),H=D.toString().padStart(2,"0");return{groupedhour:`${L}:${H} ${F}`,totalticketcount:v.totalticketcount}}).map(v=>v.groupedhour),h=e.map(v=>v.totalticketcount),f={tooltip:{trigger:"item",formatter:function(v){return`${v.name}
371: ${v.value.toLocaleString()} visitors`}},xAxis:{type:"category",data:u,name:"Time"},yAxis:{type:"value",name:"Total Count"},series:[{data:h,type:"line",areaStyle:{}}]};c.setOption(f)}}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(Hr),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-entrance-ticketing-report-analytics"]],standalone:!1,decls:106,vars:9,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","daily"],["value","weekly"],["value","monthly"],["value","onsite"],["value","onsite-guide"],["value","onsite-paid"],["value","onsite-pay-at-gate"],["value","onsite-guide-paid"],["value","onsite-guide-pay-at-gate"],["type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"row"],[1,"col-md-6"],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["id","chartingBox6",1,"chart-container"],["id","chartingBox5",1,"chart-container"],["id","chartingBox7",1,"chart-container"],["id","chartingBox8",1,"chart-container"],[1,"col-md-12"],["id","chartingBox9",1,"chart-container"],["id","chartingBox1",1,"chart-container"],["id","chartingBox2",1,"chart-container"],["id","barChart",1,"chart-container"],["id","barChartVisitorAmount",1,"chart-container"],["id","pieChart",1,"chart-container"],["id","pieChart1",1,"chart-container"],["id","chartingBox3",1,"chart-container"],["id","chartingBox4",1,"chart-container"],["id","chartingBox10",1,"chart-container"],["id","chartingBox11",1,"chart-container"],["id","chartingBox12",1,"chart-container"],["id","chartingBox13",1,"chart-container"],["id","chartingBox14",1,"chart-container"],["id","chartingBox15",1,"chart-container"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sales Analytics"),o(),s(5,"div",3),l(6,"Transaction Analytics"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Frequency"),o(),s(12,"select",8),X("ngModelChange",function(d){return K(a.selectedFrequency,d)||(a.selectedFrequency=d),d}),S("change",function(){return a.onFrequencyChange()}),s(13,"option",9),l(14,"Daily Sales"),o(),s(15,"option",10),l(16,"Weekly Sales"),o(),s(17,"option",11),l(18,"Monthly Sales"),o()()(),s(19,"div",6)(20,"label",7),l(21,"Ticket Type"),o(),s(22,"select",8),X("ngModelChange",function(d){return K(a.ticketType,d)||(a.ticketType=d),d}),S("change",function(){return a.onTicketTpypeChange()}),s(23,"option",12),l(24,"onsite"),o(),s(25,"option",13),l(26,"onsite-guide"),o(),s(27,"option",14),l(28,"onsite-paid"),o(),s(29,"option",15),l(30,"onsite-pay-at-gate"),o(),s(31,"option",16),l(32,"onsite-guide-paid"),o(),s(33,"option",17),l(34," onsite-guide-pay-at-gate "),o()()(),s(35,"div",6)(36,"label",7),l(37,"Date From"),o(),s(38,"input",18),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(39,"div",6)(40,"label",7),l(41,"Date To"),o(),s(42,"input",18),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(43,"div",19)(44,"button",20),S("click",function(){return a.applyFilter()}),s(45,"span",21),l(46,"search"),o(),l(47," Generate "),o()()(),s(48,"div",19)(49,"button",22),S("click",function(){return a.onPressGenerateExcel()}),s(50,"span",21),l(51,"description"),o(),l(52,"EXCEL "),o()()(),s(53,"div",23)(54,"div",24)(55,"div",25)(56,"div",26)(57,"div",27)(58,"div",28)(59,"div",29)(60,"div",30),l(61,"Total Sales Count"),o()(),s(62,"div",31),B(63,"div",32),o()()(),s(64,"div",27)(65,"div",28)(66,"div",29)(67,"div",30),l(68,"Total Sales Values (LKR)"),o()(),s(69,"div",31),B(70,"div",33),o()()(),s(71,"div",27)(72,"div",28)(73,"div",29)(74,"div",30),l(75,"Total Sales (LKR)"),o()(),s(76,"div",31),B(77,"div",34),o()()(),s(78,"div",27)(79,"div",28)(80,"div",29)(81,"div",30),l(82,"Top 10 Visited Nationalities"),o()(),s(83,"div",31),B(84,"div",35),o()()(),s(85,"div",36)(86,"div",28)(87,"div",29)(88,"div",30),l(89," Ticket Sales Volume Over Time (Peak & Off-Peak Hours) "),o()(),s(90,"div",31),B(91,"div",37),o()()()()(),B(92,"div",38)(93,"div",39)(94,"div",40)(95,"div",41)(96,"div",42)(97,"div",43)(98,"div",44)(99,"div",45)(100,"div",46)(101,"div",47)(102,"div",48)(103,"div",49)(104,"div",50)(105,"div",51),o()()()),r&2&&(p("ngClass",Z(7,Ime,a.isCollapsed)),m(12),q("ngModel",a.selectedFrequency),m(10),q("ngModel",a.ticketType),m(16),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate))},dependencies:[ue,Bt,Vt,Ke,Ot,Ne,Le],styles:["table[_ngcontent-%COMP%]{width:100%;margin-top:20px;border-collapse:collapse}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px;text-align:center;border:1px solid #ddd}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#333;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#000;color:#fff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#111}input[type=text][_ngcontent-%COMP%]{width:100%;margin-bottom:10px;padding:10px;font-size:14px;border:1px solid #ccc;border-radius:4px}input[type=text][_ngcontent-%COMP%]:focus{outline:none;border-color:#2873ff}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#444;cursor:pointer}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-family:Arial,sans-serif}"]});let i=n;return i})();var oL=Di(Ti());var kme=i=>({collapsed:i});
371function Mme(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"strong"),l(6),I(7,"currencyFormat"),o()(),s(8,"td"),l(9),o()()),i&2){let t=n.$implicit;m(3),_("#",t.userid),m(3),b(M(7,3,t.totalincome)),m(3),b(t.totalsales)}}function Ame(i,n){i&1&&(s(0,"tr")(1,"td",29),l(2,"No results found."),o()())}var sL=(()=>{let n=class n{constructor(e,r,a,c){this.sidebarService=e,this.admissionService=r,this.spinner=a,this.toastr=c,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.selectedFrequency="daily",this.ticketType="onsite",this.frequency="",this.isCollapsed=!1,this.TourGuideReport=[],this.searchTerm=""}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.getTourGuideReport()}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onFrequencyChange(){console.log(this.selectedFrequency),this.selectedFrequency=this.selectedFrequency,console.log("selected frequency",this.selectedFrequency)}onTicketTpypeChange(){console.log(this.ticketType),this.ticketType=this.ticketType,console.log("selected frequency",this.ticketType)}onPressGenerateExcel(){this.generateExcel()}applyFilter(){console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate,this.selectedFrequency),this.getTourGuideReport()}getTourGuideReport(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.admissionService.tourGuideReport(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.TourGuideReport=e.data,console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}filterTable(){this.filteredTableData}get filteredTableData(){return this.searchTerm.trim()?this.TourGuideReport.filter(e=>{let r=e.userid.toString(),a=this.searchTerm.trim();return r.includes(a)}):this.TourGuideReport}generateExcel(){try{if(console.log("Generating Excel for Tour Guide Report..."),this.TourGuideReport.length===0){this.toastr.warning("No records found to generate the Excel file.","Warning");return}let e=this.TourGuideReport.map(f=>({"User ID":f.userid,"Total Income (LKR)":f.totalincome.toLocaleString(),"Total Sales":f.totalsales})),r=[[`Tour Guide Report from ${this.selectedStartDate} to ${this.selectedEndDate}`]],a=Nn.aoa_to_sheet(r);Nn.sheet_add_json(a,e,{origin:"A3"}),a.A1.s={font:{bold:!0,size:14},alignment:{horizontal:"center"}};let c={s:{c:0,r:0},e:{c:2,r:0}};a["!merges"]=[c];let d=Nn.book_new();Nn.book_append_sheet(d,a,"Tour Guide Report");let u=Ec(d,{bookType:"xlsx",type:"array"}),h=new Blob([u],{type:"application/octet-stream"});(0,oL.saveAs)(h,`TourGuideReport_${this.selectedStartDate}_to_${this.selectedEndDate}.xlsx`),this.toastr.success("File generated successfully!","Success")}catch(e){console.error("Error generating Excel file:",e),this.toastr.error("Something went wrong while generating the file.","Error")}}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(Hr),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-tourguide-report-analytics"]],standalone:!1,decls:56,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","daily"],["value","weekly"],["value","monthly"],["type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"search-container"],[1,"search-box"],["type","text","placeholder","Search by User ID or Name...",1,"form-control","search-input",3,"ngModelChange","input","ngModel"],[1,"table-wrapper"],[1,"table-responsive","withSearchbar"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],[4,"ngIf"],["colspan","3",1,"text-center"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Tour Guide Reports"),o(),s(5,"div",3),l(6,"Transaction Reports"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Frequency"),o(),s(12,"select",8),X("ngModelChange",function(d){return K(a.selectedFrequency,d)||(a.selectedFrequency=d),d}),S("change",function(){return a.onFrequencyChange()}),s(13,"option",9),l(14,"Daily Sales"),o(),s(15,"option",10),l(16,"Weekly Sales"),o(),s(17,"option",11),l(18,"Monthly Sales"),o()()(),s(19,"div",6)(20,"label",7),l(21,"Date From"),o(),s(22,"input",12),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(23,"div",6)(24,"label",7),l(25,"Date To"),o(),s(26,"input",12),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(27,"div",13)(28,"button",14),S("click",function(){return a.applyFilter()}),s(29,"span",15),l(30,"search"),o(),l(31," Generate "),o()()(),s(32,"div",13)(33,"button",16),S("click",function(){return a.onPressGenerateExcel()}),s(34,"span",15),l(35,"description"),o(),l(36,"EXCEL "),o()()(),s(37,"div",17)(38,"div",18)(39,"div",19)(40,"div",20)(41,"input",21),X("ngModelChange",function(d){return K(a.searchTerm,d)||(a.searchTerm=d),d}),S("input",function(){return a.filterTable()}),o()()(),s(42,"div",22)(43,"div",23)(44,"table",24)(45,"thead",25)(46,"tr")(47,"th"),l(48,"#UserId"),o(),s(49,"th"),l(50,"Total Income"),o(),s(51,"th"),l(52,"Total Count"),o()()(),s(53,"tbody",26),T(54,Mme,10,5,"tr",27)(55,Ame,3,0,"tr",28),o()()()()()()()),r&2&&(p("ngClass",Z(9,kme,a.isCollapsed)),m(12),q("ngModel",a.selectedFrequency),m(10),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(15),q("ngModel",a.searchTerm),m(13),p("ngForOf",a.filteredTableData),m(),p("ngIf",a.filteredTableData.length===0))},dependencies:[ue,_e,Dt,Bt,Vt,Ke,Ot,Ne,Le,Be],styles:[".search-container[_ngcontent-%COMP%]{margin-bottom:1rem}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{max-width:100%;width:100%}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{width:100%;border:1px solid #ddd;border-radius:4px;font-family:Roboto,Helvetica Neue,sans-serif;font-size:small;color:#333}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 2px #007bff40}"]});let i=n;return i})();var Pme=i=>({collapsed:i}),lL=(()=>{let n=class n{constructor(e,r,a,c){this.sidebarService=e,this.photoShootService=r,this.spinner=a,this.toastr=c,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.selectedFrequency="daily",this.ticketType="onsite",this.frequency="",this.isCollapsed=!1,this.PrePhotoShoot=[]}
371ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.getPreshootReport()}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}onFrequencyChange(){console.log(this.selectedFrequency),this.selectedFrequency=this.selectedFrequency,console.log("selected frequency",this.selectedFrequency)}onTicketTpypeChange(){console.log(this.ticketType),this.ticketType=this.ticketType,console.log("selected frequency",this.ticketType)}onPressGenerateExcel(){this.generateExcel()}applyFilter(){console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate,this.selectedFrequency),this.clearCharts(),this.getPreshootReport()}clearCharts(){["chartingBox1","chartingBox2","barChart","barChartVisitorAmount","pieChart","pieChart1","chartingBox3","chartingBox4","chartingBox5","chartingBox6","chartingBox7","chartingBox8","chartingBox9","chartingBox10","chartingBox11","chartingBox12","chartingBox13","chartingBox14","chartingBox15"].forEach(r=>{let a=document.getElementById(r);if(a){let c=Oc(a);c&&c.dispose(),a.innerHTML=""}else console.warn(`No element found with ID: ${r}`)})}getPreshootReport(){console.log(""),this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.spinner.show(),this.photoShootService.preShootPhotoShootReport(this.selectedStartDate,this.selectedEndDate,this.selectedFrequency).subscribe({next:e=>{this.PrePhotoShoot=e.data,this.PrePhotoShoot.length!=0?(this.initLineChart5(this.PrePhotoShoot),this.initLineChart6(this.PrePhotoShoot)):this.toastr.warning("No records found for selected Range"),console.log("API Response:",e),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}initLineChart5(e){let r=document.getElementById("chartingBox3");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(v=>v.issueddate),u=e.map(v=>v.amount),h=e.map(v=>v.totalcount),f={xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Amount (LKR)"},series:[{name:"Sales",data:u,type:"line",smooth:!0}],tooltip:{trigger:"axis",formatter:function(v){let C=v[0];return`Date: ${C.name}<br>AmountL(LKR): ${C.value}`}}};c.setOption(f)}}initLineChart6(e){let r=document.getElementById("chartingBox4");if(r){let a=document.createElement("div");a.style.width="100%",a.style.height="400px",r.appendChild(a);let c=Qi(a),d=e.map(f=>f.issueddate),u=e.map(f=>f.totalcount),h={xAxis:{type:"category",data:d,axisLabel:{rotate:45},name:"Dates"},yAxis:{type:"value",name:"Total Count"},series:[{name:"Sales",data:u,type:"line",smooth:!0}],tooltip:{trigger:"axis",formatter:function(f){let v=f[0];return`Date: ${v.name}<br>Count: ${v.value}`}}};c.setOption(h)}}generateExcel(){}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(As),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-photo-shoot-analytics"]],standalone:!1,decls:70,vars:8,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","daily"],["value","weekly"],["type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"row"],[1,"col-md-6"],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],["id","chartingBox3",1,"chart-container"],["id","chartingBox4",1,"chart-container"],["id","chartingBox1",1,"chart-container"],["id","chartingBox2",1,"chart-container"],["id","barChart",1,"chart-container"],["id","barChartVisitorAmount",1,"chart-container"],["id","pieChart",1,"chart-container"],["id","pieChart1",1,"chart-container"],["id","chartingBox5",1,"chart-container"],["id","chartingBox6",1,"chart-container"],["id","chartingBox7",1,"chart-container"],["id","chartingBox8",1,"chart-container"],["id","chartingBox9",1,"chart-container"],["id","chartingBox10",1,"chart-container"],["id","chartingBox11",1,"chart-container"],["id","chartingBox12",1,"chart-container"],["id","chartingBox13",1,"chart-container"],["id","chartingBox14",1,"chart-container"],["id","chartingBox15",1,"chart-container"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Reports Analytics"),o(),s(5,"div",3),l(6,"Transaction Analytics"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Frequency"),o(),s(12,"select",8),X("ngModelChange",function(d){return K(a.selectedFrequency,d)||(a.selectedFrequency=d),d}),S("change",function(){return a.onFrequencyChange()}),s(13,"option",9),l(14,"Daily Sales"),o(),s(15,"option",10),l(16,"Weekly Sales"),o()()(),s(17,"div",6)(18,"label",7),l(19,"Date From"),o(),s(20,"input",11),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(21,"div",6)(22,"label",7),l(23,"Date To"),o(),s(24,"input",11),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(25,"div",12)(26,"button",13),S("click",function(){return a.applyFilter()}),s(27,"span",14),l(28,"search"),o(),l(29," Generate "),o()()(),s(30,"div",12)(31,"button",15),S("click",function(){return a.onPressGenerateExcel()}),s(32,"span",14),l(33,"description"),o(),l(34,"EXCEL "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"div",20)(40,"div",21)(41,"div",22)(42,"div",23),l(43," Total Pre-shoot/Photo-shoot Sales Amount (LKR) "),o()(),s(44,"div",24),B(45,"div",25),o()()(),s(46,"div",20)(47,"div",21)(48,"div",22)(49,"div",23),l(50," Total Pre-shoot/Photo-shoot Sales Count "),o()(),s(51,"div",24),B(52,"div",26),o()()()()(),B(53,"div",27)(54,"div",28)(55,"div",29)(56,"div",30)(57,"div",31)(58,"div",32)(59,"div",33)(60,"div",34)(61,"div",35)(62,"div",36)(63,"div",37)(64,"div",38)(65,"div",39)(66,"div",40)(67,"div",41)(68,"div",42)(69,"div",43),o()()()),r&2&&(p("ngClass",Z(6,Pme,a.isCollapsed)),m(12),q("ngModel",a.selectedFrequency),m(8),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate))},dependencies:[ue,Bt,Vt,Ke,Ot,Ne,Le],encapsulation:2});let i=n;return i})();var Fme=i=>({collapsed:i}),Rme=(i,n)=>({completed:i,void:n});
371function Ome(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"date"),o(),s(7,"td",18),l(8),o(),s(9,"td",18),l(10),o(),s(11,"td")(12,"span",19),l(13),o()(),s(14,"td",10)(15,"strong"),l(16),I(17,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.reservationId),m(2),_(" ",Jt(6,7,t.createdDate,"MMM d, y \xB7 hh:mm:ss a")," "),m(3),_(" ",t.confirmationCode," "),m(2),b(t.reservationType),m(2),p("ngClass",Et(12,Rme,t.paymentStatus.trim().toLowerCase()==="completed",t.paymentStatus.trim().toLowerCase()==="pending")),m(),_(" ",t.paymentStatus," "),m(3),b(M(17,10,t.amount))}}function Nme(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var cL=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.photoshootservice=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.listOfReservation=[],this.filterByUser=!1,this.keyword="",this.isCollapsed=!1,this.currentPage=1,this.itemsPerPage=20,this.totalItems=0,this.totalPages=0,this.pages=[]}ngOnInit(){this.getTicketSales(0,this.itemsPerPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e,r){this.spinner.show(),this.photoshootservice.getPhotoShootTickets(e,r).subscribe({next:a=>{console.log("API Response:",a),a&&a.data&&(this.listOfReservation=a.data.listOfReservations||[],this.totalItems=a.data.rowCount,this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage),this.updatePagination()),this.spinner.hide(),this.scrollToTop()},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}updatePagination(){let r=Math.max(1,Math.min(this.currentPage-Math.floor(5),this.totalPages-10+1)),a=Math.min(this.totalPages,r+10-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){if(e>=1&&e<=this.totalPages){console.log("Navigating to page:",e);let r=e-1;this.getTicketSales(r,this.itemsPerPage),this.currentPage=e,this.updatePagination(),this.scrollToTop()}}nextPage(){this.currentPage<this.totalPages&&this.goToPage(this.currentPage+1)}prevPage(){this.currentPage>1&&this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}};n.\u0275fac=function(r){return new(r||n)(x(As),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-photo-shoot-tickets"]],standalone:!1,decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Shoot Tickets Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Reservation Id"),o(),s(16,"th"),l(17,"Reservation Date"),o(),s(18,"th"),l(19,"Confirmation Code"),o(),s(20,"th"),l(21,"Type"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Ome,18,15,"tr",12),o()()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,Nme,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,Fme,a.isCollapsed)),m(27),p("ngForOf",a.listOfReservation),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var Lme=i=>({collapsed:i});
371function Bme(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td",19),l(4),I(5,"currencyFormat"),o(),s(6,"td",19),l(7),I(8,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(2),b(t.category),m(2),_(" ",M(5,3,t.total_count)," "),m(3),_(" ",M(8,5,t.total_cost)," ")}}var dL=(()=>{let n=class n{constructor(e,r,a,c,d){this.admissionService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.entranceTicketingService=d,this.selectedStartDate="",this.selectedEndDate="",this.isCollapsed=!1,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={visitorTotalCount:0,visitorTotalCost:0,vehicalTotalCount:0,vehicalTotalCost:0},this.totalCount=0,this.totalCost=0}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}formatCategoryName(e){return e.split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("-")}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.admissionService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.result.map(r=>tt(le({},r),{category:this.formatCategoryName(r.category)})),this.total.visitorTotalCount=0,this.total.visitorTotalCost=0,this.total.vehicalTotalCount=0,this.total.vehicalTotalCost=0,this.items.forEach(r=>{let a=r.category.toLowerCase();["local-kids","local-adults","tourist-kids","tourist-adults"].includes(a)?(this.total.visitorTotalCount+=r.total_count,this.total.visitorTotalCost+=r.total_cost):(this.total.vehicalTotalCount+=r.total_count,this.total.vehicalTotalCost+=r.total_cost)}),this.totalCount=this.items.reduce((r,a)=>r+a.total_count,0),this.totalCost=this.items.reduce((r,a)=>r+a.total_cost,0),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseReportPDF()}getItemWiseReportPDF(){this.spinner.show(),this.entranceTicketingService.getItemWiseReportPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.entranceTicketingService.downloadFile(e,`Entrance Ticketing Itemwise Report ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`),this.spinner.hide()},error:e=>{console.error("Error downloading PDF:",e),this.toastr.error("Failed to generate PDF:","Error"),this.spinner.hide()}})}getItemWiseReportExcel(){this.spinner.show(),this.entranceTicketingService.getItemWiseReportExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.entranceTicketingService.downloadFile(e,`Entrance Ticketing Itemwise Report ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`),this.spinner.hide()},error:e=>{console.error("Error downloading Excel:",e),this.toastr.error("Failed to generate Excel:","Error"),this.spinner.hide()}})}exportToExcel(){this.getItemWiseReportExcel()}printReport(){window.print()}};n.\u0275fac=function(r){return new(r||n)(x(Hr),x(pe),x(me),x(ce),x(ru))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-report-admission"]],standalone:!1,decls:97,vars:31,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table","mb-0"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Entrance Ticketing \u2014 Item Wise Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
371),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th",19),l(45,"Count"),o(),s(46,"th",19),l(47,"Cost (LKR)"),o()()(),s(48,"tbody",20),T(49,Bme,9,7,"tr",21),o(),s(50,"tfoot")(51,"tr")(52,"td"),l(53,"Total"),o(),s(54,"td",19),l(55),I(56,"currencyFormat"),o(),s(57,"td",19),l(58),I(59,"currencyFormat"),o()()()(),s(60,"div",22)(61,"div",23)(62,"div",24)(63,"div",25)(64,"span",26),l(65,"Visitor Count:"),o(),s(66,"span"),l(67),I(68,"currencyFormat"),o()()(),s(69,"div",24)(70,"div",25)(71,"span",26),l(72,"Visitor Sales:"),o(),s(73,"span"),l(74),I(75,"currencyFormat"),o()()(),s(76,"div",24)(77,"div",25)(78,"span",26),l(79,"Vehicle Count:"),o(),s(80,"span"),l(81),I(82,"currencyFormat"),o()()(),s(83,"div",24)(84,"div",25)(85,"span",26),l(86,"Vehicle Sales:"),o(),s(87,"span"),l(88),I(89,"currencyFormat"),o()()(),s(90,"div",24)(91,"div",27)(92,"span"),l(93,"Total Revenue:"),o(),s(94,"span"),l(95),I(96,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(29,Lme,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(33),p("ngForOf",a.items),m(6),b(M(56,15,a.totalCount)),m(3),b(M(59,17,a.totalCost)),m(9),b(M(68,19,a.total.visitorTotalCount)),m(7),b(M(75,21,a.total.visitorTotalCost)),m(7),b(M(82,23,a.total.vehicalTotalCount)),m(7),b(M(89,25,a.total.vehicalTotalCost)),m(7),b(M(96,27,a.totalCost)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();function om(){return i=>(i.value||"").trim().length===0?{whitespace:!0}:null}function _u(i){return n=>{let t=(n.value||"").trim();return t.length===0?{whitespace:!0}:t.length<i?{minlength:{requiredLength:i,actualLength:t.length}}:null}}function mL(){return i=>{let n=i.value;return n!==null&&n<0?{nonNegative:{value:i.value}}:null}}var uL=(()=>{let n=class n{constructor(e){this.http=e,this.news_event_url=ui.ambuluwawaBackendUrl+"/news-event"}saveNewsEvent(e){let r=new xe({"Content-Type":"application/json",path:"new"});return this.http.post(this.news_event_url,e,{headers:r})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Ume=i=>({collapsed:i}),jv=i=>({"is-invalid":i});function jme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Image is required"),o()())}function Wme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Status is required"),o()())}function Hme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Status cannot be empty or whitespace only"),o()())}function Gme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Title is required"),o()())}function $me(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Title must be at least 3 characters"),o()())}function zme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Title cannot be empty or whitespace only"),o()())}function Yme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Date is required"),o()())}function qme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Description is required"),o()())}function Kme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Description must be at least 5 characters"),o()())}function Xme(i,n){i&1&&(s(0,"div",40)(1,"div"),l(2,"Description cannot be empty or whitespace only"),o()())}var pL=(()=>{let n=class n{constructor(e,r,a,c,d){this.fb=e,this.newsEventService=r,this.sidebarService=a,this.spinner=c,this.cognitoService=d,this.selectedType="news",this.submitted=!1,this.imageFile=null,this.isCollapsed=!1,this.successMessage="",this.errorMessage="",this.minDate="",this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r});let e=new Date;this.minDate=e.toISOString().split("T")[0],this.checkUserRole().then(()=>{this.initializeForm()})}ngAfterViewInit(){setTimeout(()=>{this.successModal=new bootstrap.Modal("#successModal"),this.errorModal=new bootstrap.Modal("#errorMod
371al")})}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}initializeForm(){this.newsEventForm=this.fb.group({image:["",[At.required]],status:["",[At.required,om()]],title:["",[At.required,_u(3),om()]],date:["",At.required],description:["",[At.required,_u(5),om()]]}),(this.isAccountant||this.isOfficeUser)&&this.newsEventForm.disable()}onTypeChange(e){this.selectedType=e,this.newsEventForm.reset(),this.submitted=!1,(this.isAccountant||this.isOfficeUser)&&this.newsEventForm.disable()}onFileChange(e){if(this.isAccountant||this.isOfficeUser)return;let r=e.target.files[0];r&&this.validateAndProcessFile(r)}onSubmit(){this.isAccountant||this.isOfficeUser||(this.submitted=!0,Object.keys(this.newsEventForm.controls).forEach(e=>{this.newsEventForm.get(e)?.markAsTouched()}),!this.newsEventForm.invalid&&this.imageFile&&(this.spinner.show(),this.convertImageToBase64(this.imageFile).then(e=>{let r={description:this.newsEventForm.get("description")?.value.trim(),effectiveDate:this.newsEventForm.get("date")?.value,files:[e],isNews:this.selectedType==="news",isOngoing:this.newsEventForm.get("status")?.value.trim().toLowerCase()==="ongoing",title:this.newsEventForm.get("title")?.value.trim()};this.newsEventService.saveNewsEvent(r).subscribe({next:a=>{this.spinner.hide(),this.successMessage=`${this.selectedType==="news"?"News":"Event"} has been successfully created!`,this.successModal&&this.successModal.show(),this.resetForm()},error:a=>{this.spinner.hide(),this.errorMessage="An error occurred while saving. Please try again.",this.errorModal&&this.errorModal.show()}})})))}convertImageToBase64(e){return new Promise((r,a)=>{let c=new FileReader;c.readAsDataURL(e),c.onload=()=>{r(c.result)},c.onerror=d=>{a(d)}})}get f(){return this.newsEventForm.controls}hideModals(){this.successModal&&this.successModal.hide(),this.errorModal&&this.errorModal.hide()}onDragOver(e){this.isAccountant||this.isOfficeUser||(e.preventDefault(),e.stopPropagation())}onDrop(e){if(this.isAccountant||this.isOfficeUser)return;e.preventDefault(),e.stopPropagation();let r=e.dataTransfer?.files;if(r&&r.length>0){let a=r[0];this.validateAndProcessFile(a)}}validateAndProcessFile(e){if(!e.type.match(/^image\/(png|jpeg|jpg|gif)$/)){this.errorMessage="Please upload only image files (PNG, JPEG, JPG, GIF)",this.errorModal?.show();return}if(e.size>5*1024*1024){this.errorMessage="File size should not exceed 5MB",this.errorModal?.show();return}this.imageFile=e,this.newsEventForm.patchValue({image:e.name}),this.newsEventForm.get("image")?.markAsTouched()}resetForm(){this.newsEventForm.reset();let e=document.querySelector('input[type="file"]');e&&(e.value=""),this.submitted=!1,this.imageFile=null,this.newsEventForm.patchValue({status:"",title:"",date:"",description:"",image:""}),(this.isAccountant||this.isOfficeUser)&&this.newsEventForm.disable()}hasError(e,r,a){let c=e.get(r);return c?.touched&&c?.hasError(a)||!1}};n.\u0275fac=function(r){return new(r||n)(x(Qr),x(uL),x(ce),x(pe),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-news-event"]],hostBindings:function(r,a){r&1&&S("dragover",function(d){return a.onDragOver(d)})("drop",function(d){return a.onDrop(d)})},standalone:!1,decls:93,vars:41,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper","justify-content-center","pb-0"],[1,"tabButtons"],["role","tablist",1,"nav","nav-pills"],["role","presentation",1,"nav-item"],["id","news-tab","type","button","role","tab",1,"nav-link",3,"click"],["id","event-tab","type","button","role","tab",1,"nav-link",3,"click"],[1,"container-body","addContent-wrapper"],[3,"ngSubmit","formGroup"],[1,"row","justify-content-center"],[1,"col-md-6","card-wrapper"],[1,"cardTitle"],[1,"card-ccontent"],[1,"form-group"],[1,"form-label"],[1,"required"],[1,"file-upload-wrapper",3,"dragover","drop"],["type","file","accept","image/png,image/jpeg,image/jpg","formControlName","image",1,"form-control",3,"change","ngClass"],[1,"text-muted"],["class","invali
371d-feedback d-block",4,"ngIf"],["type","text","formControlName","status",1,"form-control",3,"ngClass"],["type","text","formControlName","title",1,"form-control",3,"ngClass"],["type","date","formControlName","date",1,"form-control",3,"min","ngClass"],["rows","4","formControlName","description",1,"form-control",3,"ngClass"],[1,"text-end"],["type","submit",1,"btn","btn-primary",3,"disabled"],["id","successModal","tabindex","-1","aria-labelledby","successModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-0"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],["id","successModalLabel",1,"modal-title","text-center"],[1,"text-center"],[1,"modal-footer","justify-content-center","border-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],["id","errorModal","tabindex","-1","aria-labelledby","errorModalLabel","aria-hidden","true",1,"modal","fade"],["id","errorModalLabel",1,"modal-title","text-center"],[1,"invalid-feedback","d-block"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"News & Event"),o()()(),s(5,"div",3)(6,"div",4)(7,"ul",5)(8,"li",6)(9,"button",7),S("click",function(){return a.onTypeChange("news")}),l(10," News "),o()(),s(11,"li",6)(12,"button",8),S("click",function(){return a.onTypeChange("event")}),l(13," Event "),o()()()()(),s(14,"div",9)(15,"form",10),S("ngSubmit",function(){return a.onSubmit()}),s(16,"div",11)(17,"div",12)(18,"div",13),l(19),o(),s(20,"div",14)(21,"div",15)(22,"label",16),l(23,"Image "),s(24,"span",17),l(25,"*"),o()(),s(26,"div",18),S("dragover",function(d){return a.onDragOver(d)})("drop",function(d){return a.onDrop(d)}),s(27,"input",19),S("change",function(d){return a.onFileChange(d)}),o()(),s(28,"small",20),l(29,"Accepted formats: PNG, JPEG, JPG (Max size: 5MB)"),o(),T(30,jme,3,0,"div",21),o(),s(31,"div",15)(32,"label",16),l(33,"Status "),s(34,"span",17),l(35,"*"),o()(),B(36,"input",22),T(37,Wme,3,0,"div",21)(38,Hme,3,0,"div",21),o(),s(39,"div",15)(40,"label",16),l(41),s(42,"span",17),l(43,"*"),o()(),B(44,"input",23),T(45,Gme,3,0,"div",21)(46,$me,3,0,"div",21)(47,zme,3,0,"div",21),o(),s(48,"div",15)(49,"label",16),l(50),s(51,"span",17),l(52,"*"),o()(),B(53,"input",24),T(54,Yme,3,0,"div",21),o(),s(55,"div",15)(56,"label",16),l(57,"Description "),s(58,"span",17),l(59,"*"),o()(),B(60,"textarea",25),T(61,qme,3,0,"div",21)(62,Kme,3,0,"div",21)(63,Xme,3,0,"div",21),o(),s(64,"div",26)(65,"button",27),l(66),o()()()()()()()(),s(67,"div",28)(68,"div",29)(69,"div",30)(70,"div",31),B(71,"button",32),o(),s(72,"div",33)(73,"h5",34),l(74,"Success"),o(),s(75,"p",35),l(76),o()(),s(77,"div",36)(78,"button",37),S("click",function(){return a.hideModals()}),l(79," OK "),o()()()()(),s(80,"div",38)(81,"div",29)(82,"div",30)(83,"div",31),B(84,"button",32),o(),s(85,"div",33)(86,"h5",39),l(87,"Error"),o(),s(88,"p",35),l(89),o()(),s(90,"div",36)(91,"button",37),S("click",function(){return a.hideModals()}),l(92," OK "),o()()()()()),r&2&&(p("ngClass",Z(29,Ume,a.isCollapsed)),m(9),Re("active",a.selectedType==="news"),m(3),Re("active",a.selectedType==="event"),m(3),p("formGroup",a.newsEventForm),m(4),_(" ",a.selectedType==="news"?"News":"Event"," "),m(8),p("ngClass",Z(31,jv,a.hasError(a.newsEventForm,"image","required"))),m(3),p("ngIf",a.hasError(a.newsEventForm,"image","required")),m(6),p("ngClass",Z(33,jv,a.hasError(a.newsEventForm,"status","required")||a.hasError(a.newsEventForm,"status","whitespace"))),m(),p("ngIf",a.hasError(a.newsEventForm,"status","required")),m(),p("ngIf",a.hasError(a.newsEventForm,"status","whitespace")),m(3),_(" ",a.selectedType==="news"?"News":"Event"," Title "),m(3),p("ngClass",Z(35,jv,a.hasError(a.newsEventForm,"title","required")||a.hasError(a.newsEventForm,"title","minlength")||a.hasError(a.newsEventForm,"title","whitespace"))),m(),p("ngIf",a.hasError(a.newsEventForm,"title","required")),m(),p("ngIf",a.hasError(a.newsEventForm,"title","minlength")),m(),p("ngIf",a.hasError(a.newsEventForm,"title","whitespace")),m(3),_(" ",a.selectedType==="news"?"News":"Event"," Date "),m(3),p("min",a.minDate)("ngClass",Z(37,jv,a.hasError(a.newsEventForm,"date","required"))),m(),p("ngIf",a.hasError(a.newsEventForm,"date","required")),m(6),p("ngClass",Z(39,jv,a.hasError(a.newsEventForm,"description","required")||a.hasError(a.newsEventForm,"description","minlength")||a.hasError(a.newsEventForm,"description","whitespace"))),m(),p("ngIf",a.hasError(a.newsEventForm,"description","required")),m(),p("ngIf",a.hasError(a.newsEventForm,"description","minlength")),m(),p("ngIf",a.hasError(a.newsEventForm,"description","whitespace")),m(2),p("disabled",a.isAccountant||a.isOfficeUser),m(),_(" Add ",a.selectedType==="news"?"News":"Event"," "),m(10),_(" ",a.successMessage," "),m(13),_(" ",a.errorMessage," "))},dependencies:[ue,Dt,Ni,Ke,Ne,Oi,wr,$r],styles:[".no-hover[_ngcontent-%COMP%]:hover, .no-h
371over[_ngcontent-%COMP%]:active, .no-hover[_ngcontent-%COMP%]:focus{background-color:inherit!important;border-color:inherit!important;box-shadow:none!important}"]});let i=n;return i})();var hL=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.ambuluwawaBackendUrl}getUsers(){let e={};console.log("item wise payload",e);let r=new xe({"Content-Type":"application/json",path:"user/get"});return this.http.post(this.apiUrl,e,{headers:r})}createUser(e){let r=new xe({"Content-Type":"application/json",path:"user/new"});return this.http.post(this.apiUrl,e,{headers:r})}updateUser(e){let r=new xe({"Content-Type":"application/json",path:"user/update"});return this.http.post(this.apiUrl,e,{headers:r})}updateUserStatus(e,r){let a={id:e,isActive:r},c=new xe({"Content-Type":"application/json",path:"user/toggle-status"});return this.http.post(this.apiUrl,a,{headers:c})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Zme=i=>({collapsed:i}),Qme=(i,n)=>({"fa-toggle-on":i,"fa-toggle-off":n});function eue(i,n){if(i&1){let t=he();s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td")(8,"div"),l(9),o()(),s(10,"td")(11,"div"),l(12),o()(),s(13,"td")(14,"div"),l(15),o()(),s(16,"td"),l(17),o(),s(18,"td"),l(19),o(),s(20,"td")(21,"button",22),S("click",function(){let r=U(t).$implicit,a=w();return j(a.editUser(r))}),B(22,"i",23),o(),s(23,"button",24),S("click",function(){let r=U(t).$implicit,a=w();return j(a.toggleUserStatus(r))}),B(24,"i",25),o()()()}if(i&2){let t=n.$implicit,e=w();m(3),_("#",t.id),m(3),b(t.firstname),m(3),b(t.lastname),m(3),b(t.email),m(3),b(t.identification),m(2),b(t.position),m(2),b(t.role),m(2),p("disabled",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser),m(),p("ngClass",Et(10,Qme,t.isactive,!t.isactive))}}function tue(i,n){if(i&1){let t=he();s(0,"li",18)(1,"a",19),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onPageChange(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",e.currentPage===t),m(2),b(t)}}function iue(i,n){i&1&&(s(0,"div",37),l(1," First name is required "),o())}function nue(i,n){i&1&&(s(0,"div",37),l(1," Last name is required "),o())}function rue(i,n){i&1&&(s(0,"div",37),l(1," NIC/Passport is required "),o())}function aue(i,n){i&1&&(s(0,"div",37),l(1," Valid phone number is required "),o())}function oue(i,n){i&1&&(s(0,"div",37),l(1," Valid email is required "),o())}function sue(i,n){i&1&&(s(0,"div",37),l(1," Position is required "),o())}function lue(i,n){i&1&&(s(0,"div",37),l(1," Username is required "),o())}function cue(i,n){if(i&1&&(s(0,"div",35)(1,"label",36),l(2,"Username "),s(3,"span",37),l(4,"*"),o()(),B(5,"input",58),T(6,lue,2,0,"div",39),o()),i&2){let t,e=w(2);m(6),p("ngIf",((t=e.userForm.get("username"))==null?null:t.touched)&&((t=e.userForm.get("username"))==null?null:t.invalid))}}function due(i,n){i&1&&(s(0,"div",37),l(1," Password must contain 6 characters including 1 number and 1 UPPER case letter "),o())}function mue(i,n){if(i&1&&(s(0,"option",59),l(1),o()),i&2){let t=n.$implicit;p("value",t.value),m(),_(" ",t.label," ")}}function uue(i,n){i&1&&(s(0,"div",37),l(1," Permission role is required "),o())}function pue(i,n){i&1&&(s(0,"div",37),l(1," Date of birth is required. "),o())}function hue(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29)(4,"h5",30),l(5),o(),s(6,"button",31),S("click",function(){U(t);let r=w();return j(r.closeModal())}),o()(),s(7,"div",32)(8,"form",33),S("ngSubmit",function(){U(t);let r=w();return j(r.onSubmit())}),s(9,"div",34)(10,"div",35)(11,"label",36),l(12,"First Name "),s(13,"span",37),l(14,"*"),o()(),B(15,"input",38),T(16,iue,2,0,"div",39),o(),s(17,"div",35)(18,"label",36),l(19,"Last Name "),s(20,"span",37),l(21,"*"),o()(),B(22,"input",40),T(23,nue,2,0,"div",39),o(),s(24,"div",35)(25,"label",36),l(26,"NIC/Passport Number "),s(27,"span",37),l(28,"*"),o()(),B(29,"input",41),T(30,rue,2,0,"div",39),o(),s(31,"div",35)(32,"label",36),l(33,"Phone Number "),s(34,"span",37),l(35,"*"),o()(),B(36,"input",42),T(37,aue,2,0,"div",39),o(),s(38,"div",35)(39,"label",36),l(40,"Email Address "),s(41,"span",37),l(42,"*"),o()(),B(43,"input",43),T(44,oue,2,0,"div",39),o(),s(45,"div",35)(46,"label",36),l(47,"Position "),s(48,"span",37),l(49,"*"),o()(),B(50,"input",44),T(51,sue,2,0,"div",39),o(),T(52,cue,7,1,"div",45),s(53,"div",35)(54,"label",36),l(55,"Password "),s(56,"span",37),l(57,"*"),o()(),s(58,"div",46),B(59,"input",47),s(60,"button",48),S("click",function(){U(t);let r=w();return j(r.togglePasswordVisibility())}),B(61,"i",49),o()(),T(62,due,2,0,"div",39),o(),s(63,"div",35)(64,"label",36),l(65,"Select Permission Role "),s(66,"span",37),l(67,"*"),o()(),s(68,"select",50)(69,"option",51),l(70," Select Permission Role "),o(),T(71,mue,2,2,"option",52),o(),T(72,uue,2,0,"div",39),o(),s(73,"div",35)(74,"label",36),l(75,"DOB "),s(76,"span",37),l(77,"*"),o()(),B(78,"input",53),T(79,pue,2,0,"div",39),o()(),s(80,"div",54),l(81," * Password should contain minimum 6 characters including 1 number and 1 UPPER case letter "),o(),s(82,"div",55)(83,"button",56),B(84,"i",57),l(85,"Save User "),o()()()()()()()}if(i&2){let t,e,r,a,c,d,u,h,f,v=w();Re("show",v.isModalOpen),m(5),_(" ",v.isEditMode?"Update User":"Add User"," "),m(3),p("formGroup",v.userForm),m(8),p("ngIf",((t=v.userForm.get("firstName"))==null?null:t.touched)&&((t=v.userForm.get("firstName"))==null?null:t.invali
371d)),m(7),p("ngIf",((e=v.userForm.get("lastName"))==null?null:e.touched)&&((e=v.userForm.get("lastName"))==null?null:e.invalid)),m(7),p("ngIf",((r=v.userForm.get("identification"))==null?null:r.touched)&&((r=v.userForm.get("identification"))==null?null:r.invalid)),m(7),p("ngIf",((a=v.userForm.get("phone"))==null?null:a.touched)&&((a=v.userForm.get("phone"))==null?null:a.invalid)),m(7),p("ngIf",((c=v.userForm.get("email"))==null?null:c.touched)&&((c=v.userForm.get("email"))==null?null:c.invalid)),m(7),p("ngIf",((d=v.userForm.get("position"))==null?null:d.touched)&&((d=v.userForm.get("position"))==null?null:d.invalid)),m(),p("ngIf",!v.isEditMode),m(7),p("type",v.showPassword?"text":"password")("placeholder",v.isEditMode?"New Password":"Password"),m(2),p("ngClass",v.showPassword?"fa-eye-slash":"fa-eye"),m(),p("ngIf",((u=v.userForm.get("password"))==null?null:u.touched)&&((u=v.userForm.get("password"))==null?null:u.invalid)),m(7),p("ngValue",null),m(2),p("ngForOf",v.userRoleOptions),m(),p("ngIf",((h=v.userForm.get("permissionRole"))==null?null:h.touched)&&((h=v.userForm.get("permissionRole"))==null?null:h.invalid)),m(6),p("max",v.maxDate),m(),p("ngIf",((f=v.userForm.get("dob"))==null?null:f.touched)&&((f=v.userForm.get("dob"))==null?null:f.invalid)),m(4),p("disabled",!v.userForm.valid)}}function fue(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",60)(4,"h5",30),l(5,"Deactivate User"),o(),s(6,"button",31),S("click",function(){U(t);let r=w();return j(r.closeStatusModal())}),o()(),s(7,"div",32)(8,"p"),l(9),o()(),s(10,"div",61)(11,"button",62),S("click",function(){U(t);let r=w();return j(r.closeStatusModal())}),l(12," Cancel "),o(),s(13,"button",63),S("click",function(){U(t);let r=w();return j(r.confirmStatusChange())}),l(14," Confirm "),o()()()()()}if(i&2){let t=w();Re("show",t.isStatusModalOpen),m(9),_(" Do You Wish To ",t.selectedUser!=null&&t.selectedUser.isactive?"Deactivate":"Activate"," This User? ")}}var fL=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.sidebarService=e,this.ambuluwawaUserService=r,this.fb=a,this.spinner=c,this.toastr=d,this.cognitoService=u,this.isModalOpen=!1,this.userRoleOptions=MF,this.showPassword=!1,this.isEditMode=!1,this.selectedUserId=null,this.isStatusModalOpen=!1,this.selectedUser=null,this.searchQuery="",this.isAccountant=!1,this.isOfficeUser=!1,this.currentPage=1,this.pageSize=10,this.totalItems=0,this.totalPages=0,this.pages=[],this.paginatedUsers=[],this.Math=Math,this.users=[],this.isCollapsed=!1,this.userForm=this.fb.group({firstName:["",At.required],lastName:["",At.required],identification:["",At.required],phone:["",[At.required,At.pattern("^[0-9]{5,}$")]],email:["",[At.required,At.email]],position:["",At.required],username:[""],password:["",[At.required,At.minLength(6),At.pattern("^(?=.*[0-9])(?=.*[A-Z]).{6,}$")]],permissionRole:["",At.required],dob:["",At.required]});let h=new Date,f=new Date(h.getFullYear()-14,h.getMonth(),h.getDate());this.maxDate=f.toISOString().split("T")[0]}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getUsers(),this.checkUserRole()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}getUsers(){this.spinner.show(),this.ambuluwawaUserService.getUsers().subscribe(e=>{this.spinner.hide(),this.users=e.data,this.updatePagination(),this.applyPagination()},e=>{this.spinner.hide(),console.error("Error fetching users:",e)})}updatePagination(){let e=this.searchQuery?this.users.filter(r=>r.id.toString().includes(this.searchQuery)||r.firstname.toLowerCase().includes(this.searchQuery.toLowerCase())||r.lastname.toLowerCase().includes(this.searchQuery.toLowerCase())):this.users;this.totalItems=e.length,this.totalPages=Math.ceil(this.totalItems/this.pageSize),this.pages=Array.from({length:this.totalPages},(r,a)=>a+1),this.currentPage>this.totalPages&&(this.currentPage=1)}applyPagination(){let e=(this.currentPage-1)*this.pageSize,r=e+this.pageSize;this.paginatedUsers=this.users.slice(e,r)}onPageChange(e){e>=1&&e<=this.totalPages&&(this.currentPage=e,this.applyPagination())}onPageSizeChange(){this.currentPage=1,this.updatePagination(),this.applyPagination()}openAddUserModal(){this.isModalOpen=!0,this.userForm.reset(),this.userForm.get("permissionRole")?.setValue(null)}closeModal(){this.isModalOpen=!1,this.isEditMode=!1,this.selectedUserId=null,this.userForm.reset()}
371onSubmit(){if(this.userForm.valid){let e={id:this.selectedUserId,dob:this.userForm.get("dob")?.value,email:this.userForm.get("email")?.value,firstName:this.userForm.get("firstName")?.value,identification:this.userForm.get("identification")?.value,lastName:this.userForm.get("lastName")?.value,password:this.userForm.get("password")?.value||"",phoneNumber:this.userForm.get("phone")?.value,position:this.userForm.get("position")?.value,role:this.userForm.get("permissionRole")?.value,username:this.userForm.get("username")?.value||""};this.spinner.show(),this.isEditMode?this.ambuluwawaUserService.updateUser(e).subscribe({next:r=>{r.status==="warning"?this.toastr.warning(r.message):r.status==="error"?this.toastr.error(r.error):(this.toastr.success("User updated successfully"),this.closeModal(),this.getUsers()),this.spinner.hide()},error:r=>{console.log(r),this.toastr.error(r.error.error||"Failed to update user"),this.spinner.hide()}}):this.ambuluwawaUserService.createUser(e).subscribe({next:r=>{r.status==="warning"?this.toastr.warning(r.message):r.status==="error"?this.toastr.error(r.error):(this.toastr.success("User created successfully"),this.closeModal(),this.getUsers()),this.spinner.hide()},error:r=>{console.log(r),this.toastr.error(r.error.error||"Failed to create user"),this.spinner.hide()},complete:()=>{this.spinner.hide()}})}else Object.keys(this.userForm.controls).forEach(e=>{let r=this.userForm.get(e);r?.invalid&&r.markAsTouched()})}togglePasswordVisibility(){this.showPassword=!this.showPassword}editUser(e){this.isEditMode=!0,this.selectedUserId=e.id;let r=this.userForm.get("username"),a=this.userForm.get("password");r&&(r.clearValidators(),r.updateValueAndValidity()),a&&(a.clearValidators(),a.setValidators([At.pattern("^(?=.*[0-9])(?=.*[A-Z]).{6,}$")]),a.updateValueAndValidity()),this.userForm.patchValue({firstName:e.firstname,lastName:e.lastname,identification:e.identification,phone:e.phone,email:e.email,position:e.position,permissionRole:e.role,dob:e.dob}),this.isModalOpen=!0}toggleUserStatus(e){this.selectedUser=e,this.isStatusModalOpen=!0}closeStatusModal(){this.isStatusModalOpen=!1,this.selectedUser=null}confirmStatusChange(){if(this.selectedUser){this.spinner.show();let e=!this.selectedUser.isactive;this.ambuluwawaUserService.updateUserStatus(this.selectedUser.id,e).subscribe({next:r=>{this.selectedUser.isactive=e,this.spinner.hide(),this.toastr.success(`User successfully ${e?"activated":"deactivated"}`),this.closeStatusModal()},error:r=>{this.spinner.hide(),this.toastr.error("Failed to update user status"),console.error("Error updating user status:",r)}})}}filteredUsers(){if(!this.searchQuery)return this.paginatedUsers;let e=this.users.filter(c=>c.id.toString().includes(this.searchQuery)||c.firstname.toLowerCase().includes(this.searchQuery.toLowerCase())||c.lastname.toLowerCase().includes(this.searchQuery.toLowerCase()));this.totalItems=e.length,this.totalPages=Math.ceil(this.totalItems/this.pageSize),this.pages=Array.from({length:this.totalPages},(c,d)=>d+1);let r=(this.currentPage-1)*this.pageSize,a=r+this.pageSize;return e.slice(r,a)}onSearch(){this.currentPage=1,this.searchQuery?this.updatePagination():(this.updatePagination(),this.applyPagination())}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(hL),x(Qr),x(pe),x(me),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-ambuluwawa-users"]],standalone:!1,decls:48,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"mb-3","add-user-btn-container"],[1,"btn","btn-primary",3,"click","disabled"],[1,"fas","fa-plus","me-2"],[1,"search-container"],[1,"search-box"],["type","text","placeholder","Search by User ID or Name...",1,"form-control","search-input",3,"ngModelChange","ngModel"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination","pagination-sm","mb-0"],[1,"page-item"],[1,"page-link",3,"click"],["class","page-item",3,"active",4,"ngFor","ngForOf"],["class","modal",3,"show",4,"ngIf"],[1,"btn","btn-link","p-0","me-2",3,"click","disabled"],[1,"fas","fa-pencil-alt","fa-lg"],[1,"btn","btn-link","p-0",3,"click","disabled"],[1,"fas","fa-lg",3,"ngClass"],[1,"modal"],[1,"modal-dialog"],[1,"modal-content"],[1,"modal-header","bg-light","text-dark"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],[1,"modal-body"],[3,"ngSubmit","formGroup"],[1,"row","g-3"],[1,"col-md-4"],[1,"form-label"],[1,"text-danger"],["type","text","placeholder","First Name","formControlName","firstName","ng-required","firstName",1,"form-control"],["class","text-danger",4,"ngIf"],["type","text","placeholder","Last Name","formControlName","lastName",1,"form-control"],["type","text","placeholder","NIC/Passport Number","formControlName","identification",1,"form-control"],["type","number","placeholder","Phone Number","formControlName","phone",1,"form-control"],["type","email","placeholder","Email Address","formControlName","email",1,"form-control"],["type","text","placeholder","Position","formControlName","position",1,"form-control"],["class","col-md-4",4,"ngIf"],[1,"input-group"],["formControlName","password",1,"form-control",3,"type","placeholder"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fas",3,"ngClass"],["formControlName","permissionRole",1,"form-select"],["disabled","","selected","",3,"ngValue"],[3,"value",4,"ngFor","ngForOf"],["type","date","formControlName","dob",1,"form-control",3,"max"],[1,"text-muted","small","mt-2"],[1,"text-end","mt-4"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"fas","fa-save","me-2"],["type","text","placeholder","Username","formControlName","username",1,"form-control"],[3,"value"],[1,"modal-header"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Manage Users"),o()()(),s(5,"div",3)(6,"button",4),S("click",function(){return a.openAddUserModal()}),B(7,"i",5),l(8,"Add User "),o()(),s(9,"div",6)(10,"div",7)(11,"input",8),X("ngModelChange",function(d){return K(a.searchQuery,d)||(a.searchQuery=d),d}),S("ngModelChange",function(){return a.onSearch()}),o()()(),s(12,"div",9)(13,"div",10)(14,"div",11)(15,"div",12)(16,"table",13)(17,"thead",14)(18,"tr")(19,"th"),l(20,"#User No"),o(),s(21,"th"),l(22,"First Name"),o(),s(23,"th"),l(24,"Last Name"),o(),s(25,"th"),l(26,"Email"),o(),s(27,"th"),l(28,"Identification"),o(),s(29,"th"),l(30,"Position"),o(),s(31,"th"),l(32,"Permission"),o(),s(33,"th"),l(34,"Actions"),o()()(),s(35,"tbody",15),T(36,eue,25,13,"tr",16),o()(),s(37,"nav")(38,"ul",17)(39,"li",18)(40,"a",19),S("click",function(){return a.onPageChange(a.currentPage-1)}),l(41,"Previous"),o()(),T(42,tue,3,3,"li",20),s(43,"li",18)(44,"a",19),S("click",function(){return a.onPageChange(a.currentPage+1)}),l(45,"Next"),o()()()()()()()()(),T(46,hue,86,21,"div",21)(47,fue,15,3,"div",21)),r&2&&(p("ngClass",Z(11,Zme,a.isCollapsed)),m(6),p("disabled",a.isAccountant||a.isOfficeUser),m(5),q("ngModel",a.searchQuery),m(25),p("ngForOf",a.filteredUsers()),m(3),Re("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(3),p("ngIf",a.isModalOpen),m(),p("ngIf",a.isStatusModalOpen))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,Le,wr,$r],styles:[".modal[_ngcontent-%COMP%]{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1050}.modal.show[_ngcontent-%COMP%]{display:block}
371.modal[_ngcontent-%COMP%] .modal-dialog[_ngcontent-%COMP%]{max-width:800px;margin:1.75rem auto}.form-control[_ngcontent-%COMP%], .form-select[_ngcontent-%COMP%]{padding:.75rem;border-radius:8px}.form-control[_ngcontent-%COMP%]:focus, .form-select[_ngcontent-%COMP%]:focus{box-shadow:none;border-color:#4e9df7}.pagination[_ngcontent-%COMP%] .page-item[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{cursor:pointer}.pagination[_ngcontent-%COMP%] .page-item[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]:hover{background-color:#e9ecef}.pagination[_ngcontent-%COMP%] .page-item.disabled[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{cursor:not-allowed}.search-container[_ngcontent-%COMP%]{margin-left:1.3rem;margin-right:1.3rem}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{max-width:100%;width:100%}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{width:100%;border:1px solid #ddd;border-radius:4px;font-family:Roboto,Helvetica Neue,sans-serif;font-size:small;color:#333}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#4e9df7;box-shadow:0 0 0 2px #007bff40}.add-user-btn-container[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-right:1.3rem}"]});let i=n;return i})();var gL=(()=>{let n=class n{constructor(e){this.http=e,this.baseUrl=ui.ambuluwawaBackendUrl}createType1Announcement(e){let r=new xe({"Content-Type":"application/json",path:"announcement-type1/new"});return this.http.post(this.baseUrl,e,{headers:r})}createType2Announcement(e){let r=new xe({"Content-Type":"application/json",path:"announcement-type2/new"});return this.http.post(this.baseUrl,e,{headers:r})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var vue=i=>({collapsed:i}),ml=i=>({"is-invalid":i});function _ue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Document is required"),o()())}function yue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Title is required"),o()())}function Sue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Title must be at least 3 characters long"),o()())}function bue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Title cannot be blank or only whitespace"),o()())}function xue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Publish date is required"),o()())}function Cue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Description is required"),o()())}function Eue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Description must be at least 5 characters long"),o()())}function wue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Description cannot be blank or only whitespace"),o()())}function Tue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"File name is required"),o()())}function Due(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"File name cannot be blank or only whitespace"),o()())}function Iue(i,n){if(i&1){let t=he();s(0,"form",23),S("ngSubmit",function(){U(t);let r=w();return j(r.onSubmitType1())}),s(1,"div",24)(2,"div",25)(3,"div",26),l(4,"Type 1 Announcement"),o(),s(5,"div",27)(6,"div",28)(7,"label",29),l(8,"Word Document "),s(9,"span",30),l(10,"*"),o()(),s(11,"div",31),S("dragover",function(r){U(t);let a=w();return j(a.onDragOver(r))})("drop",function(r){U(t);let a=w();return j(a.onDrop(r))}),s(12,"input",32),S("change",function(r){U(t);let a=w();return j(a.onFileSelected(r))}),o()(),s(13,"small",33),l(14,"Accepted formats: DOC, DOCX"),o(),T(15,_ue,3,0,"div",34),o(),s(16,"div",28)(17,"label",29),l(18,"Title "),s(19,"span",30),l(20,"*"),o()(),B(21,"input",35),T(22,yue,3,0,"div",34)(23,Sue,3,0,"div",34)(24,bue,3,0,"div",34),o(),s(25,"div",28)(26,"label",29),l(27,"Publish Date "),s(28,"span",30),l(29,"*"),o()(),B(30,"input",36),T(31,xue,3,0,"div",34),o(),s(32,"div",28)(33,"label",29),l(34,"Description "),s(35,"span",30),l(36,"*"),o()(),B(37,"textarea",37),T(38,Cue,3,0,"div",34)(39,Eue,3,0,"div",34)(40,wue,3,0,"div",34),o(),s(41,"div",28)(42,"label",29),l(43,"File Name "),s(44,"span",30),l(45,"*"),o()(),B(46,"input",38),T(47,Tue,3,0,"div",34)(48,Due,3,0,"div",34),o(),s(49,"div",39)(50,"button",40),l(51," Add Announcement "),o()()()()()()}if(i&2){let t=w();p("formGroup",t.type1Form),m(12),p("ngClass",Z(18,ml,t.hasError(t.type1Form,"document","required"))),m(3),p("ngIf",t.hasError(t.type1Form,"document","required")),m(6),p("ngClass",Z(20,ml,t.hasError(t.type1Form,"title","required")||t.hasError(t.type1Form,"title","minlength")||t.hasError(t.type1Form,"title","whitespace"))),m(),p("ngIf",t.hasError(t.type1Form,"title","required")),m(),p("ngIf",t.hasError(t.type1Form,"title","minlength")),m(),p("ngIf",t.hasError(t.type1Form,"title","whitespace")),m(6),p("min",t.minDate)("ngClass",Z(22,ml,t.hasError(t.type1Form,"publishDate","required"))),m(),p("ngIf",t.hasError(t.type1Form,"publishDate","required")),m(6),p("ngClass",Z(24,ml,t.hasError(t.type1Form,"description","required")||t.hasError(t.type1Form,"description","minlength")||t.hasError(t.type1Form,"description","whitespace"))),m(),p("ngIf",t.hasError(t.type1Form,"description","required")),m(),p("ngIf",t.hasError(t.type1Form,"description","minlength")),m(),p("ngIf",t.hasError(t.type1Form,"description","whitespace")),m(6),p("ngClass",Z(26,ml,t.hasError(t.type1Form,"fileName","required")||t.hasError(t.type1Form,"fileName","whitespace"))),m(),p("ngIf",t.hasError(t.type1Form,"fileName","required")),m(),p("ngIf",t.hasError(t.type1Form,"fileName","whitespace")),m(2),p("disabled",t.type1Form.invali
371d)}}function kue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Name is required"),o()())}function Mue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Name must be at least 3 characters long"),o()())}function Aue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Name cannot be blank or only whitespace"),o()())}function Pue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Contract number is required"),o()())}function Fue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Please enter a valid contract number"),o()())}function Rue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Publish date is required"),o()())}function Oue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Tender opening date is required"),o()())}function Nue(i,n){if(i&1&&(s(0,"div",41)(1,"div"),l(2),o()()),i&2){let t,e=w(2);m(2),_(" ",(t=e.type2Form.get("tenderOpeningDate"))==null||t.errors==null?null:t.errors.invalidOpeningDate," ")}}function Lue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Tender opening time is required"),o()())}function Bue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Tender closing date is required"),o()())}function Vue(i,n){if(i&1&&(s(0,"div",41)(1,"div"),l(2),o()()),i&2){let t,e=w(2);m(2),_(" ",(t=e.type2Form.get("tenderClosingDate"))==null||t.errors==null?null:t.errors.invalidClosingDate," ")}}function Uue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Tender closing time is required"),o()())}function jue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2,"Further information is required"),o()())}function Wue(i,n){i&1&&(s(0,"div",41)(1,"div"),l(2," Further information must be at least 5 characters long "),o()())}function Hue(i,n){if(i&1){let t=he();s(0,"form",23),S("ngSubmit",function(){U(t);let r=w();return j(r.onSubmitType2())}),s(1,"div",24)(2,"div",25)(3,"div",26),l(4,"Type 2 Announcement"),o(),s(5,"div",27)(6,"div",28)(7,"label",29),l(8,"Name "),s(9,"span",30),l(10,"*"),o()(),B(11,"input",42),T(12,kue,3,0,"div",34)(13,Mue,3,0,"div",34)(14,Aue,3,0,"div",34),o(),s(15,"div",28)(16,"label",29),l(17,"Contract No "),s(18,"span",30),l(19,"*"),o()(),B(20,"input",43),T(21,Pue,3,0,"div",34)(22,Fue,3,0,"div",34),o(),s(23,"div",28)(24,"label",29),l(25,"Publish Date "),s(26,"span",30),l(27,"*"),o()(),B(28,"input",36),T(29,Rue,3,0,"div",34),o(),s(30,"div",28)(31,"label",29),l(32,"Tender Opening Date "),s(33,"span",30),l(34,"*"),o()(),B(35,"input",44),T(36,Oue,3,0,"div",34)(37,Nue,3,1,"div",34),o(),s(38,"div",28)(39,"label",29),l(40,"Tender Opening Time "),s(41,"span",30),l(42,"*"),o()(),B(43,"input",45),T(44,Lue,3,0,"div",34),o(),s(45,"div",28)(46,"label",29),l(47,"Tender Closing Date "),s(48,"span",30),l(49,"*"),o()(),B(50,"input",46),T(51,Bue,3,0,"div",34)(52,Vue,3,1,"div",34),o(),s(53,"div",28)(54,"label",29),l(55,"Tender Closing Time "),s(56,"span",30),l(57,"*"),o()(),B(58,"input",47),T(59,Uue,3,0,"div",34),o(),s(60,"div",28)(61,"label",29),l(62,"Further Information "),s(63,"span",30),l(64,"*"),o()(),B(65,"textarea",48),T(66,jue,3,0,"div",34)(67,Wue,3,0,"div",34),o(),s(68,"div",39)(69,"button",40),l(70," Add Announcement "),o()()()()()()}if(i&2){let t=w();p("formGroup",t.type2Form),m(11),p("ngClass",Z(27,ml,t.hasError(t.type2Form,"name","required")||t.hasError(t.type2Form,"name","minlength")||t.hasError(t.type2Form,"name","whitespace"))),m(),p("ngIf",t.hasError(t.type2Form,"name","required")),m(),p("ngIf",t.hasError(t.type2Form,"name","minlength")),m(),p("ngIf",t.hasError(t.type2Form,"name","whitespace")),m(6),p("ngClass",Z(29,ml,t.hasError(t.type2Form,"contractNo","required")||t.hasError(t.type2Form,"contractNo","pattern"))),m(),p("ngIf",t.hasError(t.type2Form,"contractNo","required")),m(),p("ngIf",t.hasError(t.type2Form,"contractNo","pattern")),m(6),p("min",t.minDate)("ngClass",Z(31,ml,t.hasError(t.type2Form,"publishDate","required"))),m(),p("ngIf",t.hasError(t.type2Form,"publishDate","required")),m(6),p("min",t.minDate)("ngClass",Z(33,ml,t.hasError(t.type2Form,"tenderOpeningDate","required")||t.hasError(t.type2Form,"tenderOpeningDate","invalidOpeningDate"))),m(),p("ngIf",t.hasError(t.type2Form,"tenderOpeningDate","required")),m(),p("ngIf",t.hasError(t.type2Form,"tenderOpeningDate","invalidOpeningDate")),m(6),p("ngClass",Z(35,ml,t.hasError(t.type2Form,"tenderOpeningTime","required"))),m(),p("ngIf",t.hasError(t.type2Form,"tenderOpeningTime","required")),m(6),p("min",t.minDate)("ngClass",Z(37,ml,t.hasError(t.type2Form,"tenderClosingDate","required")||t.hasError(t.type2Form,"tenderClosingDate","invali
371dClosingDate"))),m(),p("ngIf",t.hasError(t.type2Form,"tenderClosingDate","required")),m(),p("ngIf",t.hasError(t.type2Form,"tenderClosingDate","invalidClosingDate")),m(6),p("ngClass",Z(39,ml,t.hasError(t.type2Form,"tenderClosingTime","required"))),m(),p("ngIf",t.hasError(t.type2Form,"tenderClosingTime","required")),m(6),p("ngClass",Z(41,ml,t.hasError(t.type2Form,"furtherInformation","required")||t.hasError(t.type2Form,"furtherInformation","minlength"))),m(),p("ngIf",t.hasError(t.type2Form,"furtherInformation","required")),m(),p("ngIf",t.hasError(t.type2Form,"furtherInformation","minlength")),m(2),p("disabled",t.type2Form.invalid||t.isAccountant||t.isOfficeUser)}}var vL=(()=>{let n=class n{constructor(e,r,a,c,d){this.fb=e,this.sidebarService=r,this.announcementService=a,this.spinner=c,this.cognitoService=d,this.selectedType="type1",this.selectedFile=null,this.isCollapsed=!1,this.successMessage="",this.errorMessage="",this.isAccountant=!1,this.isOfficeUser=!1,this.minDate=new Date().toISOString().split("T")[0]}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole().then(()=>{this.initializeForms()})}ngAfterViewInit(){setTimeout(()=>{this.successModal=new bootstrap.Modal("#successModal"),this.errorModal=new bootstrap.Modal("#errorModal")})}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}initializeForms(){this.type1Form=this.fb.group({document:[null,At.required],title:["",[At.required,_u(3),om()]],publishDate:["",At.required],description:["",[At.required,_u(5),om()]],fileName:["",[At.required,om()]]}),this.type2Form=this.fb.group({name:["",[At.required,_u(3),om()]],contractNo:["",[At.required,At.pattern("^[0-9]+$")]],publishDate:["",At.required],tenderOpeningDate:["",At.required],tenderOpeningTime:["",At.required],tenderClosingDate:["",At.required],tenderClosingTime:["",At.required],furtherInformation:["",[At.required,_u(5)]]}),["publishDate","tenderOpeningDate","tenderClosingDate"].forEach(r=>{this.type2Form.get(r)?.valueChanges.subscribe(()=>{this.validateType2Dates()})}),(this.isAccountant||this.isOfficeUser)&&(this.type1Form.disable(),this.type2Form.disable())}onTypeChange(e){this.selectedType=e,e==="type1"?(this.type2Form.reset(),(this.isAccountant||this.isOfficeUser)&&this.type2Form.disable()):(this.type1Form.reset(),this.selectedFile=null,(this.isAccountant||this.isOfficeUser)&&this.type1Form.disable())}onDragOver(e){this.isAccountant||this.isOfficeUser||(e.preventDefault(),e.stopPropagation())}onDrop(e){if(!(this.isAccountant||this.isOfficeUser)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files.length)){let r=e.dataTransfer.files[0];this.handleFileSelection(r)}}onFileSelected(e){if(this.isAccountant||this.isOfficeUser)return;let r=e.target.files[0];r&&this.handleFileSelection(r)}handleFileSelection(e){e.type==="application/msword"||e.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?(this.selectedFile=e,this.type1Form.patchValue({document:e,fileName:e.name})):(this.errorMessage="Please upload a valid Word document (.doc or .docx)",this.errorModal&&this.errorModal.show(),this.type1Form.patchValue({document:null,fileName:""}))}hideModals(){this.successModal&&this.successModal.hide(),this.errorModal&&this.errorModal.hide()}validateType2Dates(){let e=new Date(this.type2Form.get("publishDate")?.value),r=new Date(this.type2Form.get("tenderOpeningDate")?.value),a=new Date(this.type2Form.get("tenderClosingDate")?.value);this.type2Form.get("tenderOpeningDate")?.setErrors(null),this.type2Form.get("tenderClosingDate")?.setErrors(null);let c=!0;return!isNaN(r.getTime())&&!isNaN(a.getTime())&&a<r&&(this.type2Form.get("tenderClosingDate")?.setErrors({invalidClosingDate:"Tender closing date must be after or on opening date"}),c=!1),!isNaN(e.getTime())&&!isNaN(r.getTime())&&r<e&&(this.type2Form.get("tenderOpeningDate")?.setErrors({invalidOpeningDate:"Tender opening date must be after or on publish date"}),c=!1),c}onSubmitType1(){if(!(this.isAccountant||this.isOfficeUser))if(this.t
371ype1Form.valid&&this.selectedFile){this.spinner.show();let e=new FileReader;e.onload=r=>{let a=r.target.result.split(",")[1],c={description:this.type1Form.get("description")?.value.trim(),fileData:a,filename:this.type1Form.get("fileName")?.value.trim(),isAnnounce:!0,isOngoing:!0,publish_date:this.type1Form.get("publishDate")?.value,title:this.type1Form.get("title")?.value.trim()};this.announcementService.createType1Announcement(c).subscribe({next:d=>{this.spinner.hide(),this.type1Form.reset(),this.selectedFile=null,this.successMessage="Type 1 announcement created successfully!",this.successModal&&this.successModal.show()},error:d=>{this.spinner.hide(),console.error("Error:",d),this.errorMessage="Failed to create Type 1 announcement. Please try again.",this.errorModal&&this.errorModal.show()}})},e.readAsDataURL(this.selectedFile)}else this.markFormGroupTouched(this.type1Form)}onSubmitType2(){if(!(this.isAccountant||this.isOfficeUser))if(this.type2Form.valid&&this.validateType2Dates()){this.spinner.show();let e={name:this.type2Form.get("name")?.value.trim(),contact_no:this.type2Form.get("contractNo")?.value.trim(),publish_date:this.type2Form.get("publishDate")?.value,tender_opening_date:this.type2Form.get("tenderOpeningDate")?.value,tender_opening_time:this.type2Form.get("tenderOpeningTime")?.value,tender_closing_date:this.type2Form.get("tenderClosingDate")?.value,tender_closing_time:this.type2Form.get("tenderClosingTime")?.value,further_information:this.type2Form.get("furtherInformation")?.value.trim()};this.announcementService.createType2Announcement(e).subscribe({next:r=>{this.spinner.hide(),this.type2Form.reset(),this.successMessage="Type 2 announcement created successfully!",this.successModal&&this.successModal.show()},error:r=>{this.spinner.hide(),console.error("Error:",r),this.errorMessage="Failed to create Type 2 announcement. Please try again.",this.errorModal&&this.errorModal.show()}})}else this.markFormGroupTouched(this.type2Form)}onSubmit(){this.selectedType==="type1"?this.onSubmitType1():this.onSubmitType2()}markFormGroupTouched(e){Object.values(e.controls).forEach(r=>{r.markAsTouched(),r instanceof Wc&&this.markFormGroupTouched(r)})}hasError(e,r,a){let c=e.get(r);return c?.touched&&c?.hasError(a)||!1}resetForm(){this.selectedType==="type1"?(this.type1Form.reset(),this.selectedFile=null,(this.isAccountant||this.isOfficeUser)&&this.type1Form.disable()):(this.type2Form.reset(),(this.isAccountant||this.isOfficeUser)&&this.type2Form.disable())}};n.\u0275fac=function(r){return new(r||n)(x(Qr),x(ce),x(gL),x(pe),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-announcement"]],standalone:!1,decls:43,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper","justify-content-center","pb-0"],[1,"tabButtons"],["role","tablist",1,"nav","nav-pills"],["role","presentation",1,"nav-item"],["id","type1-tab","type","button","role","tab",1,"nav-link",3,"click"],["id","type2-tab","type","button","role","tab",1,"nav-link",3,"click"],[1,"container-body","addContent-wrapper"],[3,"formGroup","ngSubmit",4,"ngIf"],["id","successModal","tabindex","-1","aria-labelledby","successModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
371-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-0"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],["id","successModalLabel",1,"modal-title","text-center"],[1,"text-center"],[1,"modal-footer","justify-content-center","border-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],["id","errorModal","tabindex","-1","aria-labelledby","errorModalLabel","aria-hidden","true",1,"modal","fade"],["id","errorModalLabel",1,"modal-title","text-center"],[3,"ngSubmit","formGroup"],[1,"row","justify-content-center"],[1,"col-md-6","card-wrapper"],[1,"cardTitle"],[1,"card-ccontent"],[1,"form-group"],[1,"form-label"],[1,"required"],[1,"file-upload-wrapper",3,"dragover","drop"],["type","file","accept",".doc,.docx","formControlName","document",1,"form-control",3,"change","ngClass"],[1,"text-muted"],["class","invalid-feedback d-block",4,"ngIf"],["type","text","formControlName","title",1,"form-control",3,"ngClass"],["type","date","formControlName","publishDate",1,"form-control",3,"min","ngClass"],["rows","4","formControlName","description",1,"form-control",3,"ngClass"],["type","text","formControlName","fileName",1,"form-control",3,"ngClass"],[1,"text-end"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"invalid-feedback","d-block"],["type","text","formControlName","name",1,"form-control",3,"ngClass"],["type","text","formControlName","contractNo",1,"form-control",3,"ngClass"],["type","date","formControlName","tenderOpeningDate",1,"form-control",3,"min","ngClass"],["type","time","formControlName","tenderOpeningTime",1,"form-control",3,"ngClass"],["type","date","formControlName","tenderClosingDate",1,"form-control",3,"min","ngClass"],["type","time","formControlName","tenderClosingTime",1,"form-control",3,"ngClass"],["rows","4","formControlName","furtherInformation",1,"form-control",3,"ngClass"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Announcement"),o()()(),s(5,"div",3)(6,"div",4)(7,"ul",5)(8,"li",6)(9,"button",7),S("click",function(){return a.onTypeChange("type1")}),l(10," Type 1 Announcement "),o()(),s(11,"li",6)(12,"button",8),S("click",function(){return a.onTypeChange("type2")}),l(13," Type 2 Announcement "),o()()()()(),s(14,"div",9),T(15,Iue,52,28,"form",10)(16,Hue,71,43,"form",10),o()(),s(17,"div",11)(18,"div",12)(19,"div",13)(20,"div",14),B(21,"button",15),o(),s(22,"div",16)(23,"h5",17),l(24,"Success"),o(),s(25,"p",18),l(26),o()(),s(27,"div",19)(28,"button",20),S("click",function(){return a.hideModals()}),l(29," OK "),o()()()()(),s(30,"div",21)(31,"div",12)(32,"div",13)(33,"div",14),B(34,"button",15),o(),s(35,"div",16)(36,"h5",22),l(37,"Error"),o(),s(38,"p",18),l(39),o()(),s(40,"div",19)(41,"button",20),S("click",function(){return a.hideModals()}),l(42," OK "),o()()()()()),r&2&&(p("ngClass",Z(9,vue,a.isCollapsed)),m(9),Re("active",a.selectedType==="type1"),m(3),Re("active",a.selectedType==="type2"),m(3),p("ngIf",a.selectedType==="type1"),m(),p("ngIf",a.selectedType==="type2"),m(10),_(" ",a.successMessage," "),m(13),_(" ",a.errorMessage," "))},dependencies:[ue,Dt,Ni,Ke,Ne,Oi,wr,$r],styles:[".no-hover[_ngcontent-%COMP%]:hover, .no-hover[_ngcontent-%COMP%]:active, .no-hover[_ngcontent-%COMP%]:focus{background-color:inherit!important;border-color:inherit!important;box-shadow:none!important}"]});let i=n;return i})();var Gue=i=>({collapsed:i}),$ue=i=>({show:i});function zue(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o(),s(5,"span",24),l(6),o()(),s(7,"div",25)(8,"div",26)(9,"div",27)(10,"div",28)(11,"span",29),l(12,"LKR"),o(),s(13,"input",30),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(14,"div",31)(15,"button",32),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(16,"span",33),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngClass",t.visitor_type==="Foreign"?"bg-primary":"bg-success"),m(),_(" ",t.visitor_type," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}
371function Yue(i,n){if(i&1&&(s(0,"div",19)(1,"div",34)(2,"p",35),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",36)(5,"p",37)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",37)(10,"strong"),l(11,"Visitor Type:"),o(),l(12),o(),s(13,"p",37)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",38)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedItem.visitor_type," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function que(i,n){if(i&1){let t=he();s(0,"div",39),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function Kue(i,n){if(i&1){let t=he();s(0,"div",39),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var _L=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.amberSwingService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.amberSwingService.getItemPrice().subscribe({next:e=>{e.data&&e.data[0]&&(this.priceItems=e.data[0].map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.amberSwingService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
371r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Io),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-amber-swing-edit-price"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Amber Swing \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,zue,19,6,"div",6),o()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,Yue,21,4,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,que,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,Kue,1,0,"div",17),o()),r&2&&(p("ngClass",Z(13,Gue,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,$ue,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var Xue=i=>({collapsed:i}),Jue=i=>({show:i});function Zue(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o()(),s(5,"div",24)(6,"div",25)(7,"div",26)(8,"div",27)(9,"span",28),l(10,"LKR"),o(),s(11,"input",29),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",30)(13,"button",31),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",32),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}
371function Que(i,n){if(i&1&&(s(0,"div",19)(1,"div",33)(2,"p",34),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",35)(5,"p",36)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",36)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",37)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function e0e(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function t0e(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var yL=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.herbalShopService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.herbalShopService.getItemPrice().subscribe({next:e=>{e.data&&e.data[0]&&(this.priceItems=e.data[0].map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.herbalShopService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
371r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ws),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-herbal-shop-edit-price"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Herbal Shop \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,Zue,17,4,"div",6),o()()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,Que,17,3,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,e0e,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,t0e,1,0,"div",17)),r&2&&(p("ngClass",Z(13,Xue,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,Jue,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var i0e=i=>({collapsed:i}),n0e=i=>({show:i});function r0e(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function a0e(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o(),s(5,"span",30),l(6),o()(),s(7,"div",31)(8,"div",32)(9,"div",33)(10,"div",34)(11,"span",35),l(12,"LKR"),o(),s(13,"input",36),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(14,"div",37)(15,"button",38),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(16,"span",39),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngClass",e.getVisitorTypeBadgeClass(t)),m(),_(" ",e.getVisitorTypeLabel(t)," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}
371function o0e(i,n){if(i&1&&(s(0,"div",23)(1,"div",40)(2,"p",41),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",42)(5,"p",43)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",43)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",43)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",44)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedCategory," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function s0e(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function l0e(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var SL=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.coffeeShopService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.coffeeShopService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat((a.entityItems||[]).map(c=>this.mapItemWithPrices(c))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=(this.categories[0].entityItems||[]).map(r=>this.mapItemWithPrices(r)))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.coffeeShopService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
371r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r?.entityItems&&(this.filteredPriceItems=r.entityItems.map(a=>this.mapItemWithPrices(a)))}mapItemWithPrices(e){return tt(le({},e),{visitor_type:e.visitor_type??"local",price:parseInt(e.price,10).toString(),originalPrice:parseInt(e.price,10).toString()})}getVisitorTypeLabel(e){let r=(e?.visitor_type||"local").toString().toLowerCase();return r==="foreign"?"Foreign":r==="staff"?"Staff":"Local"}getVisitorTypeBadgeClass(e){let r=(e?.visitor_type||"local").toString().toLowerCase();return r==="foreign"?"bg-primary":r==="staff"?"bg-warning":"bg-success"}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ko),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-coffee-shop-edit-price"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal
371-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge","text-white",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"View Cafe \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,r0e,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,a0e,19,6,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,o0e,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,s0e,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,l0e,1,0,"div",21)),r&2&&(p("ngClass",Z(14,i0e,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,n0e,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".chartBox-header[_ngcontent-%COMP%] .chartTitle[_ngcontent-%COMP%]{flex:1;min-width:0;margin-right:8px}.chartBox-header[_ngcontent-%COMP%] .badge[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 10px;font-size:12px;font-weight:500;color:#fff!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-primary[_ngcontent-%COMP%]{background-color:#0d6efd!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-success[_ngcontent-%COMP%]{background-color:#198754!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-warning[_ngcontent-%COMP%]{background-color:#fd7e14!important}.modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var Wl=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.HELMET,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r,{headers:new xe({"Content-Type":"application/json"})})}getDailySalesPDF(e){let r={entity_id:Se.HELMET,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.HELMET,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.HELMET,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.HELMET,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.HELMET,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideExpenseReport(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions",a,{headers:new xe({"Content-Type":"application/json"})})}getRevenueExpenseSales(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};
371return this.http.post(this.apiUrl+"/get-revenue-expense",a,{headers:new xe({"Content-Type":"application/json"})})}getMostPopularActivity(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a,{headers:new xe({"Content-Type":"application/json"})})}getVisitorCount(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a,{headers:new xe({"Content-Type":"application/json"})})}getItemWiseSalesPDF(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideExpenseReportPDF(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideExpenseReportExcel(e,r){let a={entity_id:Se.HELMET,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.HELMET,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r,{headers:new xe({"Content-Type":"application/json"})})}getItemPrice(){let e={entity_id:Se.HELMET};return this.http.post(this.apiUrl+"/entity-item-price",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.HELMET};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.HELMET,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var c0e=i=>({collapsed:i}),d0e=(i,n)=>({completed:i,void:n}),m0e=(i,n)=>({completed:i,pending:n});function u0e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div",18),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",19),l(11),o(),s(12,"td")(13,"span",20),l(14),o()(),s(15,"td")(16,"span",21),l(17),o()(),s(18,"td",10)(19,"strong"),l(20),I(21,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),_(" ",Jt(9,9,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")," "),m(3),b(t.details),m(2),p("ngClass",Et(14,d0e,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(2),p("ngClass",Et(17,m0e,t.is_returned,!t.is_returned)),m(),_(" ",t.is_returned?"Returned":"Not Returned"," "),m(3),b(M(21,12,t.amount))}}function p0e(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",22),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var bL=(()=>{let n=class n{constructor(e,r,a,c,d){this.helmetService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.currencyFormatPipe=d,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.helmetService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}};n.\u0275fac=function(r){return new(r||n)(x(Wl),x(pe),x(me),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-helmet-ticket-sales"]],standalone:!1,features:[Ii([Be])],decls:40,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"status",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Helmet Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3717,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th"),l(25,"Helmet Status"),o(),s(26,"th",10),l(27,"Amount (LKR)"),o()()(),s(28,"tbody",11),T(29,u0e,22,20,"tr",12),o()()()()()(),s(30,"ul",13)(31,"li",14)(32,"button",15),S("click",function(){return a.prevPage()}),s(33,"span",16),l(34,"\xAB"),o()()(),T(35,p0e,3,3,"li",17),s(36,"li",14)(37,"button",15),S("click",function(){return a.nextPage()}),s(38,"span",16),l(39,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,c0e,a.isCollapsed)),m(29),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var gI=Di(Ti());var h0e=i=>({collapsed:i}),f0e=(i,n)=>({completed:i,pending:n});function g0e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td")(22,"span",21),l(23),o()(),s(24,"td"),l(25),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,10,t.amount)),m(3),b(M(9,12,t.discount)),m(3),b(M(12,14,t.total)),m(3),b(M(15,16,t.cash_amount)),m(3),b(M(18,18,t.card_amount)),m(3),b(t.card_last_4||""),m(2),p("ngClass",Et(20,f0e,t.is_returned,!t.is_returned)),m(),_(" ",t.is_returned?"Returned":"Not Returned"," "),m(2),b(t.remark||"")}}var xL=(()=>{let n=class n{constructor(e,r,a,c){this.helmetService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedDate=null,this.isCollapsed=!1,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.helmetService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.helmetService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Helmet Daily Sales ${this.selectedDate}.pdf`;(0,gI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.helmetService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Helmet Daily Sales ${this.selectedDate}.xlsx`;(0,gI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}};n.\u0275fac=function(r){return new(r||n)(x(Wl),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-helmet-daily-sales-report"]],standalone:!1,decls:79,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","date-picker","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"status",3,"ngClass"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Helmet \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select day"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Helmet Status"),o(),s(54,"th"),l(55,"Remark"),o()()(),s(56,"tbody",19),T(57,g0e,26,23,"tr",20),o(),s(58,"tfoot")(59,"tr")(60,"td"),l(61,"Totals:"),o(),s(62,"td"),l(63),I(64,"currencyFormat"),o(),s(65,"td"),l(66),I(67,"currencyFormat"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),B(77,"td")(78,"td"),o()()()()()()()()),r&2&&(p("ngClass",Z(20,h0e,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(45),p("ngForOf",a.tickets),m(6),b(M(64,10,a.total.Amount)),m(3),b(M(67,12,a.total.Discount)),m(3),b(M(70,14,a.total.Total)),m(3),b(M(73,16,a.total.Cash)),m(3),b(M(76,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var v0e=i=>({collapsed:i}),CL=i=>({show:i});
371function _0e(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o()(),s(5,"div",24)(6,"div",25)(7,"div",26)(8,"div",27)(9,"span",28),l(10,"LKR"),o(),s(11,"input",29),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",30)(13,"button",31),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",32),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function y0e(i,n){if(i&1&&(s(0,"div",19)(1,"div",33)(2,"p",34),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",35)(5,"p",36)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",36)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",37)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function S0e(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function b0e(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}function x0e(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var EL=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.helmetService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.helmetService.getItemPrice().subscribe({next:e=>{e.data&&e.data[0]&&(this.priceItems=e.data[0].map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.helmetService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
371r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Wl),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-helmet-edit-price"]],standalone:!1,decls:61,vars:24,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Helmet \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,_0e,17,4,"div",6),o()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,y0e,17,3,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,S0e,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,b0e,1,0,"div",17),s(42,"div",18)(43,"div",8)(44,"div",9)(45,"div",10)(46,"h5",11),l(47,"Invalid Price"),o(),s(48,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(49,"div",19)(50,"p"),l(51," The price for "),s(52,"strong"),l(53),o(),l(54," cannot be negative. "),o(),s(55,"p"),l(56,"Please enter a valid price."),o()(),s(57,"div",14)(58,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(59," OK "),o()()()()(),T(60,x0e,1,0,"div",17),o()),r&2&&(p("ngClass",Z(18,v0e,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(20,CL,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(22,CL,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var C0e=i=>({collapsed:i});function E0e(i,n){if(i&1&&(s(0,"div",27)(1,"h3"),l(2),o(),s(3,"div",28),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var wL=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.helmetService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.visitorChart=null,this.revenueChart=null,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Visitor Count",amount:this.total_local,change:0,isPositive:!1}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}
371ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getVisitorCount()}ngAfterViewInit(){}ngOnDestroy(){this.visitorChart&&this.visitorChart.dispose(),this.revenueChart&&this.revenueChart.dispose()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.helmetService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.helmetService.getRevenueExpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_revenue+=Number(r.revenue),this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),setTimeout(()=>{this.initRevenueChart()},100),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date:",this.selectedStartDate,"to",this.selectedEndDate),this.helmetService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),setTimeout(()=>{this.initVisitorChart()},100),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Visitor Count",amount:this.total_local||0,change:0,isPositive:this.total_local>=0}]}initVisitorChart(){console.log("Initializing Visitor Chart");let e=document.getElementById("visitorChart");if(e){this.visitorChart&&this.visitorChart.dispose(),this.visitorChart=Qi(e),console.log("Visitor Data:",this.DatewiseVisitorCount);let r=this.DatewiseVisitorCount.map(d=>new Date(d.ticket_date).toISOString().split("T")[0]),a=this.DatewiseVisitorCount.map(d=>parseInt(d.local_visitors)),c={title:{text:"Visitors",left:"left",textStyle:{fontSize:16,fontWeight:"normal",color:"#333"}},xAxis:{type:"category",data:r,axisLabel:{rotate:45},name:"Date"},yAxis:{type:"value",name:"Count"},legend:{data:["Visitors"],bottom:-5},series:[{name:"Visitors",data:a,type:"bar",color:"#5c7bd9"}],tooltip:{trigger:"axis",formatter:function(d){let u=d[0].axisValue,h=d[0].data||0;return` 372 <div style="font-size: 14px; font-weight: bold; margin-bottom: 5px;">Visitors</div> 373 <div style="font-size: 12px; margin-bottom: 8px;"><strong>${u}</strong></div> 374 <div style="display: flex; align-items: center; margin-bottom: 5px;">
375 <span style="width: 12px; height: 12px; background-color: #5c7bd9; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 376 <span style="flex-grow: 1;">Visitors:</span> 377 <span style="text-align: right; width: 70px;">${h}</span> 378 </div> 379 `}}};this.visitorChart.setOption(c),window.addEventListener("resize",()=>{this.visitorChart&&this.visitorChart.resize()})}else console.error("Visitor chart element not found")}initRevenueChart(){console.log("Initializing Revenue Chart");let e=document.getElementById("revenueChart");if(e){this.revenueChart&&this.revenueChart.dispose(),this.revenueChart=Qi(e),console.log("Revenue Data:",this.revenueItems);let r=this.revenueItems.map(d=>d.transaction_date),a=this.revenueItems.map(d=>parseFloat(d.revenue)),c={title:{text:"Revenue",left:"left",textStyle:{fontSize:16,color:"#333",fontWeight:"normal"}},xAxis:{type:"category",data:r,axisLabel:{rotate:45},name:"Date"},yAxis:{type:"value",name:"Amount (LKR)"},legend:{data:["Revenue","Expense"],bottom:-5},series:[{name:"Revenue",data:a,type:"bar",color:"#ff9f43"}],tooltip:{trigger:"axis",formatter:function(d){let u=d[0].axisValue,h=d[0].data||0,f=d[1]?.data||0;return` 380 <div style="font-size: 14px; font-weight: bold; margin-bottom: 5px;">Revenue Details</div> 381 <div style="font-size: 12px; margin-bottom: 8px;"><strong>${u}</strong></div> 382 <div style="display: flex; align-items: center; margin-bottom: 5px;"> 383 <span style="width: 12px; height: 12px; background-color: #ff9f43; border-radius: 50%; display: inline-block; margin-right: 5px;"></span> 384 <span style="flex-grow: 1;">Revenue:</span> 385 <span style="text-align: right; width: 70px;">LKR ${h.toLocaleString()}</span> 386 </div> 387 `}}};this.revenueChart.setOption(c),window.addEventListener("resize",()=>{this.revenueChart&&this.revenueChart.resize()})}else console.error("Revenue chart element not found")}};n.\u0275fac=function(r){return new(r||n)(x(Wl),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-helmet-analytics"]],standalone:!1,decls:39,vars:9,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,""],[1,"row"],[1,"col-md-12"],["revenueType","Item Wise Revenue",3,"items"],[1,"col-md-6"],[1,"bg-light","p-4","rounded","shadow-sm","mb-4"],["id","visitorChart",2,"width","100%","min-height","400px","height","400px"],["id","revenueChart",2,"width","100%","min-height","400px","height","400px"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Helmet Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,E0e,7,8,"div",18),o()(),s(28,"div",19)(29,"div",20)(30,"div",21),B(31,"app-activity-wise-revenue",22),o(),s(32,"div",20)(33,"div",23)(34,"div",24),B(35,"div",25),o()(),s(36,"div",23)(37,"div",24),B(38,"div",26),o()()()()()()()()()),r&2&&(p("ngClass",Z(7,C0e,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items))},dependencies:[ue,_e,Ke,Ne,Le,uo,Dn,Be],encapsulation:2});let i=n;return i})();var vI=Di(Ti());var Ps=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}
387getDailySales(e){let r={entity_id:Se.SOUVENIR_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.SOUVENIR_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.SOUVENIR_SHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getCategoryWiseSales(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getMonthlySales(e,r){let a={entity_id:Se.SOUVENIR_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.SOUVENIR_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.SOUVENIR_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getrevenueexpenseSales(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getMostPopularActivity(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getVisitorCount(e,r){let a={entity_id:Se.SOUVENIR_SHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getTicketSales(e){let r={entity_id:Se.SOUVENIR_SHOP,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.SOUVENIR_SHOP};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:"",entity_id:Se.SOUVENIR_SHOP};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.SOUVENIR_SHOP,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var w0e=i=>({collapsed:i});function T0e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var TL=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.souvenirShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}
387setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.souvenirShopService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.souvenirShopService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Souvenir Shop Daily Sales ${this.selectedDate}.pdf`;(0,vI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.souvenirShopService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Souvenir Shop Daily Sales ${this.selectedDate}.xlsx`;(0,vI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ps),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-souvenir-shop"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Souvenir Shop Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,T0e,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,w0e,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var D0e=i=>({collapsed:i}),I0e=(i,n)=>({completed:i,void:n});
387function k0e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,I0e,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function M0e(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var DL=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.souvenirShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.souvenirShopService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ps),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-souvenir-shop"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Souvenir Shop Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(17,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,k0e,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,M0e,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,D0e,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var _I=Di(Ti());var A0e=i=>({collapsed:i});
387function P0e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var IL=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.souvenirShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.souvenirShopService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.souvenirShopService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Souvenir Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,_I.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.souvenirShopService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Souvenir Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,_I.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ps),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-souvenir-shop"]],standalone:!1,decls:120,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Souvenir Shop \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
387),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,P0e,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19),l(81),I(82,"currencyFormat"),o()()()(),s(83,"div",23)(84,"div",24)(85,"div",25)(86,"div",26)(87,"span",27),l(88,"Subtotal:"),o(),s(89,"span"),l(90),I(91,"currencyFormat"),o()()(),s(92,"div",25)(93,"div",26)(94,"span",27),l(95,"Complimentary:"),o(),s(96,"span",28),l(97),I(98,"currencyFormat"),o()()(),s(99,"div",25)(100,"div",26)(101,"span",27),l(102,"Discounts:"),o(),s(103,"span",28),l(104),I(105,"currencyFormat"),o()()(),s(106,"div",25)(107,"div",26)(108,"span",27),l(109,"Voids:"),o(),s(110,"span",28),l(111),I(112,"currencyFormat"),o()()(),s(113,"div",25)(114,"div",29)(115,"span"),l(116,"Total Revenue:"),o(),s(117,"span"),l(118),I(119,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,A0e,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(3),_(" ",M(82,26,a.total.item_total)," "),m(9),b(M(91,28,a.total.item_subtotal)),m(7),b(M(98,30,a.total.complimentary_subtotal)),m(7),b(M(105,32,a.total.discount_subtotal)),m(7),b(M(112,34,a.total.voided_subtotal)),m(7),b(M(119,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var F0e=i=>({collapsed:i}),R0e=i=>({show:i});function O0e(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function N0e(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o()(),s(5,"div",30)(6,"div",31)(7,"div",32)(8,"div",33)(9,"span",34),l(10,"LKR"),o(),s(11,"input",35),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",36)(13,"button",37),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",38),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function L0e(i,n){if(i&1&&(s(0,"div",23)(1,"div",39)(2,"p",40),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",41)(5,"p",42)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",42)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",42)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",43)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedCategory," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function B0e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function V0e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var kL=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.spinner=e,this.toastr=r,this.sidebarService=a,this.coffeeShopService=c,this.souvenirShopService=d,this.cognitoService=u,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.souvenirShopService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({}
387,c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.souvenirShopService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
387r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ko),x(Ps),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-pricing-souvenir-shop"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Souvenir Shop \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,O0e,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,N0e,17,4,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,L0e,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,B0e,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,V0e,1,0,"div",21)),r&2&&(p("ngClass",Z(14,F0e,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,R0e,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var U0e=i=>({collapsed:i});function j0e(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var ML=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.souvenirShopService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}
387ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.souvenirShopService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,this.total_revenue=e.data.totals.item_total,console.log("Total Revenue:",this.total_revenue),console.log("Categories---",this.items),console.log("Total---",this.total),this.updateSummaryData(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_guide_expense=0,this.souvenirShopService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.souvenirShopService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.souvenirShopService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ps),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-souvenir-shop-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
387date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Souvenir Shop Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,j0e,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,U0e,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var W0e=i=>({collapsed:i});function H0e(i,n){if(i&1){let t=he();s(0,"div",22)(1,"div",23)(2,"div",24)(3,"div",25),l(4),I(5,"titlecase"),o()(),s(6,"div",26)(7,"div",27)(8,"div",28)(9,"div",29)(10,"span",30),l(11,"LKR"),o(),s(12,"input",31),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a,r))}),o()()(),s(13,"div",32)(14,"button",33),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r,"visitor"))}),s(15,"span",34),l(16,"save"),o(),l(17," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(M(5,4,t.type)),m(8),p("value",t.cost)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function G0e(i,n){if(i&1){let t=he();s(0,"div",22)(1,"div",35)(2,"div",24)(3,"div",25),l(4),o()(),s(5,"div",36)(6,"p",37),l(7),o(),s(8,"div",5)(9,"div",28)(10,"div",29)(11,"span",30),l(12,"LKR"),o(),s(13,"input",31),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a,r))}),o()()(),s(14,"div",32)(15,"button",38),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r,"vehicle"))}),s(16,"span",34),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.type),m(3),b(t.description),m(6),p("value",t.cost)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function $0e(i,n){if(i&1&&(s(0,"div",20)(1,"div",39)(2,"p",40),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",41)(5,"p",42)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",42)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",43)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.type),m(4),_(" LKR ",t.selectedItem.originalCost," "),m(4),_(" LKR ",t.selectedItem.cost," ")}}function z0e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeModal())}),o()}}function Y0e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeNegativeValueModal())}),o()}}var AL=(()=>{let n=class n{constructor(e,r,a,c,d){this.entranceTicketingService=e,this.spinner=r,this.sidebarService=a,this.cognitoService=c,this.toastr=d,this.visitorTypes=[],this.vehicleTypes=[],this.showConfirmModal=!1,this.isAccountant=!1,this.isOfficeUser=!1,this.selectedItem=null,this.itemType="visitor",this.isCollapsed=!1,this.showNegativeValueModal=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.loadPrices(),this.checkUserRole()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadPrices(){this.spinner.show(),Promise.all([this.getVisitorPrice(),this.getVehiclePrice()]).finally(()=>{this.spinner.hide()})}getVisitorPrice(){this.entranceTicketingService.getVisitorPrice().subscribe({next:e=>{this.visitorTypes=e.data.visitor_types.map(r=>tt(le({},r),{originalCost:r.cost,type:this.formatVisitorType(r.type)}))},error:e=>{console.error("Error fetching visitor prices:",e),this.toastr.error("Failed to load visitor prices")}})}formatVisitorType(e){return e.split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}getVehiclePrice(){this.entranceTicketingService.getVehiclePrice().subscribe({next:e=>{this.vehicleTypes=e.data.vehicles.map(r=>tt(le({},r),{originalCost:r.cost}))},error:e=>{console.error("Error fetching vehicle prices:",e),this.toastr.error("Failed to load vehicle prices")}})}updatePrice(e,r){let a=parseFloat(r.target.value);a<0?(this.showNegativeValueModal=!0,r.target.value=e.cost):e.cost=a}closeNegativeValueModal(){this.showNegativeValueModal=!1}openConfirmModal(e,r){if(e.cost===e.originalCost){this.toastr.info("No price change detected");return}this.selectedItem=e,this.itemType=r,this.showConfirmModal=!0}confirmSavePrice(){if(!this.selectedItem)return;this.spinner.show();
387let e={id:this.selectedItem.id,typeid:this.selectedItem.typeid,cost:this.selectedItem.cost};(this.itemType==="visitor"?this.entranceTicketingService.updateVisitorPrice(e):this.entranceTicketingService.updateVehiclePrice(e)).subscribe({next:a=>{this.toastr.success("Price updated successfully!"),this.loadPrices(),this.closeModal()},error:a=>{console.error("Error updating price:",a),this.toastr.error("Failed to update price")},complete:()=>{this.spinner.hide()}})}closeModal(){this.selectedItem&&(this.selectedItem.cost=this.selectedItem.originalCost),this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(ru),x(pe),x(ce),x(ze),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-admission-edit-price"]],standalone:!1,decls:46,vars:16,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],[1,"subTitle"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"analytics-chart","mt-5"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],[1,"modal-body"],[1,"text-danger"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"chartingBox","h-100"],[1,"chartBody","pt-2"],[1,"sub-textLine"],[1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Entrance Ticketing \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h2"),l(10,"Edit Visitor Prices"),o()(),T(11,H0e,18,6,"div",7),o()(),s(12,"div",8)(13,"div",5)(14,"div",6)(15,"h2"),l(16,"Edit Vehicle Prices"),o()(),T(17,G0e,19,5,"div",7),o()()(),s(18,"div",9)(19,"div",10)(20,"div",11)(21,"div",12)(22,"h5",13),l(23,"Confirm Price Update"),o(),s(24,"button",14),S("click",function(){return a.closeModal()}),o()(),T(25,$0e,17,3,"div",15),s(26,"div",16)(27,"button",17),S("click",function(){return a.closeModal()}),l(28," Cancel "),o(),s(29,"button",18),S("click",function(){return a.confirmSavePrice()}),l(30," Confirm Update "),o()()()()(),T(31,z0e,1,0,"div",19),s(32,"div",9)(33,"div",10)(34,"div",11)(35,"div",12)(36,"h5",13),l(37,"Invalid Price"),o(),s(38,"button",14),S("click",function(){return a.closeNegativeValueModal()}),o()(),s(39,"div",20)(40,"p",21),l(41," The price cannot be negative. Please enter a valid value. "),o()(),s(42,"div",16)(43,"button",18),S("click",function(){return a.closeNegativeValueModal()}),l(44," OK "),o()()()()(),T(45,Y0e,1,0,"div",19),o()),r&2&&(p("ngClass",Z(14,W0e,a.isCollapsed)),m(11),p("ngForOf",a.visitorTypes),m(6),p("ngForOf",a.vehicleTypes),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativeValueModal?"block":"none"),Re("show",a.showNegativeValueModal),m(13),p("ngIf",a.showNegativeValueModal))},dependencies:[ue,_e,Dt,bC],encapsulation:2});let i=n;return i})();var q0e=i=>({collapsed:i});function K0e(i,n){if(i&1){let t=he();s(0,"div",18)(1,"div",19)(2,"div",20)(3,"div",21),l(4),o()(),s(5,"div",22)(6,"div",23)(7,"div",24)(8,"div",25)(9,"span",26),l(10,"LKR"),o(),s(11,"input",27),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",28)(13,"button",29),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",30),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.type),m(7),p("value",t.cost)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}
387function X0e(i,n){if(i&1&&(s(0,"div",31)(1,"div",32)(2,"p",33),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",34)(5,"p",35)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",35)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",36)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.type),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.cost," ")}}function J0e(i,n){if(i&1){let t=he();s(0,"div",37),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}var PL=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.photoShootService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.isAdmin=!1,this.showConfirmModal=!1,this.selectedItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.loadItemPrices(),this.checkUserRole()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.photoShootService.getItemPrice().subscribe({next:e=>{e.data&&(this.priceItems=e.data.map(r=>tt(le({},r),{price:r.updatedprice?.toString()||r.cost.toString(),originalPrice:r.cost.toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value),c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].cost=a)}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.cost.toString()===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.photoShootService.updateItemPrice(this.selectedItem.id,this.selectedItem.typeid,this.selectedItem.cost).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}}),console.log("update price called")}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
387r.id===this.selectedItem.id);e!==-1&&this.priceItems[e].originalPrice&&(this.priceItems[e].cost=parseInt(this.priceItems[e].originalPrice))}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(As),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-pricing-photo-shoot"]],standalone:!1,decls:23,vars:10,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"modal-body"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Shoot \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,K0e,17,4,"div",6),o()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,X0e,17,3,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,J0e,1,0,"div",17),o()),r&2&&(p("ngClass",Z(8,q0e,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var Z0e=i=>({collapsed:i});function Q0e(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function epe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function tpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.date)),m(3),b(t.cash.toLocaleString()),m(2),b(t.online.toLocaleString()),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var FL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.admissionsService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.onlineTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.admissionsService.getMonthlySalesReport(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.onlineTotal=0,this.totalRevenue=0,this.salesData.forEach(e
387=>{this.cashTotal+=e.cash,this.onlineTotal+=e.online,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.admissionsService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{this.admissionsService.downloadFile(e,`Entrance Ticketing Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`),this.spinner.hide()},error:e=>{console.error("Error downloading Excel:",e),this.toastr.error("Failed to generate Excel:","Error"),this.spinner.hide()}})}getMonthlySalesPDF(){this.spinner.show(),this.admissionsService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{this.admissionsService.downloadFile(e,`Entrance Ticketing Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`),this.spinner.hide()},error:e=>{console.error("Error downloading PDF:",e),this.toastr.error("Failed to generate PDF:","Error"),this.spinner.hide()}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Hr))},n.\u0275cmp=te({type:n,selectors:[["app-admission-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,Q0e,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,epe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Online"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,tpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,Z0e,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.onlineTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var yI=Di(Ti());var ipe=i=>({collapsed:i});function npe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function rpe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function ape(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleStr
387ing()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var RL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.amberSwingService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.amberSwingService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.amberSwingService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Swing Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,yI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.amberSwingService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Swing Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,yI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Io))},n.\u0275cmp=te({type:n,selectors:[["app-amber-swing-monthly-sales-report"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,npe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,rpe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,ape,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,ipe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var SI=Di(Ti());var ope=i=>({collapsed:i});function spe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function lpe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function cpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var OL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.paddleBoatService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.paddleBoatService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.paddleBoatService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Paddle Boat Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,SI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.paddleBoatService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Paddle Boat Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,SI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};
387n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Qa))},n.\u0275cmp=te({type:n,selectors:[["app-paddle-boat-monthly-sales-report"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,spe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,lpe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,cpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,ope,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var bI=Di(Ti());var dpe=i=>({collapsed:i});function mpe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function upe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function ppe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var NL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.horseRideService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}
387onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.horseRideService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.horseRideService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Horse Ride Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,bI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.horseRideService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Horse Ride Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,bI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Es))},n.\u0275cmp=te({type:n,selectors:[["app-horse-riding-monthly-sales-report"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,mpe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,upe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,ppe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,dpe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var xI=Di(Ti());var hpe=i=>({collapsed:i});function fpe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function gpe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function vpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var LL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.coffeeShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.coffeeShopService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.coffeeShopService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Coffee Shop Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,xI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.coffeeShopService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Coffee Shop Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,xI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ko))},n.\u0275cmp=te({type:n,selectors:[["app-coffee-shop-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,fpe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,gpe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,vpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,hpe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var CI=Di(Ti());var _pe=i=>({collapsed:i});function ype(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Spe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function bpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var BL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.souvenirShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.souvenirShopService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.souvenirShopService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Souvenir Shop Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,CI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.souvenirShopService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Souvenir Shop Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,CI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ps))},n.\u0275cmp=te({type:n,selectors:[["app-souvenir-shop-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,ype,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,Spe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,bpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,_pe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var EI=Di(Ti());var xpe=i=>({collapsed:i});function Cpe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Epe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function wpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var VL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.helmetService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.helmetService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.helmetService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Helmet Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,EI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.helmetService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Helmet Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,EI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Wl))},n.\u0275cmp=te({type:n,selectors:[["app-helmet-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,Cpe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,Epe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,wpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,xpe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var wI=Di(Ti());var Tpe=i=>({collapsed:i});function Dpe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Ipe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function kpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var UL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.herbalShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.herbalShopService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.herbalShopService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Herbal Shop Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,wI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.herbalShopService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Herbal Shop Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,wI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ws))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-sales-report-herbal-shop"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,Dpe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,Ipe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,kpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,Tpe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var TI=Di(Ti());var Mpe=i=>({collapsed:i});function Ape(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Ppe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Fpe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var jL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.adventureParkService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.adventureParkService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.adventureParkService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Adventure Park Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,TI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.adventureParkService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Adventure Park Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,TI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ts))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-sales-report-adventure-park"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,Ape,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,Ppe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,Fpe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,Mpe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var In=(()=>{let n=class n{validate(e){return mL()(e)}};n.\u0275fac=function(r){return new(r||n)},n.\u0275dir=Ci({type:n,selectors:[["","nonNegative","","ngModel",""]],standalone:!1,features:[Ii([{provide:Am,useExisting:n,multi:!0}])]});let i=n;return i})();var Rpe=i=>({collapsed:i}),Ope=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),DI=(i,n)=>({"is-invalid":i,"is-warning":n});function Npe(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Lpe(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Bpe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Vpe(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function Upe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function jpe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,Vpe,2,0,"div",71)(4,Upe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,DI,t.invalid&&t.touched,r.isAmountMismatch(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatch(e))}}function Wpe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_amount_received_cash==null?null:t.actual_amount_received_cash.toLocaleString()," ")}}function Hpe(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function Gpe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function $pe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,2),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,Hpe,2,0,"div",71)(4,Gpe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,DI,t.invalid&&t.touched,r.isAmountMismatch(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatch(e))}}function zpe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_amount_received_card==null?null:t.actual_amount_received_card.toLocaleString()," ")}}function Ype(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function qpe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function Kpe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,3),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_online_show,r)||(a.actual_amount_received_online_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"online",a))}),o(),T(3,Ype,2,0,"div",71)(4,qpe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_online_show),p("ngClass",Et(5,DI,t.invalid&&t.touched,r.isAmountMismatch(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatch(e))}}function Xpe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_amount_received_online==null?null:t.actual_amount_received_online.toLocaleString()," ")}}function Jpe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Zpe(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function Qpe(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),T(6,jpe,5,8,"td",67)(7,Wpe,2,1,"td",67)(8,$pe,5,8,"td",67)(9,zpe,2,1,"td",67)(10,Kpe,5,8,"td",67)(11,Xpe,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,Jpe,3,1,"ng-container",69)(17,Zpe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,16,t.date)),m(3),_(" ",t.system_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(18,Ope,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function ehe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function the(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65)(6,"button",78),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",79),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function ihe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function nhe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",24)(4,"thead",37)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,ihe,5,2,"tr",17),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var WL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.admissionsService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemAmountTotal=0,this.actualAmountRecievedCashTotal=0,this.actualAmountRecievedCardTotal=0,this.actualAmountRecievedOnlineTotal=0,this.selectedTicket={ticketId:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}isAmountMismatch(e){return!!(e.system_amount!=(e.actual_amount_received_cash??0)+(e.actual_amount_received_card??0)+(e.actual_amount_received_online??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
387formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_amount_received_cash=d),r==="card"&&(a.actual_amount_received_card=d),r==="online"&&(a.actual_amount_received_online=d),e.target.value=c}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){return e.is_confirmed&&e.system_amount!=(e.actual_amount_received_cash??0)+(e.actual_amount_received_card??0)+(e.actual_amount_received_online??0)?"table-danger":e.is_confirmed?"table-success":e.date<this.todayDate&&!e.is_confirmed?e.date===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary":this.isTodaysRow(e.date)?"table-light":""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_amount_received_cash!=null&&e.actual_amount_received_cash>=0&&e.actual_amount_received_card!=null&&e.actual_amount_received_card>=0&&e.actual_amount_received_online!=null&&e.actual_amount_received_online>=0){this.selectedTicket={ticketId:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter both Ticket ID and Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){this.selectedTicket.item.invalid_tickets=[...this.selectedTicket.tempInvalidTickets],this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let e=document.getElementById("invalidTicketsModal");e&&e.setAttribute("inert","true")}}calculateTotals(){this.systemAmountTotal=0,this.actualAmountRecievedCashTotal=0,this.actualAmountRecievedCardTotal=0,this.actualAmountRecievedOnlineTotal=0,this.salesData.forEach(e=>{this.systemAmountTotal+=Number(e.system_amount),this.actualAmountRecievedCashTotal+=Number(e.actual_amount_received_cash)||0,this.actualAmountRecievedCardTotal+=Number(e.actual_amount_received_card)||0,this.actualAmountRecievedOnlineTotal+=Number(e.actual_amount_received_online)||0})}onClickConfirm(e){if(e.actual_amount_received_cash===null||e.actual_amount_received_cash===void 0||e.actual_amount_received_card===null||e.actual_amount_received_card===void 0||e.actual_amount_received_online===null||e.actual_amount_received_online===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_amount_received_cash<0||e.actual_amount_received_card<0||e.actual_amount_received_online<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}
387onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.admissionsService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_amount_received_cash!==null&&this.selectedTicket.item?.actual_amount_received_cash!==void 0&&this.selectedTicket.item?.actual_amount_received_cash>=0&&this.selectedTicket.item?.actual_amount_received_card!==null&&this.selectedTicket.item?.actual_amount_received_card!==void 0&&this.selectedTicket.item?.actual_amount_received_card>=0&&this.selectedTicket.item?.actual_amount_received_online!==null&&this.selectedTicket.item?.actual_amount_received_online!==void 0&&this.selectedTicket.item?.actual_amount_received_online>=0&&(this.spinner.show(),this.admissionsService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Hr))},n.\u0275cmp=te({type:n,selectors:[["app-admission-daily-transaction-verify"]],standalone:!1,decls:157,vars:26,consts:[["confirmedIcon",""],["amountInput","ngModel"],["amountInputCard","ngModel"],["amountInputOnline","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[1,"table-light"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"modal-footer","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","text-start","w-100"],[1,"thead-dark","sticky-top"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],[4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",4)(1,"div",5),T(2,Npe,5,3,"div",6),s(3,"div",7)(4,"div")(5,"div",8),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",9)(8,"div",10)(9,"div",11)(10,"label",12),l(11,"Month"),o(),s(12,"select",13),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",14),l(14,"Select Month"),o(),T(15,Lpe,2,2,"option",15),o()(),s(16,"div",11)(17,"label",12),l(18,"Year"),o(),s(19,"select",16),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",14),l(21,"Select Year"),o(),T(22,Bpe,2,1,"option",17),o()(),s(23,"div",18)(24,"button",19),S("click",function(){return a.onClickGenerate()}),s(25,"span",20),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",4)(29,"div",21)(30,"div",22)(31,"div",23)(32,"table",24)(33,"thead",25)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",26),l(38,"System Amount(LKR)"),o(),s(39,"th",26),l(40,"Actual Amount Received Cash(LKR)"),o(),s(41,"th",26),l(42,"Actual Amount Received Card(LKR)"),o(),s(43,"th",26),l(44,"Actual Amount Received Online(LKR)"),o(),s(45,"th",26),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",26),l(48,"Actions"),o()()(),s(49,"tbody",27),T(50,Qpe,19,21,"tr",28),o(),s(51,"tfoot",29)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",26),l(56),o(),s(57,"td",26),l(58),o(),s(59,"td",26),l(60),o(),s(61,"td",26),l(62),o(),B(63,"td",26)(64,"td",26),o()()()()()()()()(),s(65,"div",30)(66,"div",31)(67,"div",32)(68,"div",33)(69,"h5",34),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",35),o(),s(72,"div",36)(73,"table",24)(74,"thead",37)(75,"tr")(76,"th"),l(77,"Invalid Ticket Number"),o(),s(78,"th"),l(79,"Ticket Reason"),o(),B(80,"th"),o()(),s(81,"tbody"),T(82,ehe,5,2,"tr",17),o()()()()()(),s(83,"div",38)(84,"div",31)(85,"div",32)(86,"div",33)(87,"h5",39),l(88," Invalid Tickets "),o(),B(89,"button",35),o(),s(90,"div",40)(91,"form",41),S("ngSubmit",function(){return a.addToList()}),s(92,"div",42)(93,"label",43),l(94,"Invalid Ticket Number"),o(),s(95,"input",44),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(96,"div",42)(97,"label",45),l(98,"Ticket Reason"),o(),s(99,"textarea",46),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(100,"div",47)(101,"button",48),S("click",function(){return a.clearForm()}),l(102," Cancel "),o(),s(103,"button",49),l(104," Add To List "),o()()()(),s(105,"div",50)(106,"div",51)(107,"table",52)(108,"thead",53)(109,"tr")(110,"th",54),l(111,"Invalid Ticket Number"),o(),s(112,"th"),l(113,"Reason"),o(),B(114,"th"),o()(),s(115,"tbody"),T(116,the,8,2,"tr",17),o()()()(),s(117,"div",55)(118,"button",56),l(119," Cancel "),o(),s(120,"button",57),S("click",function(){return a.saveInvalidTickets()}),l(121," Save "),o()()()()(),s(122,"div",58)(123,"div",31)(124,"div",32)(125,"div",33)(126,"h5",59),l(127,"Confirm Transaction"),o(),B(128,"button",35),o(),s(129,"div",36)(130,"p")(131,"strong"),l(132,"Date:"),o(),l(133),I(134,"date"),o(),s(135,"p")(136,"strong"),l(137,"System Amount:"),o(),l(138),o(),s(139,"p")(140,"strong"),l(141,"Actual Amount Cash:"),o(),l(142),o(),s(143,"p")(144,"strong"),l(145,"Actual Amount Card:"),o(),l(146),o(),s(147,"p")(148,"strong"),l(149,"Actual Amount Online:"),o(),l(150),o(),T(151,nhe,12,1,"div",60),o(),s(152,"div",55)(153,"button",56),l(154," Cancel "),o(),s(155,"button",57),S("click",function(){return a.confirmTransaction()}),l(156," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(24,Rpe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemAmountTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.actualAmountRecievedCashTotal.toLocaleString()," "),m(2),_(" ",a.actualAmountRecievedCardTotal.toLocaleString()," "),m(2),_(" ",a.actualAmountRecievedOnlineTotal.toLocaleString()," "),m(20),p("ngForOf",a.selectedTicket.item==null?null:a.selectedTicket.item.invalid_tickets),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(134,22,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_amount==null?null:a.selectedTicket.item.system_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_amount_received_cash==null?null:a.selectedTicket.item.actual_amount_received_cash.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_amount_received_card==null?null:a.selectedTicket.item.actual_amount_received_card.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_amount_received_online==null?null:a.selectedTicket.item.actual_amount_received_online.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}"]});let i=n;return i})();var rhe=i=>({collapsed:i}),ahe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),HL=(i,n)=>({"is-invalid":i,"is-warning":n});function ohe(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function she(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function lhe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function che(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function dhe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function mhe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,che,2,0,"div",71)(4,dhe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,HL,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function uhe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function phe(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function hhe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function fhe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,phe,2,0,"div",71)(4,hhe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,HL,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function ghe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function vhe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function _he(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function yhe(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),s(6,"td",66),l(7),o(),T(8,mhe,5,8,"td",67)(9,uhe,2,1,"td",67)(10,fhe,5,8,"td",67)(11,ghe,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,vhe,3,1,"ng-container",69)(17,_he,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,ahe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function She(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function bhe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,She,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function xhe(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.code," ")}}function Che(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65),l(6),o(),s(7,"td",65)(8,"button",79),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(9,"i",80),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function Ehe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function whe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,Ehe,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var GL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.amberSwingService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.getPOSList()}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,pos_unit_id:r,reason:a}=this.selectedTicket;if(a=a.trim(),e&&r)if(this.selectedTicket.tempInvalidTickets.find(d=>d.id===e))this.toastr.warning("This ticket is already present in the list.");else{console.log("pos_unit_id",r),console.log("POS LIST",this.posList);let d=this.posList.find(u=>u.id===Number(r));console.log("selectedpos_unit_id",d),d?(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:r,pos_unit_code:d.code,reason:a}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""):this.toastr.error("Selected POS not found.")}else this.toastr.error("Please enter Ticket ID, select POS, and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:a.pos_unit_id,pos_unit_code:a.pos_unit_code,reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.amberSwingService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.amberSwingService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getPOSList(){this.spinner.show(),this.amberSwingService.getPOSUnitID().subscribe({next:e=>{e&&e.data&&(this.posList=e.data.map(r=>({id:r.id,code:r.code})).sort((r,a)=>r.id-a.id)),this.spinner.hide()},error:e=>{console.error("Error loading POS list:",e),this.spinner.hide(),this.toastr.error("Failed to load POS list")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Io))},n.\u0275cmp=te({type:n,selectors:[["app-amber-daily-transaction-verify"]],standalone:!1,decls:178,vars:35,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","pos_unit_id",1,"form-label"],["id","pos_unit_id","name","pos_unit_id","required","",1,"form-control",3,"ngModelChange","ngModel"],["value","","disabled","","selected",""],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,ohe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,she,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,lhe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,yhe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,bhe,14,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"POS ID"),o(),s(111,"select",44),X("ngModelChange",function(d){return K(a.selectedTicket.pos_unit_id,d)||(a.selectedTicket.pos_unit_id=d),d}),s(112,"option",45),l(113,"Select a POS ID"),o(),T(114,xhe,2,2,"option",13),o()(),s(115,"div",40)(116,"label",46),l(117,"Ticket Reason"),o(),s(118,"textarea",47),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(119,"div",48)(120,"button",49),S("click",function(){return a.clearForm()}),l(121," Cancel "),o(),s(122,"button",50),l(123," Add To List "),o()()()(),s(124,"div",51)(125,"div",52)(126,"table",53)(127,"thead",54)(128,"tr")(129,"th",55),l(130,"Invalid Ticket Number"),o(),s(131,"th"),l(132,"POS ID"),o(),s(133,"th"),l(134,"Reason"),o(),B(135,"th"),o()(),s(136,"tbody"),T(137,Che,10,3,"tr",15),o()()()(),s(138,"div",56)(139,"button",57),l(140," Cancel "),o(),s(141,"button",58),S("click",function(){return a.saveInvalidTickets()}),l(142," Save "),o()()()()(),s(143,"div",59)(144,"div",29)(145,"div",30)(146,"div",31)(147,"h5",60),l(148,"Confirm Transaction"),o(),B(149,"button",33),o(),s(150,"div",34)(151,"p")(152,"strong"),l(153,"Date:"),o(),l(154),I(155,"date"),o(),s(156,"p")(157,"strong"),l(158,"System Cash:"),o(),l(159),o(),s(160,"p")(161,"strong"),l(162,"System Card:"),o(),l(163),o(),s(164,"p")(165,"strong"),l(166,"Actual Cash:"),o(),l(167),o(),s(168,"p")(169,"strong"),l(170,"Actual Card:"),o(),l(171),o(),T(172,whe,14,1,"div",35),o(),s(173,"div",56)(174,"button",57),l(175," Cancel "),o(),s(176,"button",58),S("click",function(){return a.confirmTransaction()}),l(177," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(33,rhe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.pos_unit_id),m(3),p("ngForOf",a.posList),m(4),q("ngModel",a.selectedTicket.reason),m(19),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(155,31,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var The=i=>({collapsed:i}),Dhe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),$L=(i,n)=>({"is-invalid":i,"is-warning":n});function Ihe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function khe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Mhe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Ahe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Phe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Fhe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,Ahe,2,0,"div",68)(4,Phe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,$L,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function Rhe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Ohe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Nhe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Lhe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,Ohe,2,0,"div",68)(4,Nhe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,$L,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function Bhe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function Vhe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Uhe(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function jhe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,Fhe,5,8,"td",64)(9,Rhe,2,1,"td",64)(10,Lhe,5,8,"td",64)(11,Bhe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,Vhe,3,1,"ng-container",66)(17,Uhe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,Dhe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Whe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Hhe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Whe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function Ghe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function $he(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function zhe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,$he,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var zL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.helmetService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.helmetService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.helmetService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Wl))},n.\u0275cmp=te({type:n,selectors:[["app-helmet-daily-transaction-verify"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Ihe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,khe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Mhe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,jhe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Hhe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,Ghe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,zhe,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,The,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var Yhe=i=>({collapsed:i}),qhe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),YL=(i,n)=>({"is-invalid":i,"is-warning":n});function Khe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Xhe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Jhe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Zhe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Qhe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function efe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,Zhe,2,0,"div",68)(4,Qhe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,YL,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function tfe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function ife(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function nfe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function rfe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,ife,2,0,"div",68)(4,nfe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,YL,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function afe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function ofe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function sfe(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function lfe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,efe,5,8,"td",64)(9,tfe,2,1,"td",64)(10,rfe,5,8,"td",64)(11,afe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,ofe,3,1,"ng-container",66)(17,sfe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,qhe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function cfe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function dfe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,cfe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function mfe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function ufe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function pfe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,ufe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var qL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.souvenirShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.souvenirShopService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.souvenirShopService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ps))},n.\u0275cmp=te({type:n,selectors:[["app-souvenir-shop-daily-transaction-verify"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Khe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Xhe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Jhe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,lfe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,dfe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,mfe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,pfe,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,Yhe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var hfe=i=>({collapsed:i}),ffe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),KL=(i,n)=>({"is-invalid":i,"is-warning":n});function gfe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function vfe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function _fe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function yfe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Sfe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function bfe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,yfe,2,0,"div",68)(4,Sfe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,KL,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function xfe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Cfe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Efe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function wfe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,Cfe,2,0,"div",68)(4,Efe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,KL,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function Tfe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function Dfe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Ife(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function kfe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,bfe,5,8,"td",64)(9,xfe,2,1,"td",64)(10,wfe,5,8,"td",64)(11,Tfe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,Dfe,3,1,"ng-container",66)(17,Ife,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,ffe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Mfe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Afe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Mfe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function Pfe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Ffe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Rfe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Ffe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var XL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.herbalShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.herbalShopService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.herbalShopService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ws))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-herbal-shop"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,gfe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,vfe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,_fe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,kfe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Afe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,Pfe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,Rfe,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,hfe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var Ofe=i=>({collapsed:i}),Nfe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),JL=(i,n)=>({"is-invalid":i,"is-warning":n});function Lfe(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Bfe(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Vfe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Ufe(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function jfe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function Wfe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,Ufe,2,0,"div",71)(4,jfe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,JL,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function Hfe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Gfe(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function $fe(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function zfe(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,Gfe,2,0,"div",71)(4,$fe,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,JL,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}
387function Yfe(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function qfe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Kfe(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function Xfe(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),s(6,"td",66),l(7),o(),T(8,Wfe,5,8,"td",67)(9,Hfe,2,1,"td",67)(10,zfe,5,8,"td",67)(11,Yfe,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,qfe,3,1,"ng-container",69)(17,Kfe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,Nfe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Jfe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function Zfe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,Jfe,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function Qfe(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.code," ")}}function ege(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65),l(6),o(),s(7,"td",65)(8,"button",79),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(9,"i",80),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function tge(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function ige(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,tge,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var ZL=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.adventureParkService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.getPOSList()}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
387formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,pos_unit_id:r,reason:a}=this.selectedTicket;if(a=a.trim(),e&&r)if(this.selectedTicket.tempInvalidTickets.find(d=>d.id===e))this.toastr.warning("This ticket is already present in the list.");else{console.log("pos_unit_id",r),console.log("POS LIST",this.posList);let d=this.posList.find(u=>u.id===Number(r));console.log("selectedpos_unit_id",d),d?(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:r,pos_unit_code:d.code,reason:a}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""):this.toastr.error("Selected POS not found.")}else this.toastr.error("Please enter Ticket ID, select POS, and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:a.pos_unit_id,pos_unit_code:a.pos_unit_code,reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.adventureParkService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.adventureParkService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getPOSList(){this.spinner.show(),this.adventureParkService.getPOSUnitID().subscribe({next:e=>{e&&e.data&&(this.posList=e.data.map(r=>({id:r.id,code:r.code})).sort((r,a)=>r.id-a.id)),this.spinner.hide()},error:e=>{console.error("Error loading POS list:",e),this.spinner.hide(),this.toastr.error("Failed to load POS list")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ts))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-adventure-park"]],standalone:!1,decls:178,vars:35,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","pos_unit_id",1,"form-label"],["id","pos_unit_id","name","pos_unit_id","required","",1,"form-control",3,"ngModelChange","ngModel"],["value","","disabled","","selected",""],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Lfe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Bfe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Vfe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,Xfe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Zfe,14,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"POS ID"),o(),s(111,"select",44),X("ngModelChange",function(d){return K(a.selectedTicket.pos_unit_id,d)||(a.selectedTicket.pos_unit_id=d),d}),s(112,"option",45),l(113,"Select a POS ID"),o(),T(114,Qfe,2,2,"option",13),o()(),s(115,"div",40)(116,"label",46),l(117,"Ticket Reason"),o(),s(118,"textarea",47),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(119,"div",48)(120,"button",49),S("click",function(){return a.clearForm()}),l(121," Cancel "),o(),s(122,"button",50),l(123," Add To List "),o()()()(),s(124,"div",51)(125,"div",52)(126,"table",53)(127,"thead",54)(128,"tr")(129,"th",55),l(130,"Invalid Ticket Number"),o(),s(131,"th"),l(132,"POS ID"),o(),s(133,"th"),l(134,"Reason"),o(),B(135,"th"),o()(),s(136,"tbody"),T(137,ege,10,3,"tr",15),o()()()(),s(138,"div",56)(139,"button",57),l(140," Cancel "),o(),s(141,"button",58),S("click",function(){return a.saveInvalidTickets()}),l(142," Save "),o()()()()(),s(143,"div",59)(144,"div",29)(145,"div",30)(146,"div",31)(147,"h5",60),l(148,"Confirm Transaction"),o(),B(149,"button",33),o(),s(150,"div",34)(151,"p")(152,"strong"),l(153,"Date:"),o(),l(154),I(155,"date"),o(),s(156,"p")(157,"strong"),l(158,"System Cash:"),o(),l(159),o(),s(160,"p")(161,"strong"),l(162,"System Card:"),o(),l(163),o(),s(164,"p")(165,"strong"),l(166,"Actual Cash:"),o(),l(167),o(),s(168,"p")(169,"strong"),l(170,"Actual Card:"),o(),l(171),o(),T(172,ige,14,1,"div",35),o(),s(173,"div",56)(174,"button",57),l(175," Cancel "),o(),s(176,"button",58),S("click",function(){return a.confirmTransaction()}),l(177," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(33,Ofe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.pos_unit_id),m(3),p("ngForOf",a.posList),m(4),q("ngModel",a.selectedTicket.reason),m(19),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(155,31,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var nge=i=>({collapsed:i}),rge=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),QL=(i,n)=>({"is-invalid":i,"is-warning":n});function age(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function oge(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function sge(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function lge(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function cge(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function dge(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,lge,2,0,"div",68)(4,cge,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,QL,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function mge(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function uge(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function pge(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function hge(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,uge,2,0,"div",68)(4,pge,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,QL,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function fge(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function gge(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function vge(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function _ge(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,dge,5,8,"td",64)(9,mge,2,1,"td",64)(10,hge,5,8,"td",64)(11,fge,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,gge,3,1,"ng-container",66)(17,vge,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,rge,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function yge(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Sge(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,yge,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function bge(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function xge(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Cge(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,xge,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var e9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.coffeeShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.coffeeShopService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.coffeeShopService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(ko))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-coffee-shop"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,age,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,oge,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,sge,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,_ge,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Sge,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,bge,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,Cge,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,nge,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var II=Di(Ti());var Fs=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.BLOVBURGERSHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.BLOVBURGERSHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.BLOVBURGERSHOP,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getCategoryWiseSales(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getrevenueexpenseSales(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getMostPopularActivity(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getVisitorCount(e,r){let a={entity_id:Se.BLOVBURGERSHOP,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getTicketSales(e){let r={entity_id:Se.BLOVBURGERSHOP,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.BLOVBURGERSHOP};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.BLOVBURGERSHOP};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.BLOVBURGERSHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.BLOVBURGERSHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.BLOVBURGERSHOP,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.BLOVBURGERSHOP,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}getPOSUnitID(){let e={entity_id:Se.BLOVBURGERSHOP};return this.http.post(this.apiUrl+"/get-pos-by-entity",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Ege=i=>({collapsed:i});
387function wge(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var t9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.blovBurgerShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.blovBurgerShopService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.blovBurgerShopService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`B LOV Burger And More Daily Sales ${this.selectedDate}.pdf`;(0,II.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.blovBurgerShopService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`B LOV Burger And More Daily Sales ${this.selectedDate}.xlsx`;(0,II.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Fs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-blov-burger-shop"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"B LOV Burger And More \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,wge,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,Ege,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var kI=Di(Ti());var Tge=i=>({collapsed:i});
387function Dge(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Ige(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function kge(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var i9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.blovBurgerShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.blovBurgerShopService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.blovBurgerShopService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`B LOV Burger And More Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,kI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.blovBurgerShopService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`B LOV Burger And More Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,kI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Fs))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-sales-report-blov-burger-shop"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,Dge,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,Ige,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
387),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,kge,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,Tge,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var MI=Di(Ti());var Mge=i=>({collapsed:i});function Age(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var n9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.blovBurgerShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.blovBurgerShopService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.blovBurgerShopService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`B LOV Burger And More Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,MI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.blovBurgerShopService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`B LOV Burger And More Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,MI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Fs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-blov-burger-shop"]],standalone:!1,decls:120,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"B LOV Burger And More \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
387),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,Age,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19),l(81),I(82,"currencyFormat"),o()()()(),s(83,"div",23)(84,"div",24)(85,"div",25)(86,"div",26)(87,"span",27),l(88,"Subtotal:"),o(),s(89,"span"),l(90),I(91,"currencyFormat"),o()()(),s(92,"div",25)(93,"div",26)(94,"span",27),l(95,"Complimentary:"),o(),s(96,"span",28),l(97),I(98,"currencyFormat"),o()()(),s(99,"div",25)(100,"div",26)(101,"span",27),l(102,"Discounts:"),o(),s(103,"span",28),l(104),I(105,"currencyFormat"),o()()(),s(106,"div",25)(107,"div",26)(108,"span",27),l(109,"Voids:"),o(),s(110,"span",28),l(111),I(112,"currencyFormat"),o()()(),s(113,"div",25)(114,"div",29)(115,"span"),l(116,"Total Revenue:"),o(),s(117,"span"),l(118),I(119,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,Mge,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(3),_(" ",M(82,26,a.total.item_total)," "),m(9),b(M(91,28,a.total.item_subtotal)),m(7),b(M(98,30,a.total.complimentary_subtotal)),m(7),b(M(105,32,a.total.discount_subtotal)),m(7),b(M(112,34,a.total.voided_subtotal)),m(7),b(M(119,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Pge=i=>({collapsed:i}),Fge=(i,n)=>({completed:i,void:n});function Rge(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,Fge,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function Oge(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var r9=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.blovBurgerShopService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.blovBurgerShopService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Fs),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-blov-burger-shop"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"B LOV Burger And More Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3877,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Rge,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,Oge,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,Pge,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var Nge=i=>({collapsed:i});function Lge(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var a9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.blovBurgerShopService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.blovBurgerShopService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.blovBurgerShopService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response in getRevenueExpenseSales:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.blovBurgerShopService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.blovBurgerShopService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Fs),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-blov-burger-shop-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
387date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"B LOV Burger And More Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,Lge,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,Nge,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var Bge=i=>({collapsed:i}),Vge=i=>({show:i}),Uge=(i,n,t,e)=>({"bg-primary":i,"bg-secondary":n,"bg-success":t,"bg-warning":e});function jge(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function Wge(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o(),s(5,"div")(6,"span",30),l(7),o()()(),s(8,"div",31)(9,"div",32)(10,"div",33)(11,"div",34)(12,"span",35),l(13,"LKR"),o(),s(14,"input",36),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(15,"div",37)(16,"button",38),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(17,"span",39),l(18,"save"),o(),l(19," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(2),p("ngClass",El(6,Uge,t.visitor_type==="Foreign-Adults",t.visitor_type==="Foreign-Kids",t.visitor_type==="Local-Adults",t.visitor_type==="Local-Kids")),m(),_(" ",t.visitor_type," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function Hge(i,n){if(i&1&&(s(0,"div",23)(1,"div",40)(2,"p",41),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",42)(5,"p",43)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",43)(10,"strong"),l(11,"Visitor Type:"),o(),l(12),o(),s(13,"p",43)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",44)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedItem.visitor_type," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function Gge(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.showConfirmModal=!1)}),o()}}
387function $ge(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var o9=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.blovBurgerShopService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.blovBurgerShopService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({},c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.blovBurgerShopService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
387r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Fs),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-pricing-blov-burger-shop"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"B LOV Burger And More \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,jge,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,Wge,20,11,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.showConfirmModal=!1}),o()(),T(21,Hge,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,Gge,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,$ge,1,0,"div",21)),r&2&&(p("ngClass",Z(14,Bge,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,Vge,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var zge=i=>({collapsed:i}),Yge=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),s9=(i,n)=>({"is-invalid":i,"is-warning":n});
387function qge(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Kge(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Xge(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Jge(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function Zge(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function Qge(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"cash",a))}),o(),T(3,Jge,2,0,"div",71)(4,Zge,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,s9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function e1e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function t1e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function i1e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function n1e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"card",a))}),o(),T(3,t1e,2,0,"div",71)(4,i1e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,s9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function r1e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function a1e(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function o1e(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function s1e(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),s(6,"td",66),l(7),o(),T(8,Qge,5,8,"td",67)(9,e1e,2,1,"td",67)(10,n1e,5,8,"td",67)(11,r1e,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,a1e,3,1,"ng-container",69)(17,o1e,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,Yge,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function l1e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function c1e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,l1e,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function d1e(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.code," ")}}function m1e(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65),l(6),o(),s(7,"td",65)(8,"button",79),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(9,"i",80),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function u1e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function p1e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,u1e,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var l9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.blovBurgerShopService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.getPOSList()}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
387formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,pos_unit_id:r,reason:a}=this.selectedTicket;if(a=a.trim(),e&&r)if(this.selectedTicket.tempInvalidTickets.find(d=>d.id===e))this.toastr.warning("This ticket is already present in the list.");else{console.log("pos_unit_id",r),console.log("POS LIST",this.posList);let d=this.posList.find(u=>u.id===Number(r));console.log("selectedpos_unit_id",d),d?(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:r,pos_unit_code:d.code,reason:a}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""):this.toastr.error("Selected POS not found.")}else this.toastr.error("Please enter Ticket ID, select POS, and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:a.pos_unit_id,pos_unit_code:a.pos_unit_code,reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.blovBurgerShopService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.blovBurgerShopService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getPOSList(){this.spinner.show(),this.blovBurgerShopService.getPOSUnitID().subscribe({next:e=>{e&&e.data&&(this.posList=e.data.map(r=>({id:r.id,code:r.code})).sort((r,a)=>r.id-a.id)),this.spinner.hide()},error:e=>{console.error("Error loading POS list:",e),this.spinner.hide(),this.toastr.error("Failed to load POS list")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Fs))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-blov-burger-shop"]],standalone:!1,decls:178,vars:35,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","pos_unit_id",1,"form-label"],["id","pos_unit_id","name","pos_unit_id","required","",1,"form-control",3,"ngModelChange","ngModel"],["value","","disabled","","selected",""],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,qge,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Kge,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Xge,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,s1e,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,c1e,14,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"POS ID"),o(),s(111,"select",44),X("ngModelChange",function(d){return K(a.selectedTicket.pos_unit_id,d)||(a.selectedTicket.pos_unit_id=d),d}),s(112,"option",45),l(113,"Select a POS ID"),o(),T(114,d1e,2,2,"option",13),o()(),s(115,"div",40)(116,"label",46),l(117,"Ticket Reason"),o(),s(118,"textarea",47),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(119,"div",48)(120,"button",49),S("click",function(){return a.clearForm()}),l(121," Cancel "),o(),s(122,"button",50),l(123," Add To List "),o()()()(),s(124,"div",51)(125,"div",52)(126,"table",53)(127,"thead",54)(128,"tr")(129,"th",55),l(130,"Invalid Ticket Number"),o(),s(131,"th"),l(132,"POS ID"),o(),s(133,"th"),l(134,"Reason"),o(),B(135,"th"),o()(),s(136,"tbody"),T(137,m1e,10,3,"tr",15),o()()()(),s(138,"div",56)(139,"button",57),l(140," Cancel "),o(),s(141,"button",58),S("click",function(){return a.saveInvalidTickets()}),l(142," Save "),o()()()()(),s(143,"div",59)(144,"div",29)(145,"div",30)(146,"div",31)(147,"h5",60),l(148,"Confirm Transaction"),o(),B(149,"button",33),o(),s(150,"div",34)(151,"p")(152,"strong"),l(153,"Date:"),o(),l(154),I(155,"date"),o(),s(156,"p")(157,"strong"),l(158,"System Cash:"),o(),l(159),o(),s(160,"p")(161,"strong"),l(162,"System Card:"),o(),l(163),o(),s(164,"p")(165,"strong"),l(166,"Actual Cash:"),o(),l(167),o(),s(168,"p")(169,"strong"),l(170,"Actual Card:"),o(),l(171),o(),T(172,p1e,14,1,"div",35),o(),s(173,"div",56)(174,"button",57),l(175," Cancel "),o(),s(176,"button",58),S("click",function(){return a.confirmTransaction()}),l(177," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(33,zge,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.pos_unit_id),m(3),p("ngForOf",a.posList),m(4),q("ngModel",a.selectedTicket.reason),m(19),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(155,31,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var h1e=i=>({collapsed:i}),f1e=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),c9=(i,n)=>({"is-invalid":i,"is-warning":n});function g1e(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function v1e(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function _1e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function y1e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function S1e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function b1e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,y1e,2,0,"div",71)(4,S1e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,c9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function x1e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function C1e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function E1e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function w1e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,C1e,2,0,"div",71)(4,E1e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,c9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function T1e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function D1e(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function I1e(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function k1e(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),s(6,"td",66),l(7),o(),T(8,b1e,5,8,"td",67)(9,x1e,2,1,"td",67)(10,w1e,5,8,"td",67)(11,T1e,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,D1e,3,1,"ng-container",69)(17,I1e,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,f1e,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function M1e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function A1e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,M1e,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function P1e(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.code," ")}}function F1e(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65),l(6),o(),s(7,"td",65)(8,"button",79),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(9,"i",80),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function R1e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function O1e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,R1e,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var d9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.paddleBoatService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.getPOSList()}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,pos_unit_id:r,reason:a}=this.selectedTicket;if(a=a.trim(),e&&r)if(this.selectedTicket.tempInvalidTickets.find(d=>d.id===e))this.toastr.warning("This ticket is already present in the list.");else{console.log("pos_unit_id",r),console.log("POS LIST",this.posList);let d=this.posList.find(u=>u.id===Number(r));console.log("selectedpos_unit_id",d),d?(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:r,pos_unit_code:d.code,reason:a}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""):this.toastr.error("Selected POS not found.")}else this.toastr.error("Please enter Ticket ID, select POS, and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:a.pos_unit_id,pos_unit_code:a.pos_unit_code,reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.paddleBoatService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.paddleBoatService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getPOSList(){this.spinner.show(),this.paddleBoatService.getPOSUnitID().subscribe({next:e=>{e&&e.data&&(this.posList=e.data.map(r=>({id:r.id,code:r.code})).sort((r,a)=>r.id-a.id)),this.spinner.hide()},error:e=>{console.error("Error loading POS list:",e),this.spinner.hide(),this.toastr.error("Failed to load POS list")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Qa))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-paddle-boat"]],standalone:!1,decls:178,vars:35,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","pos_unit_id",1,"form-label"],["id","pos_unit_id","name","pos_unit_id","required","",1,"form-control",3,"ngModelChange","ngModel"],["value","","disabled","","selected",""],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,g1e,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,v1e,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,_1e,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,k1e,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,A1e,14,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"POS ID"),o(),s(111,"select",44),X("ngModelChange",function(d){return K(a.selectedTicket.pos_unit_id,d)||(a.selectedTicket.pos_unit_id=d),d}),s(112,"option",45),l(113,"Select a POS ID"),o(),T(114,P1e,2,2,"option",13),o()(),s(115,"div",40)(116,"label",46),l(117,"Ticket Reason"),o(),s(118,"textarea",47),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(119,"div",48)(120,"button",49),S("click",function(){return a.clearForm()}),l(121," Cancel "),o(),s(122,"button",50),l(123," Add To List "),o()()()(),s(124,"div",51)(125,"div",52)(126,"table",53)(127,"thead",54)(128,"tr")(129,"th",55),l(130,"Invalid Ticket Number"),o(),s(131,"th"),l(132,"POS ID"),o(),s(133,"th"),l(134,"Reason"),o(),B(135,"th"),o()(),s(136,"tbody"),T(137,F1e,10,3,"tr",15),o()()()(),s(138,"div",56)(139,"button",57),l(140," Cancel "),o(),s(141,"button",58),S("click",function(){return a.saveInvalidTickets()}),l(142," Save "),o()()()()(),s(143,"div",59)(144,"div",29)(145,"div",30)(146,"div",31)(147,"h5",60),l(148,"Confirm Transaction"),o(),B(149,"button",33),o(),s(150,"div",34)(151,"p")(152,"strong"),l(153,"Date:"),o(),l(154),I(155,"date"),o(),s(156,"p")(157,"strong"),l(158,"System Cash:"),o(),l(159),o(),s(160,"p")(161,"strong"),l(162,"System Card:"),o(),l(163),o(),s(164,"p")(165,"strong"),l(166,"Actual Cash:"),o(),l(167),o(),s(168,"p")(169,"strong"),l(170,"Actual Card:"),o(),l(171),o(),T(172,O1e,14,1,"div",35),o(),s(173,"div",56)(174,"button",57),l(175," Cancel "),o(),s(176,"button",58),S("click",function(){return a.confirmTransaction()}),l(177," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(33,h1e,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.pos_unit_id),m(3),p("ngForOf",a.posList),m(4),q("ngModel",a.selectedTicket.reason),m(19),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(155,31,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var N1e=i=>({collapsed:i}),L1e=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),m9=(i,n)=>({"is-invalid":i,"is-warning":n});function B1e(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function V1e(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function U1e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function j1e(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function W1e(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function H1e(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
387return j(c.formatAmount(r,"cash",a))}),o(),T(3,j1e,2,0,"div",68)(4,W1e,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,m9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function G1e(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function $1e(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function z1e(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Y1e(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,$1e,2,0,"div",68)(4,z1e,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,m9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function q1e(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function K1e(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function X1e(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function J1e(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,H1e,5,8,"td",64)(9,G1e,2,1,"td",64)(10,Y1e,5,8,"td",64)(11,q1e,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,K1e,3,1,"ng-container",66)(17,X1e,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,L1e,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Z1e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Q1e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Z1e,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function eve(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function tve(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function ive(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,tve,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
387d_tickets)}}var u9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.horseRideService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
387this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.horseRideService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.horseRideService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Es))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-horse-riding"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
387-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,B1e,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,V1e,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,U1e,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,J1e,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Q1e,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,eve,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,ive,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,N1e,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
387ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var p9=Di(Ti());var Uo=(()=>{let n=class n{constructor(e,r){this.http=e,this.toastr=r,this.baseUrl=ui.ambuluwawaBackendUrl+"/auditorium",this.apiUrl=ui.apiUrl+"/guide-expense/auditorium",this.culturalShowsUrl=ui.apiUrl+"/auditorium",this.culturalShowsUrlPublic=ui.ambuluwawamgmtBackendPublicUrl,this.publicApiKey=ui.PUBLIC_API_KEY}getTicketSales(e){let r=new xe({"Content-Type":"application/json",path:"get-ticket-sales"}),a={page:e};return this.http.post(this.baseUrl,a,{headers:r})}getMonthlySalesReport(e,r){let a=new xe({"Content-Type":"application/json",path:"get-monthly-sales"}),c={month:e,year:r};return this.http.post(this.baseUrl,c,{headers:a})}getMonthlySalesPDF(e,r){let a=new xe({"Content-Type":"application/json",path:"get-monthly-sales-pdf"}),c={month:e,year:r};return this.http.post(this.baseUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Pdf){let u=d.data.base64Pdf;return this.convertBase64ToBlob(u,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading PDF:",d),this.toastr.error("Failed to generate PDF:","Error"),fr(d))))}getCategoryWiseSalesPDF(e,r){let a=new xe({"Content-Type":"application/json",path:"get-categorywise-sales-pdf"}),c={start_date:e,end_date:r};return this.http.post(this.baseUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Pdf){let u=d.data.base64Pdf;return this.convertBase64ToBlob(u,"application/pdf")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading PDF:",d),this.toastr.error("Failed to generate PDF:","Error"),fr(d))))}getMonthlySalesExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"get-monthly-sales-excel"}),c={month:e,year:r};return this.http.post(this.baseUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Excel){let u=d.data.base64Excel;return this.convertBase64ToBlob(u,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading Excel:",d),this.toastr.error("Failed to generate Excel:","Error"),fr(d))))}getCategoryWiseSalesExcel(e,r){let a=new xe({"Content-Type":"application/json",path:"get-categorywise-sales-excel"}),c={start_date:e,end_date:r};return this.http.post(this.baseUrl,c,{headers:a,responseType:"json"}).pipe(Tn(d=>{if(d.status==="success"&&d.data?.base64Excel){let u=d.data.base64Excel;return this.convertBase64ToBlob(u,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}else throw new Error("Invalid response structure or status")}),Fn(d=>(console.error("Error downloading Excel:",d),this.toastr.error("Failed to generate Excel:","Error"),fr(d))))}convertBase64ToBlob(e,r){return new za(a=>{try{let c=e.replace(/^data:.*;base64,/,"");if(!/^[A-Za-z0-9+/]+={0,2}$/.test(c))throw new Error("Invalid Base64 string");let u=atob(c),h=new ArrayBuffer(u.length),f=new Uint8Array(h);for(let C=0;C<u.length;C++)f[C]=u.charCodeAt(C);let v=new Blob([f],{type:r});a.next(v),a.complete()}catch(c){console.error("Error decoding base64 string:",c),this.toastr.error("Failed to download file","Error"),a.error(c)}})}downloadFile(e,r){(0,p9.default)(e,r)}getItemWiseSales(e,r){let a=new xe({"Content-Type":"application/json",path:"get-categorywise-sales"}),c={start_date:e,end_date:r};return this.http.post(this.baseUrl,c,{headers:a})}getCategories(){let e=new xe({"Content-Type":"application/json",path:"get-categories"});return this.http.post(this.baseUrl,{},{headers:e})}updatePrice(e){let r=new xe({"Content-Type":"application/json",path:"update-price"}),a=tt(le({},e),{price:e.amount});return delete a.amount,this.http.post(this.baseUrl,a,{headers:r})}getDailyTransactionsToVerify(e,r){let a=new xe({"Content-Type":"application/json",path:"get-daily-confirmation"}),c={month:e,year:r};return this.http.post(this.baseUrl,c,{headers:a})}confirmDailyTransactions(e){let r=new xe({"Content-Type":"application/json",path:"save-daily-confirmation"});return this.http.post(this.baseUrl,e,{headers:r})}getGuideWiseExpense(e,r){let a=new xe({"Content-Type":"application/json"}),c={month:parseInt(e,10),year:parseInt(r,10)};return this.http.post(`${this.apiUrl}/guide-wise-expense`,c,{headers:a,responseType:"json"})}getGuideExpenseTransaction(e,r,a){let c=new xe({"Content-Type":"application/json"}),d={guide_id:e,month:r,year:a};return this.http.post(`${this.apiUrl}/guide-transactions-with-expense`,d,{headers:c,responseType:"json"})}getGuideExpenseExcel(e,r){let a=new xe({"Content-Type":"application/json"}),c={month:e,year:r};return this.http.post(`${this.apiUrl}/guide-wise-expense-excel`,c,{headers:a,responseType:"json"}).pipe(Ki(d=>{console.log("--",d);let u=atob(d.data.excel),h=new Array(u.length);for(let C=0;C<u.length;C++)h[C]=u.charCodeAt(C);let f=new Uint8Array(h);return new Blob([f],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}))}getUpdateStatus(e,r,a,c,d){let u=new xe({"Content-Type":"application/json"}),h={guide_id:e,month:r,year:a,status:c,calculated_salary:d};return this.http.post(`${this.apiUrl}/update-guide-salary-status`,h,{headers:u,responseType:"json"})}getCulturalShowsList(){let e=new xe({"Content-Type":"application/json","x-api-key":ui.PUBLIC_API_KEY}),c={category_id:"",date:new Date().toISOString().split("T")[0],price_range:""};return this.http.post(`${this.culturalShowsUrl}/shows/list`,c,{headers:e,responseType:"json"})}addCulturalShow(e){let r=new xe({"Content-Type":"application/json","x-api-key":ui.PUBLIC_API_KEY});return this.http.post(`${this.culturalShowsUrl}/shows`,e,{headers:r,responseType:"json"})}getShowCategories(){let e=new xe({"x-api-key":this.publicApiKey});return this.http.get(`${this.culturalShowsUrlPublic}/show-categories`,{headers:e,responseType:"json"})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi),kt(me))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var nve=i=>({collapsed:i}),rve=(i,n)=>({completed:i,void:n});
387function ave(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"date"),o(),s(7,"td"),l(8),I(9,"date"),I(10,"date"),o(),s(11,"td",18),l(12),o(),s(13,"td")(14,"span",19),l(15),o()(),s(16,"td",10)(17,"strong"),l(18),I(19,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.id),m(2),_(" ",Jt(6,8,t.created_at,"MMM d, y \xB7 hh:mm:ss a")," "),m(3),Pi(" ",Jt(9,11,t.start_date,"MMM d, y")," - ",Jt(10,14,t.end_date,"MMM d, y")," "),m(4),b(t.details),m(2),p("ngClass",Et(19,rve,!t.void_status,t.void_status)),m(),_(" ",t.void_status?"Voided":"Completed"," "),m(3),b(M(19,17,t.amount))}}function ove(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var h9=(()=>{let n=class n{constructor(e,r,a,c){this.auditoriumService=e,this.sidebarService=r,this.spinner=a,this.toastr=c,this.ticketSales=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getTicketSales(this.currentPage)}getTicketSales(e){this.spinner.show(),this.auditoriumService.getTicketSales(e).subscribe({next:r=>{this.ticketSales=r.data.sales.map(a=>tt(le({},a),{amount:Number(a.amount),total:Number(a.total),created_at:a.created_at.replace("Z",""),details:`Name: ${a.name} 388Contact No: ${a.contact_no_1}${a.contact_no_2?`, ${a.contact_no_2}`:""}${a.email?` 389Email: ${a.email}`:""}`})),this.currentPage=r.data.page||1,this.itemsPerPage=r.data.pageSize||20,this.totalItems=r.data.total||0,this.totalPages=r.data.totalPages||0,this.updatePagination(),this.spinner.hide()},error:r=>{this.spinner.hide(),this.toastr.error("Something went wrong!","Error"),console.error("API Error:",r)}})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}};n.\u0275fac=function(r){return new(r||n)(x(Uo),x(ce),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-ticket-sales"]],standalone:!1,decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Auditorium Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(17,"Issue Date (IST)"),o(),s(18,"th"),l(19,"Booked Dates"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,ave,20,22,"tr",12),o()()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,ove,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,nve,a.isCollapsed)),m(27),p("ngForOf",a.ticketSales),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var AI=Di(Ti());var sve=i=>({collapsed:i});
389function lve(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),I(5,"currencyFormat"),o(),s(6,"td"),l(7),I(8,"currencyFormat"),o(),s(9,"td"),l(10),o(),s(11,"td",21)(12,"strong"),l(13),I(14,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.category),m(2),b(M(5,5,t.subtotal)),m(3),b(M(8,7,t.total_discount)),m(3),b(t.void_ticket_count),m(3),b(M(14,9,t.total_amount))}}var f9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.auditoriumService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.isCollapsed=!1,this.items=[],this.total={void_total:0,total_amount:0,total_discount:0,total_subtotal:0}}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.auditoriumService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.sales.map(r=>({category:r.category,subtotal:Number(r.subtotal),total_discount:Number(r.total_discount),total_amount:Number(r.total_amount),void_ticket_count:Number(r.void_ticket_count)})),e.data.totals.length>0&&(this.total={void_total:Number(e.data.totals[0].void_total)||0,total_amount:Number(e.data.totals[0].total_amount)||0,total_discount:Number(e.data.totals[0].total_discount)||0,total_subtotal:Number(e.data.totals[0].total_subtotal)||0}),this.spinner.hide(),this.items.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.auditoriumService.getCategoryWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Auditorium Booking Categorywise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,AI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.auditoriumService.getCategoryWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Auditorium Booking Categorywise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,AI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Uo),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-item-wise-sales"]],standalone:!1,decls:91,vars:29,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#fff","type","ball-pulse"],[2,"font-size","20px","color","white"],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"ngx-spinner",0)(1,"p",1),l(2,"Loading..."),o()(),s(3,"div",2)(4,"div",3)(5,"div")(6,"div",4),l(7,"Auditorium \u2014 Item Wise Summary"),o(),s(8,"div",5),l(9),o()()(),s(10,"div",6)(11,"div",7)(12,"div",8)(13,"label",9),l(14,"From"),o(),s(15,"input",10),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(16,"div",8)(17,"label",9),l(18,"To"),o(),s(19,"input",10),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(20,"div",11)(21,"button",12),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(22,"span",13),l(23,"search"),o(),l(24," Generate "),o()()(),s(25,"div",11)(26,"button",14),S("click",function(){return a.exportToPDF()}),s(27,"span",13),l(28,"picture_as_pdf"),o(),l(29,"Pdf "),o(),s(30,"button",14),S("click",function(){return a.exportToExcel()}),s(31,"span",13),l(32,"description"),o(),l(33,"Excel "),o()()(),s(34,"div",15)(35,"div",16)(36,"div",17)(37,"div",18)(38,"table",19)(39,"thead",20)(40,"tr")(41,"th"),l(42,"Category"),o(),s(43,"th"),l(44,"Subtotal"),o(),s(45,"th"),l(46,"Total Discount"),o(),s(47,"th"),l(48,"Void Ticket Count"),o(),s(49,"th",21),l(50,"Total Amount"),o()()(),s(51,"tbody",22),T(52,lve,15,11,"tr",23),o(),s(53,"tfoot")(54,"tr")(
38955,"td"),l(56,"All Categories"),o(),s(57,"td"),l(58),I(59,"currencyFormat"),o(),s(60,"td"),l(61),I(62,"currencyFormat"),o(),s(63,"td"),l(64),o(),s(65,"td",21),l(66),I(67,"currencyFormat"),o()()()(),s(68,"div",24)(69,"div",25)(70,"div",26)(71,"div",27)(72,"span",28),l(73,"Subtotal:"),o(),s(74,"span"),l(75),I(76,"currencyFormat"),o()()(),s(77,"div",26)(78,"div",27)(79,"span",28),l(80,"Discounts:"),o(),s(81,"span",29),l(82),I(83,"currencyFormat"),o()()(),s(84,"div",26)(85,"div",30)(86,"span"),l(87,"Total Revenue:"),o(),s(88,"span"),l(89),I(90,"currencyFormat"),o()()()()()()()()()()),r&2&&(m(3),p("ngClass",Z(27,sve,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(33),p("ngForOf",a.items),m(6),b(M(59,15,a.total.total_subtotal)),m(3),b(M(62,17,a.total.total_discount)),m(3),b(a.total.void_total),m(2),_(" ",M(67,19,a.total.total_amount)," "),m(9),b(M(76,21,a.total.total_subtotal)),m(7),b(M(83,23,a.total.total_discount)),m(7),b(M(90,25,a.total.total_amount)))},dependencies:[ue,_e,Ke,Ne,Le,wo,Be],encapsulation:2});let i=n;return i})();var cve=i=>({collapsed:i});function dve(i,n){if(i&1&&(s(0,"option",27),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function mve(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function uve(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",24),l(5),o(),s(6,"td",24),l(7),o(),s(8,"td",24),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var g9=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.admissionsService=c,this.auditoriumService=d,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.onlineTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.auditoriumService.getMonthlySalesReport(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,card_income:Number(c.card_income)||0,cash_income:Number(c.cash_income)||0,total_revenue:Number(c.total_revenue)||0})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.onlineTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.onlineTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.auditoriumService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{this.admissionsService.downloadFile(e,`Auditorium Booking Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`),this.spinner.hide()},error:e=>{console.error("Error downloading Excel:",e),this.toastr.error("Failed to generate Excel:","Error"),this.spinner.hide()}})}getMonthlySalesPDF(){this.spinner.show(),this.auditoriumService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{this.admissionsService.downloadFile(e,`Auditorium Booking Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`),this.spinner.hide()},error:e=>{console.error("Error downloading PDF:",e),this.toastr.error("Failed to generate PDF:","Error"),this.spinner.hide()}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Hr),x(Uo))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-monthly-sales"]],standalone:!1,decls:65,vars:12,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#fff","type","ball-pulse"],[2,"font-size","20px","color","white"],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"ngx-spinner",0)(1,"p",1),l(2,"Loading..."),o()(),s(3,"div",2)(4,"div",3)(5,"div")(6,"div",4),l(7,"Monthly Sales Reports"),o()()(),s(8,"div",5)(9,"div",6)(10,"div",7)(11,"label",8),l(12,"Month"),o(),s(13,"select",9),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(14,"option",10),l(15,"Select Month"),o(),T(16,dve,2,2,"option",11),o()(),s(17,"div",7)(18,"label",8),l(19,"Year"),o(),s(20,"select",12),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(21,"option",10),l(22,"Select Year"),o(),T(23,mve,2,1,"option",13),o()(),s(24,"div",14)(25,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(26,"span",16),l(27,"search"),o(),l(28," Generate "),o()()(),s(29,"div",14)(30,"button",17),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}),s(31,"span",16),l(32,"description"),o(),l(33,"Excel "),o(),s(34,"button",17),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(35,"span",16),l(36,"description"),o(),l(37,"PDF "),o()()(),s(38,"div",18)(39,"div",19)(40,"div",20)(41,"div",21)(42,"table",22)(43,"thead",23)(44,"tr")(45,"th"),l(46,"Date"),o(),s(47,"th",24),l(48,"Cash"),o(),s(49,"th",24),l(50,"Card"),o(),s(51,"th",24),l(52,"Total"),o()()(),s(53,"tbody",25),T(54,uve,10,6,"tr",13),o(),s(55,"tfoot",26)(56,"tr")(57,"td"),l(58,"Total"),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),s(63,"td",24),l(64),o()()()()()()()()()),r&2&&(m(3),p("ngClass",Z(10,cve,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.onlineTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,wo,St],encapsulation:2});let i=n;return i})();var pve=i=>({collapsed:i});function hve(i,n){if(i&1&&(s(0,"div",24)(1,"h3"),l(2),o(),s(3,"div",25),l(4),I(5,"currencyFormat"),o()()),i&2){let t=n.$implicit,e=n.index,r=w();p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",M(5,3,r.total_revenue)," ")}}var v9=(()=>{let n=class n{constructor(e,r,a,c,d){this.auditoriumService=e,this.spinner=r,this.toastr=a,this.router=c,this.sidebarService=d,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.auditoriumService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.sales.map(r=>({category:r.category,item_total:Number(r.subtotal)})),this.total_revenue=e.data.totals[0].total_amount,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}};n.\u0275fac=function(r){return new(r||n)(x(Uo),x(pe),x(me),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-analytics"]],standalone:!1,decls:35,vars:9,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#fff","type","ball-pulse"],[2,"font-size","20px","color","white"],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"ngx-spinner",0)(1,"p",1),l(2,"Loading..."),o()(),s(3,"div",2)(4,"div",3)(5,"div")(6,"div",4),l(7,"Auditorium Analytics"),o(),s(8,"div",5),l(9,"General Analytics Overview"),o()()(),s(10,"div",6)(11,"div",7)(12,"div",8)(13,"label",9),l(14,"From"),o(),s(15,"input",10),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(16,"div",8)(17,"label",9),l(18,"To"),o(),s(19,"input",11),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(20,"div",12)(21,"button",13),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(22,"span",14),l(23,"search"),o(),l(24," Generate "),o()()()(),s(25,"div",15)(26,"div",16)(27,"div",17)(28,"div",18)(29,"div",19),T(30,hve,6,5,"div",20),o()(),s(31,"div")(32,"div",21)(33,"div",22),B(34,"app-category-wise-revenue",23),o()()()()()()()),r&2&&(m(3),p("ngClass",Z(7,pve,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items))},dependencies:[ue,_e,Ke,Ne,Le,wo,Ta,Be],encapsulation:2});let i=n;return i})();var fve=i=>({collapsed:i}),gve=i=>({show:i});function vve(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o()(),s(5,"div",24)(6,"div",25)(7,"div",26)(8,"div",27)(9,"span",28),l(10,"LKR"),o(),s(11,"input",29),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",30)(13,"button",31),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",32),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.category),m(7),p("value",t.amount)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function _ve(i,n){if(i&1&&(s(0,"div",19)(1,"div",33)(2,"p",34),l(3," Are you sure you want to update the amount for this item? "),o(),s(4,"div",35)(5,"p",36)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",36)(10,"strong"),l(11,"Old amount:"),o(),l(12),o(),s(13,"p",37)(14,"strong"),l(15,"New amount:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.category," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.amount," ")}}function yve(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function Sve(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var _9=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.auditoriumService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.auditoriumService.getCategories().subscribe({next:e=>{e.data&&(this.priceItems=e.data.map(r=>tt(le({},r),{amount:parseInt(r.amount).toString(),originalPrice:parseInt(r.amount).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.amount);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].amount=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.amount===r.originalPrice){this.toastr.info("No amount change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.auditoriumService.updatePrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("amount updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating amount:",e),this.toastr.error("Failed to update amount. Please try again.")}
389,complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating amount:",e),this.toastr.error("Failed to update amount. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].amount=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Uo),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-edit-amount"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Auditorium \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,vve,17,4,"div",6),o()()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm amount Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,_ve,17,3,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,yve,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid amount"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The amount for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid amount."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,Sve,1,0,"div",17)),r&2&&(p("ngClass",Z(13,fve,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,gve,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.category),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var bve=i=>({collapsed:i}),xve=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),y9=(i,n)=>({"is-invalid":i,"is-warning":n});
389function Cve(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Eve(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function wve(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Tve(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Dve(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Ive(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"cash",a))}),o(),T(3,Tve,2,0,"div",68)(4,Dve,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,y9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}
389function kve(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Mve(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Ave(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Pve(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,Mve,2,0,"div",68)(4,Ave,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,y9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function Fve(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function Rve(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Ove(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function Nve(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,Ive,5,8,"td",64)(9,kve,2,1,"td",64)(10,Pve,5,8,"td",64)(11,Fve,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,Rve,3,1,"ng-container",66)(17,Ove,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,xve,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Lve(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Bve(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Lve,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}
389function Vve(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Uve(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function jve(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Uve,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var S9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.auditoriumService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.selectedTicket={ticketId:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}
389openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.auditoriumService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.auditoriumService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Uo))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-daily-transaction-verify"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Cve,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Eve,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,wve,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,Nve,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Bve,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,Vve,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,jve,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,bve,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],encapsulation:2});let i=n;return i})();var Rs=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.PHOTO_BOOTH,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r,{headers:new xe({"Content-Type":"application/json"})})}getDailySalesPDF(e){let r={entity_id:Se.PHOTO_BOOTH,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.PHOTO_BOOTH,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a,{headers:new xe({"Content-Type":"application/json"})})}getGuideCommissionReport(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions",a,{headers:new xe({"Content-Type":"application/json"})})}getRevenueExpenseSales(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a,{headers:new xe({"Content-Type":"application/json"})})}getMostPopularActivity(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a,{headers:new xe({"Content-Type":"application/json"})})}getVisitorCount(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a,{headers:new xe({"Content-Type":"application/json"})})}getItemWiseSalesPDF(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideCommissionReportPDF(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};
389return this.http.post(this.apiUrl+"/get-guide-transactions-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getGuideCommissionReportExcel(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-guide-transactions-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.PHOTO_BOOTH,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r,{headers:new xe({"Content-Type":"application/json"})})}getItemPrice(){let e={entity_id:Se.PHOTO_BOOTH};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.PHOTO_BOOTH};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.PHOTO_BOOTH,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.PHOTO_BOOTH,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.PHOTO_BOOTH,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.PHOTO_BOOTH,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}getPOSUnitID(){let e={entity_id:Se.PHOTO_BOOTH};return this.http.post(this.apiUrl+"/get-pos-by-entity",e,{headers:new xe({"Content-Type":"application/json"})})}getCategoryWiseSales(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getrevenueexpenseSales(e,r){let a={entity_id:Se.PHOTO_BOOTH,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Wve=i=>({collapsed:i}),Hve=(i,n)=>({completed:i,void:n});function Gve(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div",18),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",19),l(11),o(),s(12,"td")(13,"span",20),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),_(" ",Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")," "),m(3),b(t.details),m(2),p("ngClass",Et(12,Hve,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function $ve(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var b9=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.photoBoothService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1,this.maxAllowedPage=null}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.photoBoothService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){let a=r.data.items||[],c=a.filter(f=>
389(f.issue_Date||"").substring(0,10)>=n.CUTOFF_DATE),d=c.length<a.length;this.items=c;for(let f=0;f<this.items.length;f++)this.items[f].issue_Date.endsWith("Z")&&(this.items[f].issue_Date=this.items[f].issue_Date.replace("Z",""),this.items[f].details=this.formatDetails(this.items[f].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0;let u=null;c.length===0&&a.length>0&&this.currentPage>1?u=this.currentPage-1:d&&(u=this.currentPage),u!==null&&(this.maxAllowedPage===null||u<this.maxAllowedPage)&&(this.maxAllowedPage=u);let h=r.data.totalPages||0;this.totalPages=this.maxAllowedPage!==null?Math.min(h,this.maxAllowedPage):h,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}};n.CUTOFF_DATE="2026-02-01",n.\u0275fac=function(r){return new(r||n)(x(Rs),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-ticket-sales"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Booth Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(17,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Gve,19,15,"tr",12),o()()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,$ve,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,Wve,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var PI=Di(Ti());var zve=i=>({collapsed:i});function Yve(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var x9=(()=>{let n=class n{constructor(e,r,a,c){this.photoBoothService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedDate=null,this.isCollapsed=!1,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.minDate=n.CUTOFF_DATE,this.pages=[1,2,3,4,5]}
389ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.maxDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){if(this.selectedDate){if(this.selectedDate<n.CUTOFF_DATE){this.toastr.warning("Please select a date from Feb 1, 2026 onwards");return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.photoBoothService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){if(this.selectedDate){if(this.selectedDate<n.CUTOFF_DATE){this.toastr.warning("Please select a date from Feb 1, 2026 onwards");return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.photoBoothService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Photo Booth Daily Sales ${this.selectedDate}.pdf`;(0,PI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){if(this.selectedDate){if(this.selectedDate<n.CUTOFF_DATE){this.toastr.warning("Please select a date from Feb 1, 2026 onwards");return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.photoBoothService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Photo Booth Daily Sales ${this.selectedDate}.xlsx`;(0,PI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}};n.CUTOFF_DATE="2026-02-01",n.\u0275fac=function(r){return new(r||n)(x(Rs),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-daily-sales"]],standalone:!1,decls:77,vars:23,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","date-picker","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"tbody"],[4,"ngFor","ngForOf"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Booth \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select day"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,Yve,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td"),l(59,"Totals:"),o(),s(60,"td"),l(61),I(62,"currencyFormat"),o(),s(63,"td"),l(64),I(65,"currencyFormat"),o(),s(66,"td"),l(67),I(68,"currencyFormat"),o(),s(69,"td"),l(70),I(71,"currencyFormat"),o(),s(72,"td"),l(73),I(74,"currencyFormat"),o(),B(75,"td")(76,"td"),o()()()()()()()()),r&2&&(p("ngClass",Z(21,zve,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("min",a.minDate)("max",a.maxDate),m(43),p("ngForOf",a.tickets),m(6),b(M(62,11,a.total.Amount)),m(3),b(M(65,13,a.total.Discount)),m(3),b(M(68,15,a.total.Total)),m(3),b(M(71,17,a.total.Cash)),m(3),b(M(74,19,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var qve=i=>({collapsed:i}),Kve=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),C9=(i,n)=>({"is-invalid":i,"is-warning":n});
389function Xve(i,n){if(i&1&&(s(0,"div",57),B(1,"i",58),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Jve(i,n){if(i&1&&(s(0,"option",59),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Zve(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Qve(i,n){i&1&&(s(0,"div",69),l(1," Actual amount cannot be negative. "),o())}function e_e(i,n){i&1&&(s(0,"div",70),l(1," Amount Mismatch "),o())}function t_e(i,n){if(i&1){let t=he();s(0,"td",62)(1,"input",66,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"cash",a))}),o(),T(3,Qve,2,0,"div",67)(4,e_e,2,0,"div",68),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,C9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function i_e(i,n){if(i&1&&(s(0,"td",62),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function n_e(i,n){i&1&&(s(0,"div",69),l(1," Actual amount cannot be negative. "),o())}function r_e(i,n){i&1&&(s(0,"div",70),l(1," Amount Mismatch "),o())}function a_e(i,n){if(i&1){let t=he();s(0,"td",62)(1,"input",66,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"card",a))}),o(),T(3,n_e,2,0,"div",67)(4,r_e,2,0,"div",68),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,C9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function o_e(i,n){if(i&1&&(s(0,"td",62),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function s_e(i,n){if(i&1){let t=he();Ui(0),s(1,"button",71),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function l_e(i,n){i&1&&(s(0,"span",72),B(1,"i",73),o())}function c_e(i,n){if(i&1){let t=he();s(0,"tr",60)(1,"td",61),l(2),I(3,"date"),o(),s(4,"td",62),l(5),o(),s(6,"td",62),l(7),o(),T(8,t_e,5,8,"td",63)(9,i_e,2,1,"td",63)(10,a_e,5,8,"td",63)(11,o_e,2,1,"td",63),s(12,"td",62)(13,"button",64),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",62),T(16,s_e,3,1,"ng-container",65)(17,l_e,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,Kve,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function d_e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function m_e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",21)(4,"thead",74)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,d_e,5,2,"tr",14),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function u_e(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",61),l(2),o(),s(3,"td",61),l(4),o(),s(5,"td",61)(6,"button",75),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",76),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function p_e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function h_e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",21)(4,"thead",74)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,p_e,5,2,"tr",14),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var E9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.photoBoothService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=n.MIN_YEAR;this.years=Array.from({length:Math.max(0,e-r+1)},(a,c)=>r+c)}get filteredMonths(){return Number(this.selectedYear)===n.MIN_YEAR?this.months.filter(r=>r.number>=n.MIN_MONTH_IN_MIN_YEAR):this.months}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}onYearChange(){let e=Number(this.selectedYear),r=n.MIN_MONTH_IN_MIN_YEAR;if(e===n.MIN_YEAR&&this.selectedMonthNumber<r){let a=this.months.find(c=>c.number===r);a&&(this.selectedMonth=a.name,this.selectedMonthNumber=a.number)}}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
389formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){let a=Number(r),c=n.MIN_YEAR,d=n.MIN_MONTH_IN_MIN_YEAR;if(a<c||a===c&&e<d){this.toastr.warning("Please select Feb 2026 or later");return}this.spinner.show(),this.photoBoothService.getDailyTransactionsToVerify(e,r).subscribe({next:u=>{u&&u.data&&(this.salesData=u.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:u=>{console.error("API Error:",u),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.photoBoothService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.MIN_YEAR=2026,n.MIN_MONTH_IN_MIN_YEAR=2,n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Rs))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-daily-transaction-verify"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Xve,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Jve,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",11),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),S("change",function(){return a.onYearChange()}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Zve,2,1,"option",14),o()(),s(23,"div",15)(24,"button",16),S("click",function(){return a.onClickGenerate()}),s(25,"span",17),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",18)(30,"div",19)(31,"div",20)(32,"table",21)(33,"thead",22)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",23),l(38,"System Cash(LKR)"),o(),s(39,"th",23),l(40,"System Card(LKR)"),o(),s(41,"th",23),l(42,"Actual Cash(LKR)"),o(),s(43,"th",23),l(44,"Actual Card(LKR)"),o(),s(45,"th",23),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",23),l(48,"Actions"),o()()(),s(49,"tbody",24),T(50,c_e,19,20,"tr",25),o(),s(51,"tfoot",26)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",23),l(56),o(),s(57,"td",23),l(58),o(),s(59,"td",23),l(60),o(),s(61,"td",23),l(62),o(),B(63,"td",23)(64,"td",23),o()()()()()()()()(),s(65,"div",27)(66,"div",28)(67,"div",29)(68,"div",30)(69,"h5",31),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",32),o(),s(72,"div",33)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,m_e,12,1,"div",34),o()()()(),s(95,"div",35)(96,"div",28)(97,"div",29)(98,"div",30)(99,"h5",36),l(100," Invalid Tickets "),o(),B(101,"button",32),o(),s(102,"div",37)(103,"form",38),S("ngSubmit",function(){return a.addToList()}),s(104,"div",39)(105,"label",40),l(106,"Invalid Ticket Number"),o(),s(107,"input",41),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",39)(109,"label",42),l(110,"Ticket Reason"),o(),s(111,"textarea",43),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",44)(113,"button",45),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",46),l(116," Add To List "),o()()()(),s(117,"div",47)(118,"div",48)(119,"table",49)(120,"thead",50)(121,"tr")(122,"th",51),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,u_e,8,2,"tr",14),o()()()(),s(129,"div",52)(130,"button",53),l(131," Cancel "),o(),s(132,"button",54),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",55)(135,"div",28)(136,"div",29)(137,"div",30)(138,"h5",56),l(139,"Confirm Transaction"),o(),B(140,"button",32),o(),s(141,"div",33)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,h_e,12,1,"div",34),o(),s(164,"div",52)(165,"button",53),l(166," Cancel "),o(),s(167,"button",54),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,qve,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.filteredMonths),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],encapsulation:2});let i=n;return i})();var FI=Di(Ti());var f_e=i=>({collapsed:i});function g_e(i,n){if(i&1&&(s(0,"option",26),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function v_e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function __e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",23),l(5),o(),s(6,"td",23),l(7),o(),s(8,"td",23),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var w9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.photoBoothService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=n.MIN_YEAR;this.years=Array.from({length:Math.max(0,e-r+1)},(a,c)=>r+c)}get filteredMonths(){return Number(this.selectedYear)===n.MIN_YEAR?this.months.filter(r=>r.number>=n.MIN_MONTH_IN_MIN_YEAR):this.months}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onYearChange(){let e=Number(this.selectedYear),r=n.MIN_MONTH_IN_MIN_YEAR;if(e===n.MIN_YEAR&&this.selectedMonthNumber<r){let a=this.months.find(c=>c.number===r);a&&(this.selectedMonth=a.name,this.selectedMonthNumber=a.number)}}isBeforeCutoff(e,r){let a=Number(r),c=n.MIN_YEAR,d=n.MIN_MONTH_IN_MIN_YEAR;return a<c||a===c&&e<d}onClickGenerategetGuideWiseCommission(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseCommissionExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseCommissionPDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){if(this.isBeforeCutoff(e,r)){this.toastr.warning("Please select Feb 2026 or later");return}this.spinner.show(),this.photoBoothService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e
389=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){if(this.isBeforeCutoff(this.selectedMonthNumber,this.selectedYear)){this.toastr.warning("Please select Feb 2026 or later");return}this.spinner.show(),this.photoBoothService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Photo Booth Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,FI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){if(this.isBeforeCutoff(this.selectedMonthNumber,this.selectedYear)){this.toastr.warning("Please select Feb 2026 or later");return}this.spinner.show(),this.photoBoothService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Photo Booth Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,FI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.MIN_YEAR=2026,n.MIN_MONTH_IN_MIN_YEAR=2,n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Rs))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-monthly-sales-report"]],standalone:!1,decls:65,vars:12,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#fff","type","ball-pulse"],[2,"font-size","20px","color","white"],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"ngx-spinner",0)(1,"p",1),l(2,"Loading..."),o()(),s(3,"div",2)(4,"div",3)(5,"div")(6,"div",4),l(7,"Monthly Sales Reports"),o()()(),s(8,"div",5)(9,"div",6)(10,"div",7)(11,"label",8),l(12,"Month"),o(),s(13,"select",9),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(14,"option",10),l(15,"Select Month"),o(),T(16,g_e,2,2,"option",11),o()(),s(17,"div",7)(18,"label",8),l(19,"Year"),o(),s(20,"select",9),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),S("change",function(){return a.onYearChange()}),s(21,"option",10),l(22,"Select Year"),o(),T(23,v_e,2,1,"option",12),o()(),s(24,"div",13)(25,"button",14),S("click",function(){return a.onClickGenerategetGuideWiseCommission()}),s(26,"span",15),l(27,"search"),o(),l(28," Generate "),o()()(),s(29,"div",13)(30,"button",16),S("click",function(){return a.onClickGenerategetGuideWiseCommissionExcel()}),s(31,"span",15),l(32,"description"),o(),l(33,"Excel "),o(),s(34,"button",16),S("click",function(){return a.onClickGenerategetGuideWiseCommissionPDF()}),s(35,"span",15),l(36,"description"),o(),l(37,"PDF "),o()()(),s(38,"div",17)(39,"div",18)(40,"div",19)(41,"div",20)(42,"table",21)(43,"thead",22)(44,"tr")(45,"th"),l(46,"Date"),o(),s(47,"th",23),l(48,"Cash"),o(),s(49,"th",23),l(50,"Card"),o(),s(51,"th",23),l(52,"Total"),o()()(),s(53,"tbody",24),T(54,__e,10,6,"tr",12),o(),s(55,"tfoot",25)(56,"tr")(57,"td"),l(58,"Total"),o(),s(59,"td",23),l(60),o(),s(61,"td",23),l(62),o(),s(63,"td",23),l(64),o()()()()()()()()()),r&2&&(m(3),p("ngClass",Z(10,f_e,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.filteredMonths),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,wo,St],encapsulation:2});let i=n;return i})();var RI=Di(Ti());var y_e=i=>({collapsed:i});function S_e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var T9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.photoBoothService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.minDate=n.CUTOFF_DATE,this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.maxDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.toastr.warning("Please select a date range from Feb 1, 2026 onwards");return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.photoBoothService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}isBeforeCutoff(){let e=n.CUTOFF_DATE;return(this.selectedStartDate??"")<e||(this.selectedEndDate??"")<e}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.toastr.warning("Please select a date range from Feb 1, 2026 onwards");return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.photoBoothService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Coffee Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,RI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.toastr.warning("Please select a date range from Feb 1, 2026 onwards");return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.photoBoothService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Coffee Shop Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,RI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};
389n.CUTOFF_DATE="2026-02-01",n.\u0275fac=function(r){return new(r||n)(x(Rs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-item-wise-summary"]],standalone:!1,decls:121,vars:42,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Booth \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,S_e,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19)(81,"strong"),l(82),I(83,"currencyFormat"),o()()()()(),s(84,"div",23)(85,"div",24)(86,"div",25)(87,"div",26)(88,"span",27),l(89,"Subtotal:"),o(),s(90,"span"),l(91),I(92,"currencyFormat"),o()()(),s(93,"div",25)(94,"div",26)(95,"span",27),l(96,"Complimentary:"),o(),s(97,"span",28),l(98),I(99,"currencyFormat"),o()()(),s(100,"div",25)(101,"div",26)(102,"span",27),l(103,"Discounts:"),o(),s(104,"span",28),l(105),I(106,"currencyFormat"),o()()(),s(107,"div",25)(108,"div",26)(109,"span",27),l(110,"Voids:"),o(),s(111,"span",28),l(112),I(113,"currencyFormat"),o()()(),s(114,"div",25)(115,"div",29)(116,"span"),l(117,"Total Revenue:"),o(),s(118,"span"),l(119),I(120,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(40,y_e,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("min",a.minDate)("max",a.maxDate),m(4),q("ngModel",a.selectedEndDate),He("min",a.minDate)("max",a.maxDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,20,a.total.item_subtotal)),m(3),b(M(73,22,a.total.discount_subtotal)),m(3),b(M(76,24,a.total.complimentary_subtotal)),m(3),b(M(79,26,a.total.voided_subtotal)),m(4),b(M(83,28,a.total.item_total)),m(9),b(M(92,30,a.total.item_subtotal)),m(7),b(M(99,32,a.total.complimentary_subtotal)),m(7),b(M(106,34,a.total.discount_subtotal)),m(7),b(M(113,36,a.total.voided_subtotal)),m(7),b(M(120,38,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var b_e=i=>({collapsed:i});
389function x_e(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var D9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.photoBoothService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.minDate=n.CUTOFF_DATE,this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.maxDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}isBeforeCutoff(){let e=n.CUTOFF_DATE;return(this.selectedStartDate??"")<e||(this.selectedEndDate??"")<e}warnBeforeCutoff(){this.toastr.warning("Please select a date range from Feb 1, 2026 onwards")}getCategoryWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.warnBeforeCutoff();return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.photoBoothService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}}getRevenueExpenseSales(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.warnBeforeCutoff();return}this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.photoBoothService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}}getMostPopularActivitySales(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.warnBeforeCutoff();return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.photoBoothService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}}getVisitorCount(){if(this.selectedStartDate&&this.selectedEndDate){if(this.isBeforeCutoff()){this.warnBeforeCutoff();return}this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.photoBoothService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}};
389n.CUTOFF_DATE="2026-02-01",n.\u0275fac=function(r){return new(r||n)(x(Rs),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-analytics"]],standalone:!1,decls:38,vars:15,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Booth Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,x_e,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(13,b_e,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("min",a.minDate)("max",a.maxDate),m(4),q("ngModel",a.selectedEndDate),He("min",a.minDate)("max",a.maxDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var C_e=i=>({collapsed:i}),E_e=i=>({show:i});function w_e(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function T_e(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o()(),s(5,"div",30)(6,"div",31)(7,"div",32)(8,"div",33)(9,"span",34),l(10,"LKR"),o(),s(11,"input",35),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",36)(13,"button",37),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",38),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function D_e(i,n){if(i&1&&(s(0,"div",23)(1,"div",39)(2,"p",40),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",41)(5,"p",42)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",42)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",42)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",43)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedCategory," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function I_e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}
389function k_e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var I9=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.photoBoothService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.photoBoothService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({},c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.photoBoothService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Rs),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-photo-booth-edit-price"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Booth \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,w_e,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,T_e,17,4,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,D_e,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,I_e,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,k_e,1,0,"div",21)),r&2&&(p("ngClass",Z(14,C_e,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,E_e,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var M_e=i=>({collapsed:i});
389function A_e(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function P_e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function F_e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.date)),m(3),b(t.cash.toLocaleString()),m(2),b(t.online.toLocaleString()),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var k9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.photoShootService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.onlineTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.photoShootService.getMonthlySalesReport(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.onlineTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash,this.onlineTotal+=e.online,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.photoShootService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{this.photoShootService.downloadFile(e,`Photo Shoot Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`),this.spinner.hide()},error:e=>{console.error("Error downloading Excel:",e),this.toastr.error("Failed to generate Excel:","Error"),this.spinner.hide()}})}getMonthlySalesPDF(){this.spinner.show(),this.photoShootService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{this.photoShootService.downloadFile(e,`Photo Shoot Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`),this.spinner.hide()},error:e=>{console.error("Error downloading PDF:",e),this.toastr.error("Failed to generate PDF:","Error"),this.spinner.hide()}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(As))},n.\u0275cmp=te({type:n,selectors:[["app-photo-shoot-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,A_e,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,P_e,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Online"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,F_e,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,M_e,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.onlineTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var R_e=i=>({collapsed:i}),O_e=(i,n)=>({completed:i,pending:n});function N_e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"date"),o(),s(7,"td")(8,"span",22),l(9),o()(),s(10,"td"),l(11),o(),s(12,"td",19),l(13),I(14,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticketid),m(2),b(Jt(6,6,t.issueddate,"MMM d, y \xB7 hh:mm a")),m(3),p("ngClass",Et(11,O_e,t.paymentstatus==="completed",t.paymentstatus==="pending")),m(),_(" ",t.paymentstatus," "),m(2),b(t.tickettype),m(2),b(M(14,9,t.amount))}}var M9=(()=>{let n=class n{constructor(e,r,a,c){this.photoShootService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedDate=new Date().toISOString().split("T")[0],this.isCollapsed=!1,this.tickets=[],this.totalAmount=0,this.pendingAmount=0,this.completedAmount=0}ngOnInit(){let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.photoShootService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=(e.data.listOfTickets||[]).map(r=>tt(le({},r),{issueddate:r.issueddate.replace("Z",""),tickettype:this.formatTicketType(r.tickettype)})),this.totalAmount=e.data.totalAmount,this.pendingAmount=e.data.pendingAmount,this.completedAmount=e.data.completedAmount,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}formatTicketType(e){return e.split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join(" ")}onClickGenerateDailySales(){this.selectedDate&&this.getDailySales()}onClickedGenerateExcel(){this.getDailySalesExcel()}onClickGeneratePDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.spinner.show(),this.photoShootService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{this.photoShootService.downloadFile(e,`Photo Shoot Daily Sales ${this.selectedDate}.pdf`),this.spinner.hide()},error:e=>{console.error("Error downloading PDF:",e),this.toastr.error("Failed to generate PDF:","Error"),this.spinner.hide()}})}getDailySalesExcel(){this.spinner.show(),this.photoShootService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{this.photoShootService.downloadFile(e,`Photo Shoot Daily Sales ${this.selectedDate}.xlsx`),this.spinner.hide()},error:e=>{console.error("Error downloading Excel:",e),this.toastr.error("Failed to generate Excel:","Error"),this.spinner.hide()}})}onClickGeneratePrint(){window.print()}};n.\u0275fac=function(r){return new(r||n)(x(As),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-photo-shoot-daily-sales"]],standalone:!1,decls:67,vars:20,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","date-picker","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"status",3,"ngClass"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Photo Shoot \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),I(7,"date"),o()()(),s(8,"div",4)(9,"div",5)(10,"div",6)(11,"label",7),l(12,"Select day"),o(),s(13,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(14,"div",9)(15,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(16,"span",11),l(17,"search"),o(),l(18," Generate "),o()()(),s(19,"div",9)(20,"button",12),S("click",function(){return a.onClickedGenerateExcel()}),s(21,"span",11),l(22,"description"),o(),l(23,"Excel "),o(),s(24,"button",12),S("click",function(){return a.onClickGeneratePDF()}),s(25,"span",11),l(26,"picture_as_pdf"),o(),l(27,"Pdf "),o(),s(28,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(29,"span",11),l(30,"print"),o(),l(31,"Print "),o()()(),s(32,"div",13)(33,"div",14)(34,"div",15)(35,"div",16)(36,"table",17)(37,"thead",18)(38,"tr")(39,"th"),l(40,"#Serial"),o(),s(41,"th"),l(42,"Issue Date(IST)"),o(),s(43,"th"),l(44,"Payment Status"),o(),s(45,"th"),l(46,"Ticket Type"),o(),s(47,"th",19),l(48,"Amount(LKR)"),o()()(),s(49,"tbody",20),T(50,N_e,15,14,"tr",21),o(),s(51,"tfoot")(52,"tr")(
38953,"td"),l(54," Count: "),s(55,"strong"),l(56),o()(),B(57,"td"),s(58,"td"),l(59),I(60,"currencyFormat"),o(),s(61,"td"),l(62),I(63,"currencyFormat"),o(),s(64,"td",19),l(65),I(66,"currencyFormat"),o()()()()()()()()()),r&2&&(p("ngClass",Z(18,R_e,a.isCollapsed)),m(6),b(Jt(7,9,a.selectedDate,"MMM d, y")),m(7),q("ngModel",a.selectedDate),He("max",a.minDate),m(37),p("ngForOf",a.tickets),m(6),b(a.tickets.length),m(3),_("Completed Total:",M(60,12,a.completedAmount)),m(3),_("Pending Total:",M(63,14,a.pendingAmount)),m(3),_(" Total Revenue:",M(66,16,a.totalAmount)," "))},dependencies:[ue,_e,Ke,Ne,Le,St,Be],styles:[".status.completed[_ngcontent-%COMP%]{display:inline-block;padding:5px 10px;color:#01864e;background-color:#b4f8dc;border-radius:15px;font-size:12px}"]});let i=n;return i})();var L_e=i=>({collapsed:i}),B_e=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),OI=(i,n)=>({"is-invalid":i,"is-warning":n});function V_e(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function U_e(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function j_e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function W_e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function H_e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function G_e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"cash",a))}),o(),T(3,W_e,2,0,"div",71)(4,H_e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,OI,t.invalid&&t.touched,r.isAmountMismatch(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatch(e))}}function $_e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_amount_received_cash==null?null:t.actual_amount_received_cash.toLocaleString()," ")}}function z_e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function Y_e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function q_e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,2),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,z_e,2,0,"div",71)(4,Y_e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,OI,t.invalid&&t.touched,r.isAmountMismatch(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatch(e))}}function K_e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_amount_received_card==null?null:t.actual_amount_received_card.toLocaleString()," ")}}function X_e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function J_e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function Z_e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,3),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_online_show,r)||(a.actual_amount_received_online_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"online",a))}),o(),T(3,X_e,2,0,"div",71)(4,J_e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_online_show),p("ngClass",Et(5,OI,t.invalid&&t.touched,r.isAmountMismatch(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatch(e))}}function Q_e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_amount_received_online==null?null:t.actual_amount_received_online.toLocaleString()," ")}}function eye(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function tye(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function iye(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),T(6,G_e,5,8,"td",67)(7,$_e,2,1,"td",67)(8,q_e,5,8,"td",67)(9,K_e,2,1,"td",67)(10,Z_e,5,8,"td",67)(11,Q_e,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,eye,3,1,"ng-container",69)(17,tye,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,16,t.date)),m(3),_(" ",t.system_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(18,B_e,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function nye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function rye(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65)(6,"button",78),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",79),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function aye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function oye(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",24)(4,"thead",37)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,aye,5,2,"tr",17),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var A9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.photoShootService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemAmountTotal=0,this.actualAmountRecievedCashTotal=0,this.actualAmountRecievedCardTotal=0,this.actualAmountRecievedOnlineTotal=0,this.selectedTicket={ticketId:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}isAmountMismatch(e){return!!(e.system_amount!=(e.actual_amount_received_cash??0)+(e.actual_amount_received_card??0)+(e.actual_amount_received_online??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
389formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_amount_received_cash=d),r==="card"&&(a.actual_amount_received_card=d),r==="online"&&(a.actual_amount_received_online=d),e.target.value=c}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){return e.is_confirmed&&e.system_amount!=(e.actual_amount_received_cash??0)+(e.actual_amount_received_card??0)+(e.actual_amount_received_online??0)?"table-danger":e.is_confirmed?"table-success":e.date<this.todayDate&&!e.is_confirmed?e.date===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary":this.isTodaysRow(e.date)?"table-light":""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_amount_received_cash!=null&&e.actual_amount_received_cash>=0&&e.actual_amount_received_card!=null&&e.actual_amount_received_card>=0&&e.actual_amount_received_online!=null&&e.actual_amount_received_online>=0){this.selectedTicket={ticketId:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter both Ticket ID and Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){this.selectedTicket.item.invalid_tickets=[...this.selectedTicket.tempInvalidTickets],this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let e=document.getElementById("invalidTicketsModal");e&&e.setAttribute("inert","true")}}calculateTotals(){this.systemAmountTotal=0,this.actualAmountRecievedCashTotal=0,this.actualAmountRecievedCardTotal=0,this.actualAmountRecievedOnlineTotal=0,this.salesData.forEach(e=>{this.systemAmountTotal+=Number(e.system_amount),this.actualAmountRecievedCashTotal+=Number(e.actual_amount_received_cash)||0,this.actualAmountRecievedCardTotal+=Number(e.actual_amount_received_card)||0,this.actualAmountRecievedOnlineTotal+=Number(e.actual_amount_received_online)||0})}onClickConfirm(e){if(e.actual_amount_received_cash===null||e.actual_amount_received_cash===void 0||e.actual_amount_received_card===null||e.actual_amount_received_card===void 0||e.actual_amount_received_online===null||e.actual_amount_received_online===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_amount_received_cash<0||e.actual_amount_received_card<0||e.actual_amount_received_online<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}
389onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){console.log("pre shoot"),this.spinner.show(),this.photoShootService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_amount_received_cash!==null&&this.selectedTicket.item?.actual_amount_received_cash!==void 0&&this.selectedTicket.item?.actual_amount_received_cash>=0&&this.selectedTicket.item?.actual_amount_received_card!==null&&this.selectedTicket.item?.actual_amount_received_card!==void 0&&this.selectedTicket.item?.actual_amount_received_card>=0&&this.selectedTicket.item?.actual_amount_received_online!==null&&this.selectedTicket.item?.actual_amount_received_online!==void 0&&this.selectedTicket.item?.actual_amount_received_online>=0&&(this.spinner.show(),this.photoShootService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(As))},n.\u0275cmp=te({type:n,selectors:[["app-photo-shoot-daily-transaction-verify"]],standalone:!1,decls:157,vars:26,consts:[["confirmedIcon",""],["amountInput","ngModel"],["amountInputCard","ngModel"],["amountInputOnline","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[1,"table-light"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"modal-footer","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","text-start","w-100"],[1,"thead-dark","sticky-top"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],[4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",4)(1,"div",5),T(2,V_e,5,3,"div",6),s(3,"div",7)(4,"div")(5,"div",8),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",9)(8,"div",10)(9,"div",11)(10,"label",12),l(11,"Month"),o(),s(12,"select",13),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",14),l(14,"Select Month"),o(),T(15,U_e,2,2,"option",15),o()(),s(16,"div",11)(17,"label",12),l(18,"Year"),o(),s(19,"select",16),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",14),l(21,"Select Year"),o(),T(22,j_e,2,1,"option",17),o()(),s(23,"div",18)(24,"button",19),S("click",function(){return a.onClickGenerate()}),s(25,"span",20),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",4)(29,"div",21)(30,"div",22)(31,"div",23)(32,"table",24)(33,"thead",25)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",26),l(38,"System Amount(LKR)"),o(),s(39,"th",26),l(40,"Actual Amount Received Cash(LKR)"),o(),s(41,"th",26),l(42,"Actual Amount Received Card(LKR)"),o(),s(43,"th",26),l(44,"Actual Amount Received Online(LKR)"),o(),s(45,"th",26),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",26),l(48,"Actions"),o()()(),s(49,"tbody",27),T(50,iye,19,21,"tr",28),o(),s(51,"tfoot",29)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",26),l(56),o(),s(57,"td",26),l(58),o(),s(59,"td",26),l(60),o(),s(61,"td",26),l(62),o(),B(63,"td",26)(64,"td",26),o()()()()()()()()(),s(65,"div",30)(66,"div",31)(67,"div",32)(68,"div",33)(69,"h5",34),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",35),o(),s(72,"div",36)(73,"table",24)(74,"thead",37)(75,"tr")(76,"th"),l(77,"Invalid Ticket Number"),o(),s(78,"th"),l(79,"Ticket Reason"),o(),B(80,"th"),o()(),s(81,"tbody"),T(82,nye,5,2,"tr",17),o()()()()()(),s(83,"div",38)(84,"div",31)(85,"div",32)(86,"div",33)(87,"h5",39),l(88," Invalid Tickets "),o(),B(89,"button",35),o(),s(90,"div",40)(91,"form",41),S("ngSubmit",function(){return a.addToList()}),s(92,"div",42)(93,"label",43),l(94,"Invalid Ticket Number"),o(),s(95,"input",44),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(96,"div",42)(97,"label",45),l(98,"Ticket Reason"),o(),s(99,"textarea",46),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(100,"div",47)(101,"button",48),S("click",function(){return a.clearForm()}),l(102," Cancel "),o(),s(103,"button",49),l(104," Add To List "),o()()()(),s(105,"div",50)(106,"div",51)(107,"table",52)(108,"thead",53)(109,"tr")(110,"th",54),l(111,"Invalid Ticket Number"),o(),s(112,"th"),l(113,"Reason"),o(),B(114,"th"),o()(),s(115,"tbody"),T(116,rye,8,2,"tr",17),o()()()(),s(117,"div",55)(118,"button",56),l(119," Cancel "),o(),s(120,"button",57),S("click",function(){return a.saveInvalidTickets()}),l(121," Save "),o()()()()(),s(122,"div",58)(123,"div",31)(124,"div",32)(125,"div",33)(126,"h5",59),l(127,"Confirm Transaction"),o(),B(128,"button",35),o(),s(129,"div",36)(130,"p")(131,"strong"),l(132,"Date:"),o(),l(133),I(134,"date"),o(),s(135,"p")(136,"strong"),l(137,"System Amount:"),o(),l(138),o(),s(139,"p")(140,"strong"),l(141,"Actual Amount Cash:"),o(),l(142),o(),s(143,"p")(144,"strong"),l(145,"Actual Amount Card:"),o(),l(146),o(),s(147,"p")(148,"strong"),l(149,"Actual Amount Online:"),o(),l(150),o(),T(151,oye,12,1,"div",60),o(),s(152,"div",55)(153,"button",56),l(154," Cancel "),o(),s(155,"button",57),S("click",function(){return a.confirmTransaction()}),l(156," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(24,L_e,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemAmountTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.actualAmountRecievedCashTotal.toLocaleString()," "),m(2),_(" ",a.actualAmountRecievedCardTotal.toLocaleString()," "),m(2),_(" ",a.actualAmountRecievedOnlineTotal.toLocaleString()," "),m(20),p("ngForOf",a.selectedTicket.item==null?null:a.selectedTicket.item.invalid_tickets),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(134,22,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_amount==null?null:a.selectedTicket.item.system_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_amount_received_cash==null?null:a.selectedTicket.item.actual_amount_received_cash.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_amount_received_card==null?null:a.selectedTicket.item.actual_amount_received_card.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_amount_received_online==null?null:a.selectedTicket.item.actual_amount_received_online.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],encapsulation:2});let i=n;return i})();var sye=i=>({collapsed:i}),lye=(i,n)=>({completed:i,pending:n});function cye(i,n){if(i&1&&(s(0,"div",43)(1,"span",44),l(2),o(),s(3,"small",45),l(4),o()()),i&2){let t=w().$implicit;m(2),b(t.guidename),m(2),_("(",t.usercode,")")}}function dye(i,n){i&1&&(s(0,"div",46),l(1," N/A "),o())}function mye(i,n){i&1&&(s(0,"span",47),B(1,"i",48),o())}function uye(i,n){if(i&1){let t=he();s(0,"button",49),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.openLinkGuideModal(r))}),B(1,"i",50),l(2," Link Guide "),o()}if(i&2){let t=w(2);p("disabled",t.isAccountant||t.isOfficeUser)}}function pye(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"date"),o(),s(7,"td"),l(8),o(),s(9,"td"),T(10,cye,5,2,"div",39)(11,dye,2,0,"div",40),o(),s(12,"td"),l(13),I(14,"date"),o(),s(15,"td"),l(16),o(),s(17,"td"),l(18),o(),s(19,"td",19)(20,"strong"),l(21),I(22,"currencyFormat"),o()(),s(23,"td",20),T(24,mye,2,0,"span",41)(25,uye,3,1,"button",42),o()()),i&2){let t=n.$implicit;m(3),_("#",t.serialnumber),m(2),b(Jt(6,11,t.createdat,"MMM d, y \xB7 hh:mm a")),m(3),b(t.tickettype),m(2),p("ngIf",t.usercode&&t.guidename),m(),p("ngIf",!t.usercode||!t.guidename),m(2),_(" ",t.guidelinkeddate?Jt(14,14,t.guidelinkeddate,"MMM d, y \xB7 hh:mm a"):"N/A"," "),m(3),_(" ",t.guidelinkedby?t.guidelinkedby:"N/A"," "),m(2),_(" ",t.guidelinkedreason?t.guidelinkedreason:"N/A"," "),m(3),b(M(22,17,t.amount)),m(3),p("ngIf",t.usercode),m(),p("ngIf",!t.usercode)}}function hye(i,n){if(i&1){let t=he();s(0,"li",25)(1,"button",51),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}function fye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td",20),l(6),o(),s(7,"td",19),l(8),I(9,"currencyFormat"),o()()),i&2){let t=n.$implicit,e=w(3);m(2),b(e.formatName(t.name)),m(2),b(t.country),m(2),b(t.count),m(2),_(" ",M(9,4,t.price)," ")}}function gye(i,n){if(i&1&&(s(0,"div",71)(1,"h6",72),l(2,"Visitor Details"),o(),s(3,"div",16)(4,"table",73)(5,"thead",74)(6,"tr")(7,"th"),l(8,"Type"),o(),s(9,"th"),l(10,"Country"),o(),s(11,"th",20),l(12,"Count"),o(),s(13,"th",19),l(14,"Price"),o()()(),s(15,"tbody"),T(16,fye,10,6,"tr",22),o()()()()),i&2){let t=w(2);m(16),p("ngForOf",t.selectedTicket.visitordetails)}}function vye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td",20),l(4),o(),s(5,"td",19),l(6),I(7,"currencyFormat"),o()()),i&2){let t=n.$implicit,e=w(3);m(2),b(e.formatName(t.name)),m(2),b(t.count),m(2),_(" ",M(7,3,t.price)," ")}}function _ye(i,n){if(i&1&&(s(0,"div",71)(1,"h6",72),l(2,"Vehicle Details"),o(),s(3,"div",16)(4,"table",73)(5,"thead",74)(6,"tr")(7,"th"),l(8,"Type"),o(),s(9,"th",20),l(10,"Count"),o(),s(11,"th",19),l(12,"Price"),o()()(),s(13,"tbody"),T(14,vye,8,5,"tr",22),o()()()()),i&2){let t=w(2);m(14),p("ngForOf",t.selectedTicket.vehicledetails)}}function yye(i,n){i&1&&(s(0,"div",75),l(1," No guides found "),o())}
389function Sye(i,n){if(i&1){let t=he();s(0,"button",76),S("click",function(){let r=U(t).$implicit,a=w(2);return j(a.selectGuide(r))}),l(1),o()}if(i&2){let t=n.$implicit;m(),Pi(" ",t.name," (",t.usercode,") ")}}function bye(i,n){i&1&&(s(0,"div",77),l(1," Please select a guide "),o())}function xye(i,n){i&1&&(s(0,"span"),l(1," Please provide a reason "),o())}function Cye(i,n){i&1&&(s(0,"span"),l(1," Reason cannot be empty or contain only spaces "),o())}function Eye(i,n){if(i&1&&(s(0,"div",77),T(1,xye,2,0,"span",78)(2,Cye,2,0,"span",78),o()),i&2){let t,e,r=w(2);m(),p("ngIf",(t=r.linkGuideForm.get("reason"))==null||t.errors==null?null:t.errors.required),m(),p("ngIf",(e=r.linkGuideForm.get("reason"))==null||e.errors==null?null:e.errors.whitespace)}}function wye(i,n){if(i&1){let t=he();s(0,"div",52)(1,"div",53)(2,"div",54)(3,"h6",55),l(4,"Ticket Details"),o()(),s(5,"div",56)(6,"div",57)(7,"div",58)(8,"p")(9,"strong"),l(10,"Serial Number:"),o(),l(11),o(),s(12,"p")(13,"strong"),l(14,"Issued By:"),o(),l(15),o(),s(16,"p")(17,"strong"),l(18,"Issue Date:"),o(),l(19),I(20,"date"),o()(),s(21,"div",58)(22,"p")(23,"strong"),l(24,"Ticket Type:"),o(),l(25),o(),s(26,"p")(27,"strong"),l(28,"Payment Status:"),o(),s(29,"span",59),l(30),o()(),s(31,"p")(32,"strong"),l(33,"Amount:"),o(),l(34),I(35,"currencyFormat"),o()()(),T(36,gye,17,1,"div",60)(37,_ye,15,1,"div",60),o()(),s(38,"form",3)(39,"div",61)(40,"label",62),l(41,"Select Guide"),o(),s(42,"div",63)(43,"input",64),S("input",function(r){U(t);let a=w();return j(a.filterGuides(r))})("focus",function(){U(t);let r=w();return j(r.showGuideDropdown=!0)}),o(),s(44,"div",65),T(45,yye,2,0,"div",66)(46,Sye,2,2,"button",67),o(),T(47,bye,2,0,"div",68),o()(),s(48,"div",61)(49,"label",69),l(50,"Reason for Linking"),o(),B(51,"textarea",70),T(52,Eye,3,2,"div",68),o()()()}if(i&2){let t,e,r,a,c=w();m(11),_(" #",c.selectedTicket.serialnumber," "),m(4),_(" ",c.selectedTicket.issuername," "),m(4),_(" ",Jt(20,21,c.selectedTicket.createdat,"MMM d, y \xB7 hh:mm a")," "),m(6),_(" ",c.selectedTicket.tickettype," "),m(4),p("ngClass",Et(26,lye,c.selectedTicket.paymentstatus==="completed",c.selectedTicket.paymentstatus==="pending")),m(),_(" ",c.selectedTicket.paymentstatus," "),m(4),_(" ",M(35,24,c.selectedTicket.amount)," "),m(2),p("ngIf",c.selectedTicket.visitordetails&&c.selectedTicket.visitordetails.length>0),m(),p("ngIf",c.selectedTicket.vehicledetails&&c.selectedTicket.vehicledetails.length>0),m(),p("formGroup",c.linkGuideForm),m(5),Re("is-invalid",((t=c.linkGuideForm.get("selectedGuide"))==null?null:t.invalid)&&((t=c.linkGuideForm.get("selectedGuide"))==null?null:t.touched)),p("value",c.selectedGuideName),m(),Re("show",c.showGuideDropdown),m(),p("ngIf",c.filteredGuideList.length===0),m(),p("ngForOf",c.filteredGuideList),m(),p("ngIf",((e=c.linkGuideForm.get("selectedGuide"))==null?null:e.invalid)&&((e=c.linkGuideForm.get("selectedGuide"))==null?null:e.touched)),m(4),Re("is-invalid",((r=c.linkGuideForm.get("reason"))==null?null:r.invalid)&&((r=c.linkGuideForm.get("reason"))==null?null:r.touched)),m(),p("ngIf",((a=c.linkGuideForm.get("reason"))==null?null:a.invalid)&&((a=c.linkGuideForm.get("reason"))==null?null:a.touched))}}var P9=(()=>{let n=class n{clickOutside(e){let r=e.target;!r.closest("#guideSearch")&&!r.closest(".dropdown-menu")&&(this.showGuideDropdown=!1)}constructor(e,r,a,c,d,u){this.admissionsService=e,this.sidebarService=r,this.fb=a,this.spinner=c,this.toastr=d,this.cognitoService=u,this.guideList=[],this.ticketList=[],this.currentPage=1,this.itemsPerPage=20,this.totalItems=0,this.totalPages=0,this.pages=[],this.searchKeyword="",this.isCollapsed=!1,this.selectedTicket=null,this.filteredGuideList=[],this.showGuideDropdown=!1,this.selectedGuideName="",this.isAccountant=!1,this.isOfficeUser=!1,this.searchForm=this.fb.group({searchKeyword:["",[At.pattern("^[0-9]*$"),At.min(0)]]}),this.linkGuideForm=this.fb.group({selectedGuide:["",At.required],reason:["",[At.required,this.noWhitespaceValidator]]})}ngOnInit(){this.fetchGuideList(),this.fetchTicketList(),this.checkUserRole(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}ngAfterViewInit(){this.modal=new Zt(document.getElementById("linkGuideModal"))}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}fetchGuideList(){this.spinner.show(),this.admissionsService.getGuideList().subscribe({next:e=>{console.log("guideList",e),e.status==="success"&&(this.guideList=e.data.map(r=>({name:`${r.firstname} ${r.lastname}`,usercode:r.usercode,id:r.id}))),this.spinner.hide()},error:e=>{console.error("Error fetching guide list:",e),this.spinner.hide(),this.toastr.error("Failed to fetch guide list","Error")}})}fetchTicketList(){let e=this.searchForm.get("searchKeyword")?.value||"";this.spinner.show(),this.admissionsService.getTicketList(this.currentPage,e).subscribe({next:r=>{console.log("ticketList",r),r.status==="success"&&(this.ticketList=r.data.listOfTickets.map(a=>tt(le({},a),{createdat:a.createdat?a.createdat.replace("Z",""):null,issueddate:a.issueddate?a.issueddate.replace("Z",""):null,guidelinkeddate:a.guidelinkeddate?a.guidelinkeddate.replace("Z",""):null})),this.itemsPerPage=r.data.limit,this.totalItems=parseInt(r.data.rowCount),this.totalPages=r.data.totalPages,this.updatePagination(),this.ticketList.length===0&&this.toastr.warning("No records available!","Warning")),this.spinner.hide()},error:r=>{console.error("Error fetching ticket list:",r),this.spinner.hide(),this.toastr.error("Failed to fetch ticket list","Error")}})}updatePagination(){if(this.totalPages<=10){this.pages=Array.from({length:this.totalPages},(d,u)=>u+1);return}let r=Math.floor(9/2),a=Math.max(1,this.currentPage-r),c=a+10-1;c>this.totalPages&&(c=this.totalPages,a=Math.max(1,c-10+1)),this.pages=Array.from({length:c-a+1},(d,u)=>a+u)}goToPage(e){e!==this.currentPage&&(this.currentPage=e,this.fetchTicketList())}prevPage(){this.currentPage>1&&(this.currentPage--,this.fetchTicketList())}nextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.fetchTicketList())}openLinkGuideModal(e){this.selectedTicket=e,this.filteredGuideList=[...this.guideList],this.linkGuideForm.reset(),this.selectedGuideName="",this.showGuideDropdown=!1,this.modal.show(),setTimeout(()=>{let r=document.getElementById("linkGuideModal");if(r){let a=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not
389([tabindex="-1"])');a.length>0&&a[0].focus()}},300)}filterGuides(e){let r=e.target.value.toLowerCase();if(!r){this.filteredGuideList=[...this.guideList];return}this.filteredGuideList=this.guideList.filter(a=>a.name.toLowerCase().includes(r)||a.usercode.toLowerCase().includes(r)),this.showGuideDropdown=!0}selectGuide(e){this.selectedGuideName=`${e.name} (${e.usercode})`,this.linkGuideForm.get("selectedGuide")?.setValue(e.id),this.showGuideDropdown=!1}linkGuideToTicket(){if(this.linkGuideForm.invalid||!this.selectedTicket)return;let e=this.linkGuideForm.get("selectedGuide")?.value,r=this.linkGuideForm.get("reason")?.value.trim(),a=this.selectedTicket.ticketid;this.spinner.show(),this.admissionsService.linkGuideToTicket(a,e,r).subscribe({next:c=>{c.status==="success"?(this.toastr.success("Guide linked successfully!","Success"),this.modal.hide(),this.fetchTicketList()):this.toastr.error(c.message||"Failed to link guide","Error"),this.spinner.hide()},error:c=>{console.error("Error linking guide:",c),this.toastr.error("Failed to link guide","Error"),this.spinner.hide()}})}formatName(e){return e?e.split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join(" "):""}closeModal(){this.modal.hide(),setTimeout(()=>{let e=document.querySelectorAll(".btn-outline-primary.btn-sm");e.length>0&&e[0].focus()},300)}noWhitespaceValidator(e){return e.value&&e.value.trim().length===0?{whitespace:!0}:null}refreshSearch(){this.searchForm.get("searchKeyword")?.setValue(""),this.currentPage=1,this.fetchTicketList()}onSearchClick(){if((this.searchForm.get("searchKeyword")?.value||"")===""){this.toastr.warning("Please enter a ticket ID","Empty Search");return}this.fetchTicketList()}};n.\u0275fac=function(r){return new(r||n)(x(Hr),x(ce),x(Qr),x(pe),x(me),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-link-guide-admission"]],hostBindings:function(r,a){r&1&&S("click",function(d){return a.clickOutside(d)},lk)},standalone:!1,decls:72,vars:14,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[3,"formGroup"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","number","formControlName","searchKeyword","placeholder","Enter Ticket ID",1,"form-control"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon","me-2",3,"click"],[1,"material-icons-outlined"],["type","button",1,"btn","btn-outline-secondary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"text-center"],[1,"tbody"],[4,"ngFor","ngForOf"],["aria-label","Page navigation"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],["id","linkGuideModal","tabindex","-1","aria-labelledby","linkGuideModalLabel","aria-hidden","true","role","dialog",1,"modal","fade"],["role","document",1,"modal-dialog","modal
389-lg"],[1,"modal-content"],[1,"modal-header"],["id","linkGuideModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["class","guide-details",4,"ngIf"],["class","text-muted",4,"ngIf"],["class","text-success","title","Guide Linked",4,"ngIf"],["type","button","class","btn btn-outline-primary btn-sm","title","Link Guide",3,"disabled","click",4,"ngIf"],[1,"guide-details"],[1,"guide-name"],[1,"guide-code","text-muted","d-block"],[1,"text-muted"],["title","Guide Linked",1,"text-success"],[1,"fas","fa-user-check","fa-2x"],["type","button","title","Link Guide",1,"btn","btn-outline-primary","btn-sm",3,"click","disabled"],[1,"fas","fa-user-plus"],[1,"page-link",3,"click"],[1,"modal-body"],[1,"card","mb-3"],[1,"card-header","bg-light"],[1,"mb-0"],[1,"card-body"],[1,"row"],[1,"col-md-6"],[1,"status",3,"ngClass"],["class","mt-3",4,"ngIf"],[1,"mb-3"],["for","guideSelect",1,"form-label"],[1,"dropdown"],["type","text","id","guideSearch","placeholder","Search and select a guide...",1,"form-control",3,"input","focus","value"],[1,"dropdown-menu","w-100"],["class","dropdown-item text-muted",4,"ngIf"],["type","button","class","dropdown-item",3,"click",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],["for","reason",1,"form-label"],["id","reason","rows","3","placeholder","Enter reason for linking guide to this ticket","formControlName","reason",1,"form-control"],[1,"mt-3"],[1,"mb-2"],[1,"table","table-sm","table-bordered"],[1,"table-light"],[1,"dropdown-item","text-muted"],["type","button",1,"dropdown-item",3,"click"],[1,"invalid-feedback"],[4,"ngIf"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Link Guide"),o()()(),s(5,"form",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"label",7),l(10,"Search Tickets"),o(),B(11,"input",8),o(),s(12,"div",9)(13,"button",10),S("click",function(){return a.onSearchClick()}),s(14,"span",11),l(15,"search"),o(),l(16," Search "),o(),s(17,"button",12),S("click",function(){return a.refreshSearch()}),s(18,"span",11),l(19,"refresh"),o(),l(20," Refresh "),o()()()()(),s(21,"div",13)(22,"div",14)(23,"div",15)(24,"div",16)(25,"table",17)(26,"thead",18)(27,"tr")(28,"th"),l(29,"#Serial"),o(),s(30,"th"),l(31,"Issue Date (IST)"),o(),s(32,"th"),l(33,"Ticket Type"),o(),s(34,"th"),l(35,"Guide Details"),o(),s(36,"th"),l(37,"Guide Linked Date"),o(),s(38,"th"),l(39,"Guide Linked By"),o(),s(40,"th"),l(41,"Reason"),o(),s(42,"th",19),l(43,"Amount (LKR)"),o(),s(44,"th",20),l(45,"Action"),o()()(),s(46,"tbody",21),T(47,pye,26,19,"tr",22),o()()()()(),s(48,"nav",23)(49,"ul",24)(50,"li",25)(51,"button",26),S("click",function(){return a.prevPage()}),s(52,"span",27),l(53,"\xAB"),o()()(),T(54,hye,3,3,"li",28),s(55,"li",25)(56,"button",26),S("click",function(){return a.nextPage()}),s(57,"span",27),l(58,"\xBB"),o()()()()()()(),s(59,"div",29)(60,"div",30)(61,"div",31)(62,"div",32)(63,"h5",33),l(64," Link Guide to Ticket "),o(),B(65,"button",34),o(),T(66,wye,53,29,"div",35),s(67,"div",36)(68,"button",37),S("click",function(){return a.closeModal()}),l(69," Cancel "),o(),s(70,"button",38),S("click",function(){return a.linkGuideToTicket()}),l(71," Confirm "),o()()()()()),r&2&&(p("ngClass",Z(12,sye,a.isCollapsed)),m(5),p("formGroup",a.searchForm),m(42),p("ngForOf",a.ticketList),m(3),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages),m(10),p("ngIf",a.selectedTicket),m(4),p("disabled",a.linkGuideForm.invali
389d))},dependencies:[ue,_e,Dt,Ni,Ke,qi,Ne,Oi,wr,$r,St,Be],styles:[".completed[_ngcontent-%COMP%]{display:inline-block;padding:5px 10px;color:#01864e;background-color:#b4f8dc;border-radius:15px;font-size:12px}.pending[_ngcontent-%COMP%]{display:inline-block;padding:5px 10px;color:#aa0;background-color:#f9fd7f;border-radius:15px;font-size:12px}.pagination[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:20px}.page-btn[_ngcontent-%COMP%]{padding:5px 10px;margin:0 5px;border:1px solid #d8e2ef;background-color:#fff;color:#333;cursor:pointer;transition:background-color .3s,color .3s}.page-btn[_ngcontent-%COMP%]:hover{background-color:#2873ff;color:#fff}.page-btn.active[_ngcontent-%COMP%]{background-color:#2873ff;color:#fff;border-color:#2873ff;font-weight:700}.page-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.page-btn[_ngcontent-%COMP%]:disabled:hover{background-color:#fff;color:#333}.error-message[_ngcontent-%COMP%]{color:#dc3545;font-size:.8rem;margin-top:.25rem}input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#dc3545}.dropdown[_ngcontent-%COMP%]{position:relative}.dropdown-menu[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;width:100%;padding:0}.dropdown-item[_ngcontent-%COMP%]{cursor:pointer;padding:8px 12px;border-bottom:1px solid #f0f0f0;white-space:normal;word-break:break-word}.dropdown-item[_ngcontent-%COMP%]:hover{background-color:#f8f9fa}.dropdown-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.dropdown-menu[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.dropdown-menu[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.dropdown-menu[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:4px}.dropdown-menu[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.guide-details[_ngcontent-%COMP%]{line-height:1.3}.guide-name[_ngcontent-%COMP%]{font-weight:500}.guide-code[_ngcontent-%COMP%]{font-size:.85rem}"]});let i=n;return i})();var NI=Di(Ti());var Os=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.LAKE_FRONT_REST,start_date:e};return console.log("API Payload:",r),this.http.post(this.apiUrl+"/get-daily-sales",r)}getMonthlySales(e,r){let a={entity_id:Se.LAKE_FRONT_REST,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.LAKE_FRONT_REST,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.LAKE_FRONT_REST,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailySalesPDF(e){let r={entity_id:Se.LAKE_FRONT_REST,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.LAKE_FRONT_REST,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getrevenueexpenseSales(e,r){let a={entity_id:Se.LAKE_FRONT_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getItemWiseSales(e,r){let a={entity_id:Se.LAKE_FRONT_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.LAKE_FRONT_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.LAKE_FRONT_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.LAKE_FRONT_REST,current_page:e};return console.log("API Payload:",r),this.http.post(this.apiUrl+"/ticket-sales",r)}getMostPopularActivity(e,r){let a={entity_id:Se.LAKE_FRONT_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getVisitorCount(e,r){let a={entity_id:Se.LAKE_FRONT_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getItemPrice(){let e={entity_id:Se.LAKE_FRONT_REST};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.LAKE_FRONT_REST};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.LAKE_FRONT_REST,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Tye=i=>({collapsed:i});
389function Dye(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var F9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.lakefrontrestservice=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.isCollapsed=!1,this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.lakefrontrestservice.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.lakefrontrestservice.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Lake Front Rest Daily Sales ${this.selectedDate}.pdf`;(0,NI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.lakefrontrestservice.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Lake Front Rest Daily Sales ${this.selectedDate}.xlsx`;(0,NI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Os),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-lake-front-rest"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Lake Front Rest \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,Dye,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,Tye,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Iye=i=>({collapsed:i}),kye=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),R9=(i,n)=>({"is-invalid":i,"is-warning":n});
389function Mye(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Aye(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Pye(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Fye(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Rye(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Oye(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"cash",a))}),o(),T(3,Fye,2,0,"div",68)(4,Rye,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,R9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function Nye(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Lye(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Bye(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Vye(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"card",a))}),o(),T(3,Lye,2,0,"div",68)(4,Bye,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,R9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function Uye(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function jye(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Wye(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function Hye(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,Oye,5,8,"td",64)(9,Nye,2,1,"td",64)(10,Vye,5,8,"td",64)(11,Uye,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,jye,3,1,"ng-container",66)(17,Wye,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,kye,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Gye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function $ye(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Gye,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function zye(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Yye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function qye(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Yye,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var O9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.lakefrontrestService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
389formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.lakefrontrestService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.lakefrontrestService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Os))},n.\u0275cmp=te({type:n,selectors:[["app-lake-front-rest-daily-transaction-verify"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Mye,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Aye,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Pye,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,Hye,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,$ye,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,zye,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,qye,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,Iye,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var LI=Di(Ti());var Kye=i=>({collapsed:i});function Xye(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),I(21,"currencyFormat"),o(),s(22,"td",19)(23,"strong"),l(24),I(25,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,9,t.average_unit_price)),m(3),b(M(12,11,t.item_subtotal)),m(3),b(M(15,13,t.discount_subtotal)),m(3),b(M(18,15,t.complimentary_subtotal)),m(3),b(M(21,17,t.voided_subtotal)),m(4),b(M(25,19,t.item_total))}}var N9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.lakefrontrestservice=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.isCollapsed=!1,this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0}}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}
389setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.lakefrontrestservice.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.lakefrontrestservice.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Lake Front Rest Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,LI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.lakefrontrestservice.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Lake Front Rest Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,LI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Os),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-lake-front-rest"]],standalone:!1,decls:118,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","4"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Lake Front Rest \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Item"),o(),s(44,"th"),l(45,"Quantity"),o(),s(46,"th"),l(47,"Voided Ticket Count"),o(),s(48,"th"),l(49,"Average Unit Price"),o(),s(50,"th"),l(51,"Item Subtotal"),o(),s(52,"th"),l(53,"Discount Subtotal"),o(),s(54,"th"),l(55,"Complimentary Subtotal"),o(),s(56,"th"),l(57,"Voided Subtotal"),o(),s(58,"th",19),l(59,"Item Total"),o()()(),s(60,"tbody",20),T(61,Xye,26,21,"tr",21),o(),s(62,"tfoot")(63,"tr")(64,"td",22),l(65,"All Activities"),o(),s(66,"td"),l(67),I(68,"currencyFormat"),o(),s(69,"td"),l(70),I(71,"currencyFormat"),o(),s(72,"td"),l(73),I(74,"currencyFormat"),o(),s(75,"td"),l(76),I(77,"currencyFormat"),o(),s(78,"td",19),l(79),I(80,"currencyFormat"),o()()()(),s(81,"div",23)(82,"div",24)(83,"div",25)(84,"div",26)(85,"span",27),l(86,"Subtotal:"),o(),s(87,"span"),l(88),I(89,"currencyFormat"),o()()(),s(90,"div",25)(91,"div",26)(92,"span",27),l(93,"Complimentary:"),o(),s(94,"span",28),l(95),I(96,"currencyFormat"),o()()(),s(97,"div",25)(98,"div",26)(99,"span",27),l(100,"Discounts:"),o(),s(101,"span",28),l(102),I(103,"currencyFormat"),o()()(),s(104,"div",25)(105,"div",26)(106,"span",27),l(107,"Voids:"),o(),s(108,"span",28),l(109),I(110,"currencyFormat"),o()()(),s(111,"div",25)(112,"div",29)(113,"span"),l(114,"Total Revenue:"),o(),s(115,"span"),l(116),I(117,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,Kye,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(45),p("ngForOf",a.items),m(6),b(M(68,18,a.total.item_subtotal)),m(3),b(M(71,20,a.total.discount_subtotal)),m(3),b(M(74,22,a.total.complimentary_subtotal)),m(3),b(M(77,24,a.total.voided_subtotal)),m(3),_(" ",M(80,26,a.total.item_total)," "),m(9),b(M(89,28,a.total.item_subtotal)),m(7),b(M(96,30,a.total.complimentary_subtotal)),m(7),b(M(103,32,a.total.discount_subtotal)),m(7),b(M(110,34,a.total.voided_subtotal)),m(7),b(M(117,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Jye=i=>({collapsed:i}),Zye=(i,n)=>({completed:i,void:n});function Qye(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,Zye,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function eSe(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var L9=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.lakefrontrestservice=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.lakefrontrestservice.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Os),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-lake-front-rest"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Lake Front Rest Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3897,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Qye,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,eSe,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,Jye,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var tSe=i=>({collapsed:i});function iSe(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var B9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.lakefrontrestservice=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.lakefrontrestservice.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.lakefrontrestservice.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_revenue+=Number(r.revenue),this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.lakefrontrestservice.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.lakefrontrestservice.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Os),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-lake-front-rest-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items","revenueType"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems"],["title","Most Popular Item",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Lake Front Rest Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,iSe,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-activity-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,tSe,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items)("revenueType","Item Wise Revenue"),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,uo,Jn,Zn,Qn,Dn,Be],encapsulation:2});let i=n;return i})();var nSe=i=>({collapsed:i}),rSe=i=>({show:i});function aSe(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function oSe(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o()(),s(5,"div",30)(6,"div",31)(7,"div",32)(8,"div",33)(9,"span",34),l(10,"LKR"),o(),s(11,"input",35),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",36)(13,"button",37),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",38),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function sSe(i,n){if(i&1&&(s(0,"div",23)(1,"div",39)(2,"p",40),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",41)(5,"p",42)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",42)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",43)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function lSe(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function cSe(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var V9=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.lakefrontrestservice=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.lakefrontrestservice.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({}
389,c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.lakefrontrestservice.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Os),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-beer-garden-edit-price"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Lake Front Rest \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,aSe,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,oSe,17,4,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,sSe,17,3,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,lSe,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,cSe,1,0,"div",21)),r&2&&(p("ngClass",Z(14,nSe,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,rSe,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var BI=Di(Ti());var dSe=i=>({collapsed:i});
389function mSe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function uSe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function pSe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var U9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.lakefrontrestservice=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.lakefrontrestservice.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.lakefrontrestservice.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Lake Front Rest Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,BI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.lakefrontrestservice.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Lake Front Rest Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,BI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Os))},n.\u0275cmp=te({type:n,selectors:[["app-lake-front-rest-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,mSe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,uSe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,pSe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,dSe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var hSe=i=>({collapsed:i});function fSe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),I(7,"date"),o(),s(8,"td",18)(9,"span",44),l(10),o()(),s(11,"td",18)(12,"button",45),S("click",function(){let r=U(t).$implicit,a=w();return j(a.prepareDelete(r))}),B(13,"i",46),l(14," Delete "),o()()()}if(i&2){let t=n.$implicit,e=n.index,r=w();m(2),_("#",(r.currentPage-1)*r.itemsPerPage+e+1),m(2),b(t.qr_code),m(2),_(" ",Jt(7,7,t.created_at,"MMM d, y \xB7 hh:mm a")," "),m(3),p("ngClass",t.is_active?"bg-success":"bg-danger"),m(),_(" ",t.is_active?"Active":"Inactive"," "),m(2),p("disabled",t.is_active)("disabled",r.isAccountant||r.isOfficeUser)}}function gSe(i,n){i&1&&(s(0,"tr")(1,"td",47),l(2," No QR codes registered yet "),o()())}function vSe(i,n){if(i&1){let t=he();s(0,"li",24)(1,"button",48),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var j9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.fb=e,this.sidebarService=r,this.admissionsService=a,this.spinner=c,this.toastr=d,this.cognitoService=u,this.isCollapsed=!1,this.registeredQrCodes=[],this.selectedQrCode=null,this.isAccountant=!1,this.isOfficeUser=!1,this.currentPage=1,this.itemsPerPage=10,this.totalPages=0,this.totalItems=0,this.pages=[],this.qrCodeForm=this.fb.group({qrCode:["",[At.required]]})}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.loadRegisteredQrCodes(),this.checkUserRole()}ngAfterViewInit(){this.modal=new Zt(document.getElementById("confirmQrModal"),{backdrop:"static",keyboard:!1,focus:!0}),this.deleteModal=new Zt(document.getElementById("confirmDeleteModal"),{backdrop:"static",keyboard:!1,focus:!0});let e=document.getElementById("confirmQrModal"),r=document.getElementById("confirmDeleteModal");e&&(e.addEventListener("shown.bs.modal",()=>{let a=e.querySelector(".btn-primary");a&&a.focus()}),e.addEventListener("hidden.bs.modal",()=>{let a=document.querySelector(".modal-backdrop");a&&a.remove();let c=document.querySelector('[data-bs-target="#confirmQrModal"]');c&&c.focus()})),r&&(r.addEventListener("shown.bs.modal",()=>{let a=r.querySelector(".btn-outline-danger");a&&a.focus()}),r.addEventListener("hidden.bs.modal",()=>{let a=document.querySelector(".modal-backdrop");a&&a.remove();let c=document.querySelector('[data-bs-target="#confirmDeleteModal"]');c&&c.focus()}))}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadRegisteredQrCodes(){this.spinner.show(),this.admissionsService.getQrCodes(this.currentPage,this.itemsPerPage).subscribe({next:e=>{e.statusCode===200?(this.registeredQrCodes=e.data.qrCodes,this.totalItems=e.data.total,this.currentPage=e.data.page,this.itemsPerPage=e.data.limit,this.updatePagination(),this.registeredQrCodes.length===0&&this.currentPage===1&&this.toastr.warning("No QR codes found")):this.toastr.error(e.message??"Failed to load QR codes","Error"),this.spinner.hide()},error:e=>{console.error("Error loading QR codes:",e),this.toastr.error(e.error.message??"Failed to load QR codes","Error"),this.spinner.hide()}})}updatePagination(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage);
389let e=5,r=Math.max(1,this.currentPage-Math.floor(e/2)),a=r+e-1;a>this.totalPages&&(a=this.totalPages,r=Math.max(1,a-e+1)),this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}prevPage(){this.currentPage>1&&(this.currentPage--,this.loadRegisteredQrCodes())}nextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.loadRegisteredQrCodes())}goToPage(e){this.currentPage!==e&&(this.currentPage=e,this.loadRegisteredQrCodes())}onSubmit(){if(this.qrCodeForm.valid){let e=this.qrCodeForm.get("qrCode")?.value;this.spinner.show(),this.admissionsService.saveQrCode(e).subscribe({next:r=>{r.statusCode===200?(this.toastr.success("QR Code registered successfully!","Success"),this.qrCodeForm.reset(),this.loadRegisteredQrCodes(),this.closeModal()):this.toastr.error(r.message??"Failed to register QR Code","Error"),this.spinner.hide()},error:r=>{console.error("Error registering QR Code:",r),this.toastr.error(r.error.message??"Failed to register QR Code","Error"),this.spinner.hide(),this.closeModal()}})}else this.toastr.warning("Please enter a valid QR Code","Warning")}prepareDelete(e){this.selectedQrCode=e}confirmDelete(){this.selectedQrCode&&(this.spinner.show(),this.admissionsService.deleteQrCode(this.selectedQrCode.qr_code).subscribe({next:e=>{e.statusCode===200?(this.toastr.success("QR Code deleted successfully!","Success"),this.loadRegisteredQrCodes(),this.closeDeleteModal()):(console.log(e.message),this.toastr.error(e.message??"Failed to delete QR Code","Error")),this.spinner.hide(),this.selectedQrCode=null},error:e=>{console.error("Error deleting QR Code:",e),this.toastr.error(e.error.message??"Failed to delete QR Code","Error"),this.spinner.hide(),this.selectedQrCode=null,this.closeDeleteModal()}}))}closeModal(){this.modal&&this.modal.hide()}closeDeleteModal(){this.deleteModal&&(this.deleteModal.hide(),this.selectedQrCode=null)}};n.\u0275fac=function(r){return new(r||n)(x(Qr),x(ce),x(Hr),x(pe),x(me),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-register-qr-code"]],standalone:!1,decls:90,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[3,"formGroup"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","text","formControlName","qrCode","placeholder","Enter QR value",1,"form-control",3,"readOnly"],[1,"exportBtns"],["type","button","data-bs-toggle","modal","data-bs-target","#confirmQrModal",1,"btn","btn-outline-primary","withIcon","me-2",3,"disabled"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-center"],[1,"tbody"],[4,"ngFor","ngForOf"],[4,"ngIf"],["aria-label","Page navigation"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],["id","confirmQrModal","tabindex","-1","aria-labelledby","confirmQrModalLabel","role","dialog",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],["id","confirmQrModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close",3,"click"],[1,"modal-body"],[1,"card"],[1,"card-body"],[1,"mb-0","text-muted"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],["id","confirmDeleteModal","tabindex","-1","aria-labelledby","confirmDeleteModalLabel","role","dialog",1,"modal","fade"],["id","confirmDeleteModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn","btn-outline-danger",3,"click"],[1,"badge",3,"ngClass"],["data-bs-toggle","modal","data-bs-target","#confirmDeleteModal","title","Delete QR Code",1,"btn","btn-sm","btn-outline-danger","withIcon",3,"click","disabled"],[1,"fas","fa-trash"],["colspan","5",1,"text-center"],[1,"page-link",3,"click"]],template:function(r,a){if(r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Register QR Code"),o()()(),s(5,"form",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"label",7),l(10,"QR Code"),o(),B(11,"input",8),o(),s(12,"div",9)(13,"button",10)(14,"span",11),l(15,"save"),o(),l(16," Save "),o()()()()(),s(17,"div",12)(18,"div",13)(19,"div",14)(20,"div",15)(21,"table",16)(22,"thead",17)(23,"tr")(24,"th"),l(25,"#Serial"),o(),s(26,"th"),l(27,"QR Code"),o(),s(28,"th"),l(29,"Registration Date"),o(),s(30,"th",18),l(31,"Status"),o(),s(32,"th",18),l(33,"Actions"),o()()(),s(34,"tbody",19),T(35,fSe,15,10,"tr",20)(36,gSe,3,0,"tr",21),o()()()()(),s(37,"nav",22)(38,"ul",23)(39,"li",24)(40,"button",25),S("click",function(){return a.prevPage()}),s(41,"span",26),l(42,"\xAB"),o()()(),T(43,vSe,3,3,"li",27),s(44,"li",24)(45,"button",25),S("click",function(){return a.nextPage()}),s(46,"span",26),l(47,"\xBB"),o()()()()()()(),s(48,"div",28)(49,"div",29)(50,"div",30)(51,"div",31)(52,"h5",32),l(53," Confirm QR Code Registration "),o(),s(54,"button",33),S("click",function(){return a.closeModal()}),o()(),s(55,"div",34)(56,"div",35)(57,"div",36)(58,"p")(59,"strong"),l(60,"QR Code:"),o(),l(61),o(),s(62,"p",37),l(63," Are you sure you want to register this QR code? "),o()()()(),s(64,"div",38)(65,"button",39),S("click",function(){return a.closeModal()}),l(66," Cancel "),o(),s(67,"button",40),S("click",function(){return a.onSubmit()}
389),l(68," Confirm "),o()()()()(),s(69,"div",41)(70,"div",29)(71,"div",30)(72,"div",31)(73,"h5",42),l(74," Confirm QR Code Deletion "),o(),s(75,"button",33),S("click",function(){return a.closeDeleteModal()}),o()(),s(76,"div",34)(77,"div",35)(78,"div",36)(79,"p")(80,"strong"),l(81,"QR Code:"),o(),l(82),o(),s(83,"p",37),l(84," Are you sure you want to delete this QR code? This action cannot be undone. "),o()()()(),s(85,"div",38)(86,"button",39),S("click",function(){return a.closeDeleteModal()}),l(87," Cancel "),o(),s(88,"button",43),S("click",function(){return a.confirmDelete()}),l(89," Delete "),o()()()()()),r&2){let c,d;p("ngClass",Z(20,hSe,a.isCollapsed)),m(5),p("formGroup",a.qrCodeForm),m(6),Re("is-invalid",((c=a.qrCodeForm.get("qrCode"))==null?null:c.invalid)&&((c=a.qrCodeForm.get("qrCode"))==null?null:c.touched)),p("readOnly",a.isAccountant||a.isOfficeUser),m(2),p("disabled",a.qrCodeForm.invalid)("disabled",a.isAccountant||a.isOfficeUser),m(22),p("ngForOf",a.registeredQrCodes),m(),p("ngIf",a.registeredQrCodes.length===0),m(3),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages),m(3),He("aria-hidden",!1),m(13),_(" ",(d=a.qrCodeForm.get("qrCode"))==null?null:d.value," "),m(8),He("aria-hidden",!1),m(13),_(" ",a.selectedQrCode==null?null:a.selectedQrCode.qr_code)}},dependencies:[ue,_e,Dt,Ni,Ke,Ne,Oi,wr,$r,St],styles:[".badge[_ngcontent-%COMP%]{padding:.5em .75em;font-weight:500;border-radius:4px;font-size:.875rem;line-height:1.5;text-transform:capitalize;min-width:80px;text-align:center;display:inline-block}.badge.bg-success[_ngcontent-%COMP%]{background-color:#28a745!important;color:#fff}.badge.bg-danger[_ngcontent-%COMP%]{background-color:#555353!important;color:#fff}.pagination[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:20px}.page-btn[_ngcontent-%COMP%]{padding:5px 10px;margin:0 5px;border:1px solid #d8e2ef;background-color:#fff;color:#333;cursor:pointer;transition:background-color .3s,color .3s}.page-btn[_ngcontent-%COMP%]:hover{background-color:#2873ff;color:#fff}.page-btn.active[_ngcontent-%COMP%]{background-color:#2873ff;color:#fff;border-color:#2873ff;font-weight:700}.page-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.page-btn[_ngcontent-%COMP%]:disabled:hover{background-color:#fff;color:#333}input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#dc3545}.btn.btn-sm[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.875rem}.btn.withIcon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem}@media (max-width: 768px){.table-responsive[_ngcontent-%COMP%]{margin:0 -15px}.pagination[_ngcontent-%COMP%]{margin:15px 0}}"]});let i=n;return i})();var W9=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.ambuluwawaBackendUrl}sendBulkSms(e,r){let a={phoneNumbers:e,message:r},c=new xe({"Content-Type":"application/json",path:"sms/send-bulk"});return this.http.post(this.apiUrl,a,{headers:c}).pipe(Fn(d=>(console.error("Error sending SMS:",d),fr(()=>d))))}getGuides(){let e=new xe({"Content-Type":"application/json",path:"user/guide/get-for-mobile"});return this.http.post(this.apiUrl,{},{headers:e}).pipe(Fn(r=>(console.error("Error fetching guides:",r),fr(()=>r))))}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ySe=i=>({collapsed:i}),SSe=i=>({"is-invalid":i}),bSe=()=>({standalone:!0});function xSe(i,n){i&1&&(s(0,"div"),l(1,"Message is required"),o())}function CSe(i,n){i&1&&(s(0,"div"),l(1,"Message must be at least 10 characters long"),o())}function ESe(i,n){if(i&1&&(s(0,"div",41),T(1,xSe,2,0,"div",42)(2,CSe,2,0,"div",42),o()),i&2){let t,e,r=w();m(),p("ngIf",(t=r.messageForm.get("message"))==null||t.errors==null?null:t.errors.required),m(),p("ngIf",(e=r.messageForm.get("message"))==null||e.errors==null?null:e.errors.minlength)}}function wSe(i,n){if(i&1&&(s(0,"option",43),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.name," ")}}
389function TSe(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){let r=U(t).$implicit,a=w();return j(a.toggleContact(r))}),s(1,"div",45)(2,"div",46)(3,"input",47),S("click",function(r){let a=U(t).$implicit;return w().toggleContact(a),j(r.stopPropagation())}),o()(),s(4,"div",48)(5,"div",49),l(6),o(),s(7,"div",50),l(8),o()()()()}if(i&2){let t=n.$implicit,e=w();Re("selected",e.isSelected(t)),m(3),p("checked",e.isSelected(t)),m(3),b(t.name),m(2),j_(" Guide ID: ",t.guideId," | Phone: ",t.phoneNumber," | District: ",t.district," ")}}function DSe(i,n){i&1&&(s(0,"li",61)(1,"span",62),l(2,"..."),o()())}function ISe(i,n){if(i&1){let t=he();s(0,"li",53)(1,"button",63),S("click",function(){let r=U(t).$implicit,a=w(2);return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w(2);Re("active",t===e.currentPage),m(2),b(t)}}function kSe(i,n){i&1&&(s(0,"li",61)(1,"span",62),l(2,"..."),o()())}function MSe(i,n){if(i&1){let t=he();s(0,"div",51)(1,"ul",52)(2,"li",53)(3,"button",54),S("click",function(){U(t);let r=w();return j(r.goToPage(1))}),s(4,"span",55),l(5,"\xAB\xAB"),o()()(),s(6,"li",53)(7,"button",56),S("click",function(){U(t);let r=w();return j(r.prevPage())}),s(8,"span",55),l(9,"\xAB"),o()()(),T(10,DSe,3,0,"li",57)(11,ISe,3,3,"li",58)(12,kSe,3,0,"li",57),s(13,"li",53)(14,"button",59),S("click",function(){U(t);let r=w();return j(r.nextPage())}),s(15,"span",55),l(16,"\xBB"),o()()(),s(17,"li",53)(18,"button",60),S("click",function(){U(t);let r=w();return j(r.goToPage(r.totalPages))}),s(19,"span",55),l(20,"\xBB\xBB"),o()()()()()}if(i&2){let t=w();m(2),Re("disabled",t.currentPage===1),m(),p("disabled",t.currentPage===1),m(3),Re("disabled",t.currentPage===1),m(),p("disabled",t.currentPage===1),m(3),p("ngIf",t.startPage>1),m(),p("ngForOf",t.getVisiblePages()),m(),p("ngIf",t.endPage<t.totalPages),m(),Re("disabled",t.currentPage===t.totalPages),m(),p("disabled",t.currentPage===t.totalPages),m(3),Re("disabled",t.currentPage===t.totalPages),m(),p("disabled",t.currentPage===t.totalPages)}}function ASe(i,n){i&1&&B(0,"span",77)}function PSe(i,n){if(i&1){let t=he();s(0,"div",64)(1,"div",65)(2,"div",66)(3,"div",67)(4,"div",68)(5,"h5",69),l(6,"Confirm Message"),o(),s(7,"button",70),S("click",function(){U(t);let r=w();return j(r.cancelSend())}),o()(),s(8,"div",71)(9,"p",72),l(10),o()(),s(11,"div",73)(12,"button",74),S("click",function(){U(t);let r=w();return j(r.cancelSend())}),l(13," Cancel "),o(),s(14,"button",36),S("click",function(){U(t);let r=w();return j(r.confirmSend())}),T(15,ASe,1,0,"span",75),l(16),o()()()()(),B(17,"div",76),o()}if(i&2){let t=w();m(7),p("disabled",t.isSending),m(3),_(" Are you sure you want to send this message to ",t.selectedContacts.length," contacts? "),m(2),p("disabled",t.isSending),m(2),p("disabled",t.isSending),m(),p("ngIf",t.isSending),m(),_(" ",t.isSending?"Sending...":"Confirm"," ")}}var H9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.fb=e,this.sidebarService=r,this.smsService=a,this.toastr=c,this.spinner=d,this.cdr=u,this.contacts=[],this.filteredContacts=[],this.selectedContacts=[],this.searchTerm="",this.selectedDistrict="All Districts",this.showConfirmationDialog=!1,this.isCollapsed=!1,this.isSending=!1,this.Math=Math,this.districts=[],this.availableDistricts=[],this.currentPage=1,this.itemsPerPage=10,this.totalItems=0,this.totalPages=0,this.displayedContacts=[],this.startPage=1,this.endPage=1,this.messageForm=this.fb.group({message:["",[At.required,At.minLength(10)]]})}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.initializeDistricts(),this.loadGuides()}initializeDistricts(){let e=Object.values($h).flat();this.districts=[{id:"All Districts",name:"All Districts"},...e.map(r=>({id:r.name,name:r.name}))],this.availableDistricts=[...this.districts]}loadGuides(){this.spinner.show(),this.smsService.getGuides().pipe(xl(()=>this.spinner.hide())).subscribe({next:e=>{e.status==="success"&&e.data.GuideList?(this.contacts=e.data.GuideList.map(r=>({id:r.id,name:`${r.firstname} ${r.lastname}`,guideId:r.usercode,phoneNumber:r.phonenumber,district:r.district})),this.filteredContacts=[...this.contacts],this.updateAvailableDistricts(),this.initializePagination(),this.clearFilters()):this.toastr.error("Failed to load guides","Error")},error:e=>{console.error("Error loading guides:",e),this.toastr.error("Failed to load guides","Error")}})}updateAvailableDistricts(){let e=[...new Set(this.contacts.map(r=>r.district))];this.availableDistricts=[{id:"All Districts",name:"All Districts"},...e.map(r=>({id:r,name:r}))]}applyFilters(){let e=[...this.contacts];if(this.searchTerm){let r=this.searchTerm.toLowerCase();e=e.filter(a=>a.name.toLowerCase().includes(r)||a.guideId.toLowerCase().includes(r)||a.phoneNumber.includes(r))}this.selectedDistrict&&this.selectedDistrict!=="All Districts"&&(e=e.filter(r=>{let a=this.normalizeDistrictName(r.district),c=this.normalizeDistrictName(this.selectedDistrict);return a===c})),this.filteredContacts=[...e],this.currentPage=1,this.initializePagination(),this.cdr.detectChanges(),setTimeout(()=>{this.cdr.detectChanges()},0)}initializePagination(){this.totalItems=this.filteredContacts.length,this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage),this.updatePagination(),this.updateDisplayedContacts()}updatePagination(){let r=Math.floor(5);this.startPage=Math.max(1,this.currentPage-r),this.endPage=Math.min(this.totalPages,this.startPage+10-1),this.endPage-this.startPage<9&&(this.startPage=Math.max(1,this.endPage-10+1))}updateDisplayedContacts(){let e=(this.currentPage-1)*this.itemsPerPage,r=Math.min(e+this.itemsPerPage,this.filteredContacts.length);this.displayedContacts=[],this.cdr.detectChanges(),this.displayedContacts=[...this.filteredContacts.slice(e,r)],this.cdr.detectChanges()}getVisiblePages(){let e=[];for(let r=this.startPage;r<=this.endPage;r++)e.push(r);return e}onSearch(e){this.searchTerm=e.target.value,this.applyFilters()}onDistrictChange(){this.applyFilters()}goToPage(e){e>=1&&e<=this.totalPages&&(this.currentPage=e,this.updatePagination(),this.updateDisplayedContacts())}prevPage(){this.currentPage>1&&this.goToPage(this.currentPage-1)}nextPage(){this.currentPage<this.totalPages&&this.goToPage(this.currentPage+1)}toggleContact(e){let r=this.selectedContacts.findIndex(a=>a.id===e.id);r===-1?this.selectedContacts.push(e):this.selectedContacts.splice(r,1),this.cdr.detectChanges()}toggleAll(){this.selectedContacts.length===this.filteredContacts.length?this.selectedContacts=[]:this.selectedContacts=[...this.filteredContacts],this.cdr.detectChanges()}clearFilters(){this.searchTerm="",this.selectedDistrict="All Districts",this.applyFilters();let e=document.querySelector('input[placeholder*="Search by name"]');e&&(e.value="")}normalizeDistrictName(e){if(!e)return"";let r=e.trim().toLowerCase();return{kaluthara:"kalutara",mathara:"matara",kurunagala:"kurunegala",mullaitivu:"mullativu",trincomalee:"trincomalee",batticaloa:"batticaloa",anuradhapura:"anuradhapura",polonnaruwa:"polonnaruwa",badulla:"badulla",monaragala:"monaragala",ratnapura:"ratnapura",kegalle:"kegalle",colombo:"colombo",gampaha:"gampaha",kandy:"kandy",matale:"matale","nuwara eliya":"nuwara eliya",galle:"galle",hambantota:"hambantota",jaffna:"jaffna",kilinochchi:"kilinochchi",vavuniya:"vavuniya",ampara:"ampara"}[r]||r}isSelected(e){return this.selectedContacts.some(r=>r.id===e.id)}openConfirmationDialog(){this.messageForm.valid&&this.selectedContacts.length>0?this.showConfirmationDialog=!0:(this.messageForm.valid||this.toastr.warning("Please enter a valid message (minimum 10 characters)","Validation Error"),this.selectedContacts.length===0&&this.toastr.warning("Please select at least one recipient","Validation Error"))}confirmSend(){if(this.messageForm.valid&&this.selectedContacts.length>0){this.isSending=!0,this.spinner.show();let e=this.selectedContacts.map(a=>a.phoneNumber),r=this.messageForm.get("message")?.value;this.smsService.sendBulkSms(e,r).pipe(xl(()=>{this.isSending=!1,this.spinner.hide()})).subscribe({next:a=>{a.data.response.success===!0?(this.toastr.success(`Successfully sent message to ${this.selectedContacts.length} recipients`,"Success"),this.messageForm.reset(),this.selectedContacts=[],this.clearFilters()):this.toastr.error(a.message||"Failed to send SMS messages","Error"),this.showConfirmationDialog=!1},error:a=>{console.error("Error sending SMS:",a);let c=a.error?.message||"Failed to send SMS messages";this.toastr.error(c,"Error"),this.showConfirmationDialog=!1}})}}cancelSend(){this.isSending||(this.showConfirmationDialog=!1)}get isButtonEnabled(){let e=this.messageForm.valid,r=this.selectedContacts.length>0,a=!this.isSending;return e&&r&&a}onMessageInput(){this.messageForm.get("message")?.markAsTouched(),this.messageForm.updateValueAndValidity(),this.cdr.detectChanges()}onContactListScroll(e){e.stopPropagation()}trackByContact(e,r){return r.id}};n.\u0275fac=function(r){return new(r||n)(x(Qr),x(ce),x(W9),x(me),x(pe),x(Kn))},n.\u0275cmp=te({type:n,selectors:[["app-sms-broadcast"]],standalone:!1,decls:60,vars:21,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body","addContent-wrapper"],[1,"row","justify-content-center"],[1,"col-md-10","card-wrapper"],[1,"cardTitle"],[1,"card-ccontent"],[3,"formGroup"],[1,"form-group"],[1,"form-label"],[1,"required"],["rows","4","formControlName","message","placeholder","Enter your message here...",1,"form-control",3,"input","ngClass"],["class","invali
389d-feedback d-block",4,"ngIf"],[1,"form-group","mt-4"],[1,"form-label","mb-3"],[1,"row","mb-3","align-items-end"],[1,"col-md-4"],[1,"search-box"],[1,"input-group"],[1,"input-group-text"],[1,"material-icons-outlined"],["type","text","placeholder","Search by name, guide ID, or phone number...",1,"form-control",3,"input"],[1,"col-md-3"],[1,"district-filter"],[1,"form-select",3,"ngModelChange","change","ngModel","ngModelOptions"],[3,"value",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"col-md-2"],["type","button",1,"btn","btn-outline-secondary","withIcon",3,"click"],[1,"contact-list-container",3,"wheel"],[1,"contact-list"],["class","contact-item",3,"selected","click",4,"ngFor","ngForOf","ngForTrackBy"],["class","pagination-container mt-3",4,"ngIf"],[1,"text-end","mt-4"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"material-icons-outlined","me-1"],["class","modal-overlay",4,"ngIf"],["bdColor","rgba(0, 0, 0, 0.8)","size","medium","color","#fff","type","ball-clip-rotate",3,"fullScreen"],[2,"color","white"],[1,"invalid-feedback","d-block"],[4,"ngIf"],[3,"value"],[1,"contact-item",3,"click"],[1,"d-flex","align-items-center"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"click","checked"],[1,"contact-details","ms-2"],[1,"contact-name"],[1,"contact-info"],[1,"pagination-container","mt-3"],[1,"pagination","justify-content-center","mb-0"],[1,"page-item"],["title","First Page",1,"page-link",3,"click","disabled"],["aria-hidden","true"],["title","Previous Page",1,"page-link",3,"click","disabled"],["class","page-item disabled",4,"ngIf"],["class","page-item",3,"active",4,"ngFor","ngForOf"],["title","Next Page",1,"page-link",3,"click","disabled"],["title","Last Page",1,"page-link",3,"click","disabled"],[1,"page-item","disabled"],[1,"page-link"],[1,"page-link",3,"click"],[1,"modal-overlay"],["tabindex","-1",1,"modal","fade","show","d-block"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-0"],[1,"modal-title"],["type","button",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-0"],[1,"modal-footer","justify-content-center","border-0"],["type","button",1,"btn","btn-secondary",3,"click","disabled"],["class","spinner-border spinner-border-sm me-2","role","status","aria-hidden","true",4,"ngIf"],[1,"modal-backdrop","fade","show"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","me-2"]],template:function(r,a){if(r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"SMS Broadcast"),o(),s(5,"div",3),l(6,"Send Messages to Multiple Contacts"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7),l(11,"Send SMS Message"),o(),s(12,"div",8)(13,"form",9)(14,"div",10)(15,"label",11),l(16,"Message "),s(17,"span",12),l(18,"*"),o()(),s(19,"textarea",13),S("input",function(){return a.onMessageInput()}),o(),T(20,ESe,3,2,"div",14),o(),s(21,"div",15)(22,"label",16),l(23,"Filter Recipients "),s(24,"span",12),l(25,"*"),o()(),s(26,"div",17)(27,"div",18)(28,"div",19)(29,"div",20)(30,"span",21)(31,"span",22),l(32,"search"),o()(),s(33,"input",23),S("input",function(d){return a.onSearch(d)}),o()()()(),s(34,"div",24)(35,"div",25)(36,"select",26),X("ngModelChange",function(d){return K(a.selectedDistrict,d)||(a.selectedDistrict=d),d}),S("change",function(){return a.onDistrictChange()}),T(37,wSe,2,2,"option",27),o()()(),s(38,"div",24)(39,"button",28),S("click",function(){return a.toggleAll()}),s(40,"span",22),l(41,"select_all"),o(),l(42),o()(),s(43,"div",29)(44,"button",30),S("click",function(){return a.clearFilters()}),s(45,"span",22),l(46,"restart_alt"),o(),l(47," Reset "),o()()(),s(48,"div",31),S("wheel",function(d){return a.onContactListScroll(d)}),s(49,"div",32),T(50,TSe,9,7,"div",33),o()(),T(51,MSe,21,15,"div",34),o(),s(52,"div",35)(53,"button",36),S("click",function(){return a.openConfirmationDialog()}),s(54,"span",37),l(55,"send"),o(),l(56),o()()()()()()(),T(57,PSe,18,6,"div",38),s(58,"ngx-spinner",39),B(59,"p",40),o()()),r&2){let c,d;p("ngClass",Z(16,ySe,a.isCollapsed)),m(13),p("formGroup",a.messageForm),m(6),p("ngClass",Z(18,SSe,((c=a.messageForm.get("message"))==null?null:c.invalid)&&((c=a.messageForm.get("message"))==null?null:c.touched))),m(),p("ngIf",((d=a.messageForm.get("message"))==null?null:d.invalid)&&((d=a.messageForm.get("message"))==null?null:d.touched)),m(16),q("ngModel",a.selectedDistrict),p("ngModelOptions",Bu(20,bSe)),m(),p("ngForOf",a.availableDistricts),m(5),Pi(" ",a.selectedContacts.length===a.filteredContacts.length?"Deselect All":"Select All"," (",a.filteredContacts.length,") "),m(8),p("ngForOf",a.displayedContacts)("ngForTrackBy",a.trackByContact),m(),p("ngIf",a.totalPages>1),m(2),p("disabled",!a.isButtonEnabled),m(3),_(" ",a.isSending?"Sending...":"Send Message"," "),m(),p("ngIf",a.showConfirmationDialog),m(),p("fullScreen",!0)}},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,Ot,Ne,Oi,Le,wr,$r,wo],styles:[".mainContainer[_ngcontent-%COMP%]{background-color:#edf3fe;padding:20px;min-height:100vh;transition:all .3s ease;margin-left:250px;position:relative}.mainContainer.collapsed[_ngcontent-%COMP%]{margin-left:80px}@media (max-width: 768px){.mainContainer[_ngcontent-%COMP%]{margin-left:20px;padding:15px}.mainContainer.collapsed[_ngcontent-%COMP%]{margin-left:20px}}.header[_ngcontent-%COMP%]{margin-bottom:20px}.header[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#333}.header[_ngcontent-%COMP%] .transaction-log[_ngcontent-%COMP%]{font-size:14px;color:#666}.card-wrapper[_ngcontent-%COMP%]{background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;padding:20px;margin-bottom:20px}.cardTitle[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#333;margin-bottom:20px;padding-bottom:10px;border-bottom:1px solid #eee}.form-group[_ngcontent-%COMP%]{margin-bottom:20px}.form-label[_ngcontent-%COMP%]{font-weight:500;color:#333;margin-bottom:8px}.form-label[_ngcontent-%COMP%] .required[_ngcontent-%COMP%]{color:#dc3545}.search-box[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{background-color:#fff;border-right:none;color:#666;height:38px}.search-box[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{border-left:none;height:38px}.search-box[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{box-shadow:none;border-color:#ced4da}.district-filter[_ngcontent-%COMP%] .form-select[_ngcontent-%COMP%]{border:1px solid #dee2e6;border-radius:4px;padding:.375rem .75rem;font-size:14px;color:#495057;background-color:#fff;height:38px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.district-filter[_ngcontent-%COMP%] .form-select[_ngcontent-%COMP%]:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.district-filter[_ngcontent-%COMP%] .form-select[_ngcontent-%COMP%]:hover{border-color:#adb5bd}.btn.withIcon[_ngcontent-%COMP%]{height:38px;display:flex;align-items:center;justify-content:center}@media (max-width: 768px){.search-box[_ngcontent-%COMP%], .district-filter[_ngcontent-%COMP%]{margin-bottom:10px}.btn-outline-secondary[_ngcontent-%COMP%] .material-icons-outlined[_ngcontent-%COMP%]{font-size:16px}}.contact-list-container[_ngcontent-%COMP%]{border:1px solid #dee2e6;border-radius:4px;max-height:400px;overflow-y:auto;overflow-x:hidden}.contact-list[_ngcontent-%COMP%] .contact-item[_ngcontent-%COMP%]{padding:12px 15px;border-bottom:1px solid #eee;cursor:pointer;transition:background-color .2s ease}.contact-list[_ngcontent-%COMP%] .contact-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.contact-list[_ngcontent-%COMP%] .contact-item[_ngcontent-%COMP%]:hover{background-color:#f8f9fa}.contact-list[_ngcontent-%COMP%] .contact-item.selected[_ngcontent-%COMP%]{background-color:#e8f0fe}.contact-list[_ngcontent-%COMP%] .contact-item[_ngcontent-%COMP%] .contact-name[_ng
389content-%COMP%]{font-weight:500;color:#333}.contact-list[_ngcontent-%COMP%] .contact-item[_ngcontent-%COMP%] .contact-info[_ngcontent-%COMP%]{font-size:12px;color:#666}.pagination-container[_ngcontent-%COMP%]{padding:10px 0}.pagination-container[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%]{margin-bottom:0}.pagination-container[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:#007bff;border:1px solid #dee2e6;padding:.375rem .75rem}.pagination-container[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]:hover{background-color:#e9ecef}.pagination-container[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] .page-item.active[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{background-color:#007bff;border-color:#007bff;color:#fff}.pagination-container[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] .page-item.disabled[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:#6c757d;pointer-events:none;background-color:#fff;border-color:#dee2e6}.modal-overlay[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1050;display:flex;align-items:center;justify-content:center}.modal[_ngcontent-%COMP%]{position:relative;z-index:1055}.modal.fade.show[_ngcontent-%COMP%]{display:block}.modal[_ngcontent-%COMP%] .modal-dialog[_ngcontent-%COMP%]{max-width:500px;margin:1.75rem auto}.modal[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{border:none;border-radius:8px;background-color:#fff;position:relative;z-index:1056}.modal[_ngcontent-%COMP%] .modal-header[_ngcontent-%COMP%]{padding:1rem 1.5rem;background-color:#fff;border-top-left-radius:8px;border-top-right-radius:8px}.modal[_ngcontent-%COMP%] .modal-header[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%]{padding:1rem;margin:-.5rem -.5rem -.5rem auto}.modal[_ngcontent-%COMP%] .modal-header[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%]:hover{opacity:.75}.modal[_ngcontent-%COMP%] .modal-header[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%]:disabled{opacity:.25}.modal[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{padding:1.5rem;background-color:#fff}.modal[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%]{padding:1rem 1.5rem;background-color:#fff;border-bottom-left-radius:8px;border-bottom-right-radius:8px}.modal[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{min-width:100px}.modal[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:not(:last-child){margin-right:.5rem}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1040}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.5rem 1rem;font-weight:500}.btn.btn-primary[_ngcontent-%COMP%]{background-color:#007bff;border-color:#007bff}.btn.btn-primary[_ngcontent-%COMP%]:hover{background-color:#0056b3;border-color:#0056b3}.btn.btn-primary[_ngcontent-%COMP%]:disabled{background-color:#6c757d;border-color:#6c757d}.btn.btn-outline-primary[_ngcontent-%COMP%]{color:#007bff;border-color:#007bff}.btn.btn-outline-primary[_ngcontent-%COMP%]:hover{background-color:#007bff;color:#fff}.material-icons-outlined[_ngcontent-%COMP%]{font-size:18px;line-height:1}"]});let i=n;return i})();var VI=Di(Ti());var FSe=i=>({collapsed:i});function RSe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function OSe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function NSe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var G9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.paddleBoatService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}
389onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.paddleBoatService.getMonthlyFoodSalesSummary(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.paddleBoatService.getMonthlyFoodSalesSummaryExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Paddle Boat Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,VI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.paddleBoatService.getMonthlyFoodSalesSummaryPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Paddle Boat Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,VI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Qa))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-food-sales-summary"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Food Sales Summary"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,RSe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,OSe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(28,"span",14),l(29,"description"),o(),l(30,"PDF "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}),s(32,"span",14),l(33,"description"),o(),l(34,"Excel "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,NSe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,FSe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var UI=Di(Ti());var LSe=i=>({collapsed:i});function BSe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),I(5,"currencyFormat"),o(),s(6,"td"),l(7),I(8,"currencyFormat"),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),o(),s(20,"td"),l(21),o()()),i&2){let t=n.$implicit;m(2),_("#",t.ticket_id),m(2),b(M(5,8,t.amount)),m(3),b(M(8,10,t.discount)),m(3),b(M(11,12,t.total)),m(3),b(M(14,14,t.cash_amount)),m(3),b(M(17,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var $9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.paddleBoatService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.paddleBoatService.getDailyFoodSalesSummary(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.paddleBoatService.getDailyFoodSalesSummaryPDF(this.selectedDate).subscribe({next:e=>{let r=`Paddle Boat Daily Sales ${this.selectedDate}.pdf`;(0,UI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.paddleBoatService.getDailyFoodSalesSummaryExcel(this.selectedDate).subscribe({next:e=>{let r=`Paddle Boat Daily Sales ${this.selectedDate}.xlsx`;(0,UI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Qa),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-food-sales-summary"]],standalone:!1,decls:77,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","3"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Daily Food Sales Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o()()(),s(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"table",17)(32,"thead",18)(33,"tr")(34,"th"),l(35,"#Serial"),o(),s(36,"th"),l(37,"Amount"),o(),s(38,"th"),l(39,"Discount"),o(),s(40,"th"),l(41,"Total"),o(),s(42,"th"),l(43,"Cash"),o(),s(44,"th"),l(45,"Card"),o(),s(46,"th"),l(47,"Card Last4"),o(),s(48,"th"),l(49,"Remark"),o()()(),s(50,"tbody",19),T(51,BSe,22,18,"tr",20),o(),s(52,"tfoot")(53,"tr")(54,"td")(55,"strong"),l(56,"Totals:"),o()(),s(57,"td")(58,"strong"),l(59),I(60,"currencyFormat"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td",21)(74,"strong"),l(75),I(76,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(20,LSe,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(39),p("ngForOf",a.tickets),m(8),b(M(60,10,a.total.Amount)),m(4),b(M(64,12,a.total.Discount)),m(4),b(M(68,14,a.total.Total)),m(4),b(M(72,16,a.total.Cash)),m(4),b(M(76,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var z9=Di(Ti());var VSe=["reviewModal"],USe=["invoiceContent"],jSe=i=>({collapsed:i}),WSe=(i,n,t,e)=>({approved:i,rejected:n,hold:t,"in-review":e});
389function HSe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function GSe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function $Se(i,n){if(i&1){let t=he();s(0,"button",60),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.generatePDF(r))}),s(1,"i",14),l(2,"picture_as_pdf"),o()()}}function zSe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),o(),s(11,"td",23)(12,"span",56),l(13),o()(),s(14,"td",24),l(15),I(16,"currencyFormat"),o(),s(17,"td",23)(18,"div",57)(19,"button",58),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onReviewClick(r))}),s(20,"i",14),l(21,"visibility"),o()(),T(22,$Se,3,0,"button",59),o()()()}if(i&2){let t=n.$implicit,e=w();m(2),b(t.guide_id),m(2),b(t.bank_code),m(2),b(t.bank_branch_code),m(2),b(t.bank_account_number),m(2),b(t.bank_account_name),m(2),p("ngClass",El(11,WSe,t.status==="approved",t.status==="rejected",t.status==="hold",!t.status)),m(),_(" ",e.getStatusLabel(t.status)," "),m(2),_("",M(16,9,t.expense),"/-"),m(7),p("ngIf",t.status==="approved")}}function YSe(i,n){if(i&1&&(s(0,"p"),l(1),o()),i&2){let t=w(2);m(),_(" ",t.guideDetails==null?null:t.guideDetails.address_line_2," ")}}function qSe(i,n){if(i&1&&(s(0,"div",67)(1,"div",68),l(2),I(3,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(2),W_(" ",t.name," (",t.country,") - ",t.count," x LKR ",M(3,4,t.price)," ")}}function KSe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div",63),l(3),I(4,"date"),o(),s(5,"div",64),T(6,qSe,4,6,"div",65),o()(),s(7,"td",66),l(8),I(9,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(3),Pi(" ",Jt(4,4,t.issueddate,"MMM dd, yyyy hh:mm a")," - Entrance Ticket# ",t.serialnumber," "),m(3),p("ngForOf",t.visitordetails),m(2),_(" ",M(9,7,t.visitortotal)," ")}}function XSe(i,n){if(i&1&&(s(0,"div",41)(1,"div",42)(2,"div",43)(3,"div",44)(4,"p",45),l(5,"from"),o(),s(6,"h6"),l(7,"Ambuluwawa Biodiversity Complex"),o(),s(8,"p"),l(9,"Gampola 20500"),o(),s(10,"p"),l(11,"Sri Lanka"),o(),s(12,"p"),l(13,"+94 71 272 4724"),o(),s(14,"p"),l(15,"[email protected]"),o()(),s(16,"div",46)(17,"p",45),l(18,"to"),o(),s(19,"h6"),l(20),o(),s(21,"p"),l(22),o(),T(23,YSe,2,1,"p",47),s(24,"p"),l(25),o(),s(26,"p"),l(27),o(),s(28,"p"),l(29),o()(),s(30,"div",48)(31,"p",45),l(32,"Statement / Period"),o(),s(33,"h6"),l(34),o(),s(35,"p"),l(36),o(),s(37,"p"),l(38),o(),s(39,"p"),l(40,"REF Expenses"),o()()()(),s(41,"div",49)(42,"div",20)(43,"table",21)(44,"thead")(45,"tr")(46,"th"),l(47,"DESCRIPTION"),o(),s(48,"th",24),l(49,"SUB TOTAL (LKR)"),o()()(),s(50,"tbody"),T(51,KSe,10,9,"tr",11),o()()()(),s(52,"div",50)(53,"div",51)(54,"div",52)(55,"small"),l(56,"Total Amount (LKR):"),o(),s(57,"span",53),l(58),I(59,"currencyFormat"),o()()(),s(60,"div",54)(61,"div",52)(62,"small"),l(63,"Total expense (LKR):"),o(),s(64,"span",55),l(65),I(66,"currencyFormat"),o()()()(),s(67,"div",61)(68,"p"),B(69,"i",62),l(70," ambuluwawa.com"),o()()()),i&2){let t=w();m(20),Pi(" ",t.guideDetails==null?null:t.guideDetails.firstname," ",t.guideDetails==null?null:t.guideDetails.lastname," "),m(2),b(t.guideDetails==null?null:t.guideDetails.address_line_1),m(),p("ngIf",t.guideDetails==null?null:t.guideDetails.address_line_2),m(2),Pi("",t.guideDetails==null?null:t.guideDetails.city,", ",t.guideDetails==null?null:t.guideDetails.postal_code),m(2),b(t.guideDetails==null?null:t.guideDetails.country),m(2),b(t.guideDetails==null?null:t.guideDetails.phone),m(5),_("Statement ID: ",t.userCode),m(2),Pi("",t.selectedMonth," ",t.selectedYear),m(2),_("Guide# ",t.userCode),m(13),p("ngForOf",t.transactionData),m(7),_(" ",M(59,15,t.calculateTotals().totalAmount),"/- "),m(7),_(" ",M(66,17,t.calculateTotals().totalExpense),"/- ")}}function JSe(i,n){if(i&1&&(s(0,"p"),l(1),o()),i&2){let t=w();m(),_(" ",t.guideDetails==null?null:t.guideDetails.address_line_2," ")}}function ZSe(i,n){if(i&1&&(Ui(0),l(1),I(2,"currencyFormat"),ji()),i&2){let t=n.$implicit,e=n.last;m(),H_(" ",t.name," (",t.country,") - ",t.count," x LKR ",M(2,5,t.price),"",e?"":" / "," ")}}function QSe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div",69),l(3),I(4,"date"),o(),s(5,"div",64),T(6,ZSe,3,7,"ng-container",11),o()(),s(7,"td",24),l(8),I(9,"currencyFormat"),o()()),i&2){let t=n.$implicit;m(3),Pi(" ",Jt(4,4,t.issueddate,"MMM dd, yyyy hh:mm a")," - Entrance Ticket# ",t.serialnumber," "),m(3),p("ngForOf",t.visitordetails),m(2),_(" ",M(9,7,t.visitortotal)," ")}}var Y9=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.auditoriumService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.cdr=h,this.selectedMonth="",this.selectedYear="",this.months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.years=[],this.isCollapsed=!1,this.items=[],this.isAccountant=!1,this.isOfficeUser=!1,this.transactionData=[],this.userCode=""}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.onClickGenerategetGuideWiseExpense(),this.checkUserRole()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}setDefaultMonth(){let e=new Date;e.setMonth(e.getMonth()-1),this.selectedMonth=this.months[e.getMonth()],this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear();this.years=Array.from({length:6},(r,a)=>e-(5-a))}onClickGenerateExcel(){this.getGuideExpenseExcel()}getGuideExpenseExcel(){let e=this.getMonthNumber(this.selectedMonth),r=this.selectedYear;e&&r&&(this.spinner.show(),this.auditoriumService.getGuideExpenseExcel(Number(e),Number(r)).subscribe({next:a=>{let c=`Guide expense report ${e}-${r}.xlsx`;(0,z9.default)(a,c),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:a=>{console.error("Error downloading Excel:",a),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGenerategetGuideWiseExpense(){if(this.selectedMonth&&this.selectedYear){let e=this.getMonthNumber(this.selectedMonth);this.getGuideWiseExpense(e,this.selectedYear)}}getGuideWiseExpense(e,r){this.spinner.show(),this.auditoriumService.getGuideWiseExpense(e,r).subscribe({next:a=>{a&&a.data&&(this.items=a.data.items.map(c=>tt(le({},c),{expense:Number(c.expense)}))),this.spinner.hide(),this.items.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}getMonthNumber(e){return{January:"01",February:"02",March:"03",April:"04",May:"05",June:"06",July:"07",August:"08",September:"09",October:"10",November:"11",December:"12"}[e]}onReviewClick(e){this.getGuideExpenseTransaction(e)}getGuideExpenseTransaction(e){this.spinner.show();let r=this.getMonthNumber(this.selectedMonth);r&&this.selectedYear&&this.auditoriumService.getGuideExpenseTransaction(e.guide_id,parseInt(r,10),parseInt(this.selectedYear,10)).subscribe({next:a=>{this.guideDetails=a.data,console.log(this.guideDetails),this.transactionData=a.data.transactions,console.log(this.transactionData),a.data&&(this.userCode=a.data.usercode),this.spinner.hide();let c=document.getElementById("reviewModal");c&&new bootstrap.Modal(c).show()},error:a=>{console.error("Error fetching transaction data:",a),this.spinner.hide(),this.toastr.error("Failed to fetch transaction data","Error")}})}calculateTotals(){let e=0,r=0;for(let a of this.transactionData)e+=Number(a.visitortotal),r+=Number(a.expense);return{totalAmount:e,totalExpense:r}}updateStatus(e,r){if(!this.guideDetails||!this.guideDetails.usercode){this.toastr.error("No guide details available");return}let a=this.guideDetails.usercode,c=this.getMonthNumber(this.selectedMonth),d=parseInt(this.selectedYear);console.log(a,c,d,e,r),this.spinner.show(),this.auditoriumService.getUpdateStatus(a,parseInt(c),d,e,r).subscribe({next:u=>{this.toastr.success(`Status updated to ${e} successfully`),this.spinner.hide();let h=document.getElementById("reviewModal");h&&bootstrap.Modal.getInstance(h)?.hide(),this.onClickGenerategetGuideWiseExpense()},error:u=>{console.error("Error updating status:",u),this.toastr.error("Failed to update status"),this.spinner.hide()}})}getStatusLabel(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"In Review"}getStatusClass(e){switch(e){case"approved":return"text-success";case"rejected":return"text-danger";case"hold":return"text-warning";default:return"text-secondary"}}generatePDF(e){return ye(this,null,function*(){this.spinner.show();try{let r=this.getMonthNumber(this.selectedMonth),a=yield this.auditoriumService.getGuideExpenseTransaction(e.guide_id,parseInt(r),parseInt(this.selectedYear)).toPromise();this.guideDetails=a.data,this.transactionData=a.data.transactions;let c=new $i("p","mm","a4"),d=c.internal.pageSize.width,u=15,h=d-u*2,f=5,v="assets/ambuluwawaLogo.png",C=40,y=20,A=u,D=f;c.addImage(v,"PNG",A,D,C,y),f=D+y+5,c.setFontSize(9),c.setTextColor(128,128,128),c.text("from",u,f),f+=6,c.setTextColor(0),c.setFont("helvetica","normal"),c.text("Ambuluwawa Biodiversity Complex",u,f),f+=5,c.text("Gampola 20500",u,f),f+=5,c.text("Sri Lanka",u,f),f+=5,c.text("+94 71 272 4724",u,f),f+=5,c.text("[email protected]",u,f);let F=d/2.5,R=D+y+5;c.setTextColor(128,128,128),c.text("to",F,R),R+=6,c.setTextColor(0),c.text(`${this.guideDetails.firstname} ${this.guideDetails.lastname}`,F,R),R+=5,c.text(this.guideDetails.address_line_1,F,R),this.guideDetails.address_line_2&&(R+=5,c.text(this.guideDetails.address_line_2,F,R)),R+=5,c.text(`${this.guideDetails.city}, ${this.guideDetails.postal_code}`,F,R),R+=5,c.text(this.guideDetails.country,F,R),R+=5,c.text(this.guideDetails.phone,F,R);let L=d-u,H=D+y+5;c.setTextColor(128,128,128),c.text("Statement / Period",L,H,{align:"right"}),H+=6,c.setTextColor(0),c.text(`Statement ID: ${this.guideDetails.usercode}`,L,H,{align:"right"}),H+=5,c.text(`${this.selectedMonth} ${this.selectedYear}`,L,H,{align:"right"}),H+=5,c.text(`Guide# ${this.guideDetails.usercode}`,L,H,{align:"right"}),H+=5,c.text("REF Expenses",L,H,{align:"right"}
389),f=Math.max(f,R,H)+5,c.setDrawColor(220,220,220),c.setLineWidth(.5),c.setFontSize(9),c.setTextColor(0),c.setFont("helvetica","bold"),c.text("DESCRIPTION",u,f),c.text("SUB TOTAL (LKR)",d-u,f,{align:"right"}),f+=5,c.line(u,f,d-u,f),f+=5,c.setFont("helvetica","normal");for(let J of this.transactionData){f>c.internal.pageSize.height-40&&(c.addPage(),f=u),c.setFont("helvetica","bold");let Fe=`${new Date(J.issueddate).toLocaleString("en-US",{month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})} - Entrance Ticket# ${J.serialnumber}`;c.text(Fe,u,f),c.setTextColor(0),c.text(J.visitortotal.toLocaleString(),d-u,f,{align:"right"}),f+=6,c.setFont("helvetica","normal");for(let $e of J.visitordetails){f>c.internal.pageSize.height-20&&(c.addPage(),f=u);let Qe=`${$e.name} (${$e.country}) - ${$e.count} x LKR ${$e.price.toLocaleString()}`,ot=c.splitTextToSize(Qe,h-60);c.text(ot,u,f),f+=ot.length*2+2}c.setDrawColor(220,220,220),c.line(u,f,d-u,f),f+=5}f>c.internal.pageSize.height-20&&(c.addPage(),f=u),f+=2,c.setFontSize(11),c.setTextColor(128,128,128),c.text("Total Amount (LKR):",u,f),c.setTextColor(0),c.setFont("helvetica","bold");let se=this.calculateTotals().totalAmount.toLocaleString()+"/-";c.text(se,u+50,f),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text("Total expense (LKR):",d-u-80,f),c.setTextColor(0),c.setFont("helvetica","bold");let Ce=this.calculateTotals().totalExpense.toLocaleString()+"/-";c.text(Ce,d-u,f,{align:"right"}),f+=5,c.setDrawColor(220,220,220),c.line(u,f,d-u,f),f+=10;let ve=20+10+7.5;f+ve>c.internal.pageSize.height-u&&(c.addPage(),f=u),c.setFontSize(9),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text(`Account Holder Name: ${this.guideDetails.bank_account_name}`,u,f),f+=5,c.text(`Account Number: ${this.guideDetails.bank_account_number}`,u,f),f+=5,c.text(`Bank Name: ${this.guideDetails.bank_name}`,u,f),f+=5,c.text(`Bank Branch: ${this.guideDetails.bank_branch}`,u,f),f+=10,c.setFont("helvetica","bold"),c.text("Terms & Conditions:",u,f),f+=5,c.setFont("helvetica","normal");let W=c.splitTextToSize("All payments are issued by Check or Electronic Deposit within 30 days of statement date. For any questions, please contact Accounts Payable at +94 71 272 4724",h);c.text(W,u,f),f+=W.length*2+5,c.setDrawColor(220,220,220),c.line(u,f,d-u,f),f+=5,c.setFontSize(9),c.setTextColor(128,128,128),c.setFont("helvetica","normal"),c.text("THANK YOU FOR YOUR SUPPORT",d*.5,f,{align:"center"}),f+=5,c.text("Ambuluwawa Biodiversity Complex | ambuluwawa.com",d*.5,f,{align:"center"}),c.save(`${this.guideDetails.usercode}.pdf`),this.toastr.success("PDF generated successfully!","Success")}catch(r){console.error("Error generating PDF:",r),this.toastr.error("Failed to generate PDF:","Error")}finally{this.spinner.hide()}})}formatCurrency(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}isAllEntriesApproved(){return!this.items||this.items.length===0?!1:this.items.every(e=>e.status==="approved")}onDropdownClick(e){console.log("Dropdown clicked for:",e)}};n.\u0275fac=function(r){return new(r||n)(x(Uo),x(pe),x(me),x(ze),x(_t),x(ce),x(Kn))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-guide-expense"]],viewQuery:function(r,a){if(r&1&&(An(VSe,5),An(USe,5)),r&2){let c;on(c=sn())&&(a.reviewModal=c.first),on(c=sn())&&(a.invoiceContent=c.first)}},standalone:!1,decls:159,vars:33,consts:[["invoiceContent",""],[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","ngModel"],["value",""],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"btn","btn-outline-primary","withIcon"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-center"],[1,"text-end"],[1,"tbody","rowH"],["id","reviewModal","tabindex","-1","aria-labelledby","reviewModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-lg"],[1,"modal-content"],[1,"modal-header"],["id","reviewModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],["class","invoice pdf-template",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"d-flex","gap-2"],[1,"btn","btn-success","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],[1,"btn","btn-warning","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],[1,"btn","btn-danger","d-inline-flex","align-items-center","gap-2",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["id","invoiceContent",1,"d-none"],[1,"invoice","pdf-template"],[1,"invoice-header"],[1,"from-to-section"],[1,"from"],[1,"mb-1"],[1,"to"],[4,"ngIf"],[1,"statement-info"],[1,"invoice-content","mt-4"],[1,"invoice-price"],[1,"invoice-price-left"],[1,"sub-price"],[1,"text-inverse"],[1,"invoice-price-right"],[1,"f-w-600"],[1,"status",3,"ngClass"],[1,"d-flex","gap-2","justify-content-center"],["title","Review",1,"btn","btn-outline-secondary","btn-sm","btn-icon",3,"click"],["class","btn btn-outline-secondary btn-sm btn-icon","title","Generate PDF",3,"click",4,"ngIf"],["title","Generate PDF",1,"btn","btn-outline-secondary","btn-sm","btn-icon",3,"click"],[1,"invoice-footer","text-center","mt-4"],[1,"fa","fa-globe"],[1,"ticket-header","mb-2"],[1,"visitor-details"],["class","row",4,"ngFor","ngForOf"],[1,"text-end","align-middle"],[1,"row"],[1,"col-12"],[1,"ticket-header"]],template:function(r,a){if(r&1){let c=he();s(0,"div",1)(1,"div",2)(2,"div")(3,"div",3),l(4,"Guide expense Reports"),o(),s(5,"div",4),l(6,"Transaction Reports Log"),o()()(),s(7,"div",5)(8,"div",6)(9,"div",7)(10,"label",8),l(11,"Month"),o(),s(12,"select",9),X("ngModelChange",function(u){return U(c),K(a.selectedMonth,u)||(a.selectedMonth=u),j(u)}),s(13,"option",10),l(14,"Select Month"),o(),T(15,HSe,2,1,"option",11),o()(),s(16,"div",7)(17,"label",8),l(18,"Year"),o(),s(19,"select",9),X("ngModelChange",function(u){return U(c),K(a.selectedYear,u)||(a.selectedYear=u),j(u)}),s(20,"option",10),l(21,"Select Year"),o(),T(22,GSe,2,1,"option",11),o()(),s(23,"div",12)(24,"button",13),S("click",function(){return U(c),j(a.onClickGenerategetGuideWiseExpense())}),s(25,"span",14),l(26,"search"),o(),l(27," Generate "),o()()(),s(28,"div",12)(29,"button",15),S("click",function(){return U(c),j(a.onClickGenerateExcel())}),s(30,"span",14),l(31,"description"),o(),l(32,"Excel "),o(),s(33,"button",16)(34,"span",14),l(35,"print"),o(),l(36,"Print "),o()()(),s(37,"div",17)(38,"div",18)(39,"div",19)(40,"div",20)(41,"table",21)(42,"thead",22)(43,"tr")(44,"th"),l(45,"#Serial"),o(),s(46,"th"),l(47,"Bank Code"),o(),s(48,"th"),l(49,"Branch Code"),o(),s(50,"th"),l(51,"Account No."),o(),s(52,"th"),l(53,"Name"),o(),s(54,"th",23),l(55,"Status"),o(),s(56,"th",24),l(57,"Amount (LKR)"),o(),s(58,"th",23),l(59,"Action"),o()()(),s(60,"tbody",25),T(61,zSe,23,16,"tr",11),o()()()()()()(),s(62,"div",26)(63,"div",27)(64,"div",28)(65,"div",29)(66,"h5",30),l(67," Guide expense Statement "),o(),B(68,"button",31),o(),s(69,"div",32),T(70,XSe,71,19,"div",33),o(),s(71,"div",34)(72,"div",35)(73,"button",36),S("click",function(){return U(c),j(a.updateStatus("approved",a.calculateTotals().totalExpense))}),s(74,"i",14),l(75,"check_circle"),o(),s(76,"span"),l(77,"Approve"),o()(),s(78,"button",37),S("click",function(){return U(c),j(a.updateStatus("hold",a.calculateTotals().totalExpense))}),s(79,"i",14),l(80,"pause_circle"),o(),s(81,"span"),l(82,"Hold"),o()(),s(83,"button",38),S("click",function(){return U(c),j(a.updateStatus("rejected",a.calculateTotals().totalExpense))}),s(84,"i",14),l(85,"cancel"),o(),s(86,"span"),l(87,"Reject"),o()()(),s(88,"button",39),l(89," Close "),o()()()()(),s(90,"div",40,0)(92,"div",41)(93,"div",42)(94,"div",43)(95,"div",44)(96,"p",45),l(97,"from"),o(),s(98,"h6"),l(99,"Ambuluwawa Biodiversity Complex"),o(),s(100,"p"),l(101,"Gampola 20500"),o(),s(102,"p"),l(103,"Sri Lanka"),o(),s(104,"p"),l(105,"+94 71 272 4724"),o(),s(106,"p"),l(107,"[email protected]"),o()(),s(108,"div",46)(109,"p",45),l(110,"to"),o(),s(111,"h6"),l(112),o(),s(113,"p"),l(114),o(),T(115,JSe,2,1,"p",47),s(116,"p"),l(117),o(),s(118,"p"),l(119),o(),s(120,"p"),l(121),o()(),s(122,"div",48)(123,"p",45),l(124,"Statement / Period"),o(),s(125,"h6"),l(126),o(),s(127,"p"),l(128),o(),s(129,"p"),l(130),o(),s(131,"p"),l(132,"REF Expenses"),o()()()(),s(133,"div",49)(134,"div",20)(135,"table",21)(136,"thead")(137,"tr")(138,"th"),l(139,"DESCRIPTION"),o(),s(140,"th",24),l(141,"SUB TOTAL (LKR)"),o()()(),s(142,"tbody"),T(143,QSe,10,9,"tr",11),o()()(),s(144,"div",50)(145,"div",51)(146,"div",52)(147,"small"),l(148,"Total Amount (LKR):"),o(),s(149,"span",53),l(150),I(151,"currencyFormat"),o()()(),s(152,"div",54)(153,"div",52)(154,"small"),l(155,"Total expense (LKR):"),o(),s(156,"span",55),l(157),I(158,"currencyFormat"),o()()()()()()()}r&2&&(p("ngClass",Z(31,jSe,a.isCollapsed)),m(12),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(5),p("disabled",!a.isAllEntriesApproved()),m(32),p("ngForOf",a.items),m(9),p("ngIf",a.guideDetails),m(3),p("disabled",a.isAccountant||a.isOfficeUser),m(5),p("disabled",a.isAccountant||a.isOfficeUser),m(5),p("disabled",a.isAccountant||a.isOfficeUser),m(29),Pi("",a.guideDetails==null?null:a.guideDetails.firstname," ",a.guideDetails==null?null:a.guideDetails.lastname),m(2),b(a.guideDetails==null?null:a.guideDetails.address_line_1),m(),p("ngIf",a.guideDetails==null?null:a.guideDetails.address_line_2),m(2),Pi("",a.guideDetails==null?null:a.guideDetails.city,", ",a.guideDetails==null?null:a.guideDetails.postal_code),m(2),b(a.guideDetails==null?null:a.guideDetails.country),m(2),b(a.guideDetails==null?null:a.guideDetails.phone),m(5),_("Statement ID: ",a.guideDetails==null?null:a.guideDetails.usercode),m(2),Pi("",a.selectedMonth," ",a.selectedYear),m(2),_("Guide# ",a.guideDetails==null?null:a.guideDetails.usercode),m(13),p("ngForOf",a.guideDetails==null?null:a.guideDetails.transactions),m(7),_(" ",M(151,27,a.calculateTotals().totalAmount),"/- "),m(7),_(" ",M(158,29,a.calculateTotals().totalExpense),"/- "))},dependencies:[ue,_e,Dt,Bt,Vt,Ot,Ne,Le,St,Be],styles:[".modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border-radius:4px;font-weight:500}.modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:20px;
389display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%}.modal-footer[_ngcontent-%COMP%] .btn.btn-success[_ngcontent-%COMP%]{background-color:#198754;color:#fff}.modal-footer[_ngcontent-%COMP%] .btn.btn-success[_ngcontent-%COMP%]:hover{background-color:#157347}.modal-footer[_ngcontent-%COMP%] .btn.btn-warning[_ngcontent-%COMP%]{background-color:#ffc107;color:#000}.modal-footer[_ngcontent-%COMP%] .btn.btn-warning[_ngcontent-%COMP%]:hover{background-color:#ffca2c}.modal-footer[_ngcontent-%COMP%] .btn.btn-danger[_ngcontent-%COMP%]{background-color:#dc3545;color:#fff}.modal-footer[_ngcontent-%COMP%] .btn.btn-danger[_ngcontent-%COMP%]:hover{background-color:#bb2d3b}.modal-footer[_ngcontent-%COMP%] .btn.btn-secondary[_ngcontent-%COMP%]{background-color:#6c757d;color:#fff}.modal-footer[_ngcontent-%COMP%] .btn.btn-secondary[_ngcontent-%COMP%]:hover{background-color:#5c636a}.invoice[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:20px;background:#fff}@media print{.invoice[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:none!important}}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .from[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .to[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .statement-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.25rem;color:#666;font-size:14px}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .from[_ngcontent-%COMP%] h6[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .to[_ngcontent-%COMP%] h6[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .statement-info[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-weight:500;font-size:16px;margin-bottom:.5rem}.invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .from[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .to[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%], .invoice[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%] .statement-info[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%]{color:#999;font-size:13px;text-transform:uppercase}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%]{border-collapse:collapse}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6;padding:12px;font-weight:500;font-size:14px}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px;border-bottom:1px solid #dee2e6}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .ticket-header[_ngcontent-%COMP%]{font-weight:500;font-size:14px;margin-bottom:4px}.invoice[_ngcontent-%COMP%] .invoice-content[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] .visitor-details[_ngcontent-%COMP%]{color:#666;font-size:14px;line-height:1.4}.invoice[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:20px;padding:15px;background-color:#f8f9fa}.invoice[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:13px;color:#666}.invoice[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:15px;font-weight:500}.text-success[_ngcontent-%COMP%]{color:#28a745;font-weight:500}.text-danger[_ngcontent-%COMP%]{color:#dc3545;font-weight:500}.text-warning[_ngcontent-%COMP%]{color:#ffc107;font-weight:500}.text-secondary[_ngcontent-%COMP%]{color:#6c757d;font-weight:500}.status[_ngcontent-%COMP%]{padding:4px 12px;border-radius:20px;font-size:13px;font-weight:500;text-transform:capitalize;display:inline-block}.status.approved[_ngcontent-%COMP%]{background-color:#28a7451a;color:#28a745}.status.rejected[_ngcontent-%COMP%]{background-color:#dc35451a;color:#dc3545}.status.hold[_ngcontent-%COMP%]{background-color:#ffc1071a;color:#ffc107}.status.in-review[_ngcontent-%COMP%]{background-color:#6c757d1a;color:#6c757d}.pdf-version[_ngcontent-%COMP%]{background:#fff;padding:40px;max-width:800px;margin:0 auto}
389.pdf-version[_ngcontent-%COMP%] .modal-footer[_ngcontent-%COMP%], .pdf-version[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .pdf-version[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:none!important}.btn-sm[_ngcontent-%COMP%]{padding:4px 8px;font-size:13px}.btn-sm[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px}.table[_ngcontent-%COMP%]{width:100%;margin-bottom:1rem;background-color:transparent;border-collapse:collapse}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.text-end[_ngcontent-%COMP%]{text-align:right!important}.status[_ngcontent-%COMP%]{print-color-adjust:exact;-webkit-print-color-adjust:exact}.pdf-template[_ngcontent-%COMP%]{padding:40px;background:#fff}.pdf-template[_ngcontent-%COMP%] .from-to-section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;margin-bottom:30px}.pdf-template[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-bottom:8px}.pdf-template[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:4px;font-size:14px}.pdf-template[_ngcontent-%COMP%] .invoice-header[_ngcontent-%COMP%] .mb-1[_ngcontent-%COMP%]{text-transform:uppercase;color:#666;font-size:12px;margin-bottom:8px}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f8f9fa;font-weight:600}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:top}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] .ticket-header[_ngcontent-%COMP%]{font-weight:500;margin-bottom:4px}.pdf-template[_ngcontent-%COMP%] .table[_ngcontent-%COMP%] .visitor-details[_ngcontent-%COMP%]{color:#666;line-height:1.5}.pdf-template[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:30px;padding-top:20px;border-top:1px solid #dee2e6}.pdf-template[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;margin-bottom:4px;color:#666}.pdf-template[_ngcontent-%COMP%] .invoice-price[_ngcontent-%COMP%] .sub-price[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:16px;font-weight:600}.d-none[_ngcontent-%COMP%]{display:none!important}.btn-icon[_ngcontent-%COMP%]{width:32px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #ccc;background-color:#f8f9fa}.btn-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:18px;color:#666}.btn-icon[_ngcontent-%COMP%]:hover{background-color:#e2e6ea}"]});let i=n;return i})();var ebe=i=>({collapsed:i}),tbe=()=>({"fa-toggle-on":!0,"fa-toggle-off":!1}),ibe=()=>({standalone:!0});function nbe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td")(8,"div"),l(9),o()(),s(10,"td")(11,"div"),l(12),o()(),s(13,"td"),l(14),o(),s(15,"td"),l(16),o(),s(17,"td")(18,"button",19),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onEditShow(r))}),B(19,"i",20),o(),s(20,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onDeleteShow(r))}),B(21,"i",22),o()()()}if(i&2){let t=n.$implicit,e=w();m(3),_("#",t.id),m(3),b(t.show_title),m(3),b(e.formatDate(t.show_date)),m(3),b(e.formatTime(t.start_time)),m(2),b(t.category_name),m(2),b(t.available_seats),m(2),p("disabled",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser),m(),p("ngClass",Bu(9,tbe))}}function rbe(i,n){if(i&1&&(s(0,"div",23)(1,"div",24),B(2,"i",25),s(3,"h5",26),l(4,"No shows found"),o(),s(5,"p",26),l(6),o()()()),i&2){let t=w();m(6),_(" ",t.searchQuery?"No shows match your search criteria.":"No shows available for the selected date."," ")}}function abe(i,n){i&1&&(s(0,"div",38),l(1," Show title is required "),o())}function obe(i,n){if(i&1&&(s(0,"option",68),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.category_name," ")}}function sbe(i,n){i&1&&(s(0,"div",38),l(1," Category is required "),o())}function lbe(i,n){i&1&&(s(0,"div",38),l(1," Show date is required "),o())}function cbe(i,n){i&1&&(s(0,"div",38),l(1," Start time is required "),o())}function dbe(i,n){i&1&&(s(0,"div",38),l(1," End time is required "),o())}function mbe(i,n){i&1&&(s(0,"div",57)(1,"div",38),l(2," End time must be after start time "),o()())}function ube(i,n){i&1&&(s(0,"div",57)(1,"div",38),l(2," There must be at least 30 minutes between start and end time "),o()())}function pbe(i,n){i&1&&(s(0,"div",38),l(1," Total seat count is required "),o())}function hbe(i,n){i&1&&(s(0,"div",38),l(1," Please enter a valid amount "),o())}function fbe(i,n){i&1&&(s(0,"div",38),l(1," Local ticket price is required "),o())}function gbe(i,n){i&1&&(s(0,"div",38),l(1," Foreign ticket price is required "),o())}function vbe(i,n){i&1&&(s(0,"div",38),l(1," Auditorium ID is required "),o())}function _be(i,n){i&1&&(s(0,"div",38),l(1," Organizer ID is required "),o())}
389function ybe(i,n){if(i&1){let t=he();s(0,"div",69),l(1),s(2,"button",70),S("click",function(){let r=U(t).index,a=w(2);return j(a.removeArtist(r))}),o()()}if(i&2){let t=n.$implicit;m(),_(" ",t," ")}}function Sbe(i,n){i&1&&(s(0,"div",38),l(1," At least one artist name is required "),o())}function bbe(i,n){if(i&1){let t=he();s(0,"div",27)(1,"div",28)(2,"div",29)(3,"div",30)(4,"h5",31),l(5,"Add Show"),o(),s(6,"button",32),S("click",function(){U(t);let r=w();return j(r.closeModal())}),o()(),s(7,"div",33)(8,"form",34),S("ngSubmit",function(){U(t);let r=w();return j(r.onSubmit())}),s(9,"div",35)(10,"div",36)(11,"label",37),l(12,"Show Title "),s(13,"span",38),l(14,"*"),o()(),B(15,"input",39),T(16,abe,2,0,"div",40),o(),s(17,"div",36)(18,"label",37),l(19,"Category "),s(20,"span",38),l(21,"*"),o()(),s(22,"select",41)(23,"option",42),l(24,"Select Category"),o(),T(25,obe,2,2,"option",43),o(),T(26,sbe,2,0,"div",40),o(),s(27,"div",36)(28,"label",37),l(29,"Show Date "),s(30,"span",38),l(31,"*"),o()(),B(32,"input",44),T(33,lbe,2,0,"div",40),o(),s(34,"div",45)(35,"label",37),l(36,"Start Time "),s(37,"span",38),l(38,"*"),o()(),s(39,"input",46),S("change",function(){U(t);let r=w();return j(r.onTimeChange())}),o(),T(40,cbe,2,0,"div",40),o(),s(41,"div",45)(42,"label",37),l(43,"End Time "),s(44,"span",38),l(45,"*"),o()(),s(46,"input",47),S("change",function(){U(t);let r=w();return j(r.onTimeChange())}),o(),T(47,dbe,2,0,"div",40),o(),T(48,mbe,3,0,"div",48)(49,ube,3,0,"div",48),s(50,"div",36)(51,"label",37),l(52,"Total Seat Count "),s(53,"span",38),l(54,"*"),o()(),B(55,"input",49),T(56,pbe,2,0,"div",40),o(),s(57,"div",36)(58,"label",37),l(59,"Show Rent"),o(),s(60,"div",50)(61,"span",51),l(62,"LKR"),o(),s(63,"input",52),S("input",function(r){U(t);let a=w();return j(a.formatCurrency(r,"show_rent"))}),o()(),T(64,hbe,2,0,"div",40),o(),s(65,"div",36)(66,"label",37),l(67,"Local Ticket Price "),s(68,"span",38),l(69,"*"),o()(),s(70,"div",50)(71,"span",51),l(72,"LKR"),o(),s(73,"input",53),S("input",function(r){U(t);let a=w();return j(a.formatCurrency(r,"local_price"))}),o()(),T(74,fbe,2,0,"div",40),o(),s(75,"div",36)(76,"label",37),l(77,"Foreign Ticket Price "),s(78,"span",38),l(79,"*"),o()(),s(80,"div",50)(81,"span",51),l(82,"LKR"),o(),s(83,"input",54),S("input",function(r){U(t);let a=w();return j(a.formatCurrency(r,"foreign_price"))}),o()(),T(84,gbe,2,0,"div",40),o(),s(85,"div",36)(86,"label",37),l(87,"Auditorium ID "),s(88,"span",38),l(89,"*"),o()(),B(90,"input",55),T(91,vbe,2,0,"div",40),o(),s(92,"div",36)(93,"label",37),l(94,"Organizer ID "),s(95,"span",38),l(96,"*"),o()(),B(97,"input",56),T(98,_be,2,0,"div",40),o(),s(99,"div",57)(100,"label",37),l(101,"Description"),o(),B(102,"textarea",58),o(),s(103,"div",57)(104,"label",37),l(105,"Artist Names "),s(106,"span",38),l(107,"*"),o()(),s(108,"div",50)(109,"input",59),X("ngModelChange",function(r){U(t);let a=w();return K(a.newArtistName,r)||(a.newArtistName=r),j(r)}),S("keyup.enter",function(){U(t);let r=w();return j(r.addArtist())}),o(),s(110,"button",60),S("click",function(){U(t);let r=w();return j(r.addArtist())}),B(111,"i",61),l(112," Add "),o()(),s(113,"div",62),T(114,ybe,3,1,"div",63),o(),T(115,Sbe,2,0,"div",40),o()(),s(116,"div",64)(117,"button",65),S("click",function(){U(t);let r=w();return j(r.closeModal())}),l(118," Cancel "),o(),s(119,"button",66),B(120,"i",67),l(121,"Save Show "),o()()()()()()()}if(i&2){let t,e,r,a,c,d,u,h,f,v,C,y,A=w();Re("show",A.isModalOpen),m(8),p("formGroup",A.showForm),m(8),p("ngIf",((t=A.showForm.get("show_title"))==null?null:t.touched)&&((t=A.showForm.get("show_title"))==null?null:t.invalid)),m(7),p("ngValue",null),m(2),p("ngForOf",A.categories),m(),p("ngIf",((e=A.showForm.get("category_id"))==null?null:e.touched)&&((e=A.showForm.get("category_id"))==null?null:e.invalid)),m(6),p("min",A.minDate),m(),p("ngIf",((r=A.showForm.get("show_date"))==null?null:r.touched)&&((r=A.showForm.get("show_date"))==null?null:r.invalid)),m(7),p("ngIf",((a=A.showForm.get("start_time"))==null?null:a.touched)&&((a=A.showForm.get("start_time"))==null?null:a.invalid)),m(7),p("ngIf",((c=A.showForm.get("end_time"))==null?null:c.touched)&&((c=A.showForm.get("end_time"))==null?null:c.invalid)),m(),p("ngIf",A.showForm.hasError("endTimeBeforeStart")),m(
389),p("ngIf",A.showForm.hasError("insufficientDuration")),m(7),p("ngIf",((d=A.showForm.get("total_seat_count"))==null?null:d.touched)&&((d=A.showForm.get("total_seat_count"))==null?null:d.invalid)),m(8),p("ngIf",((u=A.showForm.get("show_rent"))==null?null:u.touched)&&((u=A.showForm.get("show_rent"))==null?null:u.invalid)),m(10),p("ngIf",((h=A.showForm.get("local_price"))==null?null:h.touched)&&((h=A.showForm.get("local_price"))==null?null:h.invalid)),m(10),p("ngIf",((f=A.showForm.get("foreign_price"))==null?null:f.touched)&&((f=A.showForm.get("foreign_price"))==null?null:f.invalid)),m(7),p("ngIf",((v=A.showForm.get("auditorium_id"))==null?null:v.touched)&&((v=A.showForm.get("auditorium_id"))==null?null:v.invalid)),m(7),p("ngIf",((C=A.showForm.get("organizer_id"))==null?null:C.touched)&&((C=A.showForm.get("organizer_id"))==null?null:C.invalid)),m(11),q("ngModel",A.newArtistName),p("ngModelOptions",Bu(24,ibe)),m(5),p("ngForOf",A.artistNames),m(),p("ngIf",A.artistNames.length===0&&((y=A.showForm.get("artist_names"))==null?null:y.touched)),m(4),p("disabled",!A.showForm.valid||A.artistNames.length===0)}}var q9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.sidebarService=e,this.auditoriumService=r,this.spinner=a,this.toastr=c,this.cognitoService=d,this.fb=u,this.isCollapsed=!1,this.shows=[],this.searchQuery="",this.isAccountant=!1,this.isOfficeUser=!1,this.isModalOpen=!1,this.categories=[],this.artistNames=[],this.newArtistName="",this.minDate="",this.timeValidator=h=>{let f=h.get("start_time")?.value,v=h.get("end_time")?.value;if(!f||!v)return null;let C=this.timeToMinutes(f),y=this.timeToMinutes(v);return y<=C?{endTimeBeforeStart:!0}:y-C<30?{insufficientDuration:!0}:null},this.initializeForm(),this.setMinDate()}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}
389),this.getShows(),this.checkUserRole(),this.getCategories()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}getShows(){this.spinner.show(),this.auditoriumService.getCulturalShowsList().subscribe({next:e=>{this.spinner.hide(),e&&e.data&&e.data.shows?this.shows=e.data.shows:this.shows=[],this.shows.length===0&&this.toastr.warning("No shows available for the selected date")},error:e=>{this.spinner.hide(),console.error("Error fetching shows:",e),this.toastr.error("Failed to fetch shows","Error")}})}filteredShows(){return this.searchQuery?this.shows.filter(e=>e.show_title.toLowerCase().includes(this.searchQuery.toLowerCase())||e.category_name.toLowerCase().includes(this.searchQuery.toLowerCase())):this.shows}onSearch(){}formatDate(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}formatTime(e){let[r,a]=e.split(":"),c=parseInt(r),d=c>=12?"PM":"AM";return`${c%12||12}:${a} ${d}`}formatDuration(e){return e===1?"1 hour":`${e} hours`}getArtistNames(e){return e.join(", ")}onEditShow(e){console.log("Edit show:",e),this.toastr.info("Edit functionality will be implemented soon")}onDeleteShow(e){console.log("Delete show:",e),this.toastr.info("Delete functionality will be implemented soon")}openAddShowModal(){this.isModalOpen=!0,this.resetForm()}closeModal(){this.isModalOpen=!1,this.resetForm()}initializeForm(){this.showForm=this.fb.group({show_title:["",[At.required]],category_id:[null,[At.required]],show_date:["",[At.required]],start_time:["10:00",[At.required]],end_time:["10:30",[At.required]],total_seat_count:["",[At.required,At.min(1)]],show_rent:[""],local_price:["",[At.required,this.currencyValidator]],foreign_price:["",[At.required,this.currencyValidator]],auditorium_id:[1,[At.required,At.min(1)]],organizer_id:[1,[At.required,At.min(1)]],description:[""]},{validators:this.timeValidator})}setMinDate(){let e=new Date;this.minDate=e.toISOString().split("T")[0]}resetForm(){this.showForm.reset(),this.artistNames=[],this.newArtistName="",this.showForm.patchValue({auditorium_id:1,organizer_id:1,start_time:"10:00",end_time:"10:30"}),this.showForm.get("auditorium_id")?.disable(),this.showForm.get("organizer_id")?.disable()}addArtist(){this.newArtistName.trim()&&(this.artistNames.push(this.newArtistName.trim()),this.newArtistName="")}removeArtist(e){this.artistNames.splice(e,1)}getCategories(){this.auditoriumService.getShowCategories().subscribe({next:e=>{e&&e.data&&e.data.categories&&(this.categories=e.data.categories)},error:e=>{console.error("Error fetching categories:",e),this.toastr.error("Failed to fetch categories","Error")}})}formatCurrency(e,r){let c=e.target.value.replace(/[^\d]/g,"");if(c===""){this.showForm.get(r)?.setValue("");return}let d=parseInt(c,10),u=this.formatNumberWithCommas(d);this.showForm.get(r)?.setValue(u),r==="show_rent"&&this.showForm.get(r)?.markAsTouched()}formatNumberWithCommas(e){return isNaN(e)?"":new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!0}).format(Math.floor(e))}currencyValidator(e){if(!e.touched&&(!e.value||e.value.trim()==="")||e.touched&&(!e.value||e.value.trim()===""))return null;if(e.value&&e.value.trim()!==""){let r=e.value.replace(/[^\d]/g,""),a=parseInt(r,10);if(isNaN(a)||a<0)return{invalidCurrency:!0}}return null}getNumericValue(e){return!e||e.trim()===""?0:parseInt(e.replace(/[^\d]/g,""),10)||0}timeToMinutes(e){let[r,a]=e.split(":").map(Number);return r*60+a}onTimeChange(){this.showForm.get("start_time")?.updateValueAndValidity(),this.showForm.get("end_time")?.updateValueAndValidity()}onSubmit(){if(this.showForm.valid&&this.artistNames.length>0){let e=this.showForm.getRawValue(),r={auditorium_id:parseInt(e.auditorium_id),organizer_id:parseInt(e.organizer_id),category_id:parseInt(e.category_id),show_title:e.show_title,artist_names:this.artistNames,description:e.description||"",show_date:e.show_date,start_time:e.start_time,end_time:e.end_time,total_seat_count:parseInt(e.total_seat_count),ticket_price:{local:this.getNumericValue(e.local_price),foreign:this.getNumericValue(e.foreign_price)},show_rent:this.getNumericValue(e.show_rent)};this.spinner.show(),this.auditoriumService.addCulturalShow(r).subscribe({next:a=>{this.spinner.hide(),this.toastr.success("Show added successfully!","Success"),this.closeModal(),this.get
389Shows()},error:a=>{this.spinner.hide(),console.error("Error adding show:",a),this.toastr.error("Failed to add show","Error")}})}else this.toastr.warning("Please fill in all required fields and add at least one artist","Validation Error"),this.showForm.markAllAsTouched()}};n.\u0275fac=function(r){return new(r||n)(x(ce),x(Uo),x(pe),x(me),x(ze),x(Qr))},n.\u0275cmp=te({type:n,selectors:[["app-auditorium-manage-shows"]],standalone:!1,decls:37,vars:8,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"mb-3","add-show-btn-container"],[1,"btn","btn-primary",3,"click","disabled"],[1,"fas","fa-plus","me-2"],[1,"search-container"],[1,"search-box"],["type","text","placeholder","Search by Show Title or Category...",1,"form-control","search-input",3,"ngModelChange","ngModel"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["class","no-data-message",4,"ngIf"],["class","modal",3,"show",4,"ngIf"],[1,"btn","btn-link","p-0","me-2",3,"click","disabled"],[1,"fas","fa-pencil-alt","fa-lg"],[1,"btn","btn-link","p-0",3,"click","disabled"],[1,"fas","fa-lg",3,"ngClass"],[1,"no-data-message"],[1,"text-center","py-4"],[1,"fas","fa-theater-masks","fa-3x","text-muted","mb-3"],[1,"text-muted"],[1,"modal"],[1,"modal-dialog","modal
389-lg"],[1,"modal-content"],[1,"modal-header","bg-light","text-dark"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],[1,"modal-body"],[3,"ngSubmit","formGroup"],[1,"row","g-3"],[1,"col-md-6"],[1,"form-label"],[1,"text-danger"],["type","text","placeholder","Enter show title","formControlName","show_title",1,"form-control"],["class","text-danger",4,"ngIf"],["formControlName","category_id",1,"form-select"],["disabled","","selected","",3,"ngValue"],[3,"value",4,"ngFor","ngForOf"],["type","date","formControlName","show_date",1,"form-control",3,"min"],[1,"col-md-3"],["type","time","formControlName","start_time",1,"form-control",3,"change"],["type","time","formControlName","end_time",1,"form-control",3,"change"],["class","col-12",4,"ngIf"],["type","number","placeholder","Enter total seats","formControlName","total_seat_count","min","1",1,"form-control"],[1,"input-group"],[1,"input-group-text"],["type","text","placeholder","Enter show rent","formControlName","show_rent",1,"form-control",3,"input"],["type","text","placeholder","Enter local ticket price","formControlName","local_price",1,"form-control",3,"input"],["type","text","placeholder","Enter foreign ticket price","formControlName","foreign_price",1,"form-control",3,"input"],["type","number","placeholder","Enter auditorium ID","formControlName","auditorium_id","min","1",1,"form-control"],["type","number","placeholder","Enter organizer ID","formControlName","organizer_id","min","1",1,"form-control"],[1,"col-12"],["rows","3","placeholder","Enter show description","formControlName","description",1,"form-control"],["type","text","placeholder","Enter artist name",1,"form-control",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fas","fa-plus"],[1,"mt-2"],["class","badge bg-primary me-2 mb-2",4,"ngFor","ngForOf"],[1,"text-end","mt-4"],["type","button",1,"btn","btn-secondary","me-2",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"fas","fa-save","me-2"],[3,"value"],[1,"badge","bg-primary","me-2","mb-2"],["type","button",1,"btn-close","btn-close-white","ms-2",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Manage Shows"),o()()(),s(5,"div",3)(6,"button",4),S("click",function(){return a.openAddShowModal()}),B(7,"i",5),l(8,"Add Show "),o()(),s(9,"div",6)(10,"div",7)(11,"input",8),X("ngModelChange",function(d){return K(a.searchQuery,d)||(a.searchQuery=d),d}),S("ngModelChange",function(){return a.onSearch()}),o()()(),s(12,"div",9)(13,"div",10)(14,"div",11)(15,"div",12)(16,"table",13)(17,"thead",14)(18,"tr")(19,"th"),l(20,"#Show No"),o(),s(21,"th"),l(22,"Show Title"),o(),s(23,"th"),l(24,"Date"),o(),s(25,"th"),l(26,"Time"),o(),s(27,"th"),l(28,"Category"),o(),s(29,"th"),l(30,"Available Seats"),o(),s(31,"th"),l(32,"Actions"),o()()(),s(33,"tbody",15),T(34,nbe,22,10,"tr",16),o()(),T(35,rbe,7,1,"div",17),o()()()()(),T(36,bbe,122,25,"div",18)),r&2&&(p("ngClass",Z(6,ebe,a.isCollapsed)),m(6),p("disabled",a.isAccountant||a.isOfficeUser),m(5),q("ngModel",a.searchQuery),m(23),p("ngForOf",a.filteredShows()),m(),p("ngIf",a.filteredShows().length===0),m(),p("ngIf",a.isModalOpen))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,gn,Le,wr,$r],styles:[`.modal[_ngcontent-%COMP%]{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1050}.modal.show[_ngcontent-%COMP%]{display:block}.modal[_ngcontent-%COMP%] .modal-dialog[_ngcontent-%COMP%]{max-width:800px;margin:1.75rem auto}.form-control[_ngcontent-%COMP%], .form-select[_ngcontent-%COMP%]{padding:.75rem;border-radius:8px}.form-control[_ngcontent-%COMP%]:focus, .form-select[_ngcontent-%COMP%]:focus{box-shadow:none;border-color:#4e9df7}.pagination[_ngcontent-%COMP%] .page-item[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{cursor:pointer}.pagination[_ngcontent-%COMP%] .page-item[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]:hover{background-color:#e9ecef}.pagination[_ngcontent-%COMP%] .page-item.disabled[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{cursor:not-allowed}.search-container[_ngcontent-%COMP%]{margin-left:1.3rem;margin-right:1.3rem}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{max-width:100%;width:100%}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{width:100%;border:1px solid #ddd;border-radius:4px;font-family:Roboto,Helvetica Neue,sans-serif;font-size:small;color:#333}.search-container[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#4e9df7;box-shadow:0 0 0 2px #007bff40}.add-show-btn-container[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-right:1.3rem}.form-select[_ngcontent-%COMP%]{background-color:#fff!important;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px}.form-select[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#4e9df7;box-shadow:0 0 0 .2rem #4e9df740}.form-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{background-color:#fff;color:#333}`]});let i=n;return i})();var jI=Di(Ti());var Ns=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}
389getDailySales(e){let r={entity_id:Se.SANORA_RESTAURANT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.SANORA_RESTAURANT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.SANORA_RESTAURANT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getCategoryWiseSales(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getMonthlySales(e,r){let a={entity_id:Se.SANORA_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.SANORA_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.SANORA_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getrevenueexpenseSales(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getVisitorCount(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getMostPopularActivity(e,r){let a={entity_id:Se.SANORA_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getTicketSales(e){let r={entity_id:Se.SANORA_RESTAURANT,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.SANORA_RESTAURANT};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.SANORA_RESTAURANT};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.SANORA_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var xbe=i=>({collapsed:i});function Cbe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var K9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.sanoraRestaurantService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}
389ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.sanoraRestaurantService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.sanoraRestaurantService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Sanora Restaurant Daily Sales ${this.selectedDate}.pdf`;(0,jI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.sanoraRestaurantService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Sanora Restaurant Daily Sales ${this.selectedDate}.xlsx`;(0,jI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ns),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-sales-report-sanora-restorant"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sanora Restaurant \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,Cbe,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,xbe,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var WI=Di(Ti());var Ebe=i=>({collapsed:i});
389function wbe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Tbe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Dbe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var X9=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.sanoraRestaurantService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.sanoraRestaurantService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.sanoraRestaurantService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Sanora Restaurant Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,WI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.sanoraRestaurantService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Sanora Restaurant Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,WI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ns))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-sales-sanora-restaurant"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,wbe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,Tbe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,Dbe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,Ebe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var HI=Di(Ti());var Ibe=i=>({collapsed:i});function kbe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var J9=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.sanoraRestaurantService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.sanoraRestaurantService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.sanoraRestaurantService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Sanora Restaurant Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,HI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.sanoraRestaurantService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Sanora Restaurant Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,HI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ns),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-sanora-restaurant"]],standalone:!1,decls:121,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sanora Restaurant \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,kbe,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19)(81,"strong"),l(82),I(83,"currencyFormat"),o()()()()(),s(84,"div",23)(85,"div",24)(86,"div",25)(87,"div",26)(88,"span",27),l(89,"Subtotal:"),o(),s(90,"span"),l(91),I(92,"currencyFormat"),o()()(),s(93,"div",25)(94,"div",26)(95,"span",27),l(96,"Complimentary:"),o(),s(97,"span",28),l(98),I(99,"currencyFormat"),o()()(),s(100,"div",25)(101,"div",26)(102,"span",27),l(103,"Discounts:"),o(),s(104,"span",28),l(105),I(106,"currencyFormat"),o()()(),s(107,"div",25)(108,"div",26)(109,"span",27),l(110,"Voids:"),o(),s(111,"span",28),l(112),I(113,"currencyFormat"),o()()(),s(114,"div",25)(115,"div",29)(116,"span"),l(117,"Total Revenue:"),o(),s(118,"span"),l(119),I(120,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,Ibe,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(4),b(M(83,26,a.total.item_total)),m(9),b(M(92,28,a.total.item_subtotal)),m(7),b(M(99,30,a.total.complimentary_subtotal)),m(7),b(M(106,32,a.total.discount_subtotal)),m(7),b(M(113,34,a.total.voided_subtotal)),m(7),b(M(120,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var Mbe=i=>({collapsed:i}),Abe=(i,n)=>({completed:i,void:n});function Pbe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm a")),m(3),b(t.details),m(2),p("ngClass",Et(12,Abe,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function Fbe(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var Z9=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.sanoraRestaurantService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.sanoraRestaurantService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ns),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-sanora-restaurant"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sanora Restaurant \u2014 Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3897,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,Pbe,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,Fbe,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,Mbe,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var Rbe=i=>({collapsed:i}),Obe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),Q9=(i,n)=>({"is-invalid":i,"is-warning":n});function Nbe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function Lbe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Bbe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Vbe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Ube(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function jbe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"cash",a))}),o(),T(3,Vbe,2,0,"div",68)(4,Ube,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,Q9,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function Wbe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Hbe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Gbe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function $be(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,Hbe,2,0,"div",68)(4,Gbe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,Q9,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function zbe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}
389function Ybe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function qbe(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function Kbe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,jbe,5,8,"td",64)(9,Wbe,2,1,"td",64)(10,$be,5,8,"td",64)(11,zbe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,Ybe,3,1,"ng-container",66)(17,qbe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,Obe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Xbe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Jbe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Xbe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function Zbe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Qbe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}
389function e2e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Qbe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var eB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.sanoraRestaurantService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
389this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.sanoraRestaurantService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.sanoraRestaurantService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ns))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-sanora-restaurant"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Nbe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,Lbe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Bbe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,Kbe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Jbe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,Zbe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,e2e,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,Rbe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var t2e=i=>({collapsed:i}),i2e=i=>({show:i});function n2e(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function r2e(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o()(),s(5,"div",30)(6,"div",31)(7,"div",32)(8,"div",33)(9,"span",34),l(10,"LKR"),o(),s(11,"input",35),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",36)(13,"button",37),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",38),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function a2e(i,n){if(i&1&&(s(0,"div",23)(1,"div",39)(2,"p",40),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",41)(5,"p",42)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",42)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",42)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",43)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem==null?null:t.selectedItem.name),m(4),_(" ",t.selectedCategory," "),m(4),_(" LKR ",t.selectedItem==null?null:t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem==null?null:t.selectedItem.price," ")}}
389function o2e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function s2e(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var tB=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.sanoraRestaurantService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.sanoraRestaurantService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({},c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.sanoraRestaurantService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ns),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-price-sanora-restaurant"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sanora Restaurant \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,n2e,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,r2e,17,4,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,a2e,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,o2e,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,s2e,1,0,"div",21)),r&2&&(p("ngClass",Z(14,t2e,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,i2e,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var l2e=i=>({collapsed:i});
389function c2e(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var iB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.sanoraRestaurantService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.sanoraRestaurantService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.sanoraRestaurantService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.sanoraRestaurantService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.sanoraRestaurantService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ns),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-analytics-sanora-restaurant"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Sanora Restaurant Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,c2e,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,l2e,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var GI=Di(Ti());var Ls=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.THE_STABLE,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.THE_STABLE,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.THE_STABLE,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getCategoryWiseSales(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getrevenueexpenseSales(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getMostPopularActivity(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getVisitorCount(e,r){let a={entity_id:Se.THE_STABLE,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getTicketSales(e){let r={entity_id:Se.THE_STABLE,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.THE_STABLE};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.THE_STABLE};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.THE_STABLE,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.THE_STABLE,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.THE_STABLE,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.THE_STABLE,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}getPOSUnitID(){let e={entity_id:Se.THE_STABLE};return this.http.post(this.apiUrl+"/get-pos-by-entity",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var d2e=i=>({collapsed:i});
389function m2e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var nB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.theStableService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.theStableService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.theStableService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`The Stable Daily Sales ${this.selectedDate}.pdf`;(0,GI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.theStableService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`The Stable Daily Sales ${this.selectedDate}.xlsx`;(0,GI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ls),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-salese-report-the-stable"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"The Stable \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,m2e,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,d2e,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var $I=Di(Ti());var u2e=i=>({collapsed:i});
389function p2e(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function h2e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function f2e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var rB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.theStableService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.theStableService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.theStableService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`The Stable Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,$I.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.theStableService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`The Stable Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,$I.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ls))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-sales-report-the-stable"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,p2e,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,h2e,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,f2e,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,u2e,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var zI=Di(Ti());var g2e=i=>({collapsed:i});
389function v2e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var aB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.theStableService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.theStableService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.theStableService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`The Stable Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,zI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.theStableService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`The Stable Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,zI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ls),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-the-stable"]],standalone:!1,decls:120,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"The Stable \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,v2e,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19),l(81),I(82,"currencyFormat"),o()()()(),s(83,"div",23)(84,"div",24)(85,"div",25)(86,"div",26)(87,"span",27),l(88,"Subtotal:"),o(),s(89,"span"),l(90),I(91,"currencyFormat"),o()()(),s(92,"div",25)(93,"div",26)(94,"span",27),l(95,"Complimentary:"),o(),s(96,"span",28),l(97),I(98,"currencyFormat"),o()()(),s(99,"div",25)(100,"div",26)(101,"span",27),l(102,"Discounts:"),o(),s(103,"span",28),l(104),I(105,"currencyFormat"),o()()(),s(106,"div",25)(107,"div",26)(108,"span",27),l(109,"Voids:"),o(),s(110,"span",28),l(111),I(112,"currencyFormat"),o()()(),s(113,"div",25)(114,"div",29)(115,"span"),l(116,"Total Revenue:"),o(),s(117,"span"),l(118),I(119,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,g2e,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(3),_(" ",M(82,26,a.total.item_total)," "),m(9),b(M(91,28,a.total.item_subtotal)),m(7),b(M(98,30,a.total.complimentary_subtotal)),m(7),b(M(105,32,a.total.discount_subtotal)),m(7),b(M(112,34,a.total.voided_subtotal)),m(7),b(M(119,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var _2e=i=>({collapsed:i}),y2e=(i,n)=>({completed:i,void:n});function S2e(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,y2e,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function b2e(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var oB=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.theStableService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.theStableService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ls),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-the-stable"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"The Stable Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3897,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,S2e,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,b2e,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,_2e,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var x2e=i=>({collapsed:i});function C2e(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var sB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.theStableService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.theStableService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.theStableService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response in getRevenueExpenseSales:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.theStableService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.theStableService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Ls),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-the-stable-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"The Stable Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,C2e,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,x2e,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var E2e=i=>({collapsed:i}),w2e=i=>({show:i}),T2e=(i,n,t,e)=>({"bg-primary":i,"bg-secondary":n,"bg-success":t,"bg-warning":e});function D2e(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function I2e(i,n){if(i&1&&(s(0,"div")(1,"span",40),l(2),o()()),i&2){let t=w().$implicit;m(),p("ngClass",El(2,T2e,t.visitor_type==="Foreign"||t.visitor_type==="Foreign-Adults",t.visitor_type==="Foreign-Kids",t.visitor_type==="Local"||t.visitor_type==="Local-Adults",t.visitor_type==="Local-Kids")),m(),_(" ",t.visitor_type," ")}}function k2e(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o(),T(5,I2e,3,7,"div",30),o(),s(6,"div",31)(7,"div",32)(8,"div",33)(9,"div",34)(10,"span",35),l(11,"LKR"),o(),s(12,"input",36),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(13,"div",37)(14,"button",38),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(15,"span",39),l(16,"save"),o(),l(17," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngIf",t.visitor_type),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function M2e(i,n){if(i&1&&(s(0,"p",44)(1,"strong"),l(2,"Visitor Type:"),o(),l(3),o()),i&2){let t=w(2);m(3),_(" ",t.selectedItem.visitor_type," ")}}
389function A2e(i,n){if(i&1&&(s(0,"div",23)(1,"div",41)(2,"p",42),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",43)(5,"p",44)(6,"strong"),l(7,"Item:"),o(),l(8),o(),T(9,M2e,4,1,"p",45),s(10,"p",44)(11,"strong"),l(12,"Old Price:"),o(),l(13),o(),s(14,"p",46)(15,"strong"),l(16,"New Price:"),o(),l(17),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem==null?null:t.selectedItem.name),m(),p("ngIf",t.selectedItem==null?null:t.selectedItem.visitor_type),m(4),_(" LKR ",t.selectedItem==null?null:t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem==null?null:t.selectedItem.price," ")}}function P2e(i,n){if(i&1){let t=he();s(0,"div",47),S("click",function(){U(t);let r=w();return j(r.showConfirmModal=!1)}),o()}}function F2e(i,n){if(i&1){let t=he();s(0,"div",47),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var lB=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.theStableService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.theStableService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat(a.entityItems.map(c=>tt(le({},c),{price:parseInt(c.price).toString(),originalPrice:parseInt(c.price).toString()}))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=this.categories[0].entityItems.map(r=>tt(le({},r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()})))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.theStableService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r&&(this.filteredPriceItems=r.entityItems.map(a=>tt(le({},a),{price:parseInt(a.price).toString(),originalPrice:parseInt(a.price).toString()})))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ls),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-edit-price-the-stable"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[4,"ngIf"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"badge",3,"ngClass"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],["class","mb-2",4,"ngIf"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"The Stable \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,D2e,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,k2e,18,5,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.showConfirmModal=!1}),o()(),T(21,A2e,18,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,P2e,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,F2e,1,0,"div",21)),r&2&&(p("ngClass",Z(14,E2e,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,w2e,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],encapsulation:2});let i=n;return i})();var R2e=i=>({collapsed:i}),O2e=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),cB=(i,n)=>({"is-invalid":i,"is-warning":n});function N2e(i,n){if(i&1&&(s(0,"div",61),B(1,"i",62),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function L2e(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}
389function B2e(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function V2e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function U2e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function j2e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"cash",a))}),o(),T(3,V2e,2,0,"div",71)(4,U2e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,cB,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function W2e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function H2e(i,n){i&1&&(s(0,"div",73),l(1," Actual amount cannot be negative. "),o())}function G2e(i,n){i&1&&(s(0,"div",74),l(1," Amount Mismatch "),o())}function $2e(i,n){if(i&1){let t=he();s(0,"td",66)(1,"input",70,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"card",a))}),o(),T(3,H2e,2,0,"div",71)(4,G2e,2,0,"div",72),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,cB,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function z2e(i,n){if(i&1&&(s(0,"td",66),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function Y2e(i,n){if(i&1){let t=he();Ui(0),s(1,"button",75),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function q2e(i,n){i&1&&(s(0,"span",76),B(1,"i",77),o())}function K2e(i,n){if(i&1){let t=he();s(0,"tr",64)(1,"td",65),l(2),I(3,"date"),o(),s(4,"td",66),l(5),o(),s(6,"td",66),l(7),o(),T(8,j2e,5,8,"td",67)(9,W2e,2,1,"td",67)(10,$2e,5,8,"td",67)(11,z2e,2,1,"td",67),s(12,"td",66)(13,"button",68),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",66),T(16,Y2e,3,1,"ng-container",69)(17,q2e,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,O2e,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function X2e(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}
389function J2e(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,X2e,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function Z2e(i,n){if(i&1&&(s(0,"option",63),l(1),o()),i&2){let t=n.$implicit;p("value",t.id),m(),_(" ",t.code," ")}}function Q2e(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",65),l(2),o(),s(3,"td",65),l(4),o(),s(5,"td",65),l(6),o(),s(7,"td",65)(8,"button",79),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(9,"i",80),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function exe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.pos_unit_code),m(2),b(t.reason||"-")}}function txe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",78)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"POS ID"),o(),s(10,"th"),l(11,"Ticket Reason"),o()()(),s(12,"tbody"),T(13,exe,7,3,"tr",15),o()()()),i&2){let t=w();m(13),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var dB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.theStableService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.getPOSList()}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
389formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:null,pos_unit_code:null,reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,pos_unit_id:r,reason:a}=this.selectedTicket;if(a=a.trim(),e&&r)if(this.selectedTicket.tempInvalidTickets.find(d=>d.id===e))this.toastr.warning("This ticket is already present in the list.");else{console.log("pos_unit_id",r),console.log("POS LIST",this.posList);let d=this.posList.find(u=>u.id===Number(r));console.log("selectedpos_unit_id",d),d?(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:r,pos_unit_code:d.code,reason:a}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.pos_unit_id=null,this.selectedTicket.pos_unit_code=null,this.selectedTicket.reason=""):this.toastr.error("Selected POS not found.")}else this.toastr.error("Please enter Ticket ID, select POS, and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:a.pos_unit_id,pos_unit_code:a.pos_unit_code,reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.theStableService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.theStableService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getPOSList(){this.spinner.show(),this.theStableService.getPOSUnitID().subscribe({next:e=>{e&&e.data&&(this.posList=e.data.map(r=>({id:r.id,code:r.code})).sort((r,a)=>r.id-a.id)),this.spinner.hide()},error:e=>{console.error("Error loading POS list:",e),this.spinner.hide(),this.toastr.error("Failed to load POS list")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Ls))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-the-stable"]],standalone:!1,decls:178,vars:35,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","pos_unit_id",1,"form-label"],["id","pos_unit_id","name","pos_unit_id","required","",1,"form-control",3,"ngModelChange","ngModel"],["value","","disabled","","selected",""],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,N2e,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,L2e,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,B2e,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,K2e,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,J2e,14,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"POS ID"),o(),s(111,"select",44),X("ngModelChange",function(d){return K(a.selectedTicket.pos_unit_id,d)||(a.selectedTicket.pos_unit_id=d),d}),s(112,"option",45),l(113,"Select a POS ID"),o(),T(114,Z2e,2,2,"option",13),o()(),s(115,"div",40)(116,"label",46),l(117,"Ticket Reason"),o(),s(118,"textarea",47),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(119,"div",48)(120,"button",49),S("click",function(){return a.clearForm()}),l(121," Cancel "),o(),s(122,"button",50),l(123," Add To List "),o()()()(),s(124,"div",51)(125,"div",52)(126,"table",53)(127,"thead",54)(128,"tr")(129,"th",55),l(130,"Invalid Ticket Number"),o(),s(131,"th"),l(132,"POS ID"),o(),s(133,"th"),l(134,"Reason"),o(),B(135,"th"),o()(),s(136,"tbody"),T(137,Q2e,10,3,"tr",15),o()()()(),s(138,"div",56)(139,"button",57),l(140," Cancel "),o(),s(141,"button",58),S("click",function(){return a.saveInvalidTickets()}),l(142," Save "),o()()()()(),s(143,"div",59)(144,"div",29)(145,"div",30)(146,"div",31)(147,"h5",60),l(148,"Confirm Transaction"),o(),B(149,"button",33),o(),s(150,"div",34)(151,"p")(152,"strong"),l(153,"Date:"),o(),l(154),I(155,"date"),o(),s(156,"p")(157,"strong"),l(158,"System Cash:"),o(),l(159),o(),s(160,"p")(161,"strong"),l(162,"System Card:"),o(),l(163),o(),s(164,"p")(165,"strong"),l(166,"Actual Cash:"),o(),l(167),o(),s(168,"p")(169,"strong"),l(170,"Actual Card:"),o(),l(171),o(),T(172,txe,14,1,"div",35),o(),s(173,"div",56)(174,"button",57),l(175," Cancel "),o(),s(176,"button",58),S("click",function(){return a.confirmTransaction()}),l(177," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(33,R2e,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.pos_unit_id),m(3),p("ngForOf",a.posList),m(4),q("ngModel",a.selectedTicket.reason),m(19),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(155,31,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var YI=Di(Ti());var Bs=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl,this.headers=new xe({"Content-Type":"application/json"})}getDailySales(e){let r={entity_id:Se.GELATO_HEAVEN,start_date:e};return console.log("API Payload:",r),this.http.post(this.apiUrl+"/get-daily-sales",r,{headers:this.headers})}getDailySalesPDF(e){let r={entity_id:Se.GELATO_HEAVEN,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{headers:this.headers,responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.GELATO_HEAVEN,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{headers:this.headers,responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.GELATO_HEAVEN,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a,{headers:this.headers})}getItemWiseSalesPDF(e,r){let a={entity_id:Se.GELATO_HEAVEN,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{headers:this.headers,responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.GELATO_HEAVEN,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{headers:this.headers,responseType:"blob"})}getTicketSales(e){let r={entity_id:Se.GELATO_HEAVEN,current_page:e};return console.log("API Payload:",r),this.http.post(this.apiUrl+"/ticket-sales",r,{headers:this.headers})}getrevenueexpenseSales(e,r){let a={entity_id:Se.GELATO_HEAVEN,start_date:e,end_date:r};
389return this.http.post(this.apiUrl+"/get-revenue-expense",a,{headers:this.headers})}getMostPopularActivity(e,r){let a={entity_id:Se.GELATO_HEAVEN,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a,{headers:this.headers})}getVisitorCount(e,r){let a={entity_id:Se.GELATO_HEAVEN,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a,{headers:this.headers})}getItemPrice(){let e={entity_id:Se.GELATO_HEAVEN};return this.http.post(this.apiUrl+"/entity-item-price",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.GELATO_HEAVEN};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySales(e,r){let a={entity_id:Se.GELATO_HEAVEN,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.GELATO_HEAVEN,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.GELATO_HEAVEN,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.GELATO_HEAVEN,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ixe=i=>({collapsed:i});function nxe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var mB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.gelatoHeavanService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.gelatoHeavanService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.gelatoHeavanService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Herbal Shop Daily Sales ${this.selectedDate}.pdf`;(0,YI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.gelatoHeavanService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Herbal Shop Daily Sales ${this.selectedDate}.xlsx`;(0,YI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Bs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-daily-salese-report-gelato-heavan"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Gelato Heaven \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,nxe,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,ixe,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var qI=Di(Ti());var rxe=i=>({collapsed:i});
389function axe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function oxe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function sxe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var uB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.gelatoHeavanService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.gelatoHeavanService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.gelatoHeavanService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Gelato Heavan Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,qI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.gelatoHeavanService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Gelato Heavan Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,qI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Bs))},n.\u0275cmp=te({type:n,selectors:[["app-monthly-sales-report-gelato-heavan"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Gelato Heaven - Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,axe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,oxe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,sxe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,rxe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var KI=Di(Ti());var lxe=i=>({collapsed:i});function cxe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),I(21,"currencyFormat"),o(),s(22,"td",19)(23,"strong"),l(24),I(25,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,9,t.average_unit_price)),m(3),b(M(12,11,t.item_subtotal)),m(3),b(M(15,13,t.discount_subtotal)),m(3),b(M(18,15,t.complimentary_subtotal)),m(3),b(M(21,17,t.voided_subtotal)),m(4),b(M(25,19,t.item_total))}}var pB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.gelatoHeavanService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.gelatoHeavanService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.gelatoHeavanService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Gelato Heavan Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,KI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.gelatoHeavanService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Gelato Heavan Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,KI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Bs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-item-wise-sales-report-gelato-heavan"]],standalone:!1,decls:99,vars:25,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Gelato Heaven \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Item"),o(),s(44,"th"),l(45,"Quantity"),o(),s(46,"th"),l(47,"Voided Ticket Count"),o(),s(48,"th"),l(49,"Average Unit Price"),o(),s(50,"th"),l(51,"Item Subtotal"),o(),s(52,"th"),l(53,"Discount Subtotal"),o(),s(54,"th"),l(55,"Complimentary Subtotal"),o(),s(56,"th"),l(57,"Voided Subtotal"),o(),s(58,"th",19),l(59,"Item Total"),o()()(),s(60,"tbody",20),T(61,cxe,26,21,"tr",21),o()(),s(62,"div",22)(63,"div",23)(64,"div",24)(65,"div",25)(66,"span",26),l(67,"Subtotal:"),o(),s(68,"span"),l(69),I(70,"currencyFormat"),o()()(),s(71,"div",24)(72,"div",25)(73,"span",26),l(74,"Complimentary:"),o(),s(75,"span",27),l(76),I(77,"currencyFormat"),o()()(),s(78,"div",24)(79,"div",25)(80,"span",26),l(81,"Discounts:"),o(),s(82,"span",27),l(83),I(84,"currencyFormat"),o()()(),s(85,"div",24)(86,"div",25)(87,"span",26),l(88,"Voids:"),o(),s(89,"span",27),l(90),I(91,"currencyFormat"),o()()(),s(92,"div",24)(93,"div",28)(94,"span"),l(95,"Total Revenue:"),o(),s(96,"span"),l(97),I(98,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(23,lxe,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(45),p("ngForOf",a.items),m(8),b(M(70,13,a.total.item_subtotal)),m(7),b(M(77,15,a.total.complimentary_subtotal)),m(7),b(M(84,17,a.total.discount_subtotal)),m(7),b(M(91,19,a.total.voided_subtotal)),m(7),b(M(98,21,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var dxe=i=>({collapsed:i}),mxe=(i,n)=>({completed:i,void:n});function uxe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td",19)(13,"span",20),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")),m(3),b(t.details),m(2),p("ngClass",Et(12,mxe,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function pxe(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",21),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var hB=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.gelatoHeavanService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.gelatoHeavanService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Bs),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-ticket-sales-report-gelato-heavan"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"payment-status"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Gelato Heaven Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3897,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,uxe,19,15,"tr",12),o()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,pxe,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()()),r&2&&(p("ngClass",Z(9,dxe,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var hxe=i=>({collapsed:i});function fxe(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var fB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.gelatoHeavanService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.gelatoHeavanService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.gelatoHeavanService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_revenue+=Number(r.revenue);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.gelatoHeavanService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.gelatoHeavanService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue||0,change:0,isPositive:this.total_revenue>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Bs),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-gelato-heavan-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items","revenueType"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Gelato Heaven Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,fxe,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-activity-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,hxe,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items)("revenueType","Item Wise Revenue"),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,uo,Jn,Zn,Qn,Dn,Be],encapsulation:2});let i=n;return i})();var gxe=i=>({collapsed:i}),vxe=i=>({show:i});function _xe(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o()(),s(5,"div",24)(6,"div",25)(7,"div",26)(8,"div",27)(9,"span",28),l(10,"LKR"),o(),s(11,"input",29),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",30)(13,"button",31),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",32),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function yxe(i,n){if(i&1&&(s(0,"div",19)(1,"div",33)(2,"p",34),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",35)(5,"p",36)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",36)(10,"strong"),l(11,"Old Price:"),o(),l(12),o(),s(13,"p",37)(14,"strong"),l(15,"New Price:"),o(),l(16),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function Sxe(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function bxe(i,n){if(i&1){let t=he();s(0,"div",38),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var gB=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.gelatoHeavanService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.gelatoHeavanService.getItemPrice().subscribe({next:e=>{e.data&&e.data[0]&&(this.priceItems=e.data[0].map(r=>tt(le({}
389,r),{price:parseInt(r.price).toString(),originalPrice:parseInt(r.price).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.gelatoHeavanService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Bs),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-gelato-heavan-edit-price"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Gelato Heaven \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,_xe,17,4,"div",6),o()()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,yxe,17,3,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,Sxe,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,bxe,1,0,"div",17)),r&2&&(p("ngClass",Z(13,gxe,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,vxe,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var xxe=i=>({collapsed:i}),Cxe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),vB=(i,n)=>({"is-invalid":i,"is-warning":n});function Exe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function wxe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function Txe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function Dxe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Ixe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}
389function kxe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"cash",a))}),o(),T(3,Dxe,2,0,"div",68)(4,Ixe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,vB,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function Mxe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function Axe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function Pxe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function Fxe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"card",a))}),o(),T(3,Axe,2,0,"div",68)(4,Pxe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,vB,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function Rxe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function Oxe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function Nxe(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function Lxe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,kxe,5,8,"td",64)(9,Mxe,2,1,"td",64)(10,Fxe,5,8,"td",64)(11,Rxe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,Oxe,3,1,"ng-container",66)(17,Nxe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,Cxe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function Bxe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Vxe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,Bxe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function Uxe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function jxe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function Wxe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,jxe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}var _B=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.gelatoHeavanService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}
389formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.gelatoHeavanService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.gelatoHeavanService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Bs))},n.\u0275cmp=te({type:n,selectors:[["app-daily-transaction-verification-gelato-heavan"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,Exe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Gelato Heaven - Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,wxe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,Txe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,Lxe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,Vxe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,Uxe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,Wxe,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,xxe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var Vs=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl}getDailySales(e){let r={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales",r)}getDailySalesPDF(e){let r={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-pdf",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-excel",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales",a)}getCategoryWiseSales(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales",a)}getItemWiseSalesPDF(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-pdf",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-excel",a,{responseType:"blob"})}getMonthlySales(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-pdf",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-excel",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getrevenueexpenseSales(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};
389return this.http.post(this.apiUrl+"/get-revenue-expense",a)}getVisitorCount(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts",a)}getMostPopularActivity(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular",a)}getTicketSales(e){let r={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales",r)}getItemPrice(){let e={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT};return this.http.post(this.apiUrl+"/get-categorywise-item-prices",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:Se.IDIKADA_VILLAGE_RESTAURANT};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.IDIKADA_VILLAGE_RESTAURANT,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Hxe=i=>({collapsed:i});function Gxe(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var yB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.idikadaVillageRestaurantService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.idikadaVillageRestaurantService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.categoryWiseSales,this.total=e.data.totals,console.log("Categories---",this.items),console.log("Total---",this.total),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getRevenueExpenseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,this.idikadaVillageRestaurantService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.revenueItems=e.data;for(let r of this.revenueItems)this.total_guide_expense+=Number(r.total_expense);this.updateSummaryData(),this.spinner.hide(),this.revenueItems.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getMostPopularActivitySales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.idikadaVillageRestaurantService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.popularActivity=e.data.map(r=>({transaction_date:r.transaction_date,transactions:r.transactions.map(a=>({item_name:a.item_name,category:a.category,total_quantity:a.total_quantity,total_item_subtotal:a.total_item_subtotal}))})),this.spinner.hide(),this.popularActivity.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getVisitorCount(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.idikadaVillageRestaurantService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.DatewiseVisitorCount=e.data.result,this.total_foreign=e.data.total_foreign,this.total_local=e.data.total_local,this.updateSummaryData(),this.spinner.hide(),this.DatewiseVisitorCount.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getCategoryWiseSales(),this.getRevenueExpenseSales(),this.getMostPopularActivitySales(),this.getVisitorCount()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Vs),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Idikada Village Restaurant Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,Gxe,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,Hxe,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var $xe=i=>({collapsed:i}),zxe=i=>({show:i});function Yxe(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function qxe(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o(),s(5,"span",30),l(6),o()(),s(7,"div",31)(8,"div",32)(9,"div",33)(10,"div",34)(11,"span",35),l(12,"LKR"),o(),s(13,"input",36),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(14,"div",37)(15,"button",38),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(16,"span",39),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngClass",e.getVisitorTypeBadgeClass(t)),m(),_(" ",e.getVisitorTypeLabel(t)," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function Kxe(i,n){if(i&1&&(s(0,"div",23)(1,"div",40)(2,"p",41),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",42)(5,"p",43)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",43)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",43)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",44)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedCategory," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function Xxe(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function Jxe(i,n){if(i&1){let t=he();s(0,"div",45),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var SB=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.idikadaVillageRestaurantService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}mapItemWithPrices(e){return tt(le({},e),{visitor_type:e.visitor_type??"local",price:parseInt(e.price,10).toString(),originalPrice
389:parseInt(e.price,10).toString()})}loadItemPrices(){this.spinner.show(),this.idikadaVillageRestaurantService.getItemPrice().subscribe({next:e=>{e?.data&&Array.isArray(e.data)&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat((a.entityItems||[]).map(c=>this.mapItemWithPrices(c))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=(this.categories[0].entityItems||[]).map(r=>this.mapItemWithPrices(r)))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.idikadaVillageRestaurantService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r?.entityItems&&(this.filteredPriceItems=r.entityItems.map(a=>this.mapItemWithPrices(a)))}getVisitorTypeLabel(e){return(e?.visitor_type||"local").toString().toLowerCase()==="foreign"?"Foreign":"Local"}getVisitorTypeBadgeClass(e){return(e?.visitor_type||"local").toString().toLowerCase()==="foreign"?"bg-primary":"bg-success"}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Vs),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-edit-price"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge","text-white",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4," Idikada Village Restaurant \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,Yxe,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,qxe,19,6,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,Kxe,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,Xxe,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,Jxe,1,0,"div",21)),r&2&&(p("ngClass",Z(14,$xe,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,zxe,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".chartBox-header[_ngcontent-%COMP%] .chartTitle[_ngcontent-%COMP%]{flex:1;min-width:0;margin-right:8px}.chartBox-header[_ngcontent-%COMP%] .badge[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 10px;font-size:12px;font-weight:500;color:#fff!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-primary[_ngcontent-%COMP%]{background-color:#0d6efd!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-success[_ngcontent-%COMP%]{background-color:#198754!important}.modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var XI=Di(Ti());var Zxe=i=>({collapsed:i});function Qxe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function eCe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function tCe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o()()),i&2){let t=n.$implicit;m(2),b(M(3,4,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleStr
389ing()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var bB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.idikadaVillageRestaurantService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.idikadaVillageRestaurantService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.idikadaVillageRestaurantService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Idikada Village Restaurant Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,XI.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.idikadaVillageRestaurantService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Idikada Village Restaurant Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,XI.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Vs))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-monthly-sales"]],standalone:!1,decls:62,vars:12,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,Qxe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,eCe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Total"),o()()(),s(50,"tbody",23),T(51,tCe,10,6,"tr",11),o(),s(52,"tfoot",24)(53,"tr")(54,"td"),l(55,"Total"),o(),s(56,"td",22),l(57),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o()()()()()()()()()),r&2&&(p("ngClass",Z(10,Zxe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(29),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var JI=Di(Ti());var iCe=i=>({collapsed:i});function nCe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td"),l(14),I(15,"currencyFormat"),o(),s(16,"td"),l(17),I(18,"currencyFormat"),o(),s(19,"td"),l(20),o(),s(21,"td"),l(22),o()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(2),b(M(6,8,t.amount)),m(3),b(M(9,10,t.discount)),m(3),b(M(12,12,t.total)),m(3),b(M(15,14,t.cash_amount)),m(3),b(M(18,16,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}var xB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.idikadaVillageRestaurantService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,Total:0},this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.idikadaVillageRestaurantService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.idikadaVillageRestaurantService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Idikada Village Restaurant Daily Sales ${this.selectedDate}.pdf`;(0,JI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.idikadaVillageRestaurantService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Idikada Village Restaurant Daily Sales ${this.selectedDate}.xlsx`;(0,JI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Vs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-daily-sales-report"]],standalone:!1,decls:82,vars:22,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Idikada Village Restaurant \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Amount"),o(),s(42,"th"),l(43,"Discount"),o(),s(44,"th"),l(45,"Total"),o(),s(46,"th"),l(47,"Cash"),o(),s(48,"th"),l(49,"Card"),o(),s(50,"th"),l(51,"Card Last4"),o(),s(52,"th"),l(53,"Remark"),o()()(),s(54,"tbody",19),T(55,nCe,23,18,"tr",20),o(),s(56,"tfoot")(57,"tr")(58,"td")(59,"strong"),l(60,"Totals:"),o()(),s(61,"td")(62,"strong"),l(63),I(64,"currencyFormat"),o()(),s(65,"td")(66,"strong"),l(67),I(68,"currencyFormat"),o()(),s(69,"td")(70,"strong"),l(71),I(72,"currencyFormat"),o()(),s(73,"td")(74,"strong"),l(75),I(76,"currencyFormat"),o()(),s(77,"td")(78,"strong"),l(79),I(80,"currencyFormat"),o()(),B(81,"td",21),o()()()()()()()()),r&2&&(p("ngClass",Z(20,iCe,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(43),p("ngForOf",a.tickets),m(8),b(M(64,10,a.total.Amount)),m(4),b(M(68,12,a.total.Discount)),m(4),b(M(72,14,a.total.Total)),m(4),b(M(76,16,a.total.Cash)),m(4),b(M(80,18,a.total.Card)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var ZI=Di(Ti());var rCe=i=>({collapsed:i});
389function aCe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}var CB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.idikadaVillageRestaurantService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.idikadaVillageRestaurantService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.idikadaVillageRestaurantService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Idikada Village Restaurant Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,ZI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.idikadaVillageRestaurantService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Idikada Village Restaurant Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,ZI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Vs),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-item-wise-sales-report"]],standalone:!1,decls:121,vars:40,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Idikada Village Restaurant \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,aCe,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19)(81,"strong"),l(82),I(83,"currencyFormat"),o()()()()(),s(84,"div",23)(85,"div",24)(86,"div",25)(87,"div",26)(88,"span",27),l(89,"Subtotal:"),o(),s(90,"span"),l(91),I(92,"currencyFormat"),o()()(),s(93,"div",25)(94,"div",26)(95,"span",27),l(96,"Complimentary:"),o(),s(97,"span",28),l(98),I(99,"currencyFormat"),o()()(),s(100,"div",25)(101,"div",26)(102,"span",27),l(103,"Discounts:"),o(),s(104,"span",28),l(105),I(106,"currencyFormat"),o()()(),s(107,"div",25)(108,"div",26)(109,"span",27),l(110,"Voids:"),o(),s(111,"span",28),l(112),I(113,"currencyFormat"),o()()(),s(114,"div",25)(115,"div",29)(116,"span"),l(117,"Total Revenue:"),o(),s(118,"span"),l(119),I(120,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(38,rCe,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,18,a.total.item_subtotal)),m(3),b(M(73,20,a.total.discount_subtotal)),m(3),b(M(76,22,a.total.complimentary_subtotal)),m(3),b(M(79,24,a.total.voided_subtotal)),m(4),b(M(83,26,a.total.item_total)),m(9),b(M(92,28,a.total.item_subtotal)),m(7),b(M(99,30,a.total.complimentary_subtotal)),m(7),b(M(106,32,a.total.discount_subtotal)),m(7),b(M(113,34,a.total.voided_subtotal)),m(7),b(M(120,36,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var oCe=i=>({collapsed:i}),sCe=(i,n)=>({completed:i,void:n});function lCe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm a")),m(3),b(t.details),m(2),p("ngClass",Et(12,sCe,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function cCe(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var EB=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.idikadaVillageRestaurantService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.idikadaVillageRestaurantService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[];for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Vs),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-ticket-sales"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Idikada Village Restaurant Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3897,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Amount (LKR)"),o()()(),s(26,"tbody",11),T(27,lCe,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,cCe,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,oCe,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var dCe=i=>({collapsed:i}),mCe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),wB=(i,n)=>({"is-invalid":i,"is-warning":n});function uCe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function pCe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function hCe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function fCe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function gCe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function vCe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"cash",a))}),o(),T(3,fCe,2,0,"div",68)(4,gCe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,wB,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function _Ce(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function yCe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function SCe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function bCe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,yCe,2,0,"div",68)(4,SCe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,wB,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function xCe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function CCe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function ECe(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function wCe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,vCe,5,8,"td",64)(9,_Ce,2,1,"td",64)(10,bCe,5,8,"td",64)(11,xCe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,CCe,3,1,"ng-container",66)(17,ECe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,mCe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function TCe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function DCe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,TCe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function ICe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function kCe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function MCe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,kCe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
389d_tickets)}}var TB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.idikadaVillageRestaurantService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
389this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.idikadaVillageRestaurantService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.idikadaVillageRestaurantService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Vs))},n.\u0275cmp=te({type:n,selectors:[["app-idikada-village-restaurant-daily-transaction-verification"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,uCe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,pCe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,hCe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,wCe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,DCe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,ICe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,MCe,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,dCe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var QI=Di(Ti());var Us=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl,this.reportLabel="Hostel Restaurant Report"}getDailySales(e){let r={entity_ids:Se.HOSTEL_REST,start_date:e};return this.http.post(this.apiUrl+"/get-daily-sales-combined",r)}getDailySalesPDF(e){let r={entity_ids:Se.HOSTEL_REST,start_date:e,report_label:this.reportLabel};return this.http.post(this.apiUrl+"/get-daily-sales-pdf-combined",r,{responseType:"blob"})}getDailySalesExcel(e){let r={entity_ids:Se.HOSTEL_REST,start_date:e,report_label:this.reportLabel};return this.http.post(this.apiUrl+"/get-daily-sales-excel-combined",r,{responseType:"blob"})}getItemWiseSales(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-item-wise-sales-combined",a)}getCategoryWiseSales(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-category-wise-sales-combined",a)}getItemWiseSalesPDF(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r,report_label:this.reportLabel};return this.http.post(this.apiUrl+"/get-item-wise-pdf-combined",a,{responseType:"blob"})}getItemWiseSalesExcel(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r,report_label:this.reportLabel};return this.http.post(this.apiUrl+"/get-item-wise-excel-combined",a,{responseType:"blob"})}getMonthlySales(e,r){let a={entity_ids:Se.HOSTEL_REST,month:e,year:r};return this.http.post(this.apiUrl+"/monthly-report-combined",a,{headers:new xe({"Content-Type":"application/json"})})}getMonthlySalesPDF(e,r){let a={entity_ids:Se.HOSTEL_REST,month:e,year:r,report_label:this.reportLabel};return this.http.post(this.apiUrl+"/monthly-report-pdf-combined",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getMonthlySalesExcel(e,r){let a={entity_ids:Se.HOSTEL_REST,month:e,year:r,report_label:this.reportLabel};return this.http.post(this.apiUrl+"/monthly-report-excel-combined",a,{headers:new xe({"Content-Type":"application/json"}),responseType:"blob"})}getrevenueexpenseSales(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r};
389return this.http.post(this.apiUrl+"/get-revenue-expense-combined",a)}getVisitorCount(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-visitor-counts-combined",a)}getMostPopularActivity(e,r){let a={entity_ids:Se.HOSTEL_REST,start_date:e,end_date:r};return this.http.post(this.apiUrl+"/get-most-popular-combined",a)}getTicketSales(e){let r={entity_ids:Se.HOSTEL_REST,current_page:e};return this.http.post(this.apiUrl+"/ticket-sales-combined",r)}getItemPrice(){let e={entity_ids:Se.HOSTEL_REST};return this.http.post(this.apiUrl+"/get-categorywise-item-prices-combined",e,{headers:new xe({"Content-Type":"application/json"})})}updateItemPrice(e){let r={id:e.id,item_type:e.item_type,name:e.name,prev_price:parseInt(e.originalPrice),price:e.price,visitor_type:e.visitor_type,entity_id:e.entity_id};return this.http.post(this.apiUrl+"/update-item-price",r,{headers:new xe({"Content-Type":"application/json"})})}getDailyTransactionsToVerify(e,r){let a={entity_id:Se.HOSTEL_REST,month:e,year:r};return this.http.post(this.apiUrl+"/get-daily-confirmation",a,{headers:new xe({"Content-Type":"application/json"})})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/save-daily-confirmation",e,{headers:new xe({"Content-Type":"application/json"})})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ACe=i=>({collapsed:i});function PCe(i,n){i&1&&(s(0,"th"),l(1,"Service Charge"),o())}function FCe(i,n){if(i&1&&(s(0,"td"),l(1),I(2,"currencyFormat"),o()),i&2){let t=w().$implicit;m(),_(" ",M(2,1,t.service_charge)," ")}}function RCe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),I(6,"currencyFormat"),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),T(10,FCe,3,3,"td",19),s(11,"td"),l(12),I(13,"currencyFormat"),o(),s(14,"td"),l(15),I(16,"currencyFormat"),o(),s(17,"td"),l(18),I(19,"currencyFormat"),o(),s(20,"td"),l(21),o(),s(22,"td"),l(23),o()()),i&2){let t=n.$implicit,e=w();m(3),_("#",t.ticket_id),m(2),b(M(6,9,t.amount)),m(3),b(M(9,11,t.discount)),m(2),p("ngIf",e.hasServiceCharge),m(2),_(" ",M(13,13,e.hasServiceCharge?t.grand_total:t.total)," "),m(3),b(M(16,15,t.cash_amount)),m(3),b(M(19,17,t.card_amount)),m(3),b(t.card_last_4||""),m(2),b(t.remark||"")}}function OCe(i,n){if(i&1&&(s(0,"td")(1,"strong"),l(2),I(3,"currencyFormat"),o()()),i&2){let t=w();m(2),b(M(3,1,t.total.ServiceCharge))}}var DB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.hostelRestService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedDate=null,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Discount:0,ServiceCharge:0,Total:0,GrandTotal:0},this.hasServiceCharge=!1,this.isCollapsed=!1,this.pages=[1,2,3,4,5]}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.hostelRestService.getDailySales(this.selectedDate).subscribe({next:e=>{console.log("API Response:",e),this.tickets=e.data.items,this.total=e.data.totals,this.hasServiceCharge=!!e.data.has_service_charge,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.hostelRestService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Hostel Restaurant Daily Sales ${this.selectedDate}.pdf`;(0,QI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedDate),this.hostelRestService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Hostel Restaurant Daily Sales ${this.selectedDate}.xlsx`;(0,QI.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}goToPage(e){console.log("Navigating to page:",e)}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Us),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-daily-sales-report"]],standalone:!1,decls:84,vars:24,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[4,"ngIf"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Hostel Restaurant \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select date"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Serial"),o(),s(40,"th"),l(41,"Net Total"),o(),s(42,"th"),l(43,"Discount"),o(),T(44,PCe,2,0,"th",19),s(45,"th"),l(46,"Total"),o(),s(47,"th"),l(48,"Cash"),o(),s(49,"th"),l(50,"Card"),o(),s(51,"th"),l(52,"Card Last4"),o(),s(53,"th"),l(54,"Remark"),o()()(),s(55,"tbody",20),T(56,RCe,24,19,"tr",21),o(),s(57,"tfoot")(58,"tr")(59,"td")(60,"strong"),l(61,"Totals:"),o()(),s(62,"td")(63,"strong"),l(64),I(65,"currencyFormat"),o()(),s(66,"td")(67,"strong"),l(68),I(69,"currencyFormat"),o()(),T(70,OCe,4,3,"td",19),s(71,"td")(72,"strong"),l(73),I(74,"currencyFormat"),o()(),s(75,"td")(76,"strong"),l(77),I(78,"currencyFormat"),o()(),s(79,"td")(80,"strong"),l(81),I(82,"currencyFormat"),o()(),B(83,"td",22),o()()()()()()()()),r&2&&(p("ngClass",Z(22,ACe,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(32),p("ngIf",a.hasServiceCharge),m(12),p("ngForOf",a.tickets),m(8),b(M(65,12,a.total.Amount)),m(4),b(M(69,14,a.total.Discount)),m(2),p("ngIf",a.hasServiceCharge),m(3),b(M(74,16,a.hasServiceCharge?a.total.GrandTotal:a.total.Total)),m(4),b(M(78,18,a.total.Cash)),m(4),b(M(82,20,a.total.Card)))},dependencies:[ue,_e,Dt,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var e3=Di(Ti());var NCe=i=>({collapsed:i});
389function LCe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td",19)(25,"strong"),l(26),I(27,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_category),m(2),b(t.item_name),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,10,t.average_unit_price)),m(3),b(M(14,12,t.item_subtotal)),m(3),b(M(17,14,t.discount_subtotal)),m(3),b(M(20,16,t.complimentary_subtotal)),m(3),b(M(23,18,t.voided_subtotal)),m(4),b(M(27,20,t.item_total))}}function BCe(i,n){if(i&1&&(s(0,"div",25)(1,"div",26)(2,"span",27),l(3,"Service Charge (10%):"),o(),s(4,"span",28),l(5),I(6,"currencyFormat"),o()()()),i&2){let t=w();m(5),b(M(6,1,t.total.service_charge_subtotal))}}function VCe(i,n){if(i&1&&(s(0,"div",25)(1,"div",29)(2,"span"),l(3,"Total:"),o(),s(4,"span"),l(5),I(6,"currencyFormat"),o()()()),i&2){let t=w();m(5),b(M(6,1,t.total.grand_total))}}var IB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.hostelRestService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.sortedItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0,service_charge_subtotal:0,grand_total:0},this.hasServiceCharge=!1,this.isCollapsed=!1}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.hostelRestService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{console.log("API Response:",e),this.items=e.data.items,this.total=e.data.totals,this.hasServiceCharge=!!e.data.has_service_charge,this.sortItems(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}sortItems(){this.sortedItems=[...this.items].sort((e,r)=>e.item_category.localeCompare(r.item_category))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.hostelRestService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Hostel Restaurant Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,e3.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),console.log("Fetching data for date: "+this.selectedStartDate+" to "+this.selectedEndDate),this.hostelRestService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Hostel Restaurant Itemwise Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,e3.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Us),x(pe),x(me),x(ze),x(_t),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-item-wise-sales-report"]],standalone:!1,decls:123,vars:42,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"],["class","row",4,"ngIf"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Hostel Restaurant \u2014 Item Wise Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Category"),o(),s(44,"th"),l(45,"Item"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Ticket Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Discount Subtotal"),o(),s(56,"th"),l(57,"Complimentary Subtotal"),o(),s(58,"th"),l(59,"Voided Subtotal"),o(),s(60,"th",19),l(61,"Item Total"),o()()(),s(62,"tbody",20),T(63,LCe,28,22,"tr",21),o(),s(64,"tfoot")(65,"tr")(66,"td",22),l(67,"All Activities"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),s(80,"td",19)(81,"strong"),l(82),I(83,"currencyFormat"),o()()()()(),s(84,"div",23)(85,"div",24)(86,"div",25)(87,"div",26)(88,"span",27),l(89,"Subtotal:"),o(),s(90,"span"),l(91),I(92,"currencyFormat"),o()()(),s(93,"div",25)(94,"div",26)(95,"span",27),l(96,"Complimentary:"),o(),s(97,"span",28),l(98),I(99,"currencyFormat"),o()()(),s(100,"div",25)(101,"div",26)(102,"span",27),l(103,"Discounts:"),o(),s(104,"span",28),l(105),I(106,"currencyFormat"),o()()(),s(107,"div",25)(108,"div",26)(109,"span",27),l(110,"Voids:"),o(),s(111,"span",28),l(112),I(113,"currencyFormat"),o()()(),s(114,"div",25)(115,"div",29)(116,"span"),l(117,"Net Total:"),o(),s(118,"span"),l(119),I(120,"currencyFormat"),o()()(),T(121,BCe,7,3,"div",30)(122,VCe,7,3,"div",30),o()()()()()()()),r&2&&(p("ngClass",Z(40,NCe,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(47),p("ngForOf",a.sortedItems),m(6),b(M(70,20,a.total.item_subtotal)),m(3),b(M(73,22,a.total.discount_subtotal)),m(3),b(M(76,24,a.total.complimentary_subtotal)),m(3),b(M(79,26,a.total.voided_subtotal)),m(4),b(M(83,28,a.total.item_total)),m(9),b(M(92,30,a.total.item_subtotal)),m(7),b(M(99,32,a.total.complimentary_subtotal)),m(7),b(M(106,34,a.total.discount_subtotal)),m(7),b(M(113,36,a.total.voided_subtotal)),m(7),b(M(120,38,a.total.item_total)),m(2),p("ngIf",a.hasServiceCharge),m(),p("ngIf",a.hasServiceCharge))},dependencies:[ue,_e,Dt,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var UCe=i=>({collapsed:i}),jCe=(i,n)=>({completed:i,void:n});function WCe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td")(5,"div"),l(6),o()(),s(7,"td"),l(8),I(9,"date"),o(),s(10,"td",18),l(11),o(),s(12,"td")(13,"span",19),l(14),o()(),s(15,"td",10)(16,"strong"),l(17),I(18,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.ticket_id),m(3),_("by ",t.issuer),m(2),b(Jt(9,7,t.issue_Date,"MMM d, y \xB7 hh:mm a")),m(3),b(t.details),m(2),p("ngClass",Et(12,jCe,t.status.trim().toLowerCase()==="completed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(18,10,t.amount))}}function HCe(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",20),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var kB=(()=>{let n=class n{constructor(e,r,a,c,d,u,h){this.hostelRestService=e,this.spinner=r,this.toastr=a,this.cognitoService=c,this.router=d,this.sidebarService=u,this.currencyFormatPipe=h,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.hasServiceCharge=!1,this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.hostelRestService.getTicketSales(e).subscribe({next:r=>{if(console.log("API Response:",r),r&&r.data){this.items=r.data.items||[],this.hasServiceCharge=!!r.data.has_service_charge;for(let a=0;a<this.items.length;a++)this.items[a].issue_Date.endsWith("Z")&&(this.items[a].issue_Date=this.items[a].issue_Date.replace("Z",""),this.items[a].details=this.formatDetails(this.items[a].details));this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||20,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()}this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}formatDetails(e){return e.replace(/(\d+(?:\.\d+)?)/g,r=>{let a=Number(r);return a>50?this.currencyFormatPipe.transform(a):r})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&(console.log("Navigating to page:",e),this.getTicketSales(e))}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}onClickSignout(){this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Us),x(pe),x(me),x(ze),x(_t),x(ce),x(Be))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-ticket-sales"]],standalone:!1,features:[Ii([Be])],decls:38,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline","textwrap"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Hostel Restaurant Ticket Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Serial"),o(),s(16,"th"),l(1
3897,"User"),o(),s(18,"th"),l(19,"Issue Date (IST)"),o(),s(20,"th"),l(21,"Details"),o(),s(22,"th"),l(23,"Payment Status"),o(),s(24,"th",10),l(25,"Total (LKR)"),o()()(),s(26,"tbody",11),T(27,WCe,19,15,"tr",12),o()()()()(),s(28,"ul",13)(29,"li",14)(30,"button",15),S("click",function(){return a.prevPage()}),s(31,"span",16),l(32,"\xAB"),o()()(),T(33,HCe,3,3,"li",17),s(34,"li",14)(35,"button",15),S("click",function(){return a.nextPage()}),s(36,"span",16),l(37,"\xBB"),o()()()()()()),r&2&&(p("ngClass",Z(9,UCe,a.isCollapsed)),m(27),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var GCe=i=>({collapsed:i});function $Ce(i,n){if(i&1&&(s(0,"div",26)(1,"h3"),l(2),o(),s(3,"div",27),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.title==="Revenue (LKR)"||t.title==="Guide expense fee (LKR)"?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-2")," ")}}var MB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.hostelRestService=e,this.spinner=r,this.toastr=a,this.router=c,this.cognitoService=d,this.sidebarService=u,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.revenueItems=[],this.popularActivity=[],this.DatewiseVisitorCount=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0},this.total_foreign=0,this.total_local=0,this.total_revenue=0,this.total_guide_expense=0,this.isCollapsed=!1,this.summaryData=[{title:"Revenue (LKR)",amount:this.total_revenue,change:0,isPositive:!0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense,change:0,isPositive:!1},{title:"Foreign guest count",amount:this.total_foreign,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local,change:0,isPositive:!0}],this.selectedDateRange="2-9-2024 - 18-9-2024",this.startDate="",this.endDate=""}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.loadAnalyticsData()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}toggleDatePicker(){console.log("Date picker toggled")}onStartDateChange(e){this.startDate=e.target.value,this.updateSelectedRange()}onEndDateChange(e){this.endDate=e.target.value,this.updateSelectedRange()}updateSelectedRange(){this.startDate&&this.endDate&&(this.selectedDateRange=`${this.startDate} - ${this.endDate}`)}loadAnalyticsData(){!this.selectedStartDate||!this.selectedEndDate||(this.spinner.show(),this.total_revenue=0,this.total_guide_expense=0,A_({category:this.hostelRestService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).pipe(Fn(()=>Fi(null))),revenue:this.hostelRestService.getrevenueexpenseSales(this.selectedStartDate,this.selectedEndDate).pipe(Fn(()=>Fi(null))),popular:this.hostelRestService.getMostPopularActivity(this.selectedStartDate,this.selectedEndDate).pipe(Fn(()=>Fi(null))),visitor:this.hostelRestService.getVisitorCount(this.selectedStartDate,this.selectedEndDate).pipe(Fn(()=>Fi(null)))}).subscribe({next:({category:e,revenue:r,popular:a,visitor:c})=>{this.items=e?.data?.categoryWiseSales??[],this.total=e?.data?.totals??this.total,this.revenueItems=r?.data??[];for(let d of this.revenueItems)this.total_guide_expense+=Number(d.total_expense);this.popularActivity=(a?.data??[]).map(d=>({transaction_date:d.transaction_date,transactions:d.transactions.map(u=>({entity_id:u.entity_id,entity_name:u.entity_name,item_name:u.item_name,category:u.category,total_quantity:u.total_quantity,total_item_subtotal:u.total_item_subtotal}))})),this.DatewiseVisitorCount=c?.data?.result??[],this.total_foreign=c?.data?.total_foreign??0,this.total_local=c?.data?.total_local??0,this.updateSummaryData(),this.spinner.hide(),this.items.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.loadAnalyticsData()}}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,change:0,isPositive:this.total.item_total>=0},{title:"Guide expense fee (LKR)",amount:this.total_guide_expense||0,change:0,isPositive:this.total_guide_expense>=0},{title:"Foreign guest count",amount:this.total_foreign||0,change:0,isPositive:!0},{title:"Local guest count",amount:this.total_local||0,change:0,isPositive:!0}]}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.router.navigate(["login"])}};n.\u0275fac=function(r){return new(r||n)(x(Us),x(pe),x(me),x(_t),x(ze),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-analytics"]],standalone:!1,decls:38,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],[3,"items"],[1,"col-md-6"],[3,"DatewiseVisitorCount"],[3,"revenueItems","showExpense"],["title","Popular Items",3,"popularActivity"],[1,"summary-card",3,"ngClass"],[1,"amount"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Hostel Restaurant Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,$Ce,7,8,"div",18),o()(),s(28,"div")(29,"div",19)(30,"div",20),B(31,"app-category-wise-revenue",21),o(),s(32,"div",22),B(33,"app-visited-foreign-and-local-guest-counts",23),o(),s(34,"div",22),B(35,"app-revenue-and-expense",24),o(),s(36,"div",20),B(37,"app-most-popular-activity",25),o()()()()()()()),r&2&&(p("ngClass",Z(11,GCe,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items),m(2),p("DatewiseVisitorCount",a.DatewiseVisitorCount),m(2),p("revenueItems",a.revenueItems)("showExpense",!1),m(2),p("popularActivity",a.popularActivity))},dependencies:[ue,_e,Ke,Ne,Le,Jn,Zn,Qn,Ta,Dn,Be],encapsulation:2});let i=n;return i})();var zCe=i=>({collapsed:i}),YCe=i=>({show:i});function qCe(i,n){if(i&1){let t=he();s(0,"div",24)(1,"button",25),S("click",function(){let r=U(t).$implicit,a=w();return j(a.onCategorySelect(r.category_name))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();m(),Re("active",e.selectedCategory===t.category_name),m(),_(" ",t.category_name," ")}}function KCe(i,n){if(i&1){let t=he();s(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),l(4),o()(),s(5,"div",30)(6,"div",31)(7,"div",32)(8,"div",33)(9,"span",34),l(10,"LKR"),o(),s(11,"input",35),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(12,"div",36)(13,"button",37),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(14,"span",38),l(15,"save"),o(),l(16," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function XCe(i,n){if(i&1&&(s(0,"div",23)(1,"div",39)(2,"p",40),l(3," Are you sure you want to update the price for this item? "),o(),s(4,"div",41)(5,"p",42)(6,"strong"),l(7,"Item:"),o(),l(8),o(),s(9,"p",42)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",42)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",43)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedCategory," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function JCe(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function ZCe(i,n){if(i&1){let t=he();s(0,"div",44),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var AB=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.hostelRestService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.categories=[],this.selectedCategory="",this.filteredPriceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();console.log("user role",e),this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.hostelRestService.getItemPrice().subscribe({next:e=>{e.data&&(this.categories=e.data,this.priceItems=this.categories.reduce((r,a)=>r.concat((a.entityItems||[]).map(c=>this.mapItemWithPrices(c))),[]),this.categories.length>0&&(this.selectedCategory=this.categories[0].category_name,this.filteredPriceItems=(this.categories[0].entityItems||[]).map(r=>this.mapItemWithPrices(r)))),this.spinner.hide()},error:e=>{console.error("Error fetching item prices:",e),this.toastr.error("Failed to load item prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let u=this.priceItems.findIndex(f=>f.id===e);u!==-1&&(this.negativePriceItem=this.priceItems[u],this.showNegativePriceModal=!0);let h=r.target;this.negativePriceItem&&(h.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(u=>u.id===e);c!==-1&&(this.priceItems[c].price=a.toString());let d=this.filteredPriceItems.findIndex(u=>u.id===e);d!==-1&&(this.filteredPriceItems[d].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.filteredPriceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.hostelRestService.updateItemPrice(this.selectedItem).subscribe({next:e=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")}
389,complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.filteredPriceItems.findIndex(r=>r.id===this.selectedItem.id);e!==-1&&(this.filteredPriceItems[e].price=this.filteredPriceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}onCategorySelect(e){this.selectedCategory=e;let r=this.categories.find(a=>a.category_name===e);r?.entityItems&&(this.filteredPriceItems=r.entityItems.map(a=>this.mapItemWithPrices(a)))}mapItemWithPrices(e){return tt(le({},e),{visitor_type:e.visitor_type??"local",price:parseInt(e.price,10).toString(),originalPrice:parseInt(e.price,10).toString()})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Us),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-edit-price"]],standalone:!1,decls:47,vars:18,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"row"],[1,"col-12"],[1,"tabMenu","topSeparetor"],[1,"nav","flex-nowrap","overflow-auto"],["class","nav-item",4,"ngFor","ngForOf"],[1,"analytics-chart"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"nav-item"],[1,"nav-link","mx-1",3,"click"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Hostel Restaurant \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7),T(10,qCe,3,3,"div",8),o()()()(),s(11,"div",9)(12,"div",4),T(13,KCe,17,4,"div",10),o()()()(),s(14,"div",11)(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5",15),l(19,"Confirm Price Update"),o(),s(20,"button",16),S("click",function(){return a.cancelModal()}),o()(),T(21,XCe,21,4,"div",17),s(22,"div",18)(23,"button",19),S("click",function(){return a.cancelModal()}),l(24," Cancel "),o(),s(25,"button",20),S("click",function(){return a.confirmSavePrice()}),l(26," Confirm Update "),o()()()()(),T(27,JCe,1,0,"div",21),s(28,"div",22)(29,"div",12)(30,"div",13)(31,"div",14)(32,"h5",15),l(33,"Invalid Price"),o(),s(34,"button",16),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(35,"div",23)(36,"p"),l(37," The price for "),s(38,"strong"),l(39),o(),l(40," cannot be negative. "),o(),s(41,"p"),l(42,"Please enter a valid price."),o()(),s(43,"div",18)(44,"button",20),S("click",function(){return a.closeNegativePriceModal()}),l(45," OK "),o()()()()(),T(46,ZCe,1,0,"div",21)),r&2&&(p("ngClass",Z(14,zCe,a.isCollapsed)),m(10),p("ngForOf",a.categories),m(3),p("ngForOf",a.filteredPriceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(16,YCe,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".chartBox-header[_ngcontent-%COMP%] .chartTitle[_ngcontent-%COMP%]{flex:1;min-width:0;margin-right:8px}.chartBox-header[_ngcontent-%COMP%] .badge[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 10px;font-size:12px;font-weight:500;color:#fff!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-primary[_ngcontent-%COMP%]{background-color:#0d6efd!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-success[_ngcontent-%COMP%]{background-color:#198754!important}.chartBox-header[_ngcontent-%COMP%] .badge.bg-warning[_ngcontent-%COMP%]{background-color:#fd7e14!important}.modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var t3=Di(Ti());var QCe=i=>({collapsed:i});function eEe(i,n){if(i&1&&(s(0,"option",26),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function tEe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function iEe(i,n){i&1&&(s(0,"th",22),l(1," Service Charge (10%) "),o())}function nEe(i,n){i&1&&(s(0,"th",22),l(1,"Total"),o())}
389function rEe(i,n){if(i&1&&(s(0,"td",22),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.service_charge.toLocaleString()," ")}}function aEe(i,n){if(i&1&&(s(0,"td",22),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.grand_total.toLocaleString()," ")}}function oEe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o(),T(10,rEe,2,1,"td",23)(11,aEe,2,1,"td",23),o()),i&2){let t=n.$implicit,e=w();m(2),b(M(3,6,t.transaction_date)),m(3),_(" ",t.cash_income.toLocaleString()," "),m(2),_(" ",t.card_income.toLocaleString()," "),m(2),_(" ",t.net_total.toLocaleString()," "),m(),p("ngIf",e.hasServiceCharge),m(),p("ngIf",e.hasServiceCharge)}}function sEe(i,n){if(i&1&&(s(0,"td",22),l(1),o()),i&2){let t=w();m(),_(" ",t.scTotal.toLocaleString()," ")}}function lEe(i,n){if(i&1&&(s(0,"td",22),l(1),o()),i&2){let t=w();m(),_(" ",t.grandTotal.toLocaleString()," ")}}var PB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.hostelRestService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.scTotal=0,this.grandTotal=0,this.hasServiceCharge=!1}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);e?this.selectedMonthNumber=e.number:this.selectedMonthNumber=1,console.log("selectedMonthNumber",this.selectedMonthNumber)}onClickGenerategetGuideWiseExpense(){this.selectedMonth&&this.selectedYear&&(console.log(this.selectedMonthNumber,this.selectedYear),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear))}onClickGenerategetGuideWiseExpenseExcel(){this.getMonthlySalesExcel()}onClickGenerategetGuideWiseExpensePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.hostelRestService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({entity_id:c.entity_id,entity_name:c.entity_name,transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),total_revenue:Number(c.total_revenue),net_total:Number(c.net_total??c.total_revenue),service_charge:Number(c.service_charge??0),grand_total:Number(c.grand_total??c.total_revenue)})),this.hasServiceCharge=this.salesData.some(c=>c.service_charge>0),this.calculateTotals(),console.log("response",a)),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.totalRevenue=0,this.scTotal=0,this.grandTotal=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.totalRevenue+=e.total_revenue,this.scTotal+=e.service_charge,this.grandTotal+=e.grand_total})}getMonthlySalesExcel(){this.spinner.show(),this.hostelRestService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Hostel Restaurant Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,t3.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.hostelRestService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Hostel Restaurant Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,t3.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Us))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-monthly-sales-report"]],standalone:!1,decls:66,vars:16,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,eEe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,tEe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerategetGuideWiseExpense()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpenseExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGenerategetGuideWiseExpensePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Net Total"),o(),T(50,iEe,2,0,"th",23)(51,nEe,2,0,"th",23),o()(),s(52,"tbody",24),T(53,oEe,12,8,"tr",11),o(),s(54,"tfoot",25)(55,"tr")(56,"td"),l(57,"Total"),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o(),s(62,"td",22),l(63),o(),T(64,sEe,2,1,"td",23)(65,lEe,2,1,"td",23),o()()()()()()()()),r&2&&(p("ngClass",Z(14,QCe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(28),p("ngIf",a.hasServiceCharge),m(),p("ngIf",a.hasServiceCharge),m(2),p("ngForOf",a.salesData),m(6),_(" ",a.cashTotal.toLocaleString()," "),m(2),_(" ",a.cardTotal.toLocaleString()," "),m(2),_(" ",a.totalRevenue.toLocaleString()," "),m(),p("ngIf",a.hasServiceCharge),m(),p("ngIf",a.hasServiceCharge))},dependencies:[ue,_e,Dt,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var cEe=i=>({collapsed:i}),dEe=(i,n)=>({"btn-outline-primary":i,"btn-outline-secondary":n}),FB=(i,n)=>({"is-invalid":i,"is-warning":n});function mEe(i,n){if(i&1&&(s(0,"div",58),B(1,"i",59),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate),". ")}}function uEe(i,n){if(i&1&&(s(0,"option",60),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function pEe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function hEe(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function fEe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function gEe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_cash_show,r)||(a.actual_amount_received_cash_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();
389return j(c.formatAmount(r,"cash",a))}),o(),T(3,hEe,2,0,"div",68)(4,fEe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_cash_show),p("ngClass",Et(5,FB,t.invalid&&t.touched,r.isAmountMismatchCash(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCash(e))}}function vEe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_cash_amount==null?null:t.actual_cash_amount.toLocaleString()," ")}}function _Ee(i,n){i&1&&(s(0,"div",70),l(1," Actual amount cannot be negative. "),o())}function yEe(i,n){i&1&&(s(0,"div",71),l(1," Amount Mismatch "),o())}function SEe(i,n){if(i&1){let t=he();s(0,"td",63)(1,"input",67,1),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_amount_received_card_show,r)||(a.actual_amount_received_card_show=r),j(r)}),S("input",function(r){U(t);let a=w().$implicit,c=w();return j(c.formatAmount(r,"card",a))}),o(),T(3,_Ee,2,0,"div",68)(4,yEe,2,0,"div",69),o()}if(i&2){let t=Qt(2),e=w().$implicit,r=w();m(),p("disabled",r.shouldDisableControls(e)),q("ngModel",e.actual_amount_received_card_show),p("ngClass",Et(5,FB,t.invalid&&t.touched,r.isAmountMismatchCard(e))),m(2),p("ngIf",t.invalid&&t.touched),m(),p("ngIf",r.isAmountMismatchCard(e))}}function bEe(i,n){if(i&1&&(s(0,"td",63),l(1),o()),i&2){let t=w().$implicit;m(),_(" ",t.actual_card_amount==null?null:t.actual_card_amount.toLocaleString()," ")}}function xEe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",72),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function CEe(i,n){i&1&&(s(0,"span",73),B(1,"i",74),o())}function EEe(i,n){if(i&1){let t=he();s(0,"tr",61)(1,"td",62),l(2),I(3,"date"),o(),s(4,"td",63),l(5),o(),s(6,"td",63),l(7),o(),T(8,gEe,5,8,"td",64)(9,vEe,2,1,"td",64)(10,SEe,5,8,"td",64)(11,bEe,2,1,"td",64),s(12,"td",63)(13,"button",65),S("click",function(){let r=U(t).$implicit,a=w();return j(r.is_confirmed?a.openShowInvalidTicketsModal(r):a.openAddInvalidTicketsModal(r))}),l(14),o()(),s(15,"td",63),T(16,xEe,3,1,"ng-container",66)(17,CEe,2,0,"ng-template",null,0,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(18),r=w();Re("p-1",t.date===r.earliestUnconfirmedDate),p("ngClass",r.getRowClass(t)),m(2),b(M(3,15,t.date)),m(3),_(" ",t.system_cash_amount.toLocaleString()," "),m(2),_(" ",t.system_card_amount.toLocaleString()," "),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(),p("ngIf",!t.is_confirmed),m(),p("ngIf",t.is_confirmed),m(2),p("ngClass",Et(17,dEe,!t.is_confirmed,t.is_confirmed))("disabled",r.shouldDisableControls(t)&&!t.is_confirmed),m(),_(" ",t.is_confirmed?"View Invalid Tickets":"Add Invalid Tickets"," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e)}}function wEe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function TEe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,wEe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invalid_tickets)}}function DEe(i,n){if(i&1){let t=he();s(0,"tr")(1,"td",62),l(2),o(),s(3,"td",62),l(4),o(),s(5,"td",62)(6,"button",76),S("click",function(){let r=U(t).$implicit,a=w();return j(a.removeTicket(r))}),B(7,"i",77),o()()()}if(i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function IEe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o()()),i&2){let t=n.$implicit;m(2),_("#",t.id),m(2),b(t.reason||"-")}}function kEe(i,n){if(i&1&&(s(0,"div")(1,"h6"),l(2,"Invalid Tickets:"),o(),s(3,"table",22)(4,"thead",75)(5,"tr")(6,"th"),l(7,"Invalid Ticket Number"),o(),s(8,"th"),l(9,"Ticket Reason"),o()()(),s(10,"tbody"),T(11,IEe,5,2,"tr",15),o()()()),i&2){let t=w();m(11),p("ngForOf",t.selectedTicket.item==null?null:t.selectedTicket.item.invali
389d_tickets)}}var RB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.hostelRestService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.hasUnconfirmedPreviousTransactions=!1,this.todayDate=new Date().toISOString().split("T")[0],this.confirmModalInstance=null,this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.systemAmountTotal=0,this.actualAmountRecievedTotal=0,this.posList=[],this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:null,tempInvalidTickets:[]},this.confirmationData=null,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}ngAfterViewInit(){let e=document.getElementById("invalidTicketsModal"),r=document.getElementById("showInvalidTicketsModal");e?.addEventListener("hidden.bs.modal",()=>{e.setAttribute("inert","true"),this.selectedTicket.tempInvalidTickets=[]}),r?.addEventListener("hidden.bs.modal",()=>{r.setAttribute("inert","true")})}checkUnconfirmedPreviousTransactions(){let e=new Date().toISOString().split("T")[0],a=[...this.salesData].sort((c,d)=>new Date(c.date).getTime()-new Date(d.date).getTime()).find(c=>c.date<=e&&!c.is_confirmed);this.earliestUnconfirmedDate=a?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}getRowClass(e){let{is_confirmed:r,system_card_amount:a,actual_card_amount:c,system_cash_amount:d,actual_cash_amount:u,date:h}=e;if(r)return a!==c||d!==u?"table-danger":"table-success";if(!r){if(h<this.todayDate)return h===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary";if(this.isTodaysRow(h))return"table-light"}return""}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}isAmountMismatchCash(e){return!!(e.system_cash_amount!=(e.actual_cash_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}isAmountMismatchCard(e){return!!(e.system_card_amount!=(e.actual_card_amount??0)&&!e.is_confirmed&&this.shouldEnableRow(e))}formatAmount(e,r,a){let c=e.target.value,d=0;c=c.replace(/[^0-9.]/g,""),d=Number(c);let u=c.split(".");u[0]=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),c=u.join("."),r==="cash"&&(a.actual_cash_amount=d),r==="card"&&(a.actual_card_amount=d),e.target.value=c}openShowInvalidTicketsModal(e){if(e.invalid_tickets.length!==0){this.selectedTicket.item=e;let r=document.getElementById("showInvalidTicketsModal");r&&r.removeAttribute("inert"),this.showModalInstance=new Zt(r),this.showModalInstance.show()}else this.toastr.warning("No data available")}openAddInvalidTicketsModal(e){if(e.actual_card_amount!=null&&e.actual_card_amount>=0||e.actual_cash_amount!=null&&e.actual_cash_amount>=0){this.selectedTicket={ticketId:null,pos_unit_id:15,pos_unit_code:"POS1",reason:"",item:e,tempInvalidTickets:[...e.invalid_tickets]};let r=document.getElementById("invalidTicketsModal");r&&r.removeAttribute("inert"),this.addModalInstance||(this.addModalInstance=new Zt(r)),this.addModalInstance.show()}else this.toastr.warning("Please enter amount")}clearForm(){this.selectedTicket.ticketId=null,this.selectedTicket.reason=""}addToList(){let{ticketId:e,reason:r}=this.selectedTicket;r=r.trim(),e?this.selectedTicket.tempInvalidTickets.find(c=>c.id===e)?this.toastr.warning("This ticket is already present in the list."):(this.selectedTicket.tempInvalidTickets.push({id:e,pos_unit_id:15,pos_unit_code:"POS1",reason:r}),this.toastr.success("Invalid ticket added to the list."),this.selectedTicket.ticketId=null,this.selectedTicket.reason=""):this.toastr.error("Please enter Ticket ID and provide a Reason.")}removeTicket(e){this.selectedTicket.tempInvalidTickets=this.selectedTicket.tempInvalidTickets.filter(r=>r.id!==e.id),this.toastr.info("Invalid ticket removed.")}saveInvalidTickets(){if(this.selectedTicket.item){let e=this.selectedTicket.tempInvalidTickets.map(a=>({id:a.id,pos_unit_id:15,pos_unit_code:"POS1",reason:a.reason}));
389this.selectedTicket.item.invalid_tickets=e,this.toastr.success("Invalid tickets saved Successfully."),this.addModalInstance.hide();let r=document.getElementById("invalidTicketsModal");r&&r.setAttribute("inert","true")}}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.salesData.forEach(e=>{this.systemCashTotal+=e.system_cash_amount,this.systemCardTotal+=e.system_card_amount,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0})}onClickConfirm(e){if(e.actual_card_amount===null||e.actual_card_amount===void 0||e.actual_cash_amount===null||e.actual_cash_amount===void 0){this.toastr.warning("Please enter amount");return}if(e.actual_card_amount<0||e.actual_cash_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.confirmationData=e,this.openConfirmModal(e)}openConfirmModal(e){this.selectedTicket.item=e;let r=document.getElementById("confirmModal");r&&(r.removeAttribute("inert"),this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}isDateGreaterThanToday(e){let r=new Date;return new Date(e)>r}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.hostelRestService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data,this.calculateTotals(),this.checkUnconfirmedPreviousTransactions()),this.spinner.hide(),this.salesData.length==0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}confirmTransaction(){this.selectedTicket.item?.actual_card_amount!==null&&this.selectedTicket.item?.actual_card_amount!==void 0&&this.selectedTicket.item?.actual_card_amount>=0&&this.selectedTicket.item?.actual_cash_amount!==null&&this.selectedTicket.item?.actual_cash_amount!==void 0&&this.selectedTicket.item?.actual_cash_amount>=0&&(this.spinner.show(),this.hostelRestService.confirmDailyTransactions(this.selectedTicket.item).subscribe({next:e=>{this.toastr.success("Transaction Confirmed","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(Us))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-rest-daily-transaction-verification"]],standalone:!1,decls:169,vars:33,consts:[["confirmedIcon",""],["amountInput","ngModel"],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass","p-1",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","showInvalidTicketsModal","tabindex","-1","aria-labelledby","showInvalidTicketsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","showInvalidTicketsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[4,"ngIf"],["id","invalidTicketsModal","tabindex","-1","aria-labelledby","invalidTicketsModalLabel","inert","",1,"modal","fade"],["id","invalidTicketsModalLabel",1,"modal-title"],[1,"modal-body","border-gray-500","p-2","m-3","custom-dashed",2,"background-color","#fafafa"],[3,"ngSubmit"],[1,"mb-3"],["for","ticketNumber",1,"form-label"],["type","number","min","0","id","ticketNumber","name","ticketId","placeholder","Enter the invalid ticket number","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","ticketReason",1,"form-label"],["id","ticketReason","rows","3","name","reason","placeholder","Enter the reason for invalidating the ticket","required","",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","me-3",3,"click"],["type","submit",1,"btn","btn-outline-primary"],[1,"d-flex","justify-content-start","w-100","p-0"],[1,"table-responsive","w-100","ms-2",2,"max-height","200px"],[1,"table","table-header","text-start","w-100"],[1,"thead","sticky-top","bg-white"],[1,"pe-10"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],["class","text-end align-middle",4,"ngIf"],[1,"btn","btn-sm",3,"click","ngClass","disabled"],[4,"ngIf","ngIfElse"],["type","text","placeholder","Enter amount","min","0","nonNegative","",1,"form-control","form-control-sm","text-end",3,"ngModelChange","input","disabled","ngModel","ngClass"],["class","invalid-feedback",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"invalid-feedback"],[1,"text-warning"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"table-light"],["type","button",1,"btn","btn-link","text-primary",3,"click"],[1,"fas","fa-times-circle","fa-2x"]],template:function(r,a){r&1&&(s(0,"div",2)(1,"div",3),T(2,mEe,5,3,"div",4),s(3,"div",5)(4,"div")(5,"div",6),l(6,"Daily Transaction Verification"),o()()(),s(7,"div",7)(8,"div",8)(9,"div",9)(10,"label",10),l(11,"Month"),o(),s(12,"select",11),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",12),l(14,"Select Month"),o(),T(15,uEe,2,2,"option",13),o()(),s(16,"div",9)(17,"label",10),l(18,"Year"),o(),s(19,"select",14),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",12),l(21,"Select Year"),o(),T(22,pEe,2,1,"option",15),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",2)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,EEe,19,20,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Invalid Tickets and Ticket Reasons "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"p")(79,"strong"),l(80,"System Cash:"),o(),l(81),o(),s(82,"p")(83,"strong"),l(84,"System Card:"),o(),l(85),o(),s(86,"p")(87,"strong"),l(88,"Actual Cash:"),o(),l(89),o(),s(90,"p")(91,"strong"),l(92,"Actual Card:"),o(),l(93),o(),T(94,TEe,12,1,"div",35),o()()()(),s(95,"div",36)(96,"div",29)(97,"div",30)(98,"div",31)(99,"h5",37),l(100," Invalid Tickets "),o(),B(101,"button",33),o(),s(102,"div",38)(103,"form",39),S("ngSubmit",function(){return a.addToList()}),s(104,"div",40)(105,"label",41),l(106,"Invalid Ticket Number"),o(),s(107,"input",42),X("ngModelChange",function(d){return K(a.selectedTicket.ticketId,d)||(a.selectedTicket.ticketId=d),d}),o()(),s(108,"div",40)(109,"label",43),l(110,"Ticket Reason"),o(),s(111,"textarea",44),X("ngModelChange",function(d){return K(a.selectedTicket.reason,d)||(a.selectedTicket.reason=d),d}),o()(),s(112,"div",45)(113,"button",46),S("click",function(){return a.clearForm()}),l(114," Cancel "),o(),s(115,"button",47),l(116," Add To List "),o()()()(),s(117,"div",48)(118,"div",49)(119,"table",50)(120,"thead",51)(121,"tr")(122,"th",52),l(123,"Invalid Ticket Number"),o(),s(124,"th"),l(125,"Reason"),o(),B(126,"th"),o()(),s(127,"tbody"),T(128,DEe,8,2,"tr",15),o()()()(),s(129,"div",53)(130,"button",54),l(131," Cancel "),o(),s(132,"button",55),S("click",function(){return a.saveInvalidTickets()}),l(133," Save "),o()()()()(),s(134,"div",56)(135,"div",29)(136,"div",30)(137,"div",31)(138,"h5",57),l(139,"Confirm Transaction"),o(),B(140,"button",33),o(),s(141,"div",34)(142,"p")(143,"strong"),l(144,"Date:"),o(),l(145),I(146,"date"),o(),s(147,"p")(148,"strong"),l(149,"System Cash:"),o(),l(150),o(),s(151,"p")(152,"strong"),l(153,"System Card:"),o(),l(154),o(),s(155,"p")(156,"strong"),l(157,"Actual Cash:"),o(),l(158),o(),s(159,"p")(160,"strong"),l(161,"Actual Card:"),o(),l(162),o(),T(163,kEe,12,1,"div",35),o(),s(164,"div",53)(165,"button",54),l(166," Cancel "),o(),s(167,"button",55),S("click",function(){return a.confirmTransaction()}),l(168," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(31,cEe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),_(" ",a.systemCashTotal.toLocaleStr
389ing()," "),m(2),_(" ",a.systemCardTotal.toLocaleString()," "),m(2),_(" ",a.actualCashTotal.toLocaleString()," "),m(2),_(" ",a.actualCardTotal.toLocaleString()," "),m(14),_(" ",M(77,27,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length),m(13),q("ngModel",a.selectedTicket.ticketId),m(4),q("ngModel",a.selectedTicket.reason),m(17),p("ngForOf",a.selectedTicket.tempInvalidTickets),m(17),_(" ",M(146,29,a.selectedTicket.item==null?null:a.selectedTicket.item.date)," "),m(5),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_cash_amount==null?null:a.selectedTicket.item.system_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.system_card_amount==null?null:a.selectedTicket.item.system_card_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_cash_amount==null?null:a.selectedTicket.item.actual_cash_amount.toLocaleString()," "),m(4),_(" LKR ",a.selectedTicket.item==null||a.selectedTicket.item.actual_card_amount==null?null:a.selectedTicket.item.actual_card_amount.toLocaleString()," "),m(),p("ngIf",a.selectedTicket.item==null||a.selectedTicket.item.invalid_tickets==null?null:a.selectedTicket.item.invalid_tickets.length))},dependencies:[ue,_e,Dt,Ni,Bt,Vt,Ke,qi,Ot,Ne,Oi,vn,gn,Le,fn,In,St],styles:[".custom-dashed[_ngcontent-%COMP%]{border:4px dashed #b6c1d2!important;border-style:dashed!important;border-width:2px!important;border-spacing:3px!important}input[type=number][_ngcontent-%COMP%]::-webkit-outer-spin-button, input[type=number][_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield;appearance:none}.table-header[_ngcontent-%COMP%]{font-weight:500;color:#495057;background-color:#f8f9fa;border-bottom:2px solid #dee2e6}"]});let i=n;return i})();var js=(()=>{let n=class n{constructor(e){this.http=e,this.apiUrl=ui.apiUrl+"/api/hostel",this.jsonHeaders=new xe({"Content-Type":"application/json"})}getTicketSales(e,r,a){let c={current_page:e};return r&&(c.from=r),a&&(c.to=a),this.http.post(this.apiUrl+"/sales/report",c,{headers:this.jsonHeaders})}getDailySales(e){return this.http.post(this.apiUrl+"/sales/daily",{start_date:e},{headers:this.jsonHeaders})}getDailySalesPDF(e){return this.http.post(this.apiUrl+"/sales/daily/pdf",{start_date:e},{headers:this.jsonHeaders,responseType:"blob"})}getDailySalesExcel(e){return this.http.post(this.apiUrl+"/sales/daily/excel",{start_date:e},{headers:this.jsonHeaders,responseType:"blob"})}getItemWiseSales(e,r){return this.http.post(this.apiUrl+"/sales/room-type-wise",{start_date:e,end_date:r},{headers:this.jsonHeaders})}getItemWiseSalesPDF(e,r){return this.http.post(this.apiUrl+"/sales/room-type-wise/pdf",{start_date:e,end_date:r},{headers:this.jsonHeaders,responseType:"blob"})}getItemWiseSalesExcel(e,r){return this.http.post(this.apiUrl+"/sales/room-type-wise/excel",{start_date:e,end_date:r},{headers:this.jsonHeaders,responseType:"blob"})}getCategoryWiseSales(e,r){return this.http.post(this.apiUrl+"/sales/category-wise",{start_date:e,end_date:r},{headers:this.jsonHeaders})}getMonthlySales(e,r){return this.http.post(this.apiUrl+"/sales/monthly-report",{month:Number(e),year:Number(r)},{headers:this.jsonHeaders})}getMonthlySalesPDF(e,r){return this.http.post(this.apiUrl+"/sales/monthly-report/pdf",{month:Number(e),year:Number(r)},{headers:this.jsonHeaders,responseType:"blob"})}getMonthlySalesExcel(e,r){return this.http.post(this.apiUrl+"/sales/monthly-report/excel",{month:Number(e),year:Number(r)},{headers:this.jsonHeaders,responseType:"blob"})}getDailyTransactionsToVerify(e,r){return this.http.post(this.apiUrl+"/sales/get-daily-confirmation",{month:Number(e),year:Number(r)},{headers:this.jsonHeaders})}confirmDailyTransactions(e){return this.http.post(this.apiUrl+"/sales/save-daily-confirmation",e,{headers:this.jsonHeaders})}getRoomTypes(){return this.http.get(this.apiUrl+"/room-types",{headers:this.jsonHeaders})}updateItemPrice(e){let r={id:e.id,price:e.price};return this.http.post(this.apiUrl+"/room-types/update-price",r,{headers:this.jsonHeaders})}};n.\u0275fac=function(r){return new(r||n)(kt(Bi))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var MEe=i=>({collapsed:i}),AEe=(i,n)=>({completed:i,void:n});
389function PEe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),o(),s(6,"td")(7,"div",18),l(8),o()(),s(9,"td"),l(10),I(11,"date"),o(),s(12,"td",19),l(13),o(),s(14,"td",20),l(15),o(),s(16,"td")(17,"span",21),l(18),o()(),s(19,"td",10)(20,"strong"),l(21),I(22,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(3),_("#",t.booking_id),m(2),b(t.guest_name),m(3),_("by ",t.issuer),m(2),_(" ",Jt(11,9,t.issue_Date,"MMM d, y \xB7 hh:mm:ss a")," "),m(3),b(t.details),m(2),_(" ",t.payment_method," "),m(2),p("ngClass",Et(14,AEe,t.status.trim().toLowerCase()==="confirmed",t.status.trim().toLowerCase()==="voided")),m(),_(" ",t.status," "),m(3),b(M(22,12,t.amount))}}function FEe(i,n){if(i&1){let t=he();s(0,"li",14)(1,"button",22),S("click",function(){let r=U(t).$implicit,a=w();return j(a.goToPage(r))}),l(2),o()()}if(i&2){let t=n.$implicit,e=w();Re("active",t===e.currentPage),m(2),b(t)}}var OB=(()=>{let n=class n{constructor(e,r,a,c){this.hostelBookingsService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.items=[],this.currentPage=1,this.itemsPerPage=0,this.totalItems=0,this.totalPages=0,this.pages=[],this.isCollapsed=!1}ngOnInit(){this.getTicketSales(this.currentPage),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e})}getTicketSales(e){this.spinner.show(),this.hostelBookingsService.getTicketSales(e).subscribe({next:r=>{r&&r.data&&(this.items=r.data.items||[],this.currentPage=r.data.currentPage||1,this.itemsPerPage=r.data.itemsPerPage||10,this.totalItems=r.data.totalItems||0,this.totalPages=r.data.totalPages||0,this.updatePagination()),this.spinner.hide(),this.scrollToTop()},error:r=>{console.error("API Error:",r),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}updatePagination(){let e=Math.min(10,this.totalPages),r=Math.max(1,this.currentPage-Math.floor(e/2)),a=Math.min(this.totalPages,r+e-1);this.pages=Array.from({length:a-r+1},(c,d)=>r+d)}goToPage(e){e!==this.currentPage&&e>=1&&e<=this.totalPages&&this.getTicketSales(e)}nextPage(){this.goToPage(this.currentPage+1)}prevPage(){this.goToPage(this.currentPage-1)}scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}};n.\u0275fac=function(r){return new(r||n)(x(js),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-ticket-sales"]],standalone:!1,features:[Ii([Be])],decls:42,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"container-body"],[1,"bodyContent"],[1,"table-wrapper"],[1,"table-responsive","withOutFilter"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[4,"ngFor","ngForOf"],[1,"pagination"],[1,"page-item"],[1,"page-link",3,"click","disabled"],["aria-hidden","true"],["class","page-item",3,"active",4,"ngFor","ngForOf"],[1,"subTextline"],[1,"subTextline","textwrap"],[2,"text-transform","capitalize"],[1,"status",2,"text-transform","capitalize",3,"ngClass"],[1,"page-link",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Altitude Ambuluwawa \u2014 Booking Sales"),o(),s(5,"div",3),l(6,"Transaction Log"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"table",8)(12,"thead",9)(13,"tr")(14,"th"),l(15,"#Booking"),o(),s(16,"th"),l(17,"Guest"),o(),s(18,"th"),l(19,"User"),o(),s(20,"th"),l(21,"Issue Date (IST)"),o(),s(22,"th"),l(23,"Details"),o(),s(24,"th"),l(25,"Payment"),o(),s(26,"th"),l(27,"Status"),o(),s(28,"th",10),l(29,"Amount (LKR)"),o()()(),s(30,"tbody",11),T(31,PEe,23,17,"tr",12),o()()()()()(),s(32,"ul",13)(33,"li",14)(34,"button",15),S("click",function(){return a.prevPage()}),s(35,"span",16),l(36,"\xAB"),o()()(),T(37,FEe,3,3,"li",17),s(38,"li",14)(39,"button",15),S("click",function(){return a.nextPage()}),s(40,"span",16),l(41,"\xBB"),o()()()()()),r&2&&(p("ngClass",Z(9,MEe,a.isCollapsed)),m(31),p("ngForOf",a.items),m(2),Re("disabled",a.currentPage===1),m(),p("disabled",a.currentPage===1),m(3),p("ngForOf",a.pages),m(),Re("disabled",a.currentPage===a.totalPages),m(),p("disabled",a.currentPage===a.totalPages))},dependencies:[ue,_e,St,Be],encapsulation:2});let i=n;return i})();var i3=Di(Ti());var REe=i=>({collapsed:i});
389function OEe(i,n){if(i&1&&(s(0,"tr")(1,"td")(2,"div"),l(3),o()(),s(4,"td"),l(5),o(),s(6,"td"),l(7),I(8,"currencyFormat"),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td"),l(19),I(20,"currencyFormat"),o(),s(21,"td"),l(22),I(23,"currencyFormat"),o(),s(24,"td"),l(25),o()()),i&2){let t=n.$implicit;m(3),_("#",t.booking_id),m(2),b(t.guest_name),m(2),b(M(8,9,t.amount)),m(3),b(M(11,11,t.discount)),m(3),b(M(14,13,t.total)),m(3),b(M(17,15,t.cash_amount)),m(3),b(M(20,17,t.card_amount)),m(3),b(M(23,19,t.online_amount)),m(3),b(t.remark||"")}}var NB=(()=>{let n=class n{constructor(e,r,a,c){this.hostelBookingsService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedDate=null,this.isCollapsed=!1,this.formattedDate="",this.tickets=[],this.total={Amount:0,Card:0,Cash:0,Online:0,Discount:0,Total:0}}ngOnInit(){this.setTodayDate(),this.formattedDate=this.formatDate(new Date(this.selectedDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getDailySales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getDailySales(){this.selectedDate&&(this.spinner.show(),this.hostelBookingsService.getDailySales(this.selectedDate).subscribe({next:e=>{this.tickets=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.tickets.length===0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateDailySales(){if(this.selectedDate){let e=new Date(this.selectedDate);this.formattedDate=this.formatDate(e),this.getDailySales()}}onClickGenerateDailySalesPDF(){this.getDailySalesPDF()}getDailySalesPDF(){this.selectedDate&&(this.spinner.show(),this.hostelBookingsService.getDailySalesPDF(this.selectedDate).subscribe({next:e=>{let r=`Altitude Ambuluwawa Daily Sales ${this.selectedDate}.pdf`;(0,i3.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}onClickGenerateDailySalesExcel(){this.getDailySalesExcel()}getDailySalesExcel(){this.selectedDate&&(this.spinner.show(),this.hostelBookingsService.getDailySalesExcel(this.selectedDate).subscribe({next:e=>{let r=`Altitude Ambuluwawa Daily Sales ${this.selectedDate}.xlsx`;(0,i3.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}onClickGeneratePrint(){window.print()}};n.\u0275fac=function(r){return new(r||n)(x(js),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-daily-sales-report"]],standalone:!1,decls:81,vars:25,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","date-picker","name","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","2"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Altitude Ambuluwawa \u2014 Daily Sales Report"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"Select day"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedDate,d)||(a.selectedDate=d),d}),o()(),s(13,"div",9)(14,"button",10),S("click",function(){return a.onClickGenerateDailySales()}),s(15,"span",11),l(16,"search"),o(),l(17," Generate "),o()()(),s(18,"div",9)(19,"button",12),S("click",function(){return a.onClickGenerateDailySalesPDF()}),s(20,"span",11),l(21,"picture_as_pdf"),o(),l(22,"Pdf "),o(),s(23,"button",12),S("click",function(){return a.onClickGenerateDailySalesExcel()}),s(24,"span",11),l(25,"description"),o(),l(26,"Excel "),o(),s(27,"button",12),S("click",function(){return a.onClickGeneratePrint()}),s(28,"span",11),l(29,"print"),o(),l(30,"Print "),o()()(),s(31,"div",13)(32,"div",14)(33,"div",15)(34,"div",16)(35,"table",17)(36,"thead",18)(37,"tr")(38,"th"),l(39,"#Booking"),o(),s(40,"th"),l(41,"Guest"),o(),s(42,"th"),l(43,"Amount"),o(),s(44,"th"),l(45,"Discount"),o(),s(46,"th"),l(47,"Total"),o(),s(48,"th"),l(49,"Cash"),o(),s(50,"th"),l(51,"Card"),o(),s(52,"th"),l(53,"Online"),o(),s(54,"th"),l(55,"Remark"),o()()(),s(56,"tbody",19),T(57,OEe,26,21,"tr",20),o(),s(58,"tfoot")(59,"tr")(60,"td",21),l(61,"Totals:"),o(),s(62,"td"),l(63),I(64,"currencyFormat"),o(),s(65,"td"),l(66),I(67,"currencyFormat"),o(),s(68,"td"),l(69),I(70,"currencyFormat"),o(),s(71,"td"),l(72),I(73,"currencyFormat"),o(),s(74,"td"),l(75),I(76,"currencyFormat"),o(),s(77,"td"),l(78),I(79,"currencyFormat"),o(),B(80,"td"),o()()()()()()()()),r&2&&(p("ngClass",Z(23,REe,a.isCollapsed)),m(6),b(a.formattedDate),m(6),q("ngModel",a.selectedDate),He("max",a.minDate),m(45),p("ngForOf",a.tickets),m(6),b(M(64,11,a.total.Amount)),m(3),b(M(67,13,a.total.Discount)),m(3),b(M(70,15,a.total.Total)),m(3),b(M(73,17,a.total.Cash)),m(3),b(M(76,19,a.total.Card)),m(3),b(M(79,21,a.total.Online)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var n3=Di(Ti());var NEe=i=>({collapsed:i});
389function LEe(i,n){if(i&1&&(s(0,"option",25),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function BEe(i,n){if(i&1&&(s(0,"option"),l(1),o()),i&2){let t=n.$implicit;m(),b(t)}}function VEe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),I(3,"date"),o(),s(4,"td",22),l(5),o(),s(6,"td",22),l(7),o(),s(8,"td",22),l(9),o(),s(10,"td",22),l(11),o()()),i&2){let t=n.$implicit;m(2),b(M(3,5,t.transaction_date)),m(3),b(t.cash_income.toLocaleString()),m(2),b(t.card_income.toLocaleString()),m(2),_(" ",t.online_income.toLocaleString()," "),m(2),_(" ",t.total_revenue.toLocaleString()," ")}}var LB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.hostelBookingsService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.salesData=[],this.cashTotal=0,this.cardTotal=0,this.onlineTotal=0,this.totalRevenue=0}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}onClickGenerate(){this.selectedMonth&&this.selectedYear&&this.getMonthlySales(this.selectedMonthNumber,this.selectedYear)}onClickGenerateExcel(){this.getMonthlySalesExcel()}onClickGeneratePDF(){this.getMonthlySalesPDF()}getMonthlySales(e,r){this.spinner.show(),this.hostelBookingsService.getMonthlySales(e,r).subscribe({next:a=>{a&&a.data&&(this.salesData=a.data.map(c=>({transaction_date:c.transaction_date,cash_income:Number(c.cash_income),card_income:Number(c.card_income),online_income:Number(c.online_income),total_revenue:Number(c.total_revenue)})),this.calculateTotals()),this.spinner.hide(),this.salesData.length===0&&this.toastr.warning("No records available for this month and year")},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}calculateTotals(){this.cashTotal=0,this.cardTotal=0,this.onlineTotal=0,this.totalRevenue=0,this.salesData.forEach(e=>{this.cashTotal+=e.cash_income,this.cardTotal+=e.card_income,this.onlineTotal+=e.online_income,this.totalRevenue+=e.total_revenue})}getMonthlySalesExcel(){this.spinner.show(),this.hostelBookingsService.getMonthlySalesExcel(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Altitude Ambuluwawa Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.xlsx`;(0,n3.default)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}})}getMonthlySalesPDF(){this.spinner.show(),this.hostelBookingsService.getMonthlySalesPDF(this.selectedMonthNumber,this.selectedYear).subscribe({next:e=>{let r=`Altitude Ambuluwawa Monthly Sales ${this.selectedMonth} - ${this.selectedYear}.pdf`;(0,n3.default)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(js))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-monthly-sales-report"]],standalone:!1,decls:66,vars:13,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"exportBtns"],["type","submit",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody","rowH"],[1,"sticky-bottom"],[3,"value"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Altitude Ambuluwawa \u2014 Monthly Sales Reports"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5)(8,"label",6),l(9,"Month"),o(),s(10,"select",7),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(11,"option",8),l(12,"Select Month"),o(),T(13,LEe,2,2,"option",9),o()(),s(14,"div",5)(15,"label",6),l(16,"Year"),o(),s(17,"select",10),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(18,"option",8),l(19,"Select Year"),o(),T(20,BEe,2,1,"option",11),o()(),s(21,"div",12)(22,"button",13),S("click",function(){return a.onClickGenerate()}),s(23,"span",14),l(24,"search"),o(),l(25," Generate "),o()()(),s(26,"div",12)(27,"button",15),S("click",function(){return a.onClickGenerateExcel()}
389),s(28,"span",14),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",15),S("click",function(){return a.onClickGeneratePDF()}),s(32,"span",14),l(33,"description"),o(),l(34,"PDF "),o()()(),s(35,"div",16)(36,"div",17)(37,"div",18)(38,"div",19)(39,"table",20)(40,"thead",21)(41,"tr")(42,"th"),l(43,"Date"),o(),s(44,"th",22),l(45,"Cash"),o(),s(46,"th",22),l(47,"Card"),o(),s(48,"th",22),l(49,"Online"),o(),s(50,"th",22),l(51,"Total"),o()()(),s(52,"tbody",23),T(53,VEe,12,7,"tr",11),o(),s(54,"tfoot",24)(55,"tr")(56,"td"),l(57,"Total"),o(),s(58,"td",22),l(59),o(),s(60,"td",22),l(61),o(),s(62,"td",22),l(63),o(),s(64,"td",22),l(65),o()()()()()()()()()),r&2&&(p("ngClass",Z(11,NEe,a.isCollapsed)),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(31),p("ngForOf",a.salesData),m(6),b(a.cashTotal.toLocaleString()),m(2),b(a.cardTotal.toLocaleString()),m(2),b(a.onlineTotal.toLocaleString()),m(2),b(a.totalRevenue.toLocaleString()))},dependencies:[ue,_e,Bt,Vt,Ot,Ne,Le,St],encapsulation:2});let i=n;return i})();var r3=Di(Ti());var UEe=i=>({collapsed:i});function jEe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td",30),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),o(),s(9,"td"),l(10),I(11,"currencyFormat"),o(),s(12,"td"),l(13),I(14,"currencyFormat"),o(),s(15,"td"),l(16),I(17,"currencyFormat"),o(),s(18,"td",19)(19,"strong"),l(20),I(21,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),b(t.item_name),m(2),_(" ",t.item_category," "),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(11,8,t.average_unit_price)),m(3),b(M(14,10,t.item_subtotal)),m(3),b(M(17,12,t.voided_subtotal)),m(4),b(M(21,14,t.item_total))}}var BB=(()=>{let n=class n{constructor(e,r,a,c){this.hostelBookingsService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedStartDate=null,this.selectedEndDate=null,this.isCollapsed=!1,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,discount_subtotal:0,complimentary_subtotal:0,void_count:0,voided_subtotal:0}}ngOnInit(){this.setTodayDate(),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.getItemWiseSales(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r})}setTodayDate(){let e=new Date,r=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),c=String(e.getDate()).padStart(2,"0");this.selectedStartDate=`${r}-${a}-${c}`,this.selectedEndDate=`${r}-${a}-${c}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getItemWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.hostelBookingsService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.items=e.data.items,this.total=e.data.totals,this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}onClickGenerateItemWiseSales(){if(this.selectedStartDate&&this.selectedEndDate){let e=new Date(this.selectedStartDate);this.formattedStartDate=this.formatDate(e);let r=new Date(this.selectedEndDate);this.formattedEndDate=this.formatDate(r),this.getItemWiseSales()}}exportToPDF(){this.getItemWiseSalesPDF()}getItemWiseSalesPDF(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.hostelBookingsService.getItemWiseSalesPDF(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Altitude Ambuluwawa Room-Type Sales ${this.selectedStartDate} to ${this.selectedEndDate}.pdf`;(0,r3.saveAs)(e,r),this.spinner.hide(),this.toastr.success("PDF generated successfully!","Success")},error:e=>{console.error("Error downloading PDF:",e),this.spinner.hide(),this.toastr.error("Failed to generate PDF:","Error")}}))}exportToExcel(){this.getItemwiseSalesExcel()}getItemwiseSalesExcel(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.hostelBookingsService.getItemWiseSalesExcel(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{let r=`Altitude Ambuluwawa Room-Type Sales ${this.selectedStartDate} to ${this.selectedEndDate}.xlsx`;(0,r3.saveAs)(e,r),this.spinner.hide(),this.toastr.success("Excel generated successfully!","Success")},error:e=>{console.error("Error downloading Excel:",e),this.spinner.hide(),this.toastr.error("Failed to generate Excel:","Error")}}))}printReport(){window.print()}};n.\u0275fac=function(r){return new(r||n)(x(js),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-item-wise-summary"]],standalone:!1,decls:96,vars:28,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["id","date-picker","type","date",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],["colspan","5"],[1,"d-flex","justify-content-end"],[1,"summary-section"],[1,"row"],[1,"col","d-flex","justify-content-between"],[1,"summaryLabel"],[1,"colorLabel"],[1,"col","d-flex","justify-content-between","revenue"],[2,"text-transform","capitalize"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Altitude Ambuluwawa \u2014 Room Type Summary"),o(),s(5,"div",3),l(6),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",8),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",9)(18,"button",10),S("click",function(){return a.onClickGenerateItemWiseSales()}),s(19,"span",11),l(20,"search"),o(),l(21," Generate "),o()()(),s(22,"div",9)(23,"button",12),S("click",function(){return a.exportToPDF()}),s(24,"span",11),l(25,"picture_as_pdf"),o(),l(26,"Pdf "),o(),s(27,"button",12),S("click",function(){return a.exportToExcel()}
389),s(28,"span",11),l(29,"description"),o(),l(30,"Excel "),o(),s(31,"button",12),S("click",function(){return a.printReport()}),s(32,"span",11),l(33,"print"),o(),l(34,"Print "),o()()(),s(35,"div",13)(36,"div",14)(37,"div",15)(38,"div",16)(39,"table",17)(40,"thead",18)(41,"tr")(42,"th"),l(43,"Room Type"),o(),s(44,"th"),l(45,"Category"),o(),s(46,"th"),l(47,"Quantity"),o(),s(48,"th"),l(49,"Voided Count"),o(),s(50,"th"),l(51,"Average Unit Price"),o(),s(52,"th"),l(53,"Item Subtotal"),o(),s(54,"th"),l(55,"Voided Subtotal"),o(),s(56,"th",19),l(57,"Item Total(Without Void)"),o()()(),s(58,"tbody",20),T(59,jEe,22,16,"tr",21),o(),s(60,"tfoot")(61,"tr")(62,"td",22),l(63,"All Room Types"),o(),s(64,"td"),l(65),I(66,"currencyFormat"),o(),s(67,"td"),l(68),I(69,"currencyFormat"),o(),s(70,"td",19),l(71),I(72,"currencyFormat"),o()()()(),s(73,"div",23)(74,"div",24)(75,"div",25)(76,"div",26)(77,"span",27),l(78,"Subtotal:"),o(),s(79,"span"),l(80),I(81,"currencyFormat"),o()()(),s(82,"div",25)(83,"div",26)(84,"span",27),l(85,"Voids:"),o(),s(86,"span",28),l(87),I(88,"currencyFormat"),o()()(),s(89,"div",25)(90,"div",29)(91,"span"),l(92,"Total Revenue:"),o(),s(93,"span"),l(94),I(95,"currencyFormat"),o()()()()()()()()()()),r&2&&(p("ngClass",Z(26,UEe,a.isCollapsed)),m(6),Pi(" ",a.formattedStartDate," \u2014 ",a.formattedEndDate," "),m(6),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(43),p("ngForOf",a.items),m(6),b(M(66,14,a.total.item_subtotal)),m(3),b(M(69,16,a.total.voided_subtotal)),m(3),_(" ",M(72,18,a.total.item_total)," "),m(9),b(M(81,20,a.total.item_subtotal)),m(7),b(M(88,22,a.total.voided_subtotal)),m(7),b(M(95,24,a.total.item_total)))},dependencies:[ue,_e,Ke,Ne,Le,Be],encapsulation:2});let i=n;return i})();var WEe=i=>({collapsed:i});function HEe(i,n){if(i&1&&(s(0,"div",31)(1,"h3"),l(2),o(),s(3,"div",32),l(4),I(5,"currencyFormat"),I(6,"number"),o()()),i&2){let t=n.$implicit,e=n.index;p("ngClass","summary-block-"+e),m(2),b(t.title),m(2),_(" ",t.isCurrency?M(5,3,t.amount):Jt(6,5,t.amount,"1.0-0")," ")}}function GEe(i,n){if(i&1&&(s(0,"tr")(1,"td",33),l(2),o(),s(3,"td"),l(4),o(),s(5,"td"),l(6),o(),s(7,"td"),l(8),I(9,"currencyFormat"),o(),s(10,"td"),l(11),I(12,"currencyFormat"),o(),s(13,"td",28)(14,"strong"),l(15),I(16,"currencyFormat"),o()()()),i&2){let t=n.$implicit;m(2),_(" ",t.category," "),m(2),b(t.item_quantity),m(2),b(t.void_count),m(2),b(M(9,6,t.item_subtotal)),m(3),b(M(12,8,t.voided_subtotal)),m(4),b(M(16,10,t.item_total))}}var VB=(()=>{let n=class n{constructor(e,r,a,c){this.hostelBookingsService=e,this.spinner=r,this.toastr=a,this.sidebarService=c,this.selectedStartDate=null,this.selectedEndDate=null,this.formattedStartDate="",this.formattedEndDate="",this.items=[],this.categoryItems=[],this.total={item_quantity:0,item_subtotal:0,item_total:0,void_count:0,voided_subtotal:0},this.isCollapsed=!1,this.summaryData=[]}ngOnInit(){this.setTodayDate(),this.sidebarService.collapsed$.subscribe(r=>{this.isCollapsed=r}),this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate??"")),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate??""));let e=new Date;this.minDate=e.toISOString().split("T")[0],this.updateSummaryData(),this.getRoomTypeWiseSales(),this.getCategoryWiseSales()}setTodayDate(){let e=new Date,r=new Date;r.setDate(e.getDate()-7);let a=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");this.selectedEndDate=`${a}-${c}-${d}`;let u=r.getFullYear(),h=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0");this.selectedStartDate=`${u}-${h}-${f}`}formatDate(e){let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],c=String(e.getDate()).padStart(2,"0"),d=e.getFullYear();return`${a} ${c}, ${d}`}getRoomTypeWiseSales(){this.selectedStartDate&&this.selectedEndDate&&(this.spinner.show(),this.hostelBookingsService.getItemWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.items=e.data.items,this.total=e.data.totals,this.updateSummaryData(),this.spinner.hide(),this.items.length==0&&this.toastr.warning("No records available for this date")},error:e=>{console.error("API Error:",e),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}}))}getCategoryWiseSales(){this.selectedStartDate&&this.selectedEndDate&&this.hostelBookingsService.getCategoryWiseSales(this.selectedStartDate,this.selectedEndDate).subscribe({next:e=>{this.categoryItems=e.data.categoryWiseSales||[]},error:e=>{console.error("API Error:",e)}})}onClickGenerate(){this.selectedStartDate&&this.selectedEndDate&&(this.formattedStartDate=this.formatDate(new Date(this.selectedStartDate)),this.formattedEndDate=this.formatDate(new Date(this.selectedEndDate)),this.getRoomTypeWiseSales(),this.getCategoryWiseSales())}updateSummaryData(){this.summaryData=[{title:"Revenue (LKR)",amount:this.total.item_total||0,isCurrency:!0},{title:"Nights Booked",amount:this.total.item_quantity||0,isCurrency:!1},{title:"Voided Bookings",amount:this.total.void_count||0,isCurrency:!1},{title:"Voided Amount (LKR)",amount:this.total.voided_subtotal||0,isCurrency:!0}]}};n.\u0275fac=function(r){return new(r||n)(x(js),x(pe),x(me),x(ce))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-analytics"]],standalone:!1,decls:52,vars:11,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"transaction-log"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput"],[1,"filter-form-label"],["type","date","id","start-
389date-picker",1,"form-control",3,"ngModelChange","ngModel"],["type","date","id","end-date-picker",1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click"],[1,"material-icons-outlined"],[1,"container-body"],[1,"bodyContent","withFilter"],[1,"analytics-chart"],[1,"analyticsSummary"],[1,"card-wrapper"],["class","summary-card",3,"ngClass",4,"ngFor","ngForOf"],[1,""],[1,"row"],[1,"col-md-12"],["revenueType","Room Type Wise Revenue",3,"items","isCollapsed"],[1,"col-md-12","mt-4"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead"],[1,"text-end"],[1,"tbody"],[4,"ngFor","ngForOf"],[1,"summary-card",3,"ngClass"],[1,"amount"],[2,"text-transform","capitalize"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Altitude Ambuluwawa Analytics"),o(),s(5,"div",3),l(6,"General Analytics Overview"),o()()(),s(7,"div",4)(8,"div",5)(9,"div",6)(10,"label",7),l(11,"From"),o(),s(12,"input",8),X("ngModelChange",function(d){return K(a.selectedStartDate,d)||(a.selectedStartDate=d),d}),o()(),s(13,"div",6)(14,"label",7),l(15,"To"),o(),s(16,"input",9),X("ngModelChange",function(d){return K(a.selectedEndDate,d)||(a.selectedEndDate=d),d}),o()(),s(17,"div",10)(18,"button",11),S("click",function(){return a.onClickGenerate()}),s(19,"span",12),l(20,"search"),o(),l(21," Generate "),o()()()(),s(22,"div",13)(23,"div",14)(24,"div",15)(25,"div",16)(26,"div",17),T(27,HEe,7,8,"div",18),o()(),s(28,"div",19)(29,"div",20)(30,"div",21),B(31,"app-activity-wise-revenue",22),o(),s(32,"div",23)(33,"div",24)(34,"div",25)(35,"table",26)(36,"thead",27)(37,"tr")(38,"th"),l(39,"Category"),o(),s(40,"th"),l(41,"Nights Booked"),o(),s(42,"th"),l(43,"Voided Count"),o(),s(44,"th"),l(45,"Item Subtotal"),o(),s(46,"th"),l(47,"Voided Subtotal"),o(),s(48,"th",28),l(49,"Revenue (Without Void)"),o()()(),s(50,"tbody",29),T(51,GEe,17,12,"tr",30),o()()()()()()()()()()()),r&2&&(p("ngClass",Z(9,WEe,a.isCollapsed)),m(12),q("ngModel",a.selectedStartDate),He("max",a.minDate),m(4),q("ngModel",a.selectedEndDate),He("max",a.minDate),m(11),p("ngForOf",a.summaryData),m(4),p("items",a.items)("isCollapsed",a.isCollapsed),m(20),p("ngForOf",a.categoryItems))},dependencies:[ue,_e,Ke,Ne,Le,uo,Dn,Be],encapsulation:2});let i=n;return i})();var $Ee=i=>({collapsed:i}),zEe=i=>({show:i});function YEe(i,n){if(i&1){let t=he();s(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23),l(4),o(),s(5,"span",24),l(6),o()(),s(7,"div",25)(8,"div",26)(9,"div",27)(10,"div",28)(11,"span",29),l(12,"LKR"),o(),s(13,"input",30),S("change",function(r){let a=U(t).$implicit,c=w();return j(c.updatePrice(a.id,r))}),o()()(),s(14,"div",31)(15,"button",32),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openConfirmModal(r.id))}),s(16,"span",33),l(17,"save"),o(),l(18," Save "),o()()()()()()}if(i&2){let t=n.$implicit,e=w();m(4),b(t.name),m(),p("ngClass",t.category==="private"?"bg-primary":"bg-success"),m(),_(" ",t.category," "),m(7),p("value",t.price)("readonly",e.isAccountant||e.isOfficeUser),m(2),p("disabled",e.isAccountant||e.isOfficeUser)}}function qEe(i,n){if(i&1&&(s(0,"div",19)(1,"div",34)(2,"p",35),l(3," Are you sure you want to update the price for this room type? "),o(),s(4,"div",36)(5,"p",37)(6,"strong"),l(7,"Room Type:"),o(),l(8),o(),s(9,"p",37)(10,"strong"),l(11,"Category:"),o(),l(12),o(),s(13,"p",37)(14,"strong"),l(15,"Old Price:"),o(),l(16),o(),s(17,"p",38)(18,"strong"),l(19,"New Price:"),o(),l(20),o()()()()),i&2){let t=w();m(8),_(" ",t.selectedItem.name),m(4),_(" ",t.selectedItem.category," "),m(4),_(" LKR ",t.selectedItem.originalPrice," "),m(4),_(" LKR ",t.selectedItem.price," ")}}function KEe(i,n){if(i&1){let t=he();s(0,"div",39),S("click",function(){U(t);let r=w();return j(r.cancelModal())}),o()}}function XEe(i,n){if(i&1){let t=he();s(0,"div",39),S("click",function(){U(t);let r=w();return j(r.closeNegativePriceModal())}),o()}}var UB=(()=>{let n=class n{constructor(e,r,a,c,d){this.spinner=e,this.toastr=r,this.sidebarService=a,this.hostelBookingsService=c,this.cognitoService=d,this.isCollapsed=!1,this.priceItems=[],this.showConfirmModal=!1,this.selectedItem=null,this.showNegativePriceModal=!1,this.negativePriceItem=null,this.isAccountant=!1,this.isOfficeUser=!1}ngOnInit(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.checkUserRole(),this.loadItemPrices()}checkUserRole(){return ye(this,null,function*(){try{let e=yield this.cognitoService.getUserRole();this.isAccountant=e==="Accountant",this.isOfficeUser=e==="OfficeUser"}catch(e){console.error("Error checking user role:",e)}})}loadItemPrices(){this.spinner.show(),this.hostelBookingsService.getRoomTypes().subscribe({next:e=>{e.data&&(this.priceItems=e.data.map(r=>
389({id:r.room_type_id,code:r.code,name:r.name,category:r.category,price:parseInt(r.price_per_night).toString(),originalPrice:parseInt(r.price_per_night).toString()}))),this.spinner.hide()},error:e=>{console.error("Error fetching room type prices:",e),this.toastr.error("Failed to load room type prices"),this.spinner.hide()}})}updatePrice(e,r){let a=parseInt(r.target.value);if(a<0){let d=this.priceItems.findIndex(h=>h.id===e);d!==-1&&(this.negativePriceItem=this.priceItems[d],this.showNegativePriceModal=!0);let u=r.target;this.negativePriceItem&&(u.value=this.negativePriceItem.price);return}let c=this.priceItems.findIndex(d=>d.id===e);c!==-1&&(this.priceItems[c].price=a.toString())}closeNegativePriceModal(){this.showNegativePriceModal=!1,this.negativePriceItem=null}openConfirmModal(e){let r=this.priceItems.find(a=>a.id===e);if(r){if(r.price===r.originalPrice){this.toastr.info("No price change detected");return}this.selectedItem=r,this.showConfirmModal=!0}}confirmSavePrice(){return ye(this,null,function*(){if(this.selectedItem)try{this.spinner.show(),this.hostelBookingsService.updateItemPrice(this.selectedItem).subscribe({next:()=>{this.toastr.success("Price updated successfully!"),this.loadItemPrices(),this.showConfirmModal=!1,this.selectedItem=null},error:e=>{console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again.")},complete:()=>{this.spinner.hide()}})}catch(e){console.error("Error updating price:",e),this.toastr.error("Failed to update price. Please try again."),this.spinner.hide()}})}cancelModal(){if(this.selectedItem){let e=this.priceItems.findIndex(r=>
389r.id===this.selectedItem.id);e!==-1&&(this.priceItems[e].price=this.priceItems[e].originalPrice)}this.showConfirmModal=!1,this.selectedItem=null}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(js),x(ze))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-edit-price"]],standalone:!1,decls:42,vars:17,consts:[[1,"mainContainer",3,"ngClass"],[1,"header"],[1,"page-title"],[1,"container-body"],[1,"analytics-chart"],[1,"row"],["class","col-md-3 mt-4",4,"ngFor","ngForOf"],[1,"modal"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["class","modal-backdrop fade show",3,"click",4,"ngIf"],["tabindex","-1",1,"modal","fade",3,"ngClass"],[1,"modal-body"],[1,"col-md-3","mt-4"],[1,"chartingBox"],[1,"chartBox-header","d-flex","align-items-center","justify-content-between"],[1,"chartTitle"],[1,"badge",2,"text-transform","capitalize",3,"ngClass"],[1,"chartBody"],[1,"row","mt-3"],[1,"col-md-8"],[1,"input-group"],[1,"input-group-text"],["type","number","min","0","step","1",1,"form-control",3,"change","value","readonly"],[1,"col-md-4"],[1,"btn","btn-outline-primary","withIcon","w-100","justify-content-center",3,"click","disabled"],[1,"material-icons-outlined"],[1,"text-center"],[1,"mb-3"],[1,"card","bg-light","p-3"],[1,"mb-2"],[1,"mb-0"],[1,"modal-backdrop","fade","show",3,"click"]],template:function(r,a){r&1&&(s(0,"div",0)(1,"div",1)(2,"div")(3,"div",2),l(4,"Altitude Ambuluwawa \u2014 Edit Price"),o()()(),s(5,"div",3)(6,"div",4)(7,"div",5),T(8,YEe,19,6,"div",6),o()()(),s(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h5",11),l(14,"Confirm Price Update"),o(),s(15,"button",12),S("click",function(){return a.cancelModal()}),o()(),T(16,qEe,21,4,"div",13),s(17,"div",14)(18,"button",15),S("click",function(){return a.cancelModal()}),l(19," Cancel "),o(),s(20,"button",16),S("click",function(){return a.confirmSavePrice()}),l(21," Confirm Update "),o()()()()(),T(22,KEe,1,0,"div",17),s(23,"div",18)(24,"div",8)(25,"div",9)(26,"div",10)(27,"h5",11),l(28,"Invalid Price"),o(),s(29,"button",12),S("click",function(){return a.closeNegativePriceModal()}),o()(),s(30,"div",19)(31,"p"),l(32," The price for "),s(33,"strong"),l(34),o(),l(35," cannot be negative. "),o(),s(36,"p"),l(37,"Please enter a valid price."),o()(),s(38,"div",14)(39,"button",16),S("click",function(){return a.closeNegativePriceModal()}),l(40," OK "),o()()()()(),T(41,XEe,1,0,"div",17),o()),r&2&&(p("ngClass",Z(13,$Ee,a.isCollapsed)),m(8),p("ngForOf",a.priceItems),m(),gi("display",a.showConfirmModal?"block":"none"),Re("show",a.showConfirmModal),m(7),p("ngIf",a.selectedItem),m(6),p("ngIf",a.showConfirmModal),m(),gi("display",a.showNegativePriceModal?"block":"none"),p("ngClass",Z(15,zEe,a.showNegativePriceModal)),m(11),b(a.negativePriceItem==null?null:a.negativePriceItem.name),m(7),p("ngIf",a.showNegativePriceModal))},dependencies:[ue,_e,Dt],styles:[".modal[_ngcontent-%COMP%]{background-color:#00000080}.modal.show[_ngcontent-%COMP%]{opacity:1}.modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}.card.bg-light[_ngcontent-%COMP%]{border:1px solid #dee2e6}"]});let i=n;return i})();var JEe=i=>({collapsed:i});function ZEe(i,n){if(i&1&&(s(0,"div",43),B(1,"i",44),s(2,"div"),l(3),I(4,"date"),o()()),i&2){let t=w();m(3),_(" Please confirm the transaction for ",M(4,1,t.earliestUnconfirmedDate)," before verifying later dates. ")}}function QEe(i,n){if(i&1&&(s(0,"option",45),l(1),o()),i&2){let t=n.$implicit;p("value",t.name),m(),_(" ",t.name," ")}}function ewe(i,n){if(i&1&&(s(0,"option",45),l(1),o()),i&2){let t=n.$implicit;p("value",t),m(),b(t)}}function twe(i,n){if(i&1){let t=he();Ui(0),s(1,"input",51),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_cash_amount,r)||(a.actual_cash_amount=r),j(r)}),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t)),q("ngModel",t.actual_cash_amount)}}
389function iwe(i,n){if(i&1&&l(0),i&2){let t=w().$implicit,e=w();b(e.disp(t.actual_cash_amount))}}function nwe(i,n){if(i&1){let t=he();Ui(0),s(1,"input",51),X("ngModelChange",function(r){U(t);let a=w().$implicit;return K(a.actual_card_amount,r)||(a.actual_card_amount=r),j(r)}),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t)),q("ngModel",t.actual_card_amount)}}function rwe(i,n){if(i&1&&l(0),i&2){let t=w().$implicit,e=w();b(e.disp(t.actual_card_amount))}}function awe(i,n){if(i&1){let t=he();Ui(0),s(1,"button",52),S("click",function(){U(t);let r=w().$implicit,a=w();return j(a.onClickConfirm(r))}),l(2," Confirm "),o(),ji()}if(i&2){let t=w().$implicit,e=w();m(),p("disabled",e.shouldDisableControls(t))}}function owe(i,n){i&1&&(s(0,"span",53),B(1,"i",54),o())}function swe(i,n){if(i&1){let t=he();s(0,"tr",46)(1,"td",47),l(2),I(3,"date"),o(),s(4,"td",48),l(5),o(),s(6,"td",48),l(7),o(),s(8,"td",48),T(9,twe,2,2,"ng-container",49)(10,iwe,1,1,"ng-template",null,0,mn),o(),s(12,"td",48),T(13,nwe,2,2,"ng-container",49)(14,rwe,1,1,"ng-template",null,1,mn),o(),s(16,"td",48)(17,"button",50),S("click",function(){let r=U(t).$implicit,a=w();return j(a.openShowVoidedModal(r))}),l(18),o()(),s(19,"td",48),T(20,awe,3,1,"ng-container",49)(21,owe,2,0,"ng-template",null,2,mn),o()()}if(i&2){let t=n.$implicit,e=Qt(11),r=Qt(15),a=Qt(22),c=w();p("ngClass",c.getRowClass(t)),m(2),b(M(3,12,t.date)),m(3),_(" ",c.disp(t.system_cash_amount)," "),m(2),_(" ",c.disp(t.system_card_amount)," "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",e),m(4),p("ngIf",!t.is_confirmed)("ngIfElse",r),m(4),p("disabled",!(t.invalid_tickets!=null&&t.invalid_tickets.length)),m(),_(" ",(t.invalid_tickets==null?null:t.invalid_tickets.length)||0," voided "),m(2),p("ngIf",!t.is_confirmed)("ngIfElse",a)}}function lwe(i,n){if(i&1&&(s(0,"tr")(1,"td"),l(2),o(),s(3,"td"),l(4),o(),s(5,"td",24),l(6),o()()),i&2){let t=n.$implicit,e=w();m(2),_("#",t.booking_id),m(2),b(t.guest_name),m(2),b(e.disp(t.amount))}}function cwe(i,n){if(i&1){let t=he();s(0,"div",55)(1,"label",56)(2,"strong"),l(3,"Notes"),o()(),s(4,"textarea",57),X("ngModelChange",function(r){U(t);let a=w();return K(a.selectedRow.notes,r)||(a.selectedRow.notes=r),j(r)}),o()()}if(i&2){let t=w();m(4),q("ngModel",t.selectedRow.notes)}}var jB=(()=>{let n=class n{constructor(e,r,a,c){this.spinner=e,this.toastr=r,this.sidebarService=a,this.hostelBookingsService=c,this.selectedMonth="",this.selectedMonthNumber=1,this.selectedYear="",this.months=ai,this.years=[],this.isCollapsed=!1,this.todayDate=new Date().toISOString().split("T")[0],this.salesData=[],this.systemCashTotal=0,this.systemCardTotal=0,this.systemOnlineTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.actualOnlineTotal=0,this.selectedRow=null,this.confirmModalInstance=null,this.voidedModalInstance=null,this.hasUnconfirmedPreviousTransactions=!1,this.earliestUnconfirmedDate=null}ngOnInit(){this.initializeYears(),this.setDefaultMonth(),this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}setDefaultMonth(){let e=new Date,r=this.months[e.getMonth()];this.selectedMonth=r.name,this.selectedMonthNumber=r.number,this.selectedYear=e.getFullYear().toString()}initializeYears(){let e=new Date().getFullYear(),r=2022;this.years=Array.from({length:e-r+1},(a,c)=>r+c)}onMonthChange(){let e=this.months.find(r=>r.name===this.selectedMonth);this.selectedMonthNumber=e?e.number:1}onClickGenerate(){this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear)}disp(e){return e==null?"":e.toLocaleString()}normalizeRow(e){let r=a=>a==null||a===""?null:Number(a);return{date:e?.date,system_cash_amount:r(e?.system_cash_amount),system_card_amount:r(e?.system_card_amount),system_online_amount:r(e?.system_online_amount),actual_cash_amount:r(e?.actual_cash_amount),actual_card_amount:r(e?.actual_card_amount),actual_online_amount:r(e?.actual_online_amount),is_confirmed:!!e?.is_confirmed,invalid_tickets:Array.isArray(e?.invalid_tickets)?e.invalid_tickets:[],notes:e?.notes??null,confirmed_by:e?.confirmed_by??null,confirmed_at:e?.confirmed_at??null}}buildMonthDays(e,r){let a=Number(r),c=new Date(a,e,0).getDate(),d=[];for(let u=1;u<=c;u++){let h=`${a}-${String(e).padStart(2,"0")}-${String(u).padStart(2,"0")}`;h>this.todayDate||d.push({date:h,system_cash_amount:null,system_card_amount:null,system_online_amount:null,actual_cash_amount:null,actual_card_amount:null,actual_online_amount:null,is_confirmed:!1,invalid_tickets:[],notes:null})}return d}getDailyTransactionsToVerify(e,r){this.spinner.show(),this.hostelBookingsService.getDailyTransactionsToVerify(e,r).subscribe({next:a=>{let c=(Array.isArray(a?.data)?a.data:[]).map(u=>this.normalizeRow(u)),d=new Map(c.map(u=>[u.date,u]));this.salesData=this.buildMonthDays(e,r).map(u=>d.get(u.date)??u),this.calculateTotals(),this.checkUnconfirmedPreviousTransactions(),this.spinner.hide()},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}checkUnconfirmedPreviousTransactions(){let r=[...this.salesData].sort((a,c)=>new Date(a.date).getTime()-new Date(c.date).getTime()).find(a=>a.date<=this.todayDate&&!a.is_confirmed);this.earliestUnconfirmedDate=r?.date||null,this.hasUnconfirmedPreviousTransactions=!!this.earliestUnconfirmedDate}isTodaysRow(e){return e===this.todayDate}shouldEnableRow(e){return this.hasUnconfirmedPreviousTransactions?e.date===this.earliestUnconfirmedDate:!this.isDateGreaterThanToday(e.date)}calculateTotals(){this.systemCashTotal=0,this.systemCardTotal=0,this.systemOnlineTotal=0,this.actualCashTotal=0,this.actualCardTotal=0,this.actualOnlineTotal=0,this.salesData.forEach(e
389=>{this.systemCashTotal+=e.system_cash_amount||0,this.systemCardTotal+=e.system_card_amount||0,this.systemOnlineTotal+=e.system_online_amount||0,this.actualCashTotal+=e.actual_cash_amount||0,this.actualCardTotal+=e.actual_card_amount||0,this.actualOnlineTotal+=e.actual_online_amount||0})}isDateGreaterThanToday(e){return e>this.todayDate}shouldDisableControls(e){return e.is_confirmed||this.isDateGreaterThanToday(e.date)?!0:!this.shouldEnableRow(e)}getRowClass(e){return e.is_confirmed?e.system_cash_amount!==e.actual_cash_amount||e.system_card_amount!==e.actual_card_amount?"table-danger":"table-success":e.date<this.todayDate?e.date===this.earliestUnconfirmedDate?"border border-danger bg-transparent text-warning":"table-secondary":this.isTodaysRow(e.date)?e.date===this.earliestUnconfirmedDate?"table-light":"table-secondary":""}openShowVoidedModal(e){if(e.invalid_tickets&&e.invalid_tickets.length!==0){this.selectedRow=e;let r=document.getElementById("voidedBookingsModal");r&&(this.voidedModalInstance=new Zt(r),this.voidedModalInstance.show())}else this.toastr.warning("No voided bookings for this day")}onClickConfirm(e){if(e.actual_cash_amount===null||e.actual_cash_amount===void 0||e.actual_card_amount===null||e.actual_card_amount===void 0){this.toastr.warning("Please enter cash and card amounts");return}if(e.actual_cash_amount<0||e.actual_card_amount<0){this.toastr.warning("Actual amount cannot be negative.");return}this.selectedRow=e;let r=document.getElementById("confirmModal");r&&(this.confirmModalInstance=new Zt(r),this.confirmModalInstance.show())}confirmTransaction(){let e=this.selectedRow;if(!e)return;let r={date:e.date,actual_cash_amount:e.actual_cash_amount,actual_card_amount:e.actual_card_amount,actual_online_amount:e.actual_online_amount??0,notes:e.notes??""};this.spinner.show(),this.hostelBookingsService.confirmDailyTransactions(r).subscribe({next:()=>{this.toastr.success("Cash-up recorded","Success"),this.confirmModalInstance&&this.confirmModalInstance.hide(),this.getDailyTransactionsToVerify(this.selectedMonthNumber,this.selectedYear),this.spinner.hide()},error:a=>{console.error("API Error:",a),this.spinner.hide(),this.toastr.error("Something went wrong!","Error")}})}};n.\u0275fac=function(r){return new(r||n)(x(pe),x(me),x(ce),x(js))},n.\u0275cmp=te({type:n,selectors:[["app-hostel-bookings-daily-transaction-verify"]],standalone:!1,decls:116,vars:24,consts:[["cashVal",""],["cardVal",""],["confirmedIcon",""],[1,"container-body"],[1,"mainContainer",3,"ngClass"],["class","alert alert-warning d-flex align-items-center mb-3","role","alert",4,"ngIf"],[1,"header"],[1,"page-title"],[1,"filter-wrapper"],[1,"topLeftfilter"],[1,"filterInput","me-2"],[1,"filter-form-label"],[1,"form-control",3,"ngModelChange","change","ngModel"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"form-control",3,"ngModelChange","ngModel"],[1,"exportBtns"],["type","button",1,"btn","btn-outline-primary","withIcon",3,"click","disabled"],[1,"material-icons-outlined"],[1,"bodyContent","withFilter"],[1,"table-wrapper"],[1,"table-responsive"],[1,"table"],[1,"thead","sticky-top"],[1,"text-end"],[1,"tbody"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"sticky-bottom"],["id","voidedBookingsModal","tabindex","-1","aria-labelledby","voidedBookingsModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header"],["id","voidedBookingsModalLabel",1,"modal-title"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close"],[1,"modal-body"],[1,"table-light"],[4,"ngFor","ngForOf"],["id","confirmModal","tabindex","-1","aria-labelledby","confirmModalLabel","aria-hidden","true",1,"modal","fade"],["id","confirmModalLabel",1,"modal-title"],["class","mb-2",4,"ngIf"],[1,"modal-footer"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary"],["type","button",1,"btn","btn-primary",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","align-items-center","mb-3"],[1,"fas","fa-exclamation-triangle","me-2"],[3,"value"],[3,"ngClass"],[1,"align-middle"],[1,"text-end","align-middle"],[4,"ngIf","ngIfElse"],[1,"btn","btn-sm","btn-outline-secondary",3,"click","disabled"],["type","number","min","0","placeholder","Enter amount",1,"form-control","form-control-sm","text-end",3,"ngModelChange","disabled","ngModel"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"text-success"],[1,"fas","fa-check-circle","fa-2x"],[1,"mb-2"],[1,"form-label"],["rows","2","placeholder","Optional note (e.g. short by 500 cash)",1,"form-control",3,"ngModelChange","ngModel"]],template:function(r,a){r&1&&(s(0,"div",3)(1,"div",4),T(2,ZEe,5,3,"div",5),s(3,"div",6)(4,"div")(5,"div",7),l(6," Altitude Ambuluwawa \u2014 Daily Transaction Verification "),o()()(),s(7,"div",8)(8,"div",9)(9,"div",10)(10,"label",11),l(11,"Month"),o(),s(12,"select",12),X("ngModelChange",function(d){return K(a.selectedMonth,d)||(a.selectedMonth=d),d}),S("change",function(){return a.onMonthChange()}),s(13,"option",13),l(14,"Select Month"),o(),T(15,QEe,2,2,"option",14),o()(),s(16,"div",10)(17,"label",11),l(18,"Year"),o(),s(19,"select",15),X("ngModelChange",function(d){return K(a.selectedYear,d)||(a.selectedYear=d),d}),s(20,"option",13),l(21,"Select Year"),o(),T(22,ewe,2,2,"option",14),o()(),s(23,"div",16)(24,"button",17),S("click",function(){return a.onClickGenerate()}),s(25,"span",18),l(26,"search"),o(),l(27," Generate "),o()()()(),s(28,"div",3)(29,"div",19)(30,"div",20)(31,"div",21)(32,"table",22)(33,"thead",23)(34,"tr")(35,"th"),l(36,"Date"),o(),s(37,"th",24),l(38,"System Cash(LKR)"),o(),s(39,"th",24),l(40,"System Card(LKR)"),o(),s(41,"th",24),l(42,"Actual Cash(LKR)"),o(),s(43,"th",24),l(44,"Actual Card(LKR)"),o(),s(45,"th",24),l(46,"Invalid Tickets and Reasons"),o(),s(47,"th",24),l(48,"Actions"),o()()(),s(49,"tbody",25),T(50,swe,23,14,"tr",26),o(),s(51,"tfoot",27)(52,"tr")(53,"td"),l(54,"Total(LKR)"),o(),s(55,"td",24),l(56),o(),s(57,"td",24),l(58),o(),s(59,"td",24),l(60),o(),s(61,"td",24),l(62),o(),B(63,"td",24)(64,"td",24),o()()()()()()()()(),s(65,"div",28)(66,"div",29)(67,"div",30)(68,"div",31)(69,"h5",32),l(70," Voided Bookings "),o(),B(71,"button",33),o(),s(72,"div",34)(73,"p")(74,"strong"),l(75,"Date:"),o(),l(76),I(77,"date"),o(),s(78,"table",22)(79,"thead",35)(80,"tr")(81,"th"),l(82,"Booking"),o(),s(83,"th"),l(84,"Guest"),o(),s(85,"th",24),l(86,"Amount (LKR)"),o()()(),s(87,"tbody"),T(88,lwe,7,3,"tr",36),o()()()()()(),s(89,"div",37)(90,"div",29)(91,"div",30)(92,"div",31)(93,"h5",38),l(94,"Confirm Cash-up"),o(),B(95,"button",33),o(),s(96,"div",34)(97,"p")(98,"strong"),l(99,"Date:"),o(),l(100),I(101,"date"),o(),s(102,"p")(103,"strong"),l(104,"Actual Cash:"),o(),l(105),o(),s(106,"p")(107,"strong"),l(108,"Actual Card:"),o(),l(109),o(),T(110,cwe,5,1,"div",39),o(),s(111,"div",40)(112,"button",41),l(113," Cancel "),o(),s(114,"button",42),S("click",function(){return a.confirmTransaction()}),l(115," Confirm "),o()()()()()),r&2&&(m(),p("ngClass",Z(22,JEe,a.isCollapsed)),m(),p("ngIf",a.hasUnconfirmedPreviousTransactions),m(10),q("ngModel",a.selectedMonth),m(3),p("ngForOf",a.months),m(4),q("ngModel",a.selectedYear),m(3),p("ngForOf",a.years),m(2),p("disabled",!a.selectedMonth||!a.selectedYear),m(26),p("ngForOf",a.salesData),m(6),b(a.systemCashTotal.toLocaleString()),m(2),b(a.systemCardTotal.toLocaleString()),m(2),b(a.actualCashTotal.toLocaleString()),m(2),b(a.actualCardTotal.toLocaleString()),m(14),_(" ",M(77,18,a.selectedRow==null?null:a.selectedRow.date)),m(12),p("ngForOf",a.selectedRow==null?null:a.selectedRow.invalid_tickets),m(12),_(" ",M(101,20,a.selectedRow==null?null:a.selectedRow.date)),m(5),_(" LKR ",a.disp(a.selectedRow==null?null:a.selectedRow.actual_cash_amount)," "),m(4),_(" LKR ",a.disp(a.selectedRow==null?null:a.selectedRow.actual_card_amount)," "),m(),p("ngIf",a.selectedRow))},dependencies:[ue,_e,Dt,Bt,Vt,Ke,qi,Ot,Ne,gn,Le,St],styles:[".modal-content[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 2px 10px #0000001a}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;background-color:#f8f9fa;border-radius:8px 8px 0 0}.modal-footer[_ngcontent-%COMP%]{border-top:1px solid #dee2e6;background-color:#f8f9fa;border-radius:0 0 8px 8px}"]});let i=n;return i})();var dwe=[{path:"",redirectTo:"/login",pathMatch:"full"},{path:"login",component:i6},{path:"home",component:n6,canActivate:[ht]},{path:"feedbacks",component:wF,canActivate:[ht],data:{roles:Je.MEDIA_CONTENT}},{path:"admission-ticket-sales",component:gO,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-daily-sales-reports",component:hO,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-daily-transaction-verification",component:WL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-monthly-sales-reports",component:FL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-analytics",component:Q7,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-sales-report-analytics",component:tL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-visitors-report-analytics",component:nL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-entrance-ticketing-report-analytics",component:aL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-tourguide-report-analytics",component:sL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-entrance-item-wise-report",component:dL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-edit-price",component:AL,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-link-guide",component:P9,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"admission-register-qr-code",component:j9,canActivate:[ht],data:{roles:Je.ENTRANCE_TICKETING}},{path:"tour-guide-manage-guides",component:JT,canActivate:[ht],data:{roles:Je.ADMIN}},{path:"tour-guide-expense-reports",component:AN,canActivate:[ht],data:{roles:Je.GUIDE_EXPENSE}},{path:"manage-guides",component:JT,canActivate:[ht],data:{roles:Je.ADMIN}},{path:"manage-users",component:fL,canActivate:[ht],data:{roles:Je.ADMIN}},{path:"swing-ticket-sales",component:_O,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"daily-sales-report-swing",component:yO,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"daily-transaction-verify-swing",component:GL,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"monthly-sales-report-swing",component:RL,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"ambar-swing-analytics",component:UO,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"item-wise-summary-swing",component:bO,canActivate:[ht],data:{roles:Je.AMBER_SWING}}
389,{path:"guide-expense-report-swing",component:jO,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"amber-swing-edit-price",component:_L,canActivate:[ht],data:{roles:Je.AMBER_SWING}},{path:"daily-sales-report-paddle-boat",component:SO,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"daily-transaction-verify-paddle-boat",component:d9,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"monthly-sales-report-paddle-boat",component:OL,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"item-wise-sales-report-paddle-boat",component:CO,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"tickets-sales-paddle-boat",component:xO,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"paddle-boat-analytics",component:FN,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"edit-pricing-paddle-boat",component:RN,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"paddle-boat-monthly-food-sales-summary",component:G9,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"paddle-boat-daily-food-sales-summary",component:$9,canActivate:[ht],data:{roles:Je.PADDLE_BOAT}},{path:"daily-sales-report-horse-ride",component:EO,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"daily-transaction-verify-horse-ride",component:u9,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"monthly-sales-report-horse-ride",component:NL,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"item-wise-sales-report-horse-ride",component:wO,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"ticket-sales-horse-ride",component:TO,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"horse-ride-analytics",component:ON,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"edit-pricing-horse-ride",component:NN,canActivate:[ht],data:{roles:Je.HORSE_RIDE}},{path:"daily-sales-report-herbal-shop",component:DO,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"monthly-sales-report-herbal-shop",component:UL,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"item-wise-sales-report-herbal-shop",component:IO,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"ticket-sales-herbal-shop",component:kO,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"herbal-shop-analytics",component:LN,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"herbal-shop-edit-price",component:yL,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"herbal-shop-daily-transaction-verification",component:XL,canActivate:[ht],data:{roles:Je.HERBAL_SHOP}},{path:"daily-sales-report-gelato-heavan",component:mB,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"monthly-sales-report-gelato-heavan",component:uB,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"item-wise-sales-report-gelato-heavan",component:pB,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"ticket-sales-gelato-heavan",component:hB,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"gelato-heavan-analytics",component:fB,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"gelato-heavan-edit-price",component:gB,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"gelato-heavan-daily-transaction-verification",component:_B,canActivate:[ht],data:{roles:Je.GELATO_HEAVEN}},{path:"daily-sales-report-lake-front-rest",component:F9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"daily-transaction-verify-lake-front-rest",component:O9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"item-wise-sales-report-lake-front-rest",component:N9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"ticket-sales-lake-front-rest",component:L9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"lake-front-rest-analytics",component:B9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"lake-front-rest-edit-price",component:V9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"lake-front-rest-monthly-sales",component:U9,canActivate:[ht],data:{roles:Je.LAKE_FRONT_REST}},{path:"daily-sales-report-coffee-shop",component:AO,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"item-wise-sales-report-coffee-shop",component:PO,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"ticket-sales-coffee-shop",component:FO,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"coffee-shop-analytics",component:RO,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"coffee-shop-edit-price",component:SL,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"coffee-shop-monthly-sales",component:LL,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"coffee-shop-daily-transaction-verification",component:e9,canActivate:[ht],data:{roles:Je.COFFEE_SHOP}},{path:"daily-sales-report-hostel-rest",component:DB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}},{path:"item-wise-sales-report-hostel-rest",component:IB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}},{path:"ticket-sales-hostel-rest",component:kB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}},{path:"hostel-rest-analytics",component:MB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}},{path:"hostel-rest-edit-price",component:AB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}},{path:"hostel-rest-monthly-sales",component:PB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}},{path:"hostel-rest-daily-transaction-verification",component:RB,canActivate:[ht],data:{roles:Je.HOSTEL_REST}}
389,{path:"daily-sales-report-idikada-village-restaurant",component:xB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"item-wise-sales-report-idikada-village-restaurant",component:CB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"ticket-sales-idikada-village-restaurant",component:EB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"idikada-village-restaurant-analytics",component:yB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"idikada-village-restaurant-edit-price",component:SB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"idikada-village-restaurant-monthly-sales",component:bB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"idikada-village-restaurant-daily-transaction-verification",component:TB,canActivate:[ht],data:{roles:Je.IDIKADA_VILLAGE_RESTAURANT}},{path:"daily-sales-report-sanora-restaurant",component:K9,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"monthly-sales-report-sanora-restaurant",component:X9,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"daily-transaction-verification-sanora-restaurant",component:eB,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"edit-price-sanora-restaurant",component:tB,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"sanora-restaurant-analytics",component:iB,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"item-wise-sales-report-sanora-restaurant",component:J9,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"ticket-sales-sanora-restaurant",component:Z9,canActivate:[ht],data:{roles:Je.SANORA_RESTAURANT}},{path:"daily-sales-report-adventure-park",component:OO,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"monthly-sales-report-adventure-park",component:jL,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"item-wise-sales-report-adventure-park",component:NO,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"ticket-sales-adventure-park",component:LO,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"adventure-park-analytics",component:BO,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"edit-pricing-adventure-park",component:VO,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"daily-transaction-verification-adventure-park",component:ZL,canActivate:[ht],data:{roles:Je.ADVENTURE_PARK}},{path:"daily-sales-report-blov-burger-shop",component:t9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"monthly-sales-report-blov-burger-shop",component:i9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"item-wise-sales-report-blov-burger-shop",component:n9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"ticket-sales-blov-burger-shop",component:r9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"blov-burger-shop-analytics",component:a9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"edit-pricing-blov-burger-shop",component:o9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"daily-transaction-verification-blov-burger-shop",component:l9,canActivate:[ht],data:{roles:Je.BLOVBURGERSHOP}},{path:"daily-sales-report-the-stable",component:nB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"monthly-sales-report-the-stable",component:rB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"item-wise-sales-report-the-stable",component:aB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"ticket-sales-the-stable",component:oB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"the-stable-analytics",component:sB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"edit-pricing-the-stable",component:lB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"daily-transaction-verification-the-stable",component:dB,canActivate:[ht],data:{roles:Je.THE_STABLE}},{path:"daily-sales-report-souvenir-shop",component:TL,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}},{path:"daily-transaction-verify-souvenir-shop",component:qL,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}},{path:"souvenir-shop-monthly-sales",component:BL,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}},{path:"ticket-sales-souvenir-shop",component:DL,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}}
389,{path:"item-wise-sales-report-souvenir-shop",component:IL,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}},{path:"edit-pricing-souvenir-shop",component:kL,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}},{path:"souvenir-shop-analytics",component:ML,canActivate:[ht],data:{roles:Je.SOUVENIR_SHOP}},{path:"pre-shoot-analytics",component:lL,canActivate:[ht],data:{roles:Je.PRE_SHOOT}},{path:"pre-shoot-tickets",component:cL,canActivate:[ht],data:{roles:Je.PRE_SHOOT}},{path:"pre-shoot-daily-sales",component:M9,canActivate:[ht],data:{roles:Je.PRE_SHOOT}},{path:"pre-shoot-daily-transaction-verification",component:A9,canActivate:[ht],data:{roles:Je.PRE_SHOOT}},{path:"pre-shoot-monthly-sales",component:k9,canActivate:[ht],data:{roles:Je.PRE_SHOOT}},{path:"edit-pricing-photo-shoot",component:PL,canActivate:[ht],data:{roles:Je.PRE_SHOOT}},{path:"news-event",component:pL,canActivate:[ht],data:{roles:Je.MEDIA_CONTENT}},{path:"announcement",component:vL,canActivate:[ht],data:{roles:Je.MEDIA_CONTENT}},{path:"helmet-ticket-sales",component:bL,canActivate:[ht],data:{roles:Je.HELMET}},{path:"helmet-daily-sales-report",component:xL,canActivate:[ht],data:{roles:Je.HELMET}},{path:"helmet-daily-transaction-verify",component:zL,canActivate:[ht],data:{roles:Je.HELMET}},{path:"helmet-monthly-sales",component:VL,canActivate:[ht],data:{roles:Je.HELMET}},{path:"helmet-edit-price",component:EL,canActivate:[ht],data:{roles:Je.HELMET}},{path:"helmet-analytics",component:wL,canActivate:[ht],data:{roles:Je.HELMET}},{path:"auditorium-ticket-sales",component:h9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-item-wise-sales",component:f9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-monthly-sales",component:g9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-analytics",component:v9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-edit-price",component:_9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-daily-transaction-verify",component:S9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-guide-expense",component:Y9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"auditorium-manage-shows",component:q9,canActivate:[ht],data:{roles:Je.AUDITORIUM}},{path:"sms-broadcast",component:H9,canActivate:[ht],data:{roles:Je.MEDIA_CONTENT}},{path:"photo-booth-ticket-sales",component:b9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"photo-booth-daily-sales",component:x9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"photo-booth-daily-transaction-verify",component:E9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"photo-booth-monthly-sales",component:w9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"photo-booth-item-wise-sales",component:T9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"photo-booth-analytics",component:D9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"photo-booth-edit-price",component:I9,canActivate:[ht],data:{roles:Je.PHOTO_BOOTH}},{path:"hostel-bookings-ticket-sales",component:OB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"hostel-bookings-daily-sales-report",component:NB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"hostel-bookings-monthly-sales-report",component:LB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"hostel-bookings-item-wise-summary",component:BB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"hostel-bookings-analytics",component:VB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"hostel-bookings-daily-transaction-verification",component:jB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"hostel-bookings-edit-price",component:UB,canActivate:[ht],data:{roles:Je.HOSTEL_BOOKINGS}},{path:"forgot-password",component:PN},{path:"maintenance",component:MO,canActivate:[ht]},{path:"**",redirectTo:"home"}],WB=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=_i({type:n}),n.\u0275inj=vi({imports:[Gy.forRoot(dwe),Gy]});let i=n;return i})();var Ff=i=>({active:i});function mwe(i,n){i&1&&B(0,"img",39)}function uwe(i,n){if(i&1&&(s(0,"span",23),l(1),o()),i&2){let t=w(2).$implicit;m(),_(" ",t.label," ")}}
389function pwe(i,n){if(i&1){let t=he();s(0,"li",47)(1,"a",48),S("click",function(){U(t);let r=w().$implicit,a=w(5);return j(a.setActiveSubMenu(r.key))}),l(2),o()()}if(i&2){let t=w().$implicit,e=w(5);p("ngClass",Z(3,Ff,e.isSubActive(t.key))),m(),p("routerLink",t.route),m(),_(" ",t.label," ")}}function hwe(i,n){if(i&1&&(Ui(0),T(1,pwe,3,5,"li",46),ji()),i&2){let t=n.$implicit,e=w(5);m(),p("ngIf",e.hasSubMenuAccess(t.route))}}function fwe(i,n){if(i&1&&(s(0,"ul",45),T(1,hwe,2,1,"ng-container",24),o()),i&2){let t=w(2).$implicit,e=w(2);Re("active",e.isActive(t.key)),m(),p("ngForOf",t.subMenus)}}function gwe(i,n){if(i&1){let t=he();s(0,"li",20)(1,"div",41),S("click",function(){U(t);let r=w().$implicit,a=w(2);return j(a.toggleSubMenu(r.key))}),s(2,"div")(3,"span",22),l(4),o(),T(5,uwe,2,1,"span",42),o(),s(6,"span",43),l(7," keyboard_arrow_down "),o()(),T(8,fwe,2,3,"ul",44),o()}if(i&2){let t=w().$implicit,e=w(2);m(),p("ngClass",Z(4,Ff,e.isActive(t.key))),m(3),b(t.icon),m(),p("ngIf",!e.isCollapsed||e.isActive(t.key)),m(3),p("ngIf",!e.isCollapsed||e.isActive(t.key))}}function vwe(i,n){if(i&1&&(Ui(0),T(1,gwe,9,6,"li",40),ji()),i&2){let t=n.$implicit,e=w(2);m(),p("ngIf",e.hasAccess(t.roles))}}function _we(i,n){if(i&1&&(s(0,"span",23),l(1),o()),i&2){let t=w(3).$implicit;m(),_(" ",t.label," ")}}function ywe(i,n){i&1&&(s(0,"span",43),l(1," keyboard_arrow_down "),o())}function Swe(i,n){if(i&1){let t=he();s(0,"div",41),S("click",function(){U(t);let r=w(2).$implicit,a=w(2);return j(a.toggleSubMenu(r.key))}),s(1,"div")(2,"span",22),l(3),o(),T(4,_we,2,1,"span",42),o(),T(5,ywe,2,0,"span",50),o()}if(i&2){let t=w(2).$implicit,e=w(2);p("ngClass",Z(4,Ff,e.isActive(t.key))),m(3),b(t.icon),m(),p("ngIf",!e.isCollapsed||e.isActive(t.key)),m(),p("ngIf",t.subMenus)}}function bwe(i,n){if(i&1){let t=he();s(0,"li",47)(1,"a",48),S("click",function(){U(t);let r=w().$implicit,a=w(5);return j(a.setActiveSubMenu(r.key))}),l(2),o()()}if(i&2){let t=w().$implicit,e=w(5);p("ngClass",Z(3,Ff,e.isSubActive(t.key))),m(),p("routerLink",t.route),m(),_(" ",t.label," ")}}function xwe(i,n){if(i&1&&(Ui(0),T(1,bwe,3,5,"li",46),ji()),i&2){let t=n.$implicit,e=w(5);m(),p("ngIf",e.hasSubMenuAccess(t.route))}}function Cwe(i,n){if(i&1&&(s(0,"ul",45),T(1,xwe,2,1,"ng-container",24),o()),i&2){let t=w(2).$implicit,e=w(2);Re("active",e.isActive(t.key)),m(),p("ngForOf",t.subMenus)}}function Ewe(i,n){if(i&1&&(s(0,"li",20),T(1,Swe,6,6,"div",49)(2,Cwe,2,3,"ul",44),o()),i&2){let t=w().$implicit,e=w(2);m(),p("ngIf",t.subMenus&&t.subMenus.length>0),m(),p("ngIf",t.subMenus&&(!e.isCollapsed||e.isActive(t.key)))}}function wwe(i,n){if(i&1&&(s(0,"span",23),l(1),o()),i&2){let t=w(2).$implicit;m(),_(" ",t.label," ")}}function Twe(i,n){if(i&1&&(s(0,"li",20)(1,"div",51)(2,"div")(3,"span",22),l(4),o(),T(5,wwe,2,1,"span",42),o()()()),i&2){let t=w().$implicit,e=w(2);m(),p("ngClass",Z(4,Ff,e.isActive(t.key)))("routerLink",t.route),m(3),b(t.icon),m(),p("ngIf",!e.isCollapsed||e.isActive(t.key))}}function Dwe(i,n){if(i&1&&(Ui(0),T(1,Ewe,3,2,"li",40)(2,Twe,6,6,"li",40),ji()),i&2){let t=n.$implicit,e=w(2);m(),p("ngIf",e.hasAccess(t.roles)),m(),p("ngIf",(!t.subMenus||t.subMenus.length===0)&&e.hasAccess(t.roles))}}function Iwe(i,n){if(i&1){let t=he();s(0,"div",13)(1,"div",14),T(2,mwe,1,0,"img",15),s(3,"button",16),S("click",function(){U(t);let r=w();return j(r.toggleSidebar())}),s(4,"span",17),l(5,"menu"),o()()(),s(6,"div",18)(7,"ul",19)(8,"li",20)(9,"a",21),S("click",function(){U(t);let r=w();return j(r.setActiveMenu("home"))}),s(10,"div")(11,"span",22),l(12,"dashboard"),o(),s(13,"span",23),l(14,"Dashboard"),o()()()(),T(15,vwe,2,1,"ng-container",24),o(),s(16,"ul",25),T(17,Dwe,3,2,"ng-container",24),o()(),s(18,"div",26)(19,"div",27)(20,"div",28)(21,"span"),l(22),o()(),s(23,"div",29)(24,"div",30),l(25),o(),s(26,"div",31),l(27),o(),s(28,"div",32),l(29),o()()(),s(30,"button",33),S("click",function(){U(t);let r=w();return j(r.onClickSignout())}),B(31,"i",34),s(32,"span"),l(33,"Logout"),o()()(),s(34,"div",35)(35,"div",36)(36,"div",37)(37,"div",38),l(38),o(),s(39,"div",38),l(40),o()()()()()}if(i&2){let t=w();Re("collapsed",t.isCollapsed),m(2),p("ngIf",!t.isCollapsed),m(7),p("ngClass",Z(12,Ff,t.isActive("home"))),m(6),p("ngForOf",t.menuItems),m(2),p("ngForOf",t.bottomMenuItems),m(5),b(t.profileName),m(3),b(t.name),m(2),b(t.userRole),m(2),b(t.email),m(9),_(" \xA9 ",t.currentYear," IO Technology Consulting,\xA0LLC.\xA0USA "),m(2),_("Build ",t.buildNumber)}}var HB=(()=>{let n=class n{constructor(e,r,a,c,d,u){this.router=e,this.cognitoService=r,this.sidebarService=a,this.eventService=c,this.spinner=d,this.toastr=u,this.isCollapsed=!1,this.activeMenu=null,this.activeSubMenu=null,this.userRole="",this.roles=Je,this.sidebarVisible=!1,this.showNavbar=!0,this.profileName="",this.email="",this.name="",this.currentYear=new Date().getFullYear(),this.buildNumber=DF,this.menuItems=[{key:"admission",label:"Admission Tickets",icon:"confirmation_number",roles:Je.ENTRANCE_TICKETING,subMenus:[{key:"ticket-sales",label:"Ticket Sales",route:"/admission-ticket-sales"},{key:"daily-reports",label:"Daily Sales Report",route:"/admission-daily-sales-reports"},{key:"admission-daily-transaction-verification",label:"Daily Transaction",route:"/admission-daily-transaction-verification"},{key:"admission-monthly-sales-reports",label:"Monthly Sales Report",route:"/admission-monthly-sales-reports"},{key:"entrance-item-wise-report",label:"Itemwise Sales Report",route:"/admission-entrance-item-wise-report"},{key:"admission-visitors-report-analytics",label:"Visitors Analytics",route:"/admission-visitors-report-analytics"},{key:"admission-entrance-ticketing-report-analytics",label:"Sales Analytics",route:"/admission-entrance-ticketing-report-analytics"},{key:"admission-tourguide-report-analytics",label:"Tour Guide",route:"/admission-tourguide-report-analytics"},{key:"admission-edit-price",label:"Edit Price",route:"/admission-edit-price"},{key:"admission-link-guide",label:"Link Guide",route:"/admission-link-guide"},{key:"admission-register-qr-code",label:"Register QR Code",route:"/admission-register-qr-code"}]},{key:"swing",label:"Amber Swing",icon:"settings_accessibility",roles:Je.AMBER_SWING,subMenus:[{key:"swing-ticket-sales",label:"Ticket Sales",route:"/swing-ticket-sales"},{key:"daily-sales-report-swing",label:"Daily Sales Reports",route:"/daily-sales-report-swing"},{key:"daily-transaction-verify-swing",label:"Daily Transaction",route:"/daily-transaction-verify-swing"},{key:"monthly-sales-report-swing",label:"Monthly Sales Reports",route:"/monthly-sales-report-swing"},{key:"item-wise-summary-swing",label:"Item Wise Summary",route:"/item-wise-summary-swing"},{key:"ambar-swing-analytics",label:"Analytics",route:"/ambar-swing-analytics"},{key:"guide-expense-report-swing",label:"Guide expense Report",route:"/guide-expense-report-swing"},{key:"amber-swing-edit-price",label:"Edit Price",route:"/amber-swing-edit-price"}]},{key:"paddle-boat",label:"Paddle Boat",icon:"sailing",roles:Je.PADDLE_BOAT,
389subMenus:[{key:"paddle-boat-ticket-sales",label:"Ticket Sales",route:"/tickets-sales-paddle-boat"},{key:"daily-sales-report-paddle-boat",label:"Daily Sales Reports",route:"/daily-sales-report-paddle-boat"},{key:"daily-transaction-verify-paddle-boat",label:"Daily Transaction",route:"/daily-transaction-verify-paddle-boat"},{key:"monthly-sales-report-paddle-boat",label:"Monthly Sales Reports",route:"/monthly-sales-report-paddle-boat"},{key:"item-wise-sales-report-paddle-boat",label:"Item Wise Summary",route:"/item-wise-sales-report-paddle-boat"},{key:"paddle-boat-analytics",label:"Analytics",route:"/paddle-boat-analytics"},{key:"edit-pricing-paddle-boat",label:"Edit Price",route:"/edit-pricing-paddle-boat"},{key:"paddle-boat-daily-food-sales-summary",label:"Daily Food Sales Summary",route:"/paddle-boat-daily-food-sales-summary"},{key:"paddle-boat-monthly-food-sales-summary",label:"Monthly Food Sales Summary",route:"/paddle-boat-monthly-food-sales-summary"}]},{key:"horse-ride",label:"Horse Ride",icon:"bedroom_baby",roles:Je.HORSE_RIDE,subMenus:[{key:"ticket-sales-horse-ride",label:"Ticket Sales",route:"/ticket-sales-horse-ride"},{key:"daily-sales-report-horse-ride",label:"Daily Sales Reports",route:"/daily-sales-report-horse-ride"},{key:"daily-transaction-verify-horse-ride",label:"Daily Transaction",route:"/daily-transaction-verify-horse-ride"},{key:"monthly-sales-report-horse-ride",label:"Monthly Sales Reports",route:"/monthly-sales-report-horse-ride"},{key:"item-wise-sales-report-horse-ride",label:"Item Wise Summary",route:"/item-wise-sales-report-horse-ride"},{key:"horse-ride-analytics",label:"Analytics",route:"/horse-ride-analytics"},{key:"edit-pricing-horse-ride",label:"Edit Price",route:"/edit-pricing-horse-ride"}]},{key:"the-stable",label:"The Stable",icon:"bedroom_baby",roles:Je.THE_STABLE,subMenus:[{key:"ticket-sales-the-stable",label:"Ticket Sales",route:"/ticket-sales-the-stable"},{key:"daily-sales-report-the-stable",label:"Daily Sales Reports",route:"/daily-sales-report-the-stable"},{key:"daily-transaction-verification-the-stable",label:"Daily Transaction",route:"/daily-transaction-verification-the-stable"},{key:"monthly-sales-report-the-stable",label:"Monthly Sales Reports",route:"/monthly-sales-report-the-stable"},{key:"item-wise-sales-report-the-stable",label:"Item Wise Summary",route:"/item-wise-sales-report-the-stable"},{key:"the-stable-analytics",label:"Analytics",route:"/the-stable-analytics"},{key:"edit-pricing-the-stable",label:"Edit Price",route:"/edit-pricing-the-stable"}]},{key:"herbal-shop",label:"Herbal Shop",icon:"grass",roles:Je.HERBAL_SHOP,subMenus:[{key:"ticket-sales-herbal-shop",label:"Ticket Sales",route:"/ticket-sales-herbal-shop"},{key:"daily-sales-report-herbal-shop",label:"Daily Sales Reports",route:"/daily-sales-report-herbal-shop"},{key:"herbal-shop-daily-transaction-verification",label:"Daily Transaction",route:"/herbal-shop-daily-transaction-verification"},{key:"monthly-sales-report-herbal-shop",label:"Monthly Sales Reports",route:"/monthly-sales-report-herbal-shop"},{key:"item-wise-sales-report-herbal-shop",label:"Item Wise Summary",route:"/item-wise-sales-report-herbal-shop"},{key:"herbal-shop-analytics",label:"Analytics",route:"/herbal-shop-analytics"},{key:"herbal-shop-edit-price",label:"Edit Price",route:"/herbal-shop-edit-price"}]},{key:"gelato-heavan",label:"Gelato Heaven",icon:"icecream",roles:Je.GELATO_HEAVEN,subMenus:[{key:"ticket-sales-gelato-heavan",label:"Ticket Sales",route:"/ticket-sales-gelato-heavan"},{key:"daily-sales-report-gelato-heavan",label:"Daily Sales Reports",route:"/daily-sales-report-gelato-heavan"},{key:"gelato-heavan-daily-transaction-verification",label:"Daily Transaction",route:"/gelato-heavan-daily-transaction-verification"},{key:"monthly-sales-report-gelato-heavan",label:"Monthly Sales Reports",route:"/monthly-sales-report-gelato-heavan"},{key:"item-wise-sales-report-gelato-heavan",label:"Item Wise Summary",route:"/item-wise-sales-report-gelato-heavan"},{key:"gelato-heavan-analytics",label:"Analytics",route:"/gelato-heavan-analytics"},{key:"gelato-heavan-edit-price",label:"Edit Price",route:"/gelato-heavan-edit-price"}]},{key:"lake-front-rest",label:"Lake Front Rest",icon:"sports_bar",roles:Je.LAKE_FRONT_REST,subMenus:[{key:"ticket-sales-lake-front-rest",label:"Ticket Sales",route:"/ticket-sales-lake-front-rest"},{key:"daily-sales-report-lake-front-rest",label:"Daily Sales Reports",route:"/daily-sales-report-lake-front-rest"},{key:"daily-transaction-verify-lake-front-rest",label:"Daily Transaction",route:"/daily-transaction-verify-lake-front-rest"},{key:"lake-front-rest-monthly-sales",label:"Monthly Sales Reports",route:"/lake-front-rest-monthly-sales"},{key:"item-wise-sales-report-lake-front-rest",label:"Item Wise Summary",route:"/item-wise-sales-report-lake-front-rest"},{key:"lake-front-rest-analytics",label:"Analytics",route:"/lake-front-rest-analytics"},{key:"lake-front-rest-edit-price",label:"Edit Price",route:"/lake-front-rest-edit-price"}]},{key:"coffee-shop",label:"View Cafe",icon:"local_cafe",roles:Je.COFFEE_SHOP,subMenus:[{key:"ticket-sales-coffee-shop",label:"Ticket Sales",route:"/ticket-sales-coffee-shop"},{key:"daily-sales-report-coffee-shop",label:"Daily Sales Reports",route:"/daily-sales-report-coffee-shop"},{key:"coffee-shop-daily-transaction-verification",label:"Daily Transaction",route:"/coffee-shop-daily-transaction-verification"},{key:"coffee-shop-monthly-sales",label:"Monthly Sales Reports",route:"/coffee-shop-monthly-sales"},{key:"item-wise-sales-report-coffee-shop",label:"Item Wise Summary",route:"/item-wise-sales-report-coffee-shop"},{key:"coffee-shop-analytics",label:"Analytics",route:"/coffee-shop-analytics"},{key:"coffee-shop-edit-price",label:"Edit Price",route:"/coffee-shop-edit-price"}]},{key:"hostel-rest",label:"Hostel Restaurant",icon:"restaurant",roles:Je.HOSTEL_REST,subMenus:[{key:"ticket-sales-hostel-rest",label:"Ticket Sales",route:"/ticket-sales-hostel-rest"},{key:"daily-sales-report-hostel-rest",label:"Daily Sales Reports",route:"/daily-sales-report-hostel-rest"},{key:"hostel-rest-daily-transaction-verification",label:"Daily Transaction",route:"/hostel-rest-daily-transaction-verification"},{key:"hostel-rest-monthly-sales",label:"Monthly Sales Reports",route:"/hostel-rest-monthly-sales"},{key:"item-wise-sales-report-hostel-rest",label:"Item Wise Summary",route:"/item-wise-sales-report-hostel-rest"},{key:"hostel-rest-analytics",label:"Analytics",route:"/hostel-rest-analytics"},{key:"hostel-rest-edit-price",label:"Edit Price",route:"/hostel-rest-edit-price"}]},{key:"hostel-bookings",label:"Altitude Ambuluwawa",icon:"hotel",roles:Je.HOSTEL_BOOKINGS,subMenus:[{key:"hostel-bookings-ticket-sales",label:"Booking Sales",route:"/hostel-bookings-ticket-sales"},{key:"hostel-bookings-daily-sales-report",label:"Daily Sales Reports",route:"/hostel-bookings-daily-sales-report"},{key:"hostel-bookings-daily-transaction-verification",label:"Daily Transaction Verification",route:"/hostel-bookings-daily-transaction-verification"},{key:"hostel-bookings-monthly-sales-report",label:"Monthly Sales Reports",route:"/hostel-bookings-monthly-sales-report"},{key:"hostel-bookings-item-wise-summary",label:"Room Type Summary",route:"/hostel-bookings-item-wise-summary"},{key:"hostel-bookings-analytics",label:"Analytics",route:"/hostel-bookings-analytics"},{key:"hostel-bookings-edit-price",label:"Edit Price",route:"/hostel-bookings-edit-price"}]},{key:"sanora-restaurant",label:"Sanora Restaurant",icon:"restaurant",roles:Je.SANORA_RESTAURANT,subMenus:[{key:"ticket-sales-sanora-restaurant",label:"Ticket Sales",route:"/ticket-sales-sanora-restaurant"},{key:"daily-sales-report-sanora-restaurant",label:"Daily Sales Reports",route:"/daily-sales-report-sanora-restaurant"},{key:"daily-transaction-verification-sanora-restaurant",label:"Daily Transaction",route:"/daily-transaction-verification-sanora-restaurant"},{key:"monthly-sales-report-sanora-restaurant",label:"Monthly Sales Reports",route:"/monthly-sales-report-sanora-restaurant"},{key:"item-wise-sales-report-sanora-restaurant",label:"Item Wise Summary",route:"/item-wise-sales-report-sanora-restaurant"},{key:"sanora-restaurant-analytics",label:"Analytics",route:"/sanora-restaurant-analytics"},{key:"edit-price-sanora-restaurant",label:"Edit Price",route:"/edit-price-sanora-restaurant"}]},{key:"adventure-park",label:"Adventure Park",icon:"hiking",roles:Je.ADVENTURE_PARK,subMenus:[{key:"ticket-sales-adventure-park",label:"Ticket Sales",route:"/ticket-sales-adventure-park"},{key:"daily-sales-report-adventure-park",label:"Daily Sales Reports",route:"/daily-sales-report-adventure-park"},{key:"daily-transaction-verification-adventure-park",label:"Daily Transaction",route:"/daily-transaction-verification-adventure-park"},{key:"monthly-sales-report-adventure-park",label:"Monthly Sales Reports",route:"/monthly-sales-report-adventure-park"},{key:"item-wise-sales-report-adventure-park",label:"Item Wise Summary",route:"/item-wise-sales-report-adventure-park"},{key:"adventure-park-analytics",label:"Analytics",route:"/adventure-park-analytics"},{key:"edit-pricing-adventure-park",label:"Edit Price",route:"/edit-pricing-adventure-park"}]},{key:"blov-burger-shop",label:"B LOV Burger And More",icon:"fastfood",roles:Je.BLOVBURGERSHOP,subMenus:[{key:"ticket-sales-blov-burger-shop",label:"Ticket Sales",route:"/ticket-sales-blov-burger-shop"},{key:"daily-sales-report-blov-burger-shop",label:"Daily Sales Reports",route:"/daily-sales-report-blov-burger-shop"},{key:"daily-transaction-verification-blov-burger-shop",label:"Daily Transaction",route:"/daily-transaction-verification-blov-burger-shop"},{key:"monthly-sales-report-blov-burger-shop",label:"Monthly Sales Reports",route:"/monthly-sales-report-blov-burger-shop"},{key:"item-wise-sales-report-blov-burger-shop",label:"Item Wise Summary",route:"/item-wise-sales-report-blov-burger-shop"},{key:"blov-burger-shop-analytics",label:"Analytics",route:"/blov-burger-shop-analytics"},{key:"edit-pricing-blov-burger-shop",label:"Edit Price",route:"/edit-pricing-blov-burger-shop"}]},{key:"souvenir-shop",label:"Souvenir Shop",icon:"store",roles:Je.SOUVENIR_SHOP,subMenus:[{key:"ticket-sales-souvenir-shop",label:"Ticket Sales",route:"/ticket-sales-souvenir-shop"},{key:"daily-sales-report-souvenir-shop",label:"Daily Sales Reports",route:"/daily-sales-report-souvenir-shop"},{key:"daily-transaction-verify-souvenir-shop",label:"Daily Transaction",route:"/daily-transaction-verify-souvenir-shop"},{key:"souvenir-shop-monthly-sales",label:"Monthly Sales Reports",route:"/souvenir-shop-monthly-sales"},{key:"item-wise-sales-report-souvenir-shop",label:"Item Wise Summary",route:"/item-wise-sales-report-souvenir-shop"},{key:"souvenir-shop-analytics",label:"Analytics",route:"/souvenir-shop-analytics"},{key:"edit-pricing-souvenir-shop",label:"Edit Price",route:"/edit-pricing-souvenir-shop"}]},{key:"helmet",label:"Helmet",icon:"engineering",roles:Je.HELMET,subMenus:[{key:"helmet-ticket-sales",label:"Ticket Sales",route:"/helmet-ticket-sales"},{key:"helmet-daily-sales-report",label:"Daily Sales Report",route:"/helmet-daily-sales-report"},{key:"helmet-daily-transaction-verify",label:"Daily Transaction",route:"/helmet-daily-transaction-verify"},{key:"helmet-monthly-sales",label:"Monthly Sales Report",route:"/helmet-monthly-sales"},{key:"helmet-analytics",label:"Analytics",route:"/helmet-analytics"},{key:"helmet-edit-price",label:"Edit Price",route:"/helmet-edit-price"}]},{key:"pre-shoot",label:"Photo Shoot",icon:"camera_alt",roles:Je.PRE_SHOOT,subMenus:[{key:"pre-shoot-tickets",label:"Tickets Sales",route:"/pre-shoot-tickets"},{key:"pre-shoot-daily-sales",label:"Daily Sales Report",route:"/pre-shoot-daily-sales"},{key:"pre-shoot-daily-transaction-verification",label:"Daily Transaction",route:"/pre-shoot-daily-transaction-verification"},{key:"pre-shoot-monthly-sales",label:"Monthly Sales Report",route:"/pre-shoot-monthly-sales"},{key:"pre-shoot-analytics",label:"Analytics",route:"/pre-shoot-analytics"},{key:"edit-pricing-photo-shoot",label:"Edit Price",route:"/edit-pricing-photo-shoot"}]},{key:"auditorium",label:"Auditorium",icon:"festival",roles:Je.AUDITORIUM,subMenus:[{key:"auditorium-ticket-sales",label:"Ticket Sales",route:"/auditorium-ticket-sales"},{key:"auditorium-daily-transaction-verify",label:"Daily Transaction",route:"/auditorium-daily-transaction-verify"},{key:"auditorium-item-wise-sales",label:"Item Wise Sales",route:"/auditorium-item-wise-sales"},{key:"auditorium-monthly-sales",label:"Monthly Sales Report",route:"/auditorium-monthly-sales"},{key:"auditorium-analytics",label:"Analytics",route:"/auditorium-analytics"},{key:"auditorium-edit-price",label:"Edit Price",route:"/auditorium-edit-price"},{key:"auditorium-guide-expense",label:"Expense Report",route:"/auditorium-guide-expense"},{key:"auditorium-manage-shows",label:"Manage Shows",route:"/auditorium-manage-shows"}]},{key:"photo-booth",label:"Photo Booth",icon:"camera_alt",roles:Je.PHOTO_BOOTH,subMenus:[{key:"photo-booth-ticket-sales",label:"Ticket Sales",route:"/photo-booth-ticket-sales"},{key:"photo-booth-daily-sales",label:"Daily Sales",route:"/photo-booth-daily-sales"},{key:"photo-booth-daily-transaction-verify",label:"Daily Transaction",route:"/photo-booth-daily-transaction-verify"},{key:"photo-booth-monthly-sales",label:"Monthly Sales",route:"/photo-booth-monthly-sales"},{key:"photo-booth-item-wise-sales",label:"Item Wise Sales",route:"/photo-booth-item-wise-sales"},{key:"photo-booth-analytics",label:"Analytics",route:"/photo-booth-analytics"},{key:"photo-booth-edit-price",label:"Edit Price",route:"/photo-booth-edit-price"}]}],this.bottomMenuItems=[{key:"guide",label:"Tour Guides",icon:"groups",roles:Je.GUIDE_EXPENSE,subMenus:[{key:"manage-guides",label:"Manage Guides",route:"/tour-guide-manage-guides"},{key:"expense-reports",label:"expense Reports",route:"/tour-guide-expense-reports"}]},{key:"news-event",label:"News/Event",icon:"newspaper",roles:Je.MEDIA_CONTENT,subMenus:[],route:"/news-event"},{key:"announcement",label:"Announcement",icon:"campaign",roles:Je.MEDIA_CONTENT,subMenus:[],route:"/announcement"},{key:"users",label:"Users",icon:"person",roles:Je.ADMIN,subMenus:[{key:"manage-users",label:"Manage Users",route:"/manage-users"}]},{key:"feedbacks",label:"Feedback",icon:"feedback",roles:Je.MEDIA_CONTENT,subMenus:[],route:"/feedbacks"},{key:"sms-broadcast",label:"Broadcast",icon:"sms",roles:Je.MEDIA_CONTENT,subMenus:[],route:"/sms-broadcast"}]}ngOnInit(){return ye(this,null,function*(){this.restoreMenuState(),this.setupRouterEvents(),this.setupLoginSuccessEvent(),this.initializeNavbar()})}restoreMenuState(){this.activeMenu=localStorage.getItem("activeMenu"),this.activeSubMenu=localStorage.getItem("activeSubMenu")}setupRouterEvents(){this.router.events.pipe(Vn(e=>e instanceof Yo)).subscribe(e=>{this.showNavbar=!["/login","/forgot-password"].includes(e.urlAfterRedirects)})}setupLoginSuccessEvent(){this.eventService.loginSuccess$.subscribe(()=>{this.initializeNavbar()})}initializeNavbar(){return ye(this,null,function*(){this.cognitoService.getCognitoIdToken()&&(yield this.getUserRole(),this.getProfileName()),this.subscribeToSidebarChanges()})}subscribeToSidebarChanges(){this.sidebarService.collapsed$.subscribe(e=>{this.isCollapsed=e}),this.sidebarService.sidebarVisibility$.subscribe(e=>{this.sidebarVisible=e})}getUserRole(){return ye(this,null,function*(){try{this.userRole=(yield this.cognitoService.getUserRole())||""}catch(e){console.error("Error fetching user role:",e),this.userRole=""}})}toggleSubMenu(e){this.activeMenu=this.activeMenu===e?null:e,this.activeSubMenu=this.activeMenu?this.activeSubMenu||"":null,this.saveMenuState()}toggleSidebar(){this.sidebarService.toggleCollapse()}setActiveMenu(e){this.activeMenu=e,this.activeSubMenu="",this.saveMenuState()}setActiveSubMenu(e){this.activeSubMenu=e,this.isCollapsed&&(this.sidebarService.setCollapseState(!1),setTimeout(()=>this.sidebarService.setCollapseState(!0),500)),this.saveMenuState()}saveMenuState(){localStorage.setItem("activeMenu",this.activeMenu||""),localStorage.setItem("activeSubMenu",this.activeSubMenu||"")}isActive(e){return this.activeMenu===e}isSubActive(e){return this.activeSubMenu===e}hasAccess(e){return e.includes(K1(this.userRole))}hasSubMenuAccess(e){return!Rb(K1(this.userRole),e)}clearActiveMenu(){this.activeMenu=nu
389ll,this.activeSubMenu=null,localStorage.removeItem("activeMenu"),localStorage.removeItem("activeSubMenu")}closeSidebar(){this.isCollapsed=!0}getProfileName(){if(this.name=localStorage.getItem("name"),this.email=localStorage.getItem("email"),this.name){let e=this.name.split(" ");this.profileName=e.slice(0,2).map(r=>r[0]).join("")}else this.profileName="AA"}ngAfterViewInit(){setTimeout(()=>{this.confirmationModal=new bootstrap.Modal("#confirmationModal")})}onClickSignout(){this.confirmationModal.show()}closeConfirmationModal(){this.confirmationModal.hide()}onConfirmLogout(){this.confirmationModal.hide(),this.logout()}logout(){this.spinner.show(),this.cognitoService.signOut(),localStorage.clear(),this.sidebarService.hideSidebar(),this.resetActiveMenu(),this.spinner.hide(),this.toastr.success("Logged Out Successfully!","Success"),this.sidebarService.hideSidebar(),this.router.navigate(["login"])}resetActiveMenu(){localStorage.removeItem("activeMenu"),localStorage.removeItem("activeSubMenu")}};n.\u0275fac=function(r){return new(r||n)(x(_t),x(ze),x(ce),x(rb),x(pe),x(me))},n.\u0275cmp=te({type:n,selectors:[["app-navbar"]],standalone:!1,decls:17,vars:1,consts:[["class","sidebar position-fixed z-3",3,"collapsed",4,"ngIf"],["id","confirmationModal","tabindex","-1","aria-labelledby","confirmationModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
389-dialog-centered"],[1,"modal-content"],[1,"modal-header","border-0"],["type","button","data-bs-dismiss","modal","aria-label","Close",1,"btn-close",3,"click"],[1,"modal-body"],[1,"twoLineContent"],["id","confirmationModalLabel",1,"modal-title","text-center"],[1,"text-center"],[1,"modal-footer","justify-content-center","border-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],[1,"sidebar","position-fixed","z-3"],[1,"sidebar-header"],["src","/assets/logo.svg","alt","Logo","class","logo",4,"ngIf"],[1,"nav-toggle",3,"click"],[1,"material-icons-outlined"],[1,"sidebar-body"],[1,"nav-list","list-one"],[1,"nav-item"],["routerLink","/home","routerLinkActive","active",1,"nav-link",3,"click","ngClass"],[1,"material-icons-outlined","navIcon"],[1,"navlabel"],[4,"ngFor","ngForOf"],[1,"nav-list"],[1,"profile-section"],[1,"profile-container"],[1,"profile-avatar"],[1,"profile-info"],[1,"profile-name"],[1,"profile-role"],[1,"profile-email"],[1,"logout-button",3,"click"],[1,"fa","fa-sign-out"],[1,"release-section"],[1,"release-container"],[1,"release-info"],[1,"release-name"],["src","/assets/logo.svg","alt","Logo",1,"logo"],["class","nav-item",4,"ngIf"],[1,"nav-link",3,"click","ngClass"],["class","navlabel",4,"ngIf"],[1,"material-icons-outlined","dropdownIndicator"],["class","sub-nav-list",3,"active",4,"ngIf"],[1,"sub-nav-list"],["class","sub-nav-item",3,"ngClass",4,"ngIf"],[1,"sub-nav-item",3,"ngClass"],["routerLinkActive","active",3,"click","routerLink"],["class","nav-link",3,"ngClass","click",4,"ngIf"],["class","material-icons-outlined dropdownIndicator",4,"ngIf"],["routerLinkActive","active",1,"nav-link",3,"ngClass","routerLink"]],template:function(r,a){r&1&&(T(0,Iwe,41,14,"div",0),s(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"button",5),S("click",function(){return a.closeConfirmationModal()}),o()(),s(6,"div",6)(7,"div",7)(8,"h5",8),l(9," Confirm Logout "),o(),s(10,"p",9),l(11,"Are you sure you want to logout?"),o()()(),s(12,"div",10)(13,"button",11),S("click",function(){return a.closeConfirmationModal()}),l(14," Cancel "),o(),s(15,"button",12),S("click",function(){return a.onConfirmLogout()}),l(16," Confirm "),o()()()()()),r&2&&p("ngIf",a.showNavbar)},dependencies:[ue,_e,Dt,km,pE],styles:[".sidebar[_ngcontent-%COMP%]{width:280px;background-color:var(--white);color:var(--textcolor);position:fixed;top:0;left:0;box-shadow:2px 0 5px #0000001a;z-index:100;transition:width .3s ease-in-out;display:flex;flex-direction:column;height:100vh;-ms-overflow-style:none;scrollbar-width:none}.sidebar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.sidebar[_ngcontent-%COMP%] .sidebar-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:0 20px;border-bottom:1px solid var(--bodycolor);color:#2d7be5}.sidebar[_ngcontent-%COMP%] .sidebar-header[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{max-width:130px;padding:20px 0 16px;width:100%}.sidebar[_ngcontent-%COMP%] .sidebar-header[_ngcontent-%COMP%] .nav-toggle[_ngcontent-%COMP%]{background:none;border:none;color:#fff;font-size:24px;cursor:pointer}.sidebar[_ngcontent-%COMP%] .sidebar-header[_ngcontent-%COMP%] .nav-toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--navBg)}.sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%]{height:calc(91vh - 100px);overflow-y:auto;overflow-x:hidden}.sidebar[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%]::-webkit-scrollbar{width:2px}.sidebar[_ngcontent-%COMP%] .nav-list[_ngcontent-%COMP%]{list-style-type:none;padding:10px;margin:0}.sidebar[_ngcontent-%COMP%] .nav-list.list-one[_ngcontent-%COMP%]{border-bottom:1px solid var(--bodycolor)}.sidebar[_ngcontent-%COMP%] .nav-list[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%]{width:100%;margin-top:5px;position:relative;border-radius:3px}.sidebar[_ngcontent-%COMP%] .nav-list[_ngcontent-%COMP%] .nav-item[_ngcontent-%COMP%] .navIcon[_ngcontent-%COMP%]{font-size:15px;margin-right:10px}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{display:flex;align-items:center;padding:10px 14px;cursor:pointer;text-decoration:none;font-size:14px;font-weight:500;transition:background-color .2s;justify-content:space-between}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] .dropdownIndicator[_ngcontent-%COMP%]{font-size:16px}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover{color:var(--black)}.sidebar[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]{color:var(--primaryColor)}.sidebar[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%] .dropdownIndicator[_ngcontent-%COMP%]{transform:rotate(180deg)}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%]{border-top:1px solid var(--bodycolor);padding:10px;margin-top:auto;background-color:var(--white);display:flex;flex-direction:column;align-items:center;text-align:center}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:12px}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%] .profile-avatar[_ng
389content-%COMP%]{width:40px;height:40px;background-color:var(--primaryColor);border-radius:50%;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%] .profile-avatar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--white);font-weight:500;font-size:14px}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%] .profile-info[_ngcontent-%COMP%] .profile-name[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--textcolor);margin-bottom:2px}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%] .profile-info[_ngcontent-%COMP%] .profile-role[_ngcontent-%COMP%], .sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%] .profile-info[_ngcontent-%COMP%] .profile-email[_ngcontent-%COMP%]{font-size:12px;color:var(--textcolor);opacity:.8}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .logout-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:10px;padding:8px 0;background:none;border:none;width:100%;text-align:center;cursor:pointer;color:var(--textcolor);font-size:14px;font-weight:500}.sidebar[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .logout-button[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px}.sidebar[_ngcontent-%COMP%] .release-section[_ngcontent-%COMP%]{border-top:1px solid var(--bodycolor);padding:10px 20px;margin-top:auto;background-color:var(--white);display:flex;flex-direction:column;align-items:center;text-align:center}.sidebar[_ngcontent-%COMP%] .release-section[_ngcontent-%COMP%] .release-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:12px}.sidebar[_ngcontent-%COMP%] .release-section[_ngcontent-%COMP%] .release-container[_ngcontent-%COMP%] .release-info[_ngcontent-%COMP%] .release-name[_ngcontent-%COMP%]{font-size:12px;font-weight:400;color:var(--textcolor);margin-bottom:2px}.sidebar[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%]{list-style-type:none;margin:0;padding-left:20px}.sidebar[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%] .sub-nav-item[_ngcontent-%COMP%]{font-size:13px;padding:7px 7px 7px 16px}.sidebar[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%] .sub-nav-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--textcolor);text-decoration:none}.sidebar[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%] .sub-nav-item[_ngcontent-%COMP%]:hover{color:var(--black)}.sidebar[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%] .sub-nav-item.active[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--primaryColor)}.sidebar[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%]{display:none}.sidebar[_ngcontent-%COMP%] .sub-nav-list.active[_ngcontent-%COMP%]{display:block}.sidebar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--textcolor)}.sidebar.collapsed[_ngcontent-%COMP%]{width:70px}.sidebar.collapsed[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .profile-container[_ngcontent-%COMP%] .profile-info[_ngcontent-%COMP%]{display:none}.sidebar.collapsed[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .logout-button[_ngcontent-%COMP%]{justify-content:center;padding:8px 0}.sidebar.collapsed[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .logout-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .sidebar.collapsed[_ngcontent-%COMP%] .profile-section[_ngcontent-%COMP%] .logout-button[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .sidebar.collapsed[_ngcontent-%COMP%] .release-section[_ngcontent-%COMP%]{display:none}.sidebar.collapsed[_ngcontent-%COMP%] .release-section[_ngcontent-%COMP%] .release-container[_ngcontent-%COMP%]{justify-content:center}.sidebar.collapsed[_ngcontent-%COMP%] .release-section[_ngcontent-%COMP%] .release-container[_ngcontent-%COMP%] .release-info[_ngcontent-%COMP%]{display:none}.sidebar.collapsed[_ngcontent-%COMP%] .sidebar-body[_ngcontent-%COMP%]{height:96vh}.sidebar.collapsed[_ngcontent-%COMP%] .nav-list[_ngcontent-%COMP%] .navIcon[_ngcontent-%COMP%]{font-size:18px!important;margin-right:0!important}.sidebar.collapsed[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] .dropdownIndicator[_ngcontent-%COMP%]{display:none}.sidebar.collapsed[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%], .sidebar.collapsed[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%] .navIcon[_ngcontent-%COMP%]{color:var(--primaryColor)}.sidebar.collapsed[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] .navIcon[_ngcontent-%COMP%]{display:inline-block}.sidebar.collapsed[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] .navlabel[_ngcontent-%COMP%]{display:none}.sidebar.collapsed[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%]{position:absolute;background-color:var(--white);margin-left:0;
389width:200px;padding:0;visibility:hidden;opacity:0;transition:visibility 0s,opacity .3s ease;box-shadow:0 2px 8px #0000001a;z-index:1;align-items:center;display:none}.sidebar.collapsed[_ngcontent-%COMP%] .sub-nav-list.active[_ngcontent-%COMP%]{display:block}.sidebar.collapsed[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%] .sub-nav-item[_ngcontent-%COMP%]{margin:0;width:100%;padding:7px;text-decoration:none;color:var(--textcolor)}.sidebar.collapsed[_ngcontent-%COMP%] .sub-nav-list[_ngcontent-%COMP%] .sub-nav-item[_ngcontent-%COMP%] .active[_ngcontent-%COMP%]{color:var(--primaryColor);display:block;white-space:nowrap;width:100%}.sidebar[_ngcontent-%COMP%] .separator-top[_ngcontent-%COMP%]{margin-top:16px;padding-top:16px;border-top:1px solid #e0e0e0}"]});let i=n;return i})();var GB=(()=>{let n=class n{constructor(){this.title="admin-portal"}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=te({type:n,selectors:[["app-root"]],standalone:!1,decls:6,vars:0,consts:[["bdColor","rgba(51,51,51,0.8)","size","medium","color","#4e9df7","type","ball-fussion"],[1,"app-container"],[1,"main-content"]],template:function(r,a){r&1&&(B(0,"ngx-spinner",0),s(1,"div",1),B(2,"app-navbar"),s(3,"main")(4,"div",2),B(5,"router-outlet"),o()()())},dependencies:[Zg,wo,HB],encapsulation:2});let i=n;return i})();var Mwe=(()=>{class i extends Y_{constructor(t,e,r){super(t,e,r)}ngOnDestroy(){this.flush()}static \u0275fac=function(e){return new(e||i)(kt(Vi),kt(bg),kt(z_))};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})();function Awe(){return new Bk}function Pwe(i,n,t){return new Uk(i,n,t)}var zB=[{provide:z_,useFactory:Awe},{provide:Y_,useClass:Mwe},{provide:Va,useFactory:Pwe,deps:[Hu,Y_,Ri]}],Fwe=[{provide:bg,useClass:Lk},{provide:Ed,useValue:"NoopAnimations"},...zB],$B=[{provide:bg,useFactory:()=>new Vk},{provide:Ed,useFactory:()=>"BrowserAnimations"},...zB],YB=(()=>{class i{static withConfig(t){return{ngModule:i,providers:t.disableAnimations?Fwe:$B}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:$B,imports:[Rg]})}return i})();var Rwe=new Gt("NGX_ECHARTS_CONFIG");function Owe(i){return{provide:Rwe,useValue:i}}var qB=(()=>{let n=class n{static forRoot(e){return{ngModule:n,providers:[Owe(e)]}}static forChild(){return{ngModule:n}}};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=_i({type:n}),n.\u0275inj=vi({});let i=n;return i})();var Nwe="@",Lwe=(()=>{class i{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;
389scheduler=null;injector=fe(rn);loadingSchedulerFn=fe(Bwe,{optional:!0});_engine;constructor(t,e,r,a,c){this.doc=t,this.delegate=e,this.zone=r,this.animationType=a,this.moduleImpl=c}ngOnDestroy(){this._engine?.flush()}loadImpl(){let t=()=>this.moduleImpl??import("./chunk-TPWM7BAJ.js").then(r=>r),e;return this.loadingSchedulerFn?e=this.loadingSchedulerFn(t):e=t(),e.catch(r=>{throw new Hi(5300,!1)}).then(({\u0275createEngine:r,\u0275AnimationRendererFactory:a})=>{this._engine=r(this.animationType,this.doc);let c=new a(this.delegate,this._engine,this.zone);return this.delegate=c,c})}createRenderer(t,e){let r=this.delegate.createRenderer(t,e);if(r.\u0275type===0)return r;typeof r.throwOnSyntheticProps=="boolean"&&(r.throwOnSyntheticProps=!1);let a=new a3(r);return e?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(c=>{let d=c.createRenderer(t,e);a.use(d),this.scheduler??=this.injector.get(X3,null,{optional:!0}),this.scheduler?.notify(10)}).catch(c=>{a.use(r)}),a}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}componentReplaced(t){this._engine?.flush(),this.delegate.componentReplaced?.(t)}static \u0275fac=function(e){N_()};static \u0275prov=nt({token:i,factory:i.\u0275fac})}return i})(),a3=class{delegate;replay=[];\u0275type=1;constructor(n){this.delegate=n}use(n){if(this.delegate=n,this.replay!==null){for(let t of this.replay)t(n);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(n,t){return this.delegate.createElement(n,t)}createComment(n){return this.delegate.createComment(n)}createText(n){return this.delegate.createText(n)}get destroyNode(){return this.delegate.destroyNode}appendChild(n,t){this.delegate.appendChild(n,t)}insertBefore(n,t,e,r){this.delegate.insertBefore(n,t,e,r)}removeChild(n,t,e){this.delegate.removeChild(n,t,e)}selectRootElement(n,t){return this.delegate.selectRootElement(n,t)}parentNode(n){return this.delegate.parentNode(n)}nextSibling(n){return this.delegate.nextSibling(n)}setAttribute(n,t,e,r){this.delegate.setAttribute(n,t,e,r)}removeAttribute(n,t,e){this.delegate.removeAttribute(n,t,e)}addClass(n,t){this.delegate.addClass(n,t)}removeClass(n,t){this.delegate.removeClass(n,t)}setStyle(n,t,e,r){this.delegate.setStyle(n,t,e,r)}removeStyle(n,t,e){this.delegate.removeStyle(n,t,e)}setProperty(n,t,e){this.shouldReplay(t)&&this.replay.push(r=>r.setProperty(n,t,e)),this.delegate.setProperty(n,t,e)}setValue(n,t){this.delegate.setValue(n,t)}listen(n,t,e,r){return this.shouldReplay(t)&&this.replay.push(a=>a.listen(n,t,e,r)),this.delegate.listen(n,t,e,r)}shouldReplay(n){return this.replay!==null&&n.startsWith(Nwe)}},Bwe=new Gt("");function KB(i="animations"){return Gp("NgAsyncAnimations"),Cd([{provide:Va,useFactory:(n,t,e)=>new Lwe(n,t,e,i),deps:[Vi,Hu,Ri]},{provide:Ed,useValue:i==="noop"?"NoopAnimations":"BrowserAnimations"}])}var XB=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn,Wn]})}return i})();var JB=(()=>{let n=class n{constructor(e,r,a){this.cognitoService=e,this.router=r,this.toastr=a}intercept(e,r){return Na(this.cognitoService.getValidToken()).pipe(Tn(a=>(a&&(e=e.clone({setHeaders:{Authorization:`Bearer ${a}`}})),r.handle(e))),Fn(a=>(a.status===401?(this.cognitoService.signOut(),localStorage.clear(),this.router.navigate(["/login"])):a.status===403&&(this.toastr.error("You do not have permission to perform this action","Access Denied"),this.router.navigate(["/home"])),fr(()=>a))))}};n.\u0275fac=function(r){return new(r||n)(kt(ze),kt(_t),kt(me))},n.\u0275prov=nt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var ZB=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=_i({type:n}),n.\u0275inj=vi({});let i=n;return i})();var QB=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[av]})}return i})();var Wv=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())
389),this._selected}changed=new ci;constructor(n=!1,t,e=!0,r){this._multiple=n,this._emitChanges=e,this.compareWith=r,t&&t.length&&(n?t.forEach(a=>this._markSelected(a)):this._markSelected(t[0]),this._selectedToEmit.length=0)}select(...n){this._verifyValueAssignment(n),n.forEach(e=>this._markSelected(e));let t=this._hasQueuedChanges();return this._emitChangeEvent(),t}deselect(...n){this._verifyValueAssignment(n),n.forEach(e=>this._unmarkSelected(e));let t=this._hasQueuedChanges();return this._emitChangeEvent(),t}setSelection(...n){this._verifyValueAssignment(n);let t=this.selected,e=new Set(n.map(a=>this._getConcreteValue(a)));n.forEach(a=>this._markSelected(a)),t.filter(a=>!e.has(this._getConcreteValue(a,e))).forEach(a=>this._unmarkSelected(a));let r=this._hasQueuedChanges();return this._emitChangeEvent(),r}toggle(n){return this.isSelected(n)?this.deselect(n):this.select(n)}clear(n=!0){this._unmarkAll();let t=this._hasQueuedChanges();return n&&this._emitChangeEvent(),t}isSelected(n){return this._selection.has(this._getConcreteValue(n))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(n){this._multiple&&this.selected&&this._selected.sort(n)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(n){n=this._getConcreteValue(n),this.isSelected(n)||(this._multiple||this._unmarkAll(),this.isSelected(n)||this._selection.add(n),this._emitChanges&&this._selectedToEmit.push(n))}_unmarkSelected(n){n=this._getConcreteValue(n),this.isSelected(n)&&(this._selection.delete(n),this._emitChanges&&this._deselectedToEmit.push(n))}_unmarkAll(){this.isEmpty()||this._selection.forEach(n=>this._unmarkSelected(n))}_verifyValueAssignment(n){n.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(n,t){if(this.compareWith){t=t??this._selection;for(let e of t)if(this.compareWith(n,e))return e;return n}else return n}};var eV=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn,QB,Wn]})}return i})();var tV=(()=>{class i{_animationsDisabled=Za();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(e,r){e&2&&Re("mat-pseudo-checkbox-indeterminate",r.state==="indeterminate")("mat-pseudo-checkbox-checked",r.state==="checked")("mat-pseudo-checkbox-disabled",r.disabled)("mat-pseudo-checkbox-minimal",r.appearance==="minimal")("mat-pseudo-checkbox-full",r.appearance==="full")("_mat-animation-noopable",r._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(e,r){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;
389height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px} 390`],encapsulation:2,changeDetection:0})}return i})();var Uwe=["text"],jwe=[[["mat-icon"]],"*"],Wwe=["mat-icon","*"];function Hwe(i,n){if(i&1&&B(0,"mat-pseudo-checkbox",1),i&2){let t=w();p("disabled",t.disabled)("state",t.selected?"checked":"unchecked")}}function Gwe(i,n){if(i&1&&B(0,"mat-pseudo-checkbox",3),i&2){let t=w();p("disabled",t.disabled)}}function $we(i,n){if(i&1&&(s(0,"span",4),l(1),o()),i&2){let t=w();m(),_("(",t.group.label,")")}}var s3=new Gt("MAT_OPTION_PARENT_COMPONENT"),l3=new Gt("MatOptgroup");var o3=class{source;isUserInput;constructor(n,t=!1){this.source=n,this.isUserInput=t}},Rf=(()=>{class i{_element=fe(Ai);_changeDetectorRef=fe(Kn);_parent=fe(s3,{optional:!0});group=fe(l3,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=fe(wa).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(t){this._disabled.set(t)}_disabled=vr(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new xn;_text;_stateChanges=new ci;constructor(){let t=fe(To);t.load(n2),t.load(qh),this._signalDisableRipple=!!this._parent&&Au(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(t=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),t&&this._emitSelectionChangeEvent())}deselect(t=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),t&&this._emitSelectionChangeEvent())}focus(t,e){let r=this._getHostElement();typeof r.focus=="function"&&r.focus(e)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(t.keyCode===13||t.keyCode===32)&&!Do(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=t)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new o3(this,t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["mat-option"]],viewQuery:function(e,r){if(e&1&&An(Uwe,7),e&2){let a;on(a=sn())&&(r._text=a.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(e,r){e&1&&S("click",function(){return r._selectViaInteraction()})("keydown",function(c){return r._handleKeydown(c)}),e&2&&(Fc("id",r.id),He("aria-selected",r.selected)("aria-disabled",r.disabled.toString()),Re("mdc-list-item--selected",r.selected)("mat-mdc-option-multiple",r.multiple)("mat-mdc-option-active",r.active)("mdc-list-item--disabled",r.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",Cn]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:Wwe,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(e,r){e&1&&(Ya(jwe),nr(0,Hwe,1,2,"mat-pseudo-checkbox",1),ar(1),s(2,"
390span",2,0),ar(4,1),o(),nr(5,Gwe,1,1,"mat-pseudo-checkbox",3),nr(6,$we,2,1,"span",4),B(7,"div",5)),e&2&&(rr(r.multiple?0:-1),m(5),rr(!r.multiple&&r.selected&&!r.hideSingleSelectionIndicator?5:-1),m(),rr(r.group&&r.group._inert?6:-1),m(),p("matRippleTrigger",r._getHostElement())("matRippleDisabled",r.disabled||r.disableRipple))},dependencies:[tV,VR],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""} 391`],encapsulation:2,changeDetection:0})}return i})();function iV(i,n,t){if(t.length){let e=n.toArray(),r=t.toArray(),a=0;for(let c=0;c<i+1;c++)e[c].group&&e[c].group===r[a]&&a++;return a}return 0}function nV(i,n,t,e){return i<t?i:i+n>t+e?Math.max(0,i-e+n):t}var rV=(()=>
391{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[Wn]})}return i})();var c3=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({imports:[r2,Wn,rV,Rf]})}return i})();var zwe=["trigger"],Ywe=["panel"],qwe=[[["mat-select-trigger"]],"*"],Kwe=["mat-select-trigger","*"];function Xwe(i,n){if(i&1&&(s(0,"span",4),l(1),o()),i&2){let t=w();m(),b(t.placeholder)}}function Jwe(i,n){i&1&&ar(0)}function Zwe(i,n){if(i&1&&(s(0,"span",11),l(1),o()),i&2){let t=w(2);m(),b(t.triggerValue)}}function Qwe(i,n){if(i&1&&(s(0,"span",5),nr(1,Jwe,1,0)(2,Zwe,2,1,"span",11),o()),i&2){let t=w();m(),rr(t.customTrigger?1:2)}}function eTe(i,n){if(i&1){let t=he();s(0,"div",12,1),S("keydown",function(r){U(t);let a=w();return j(a._handleKeydown(r))}),ar(2,1),o()}if(i&2){let t=w();Co(Sk("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",t._getPanelTheme())),Re("mat-select-panel-animations-enabled",!t._animationsDisabled),p("ngClass",t.panelClass),He("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}var aV=new Gt("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let i=fe(rn);return()=>Qc(i)}});function tTe(i){let n=fe(rn);return()=>Qc(n)}var iTe=new Gt("MAT_SELECT_CONFIG"),nTe={provide:aV,deps:[],useFactory:tTe},rTe=new Gt("MatSelectTrigger"),d3=class{source;value;constructor(n,t){this.source=n,this.value=t}},oV=(()=>{class i{_viewportRuler=fe($d);_changeDetectorRef=fe(Kn);_elementRef=fe(Ai);_dir=fe(ts,{optional:!0});_idGenerator=fe(wa);_renderer=fe(qn);_parentFormField=fe(rf,{optional:!0});ngControl=fe(nc,{self:!0,optional:!0});_liveAnnouncer=fe(_T);_defaultOptions=fe(iTe,{optional:!0});_animationsDisabled=Za();_initialized=new ci;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(t){let e=this.options.toArray()[t];if(e){let r=this.panel.nativeElement,a=iV(t,this.options,this.optionGroups),c=e._getHostElement();t===0&&a===1?r.scrollTop=0:r.scrollTop=nV(c.offsetTop,c.offsetHeight,r.scrollTop,r.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(t){return new d3(this,t)}_scrollStrategyFactory=fe(aV);_panelOpen=!1;_compareWith=(t,e)=>t===e;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ci;_errorStateTracker;stateChanges=new ci;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(t){this._disableRipple.set(t)}_disableRipple=vr(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(At.required)??!1}set required(t){this._required=t,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(t){this._selectionModel,this._multiple=t}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this._assignValue(t)&&this._onChange(t)}
391_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Pc(()=>{let t=this.options;return t?t.changes.pipe(hs(t),Tn(()=>Sd(...t.map(e=>e.onSelectionChange)))):this._initialized.pipe(Tn(()=>this.optionSelectionChanges))});openedChange=new xn;_openedStream=this.openedChange.pipe(Vn(t=>t),Ki(()=>{}));_closedStream=this.openedChange.pipe(Vn(t=>!t),Ki(()=>{}));selectionChange=new xn;valueChange=new xn;constructor(){let t=fe(s2),e=fe(fn,{optional:!0}),r=fe(wr,{optional:!0}),a=fe(new G_("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new af(t,this.ngControl,r,e,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this.id=this.id}ngOnInit(){this._selectionModel=new Wv(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(gr(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(gr(this._destroy)).subscribe(t=>{t.added.forEach(e=>e.select()),t.removed.forEach(e=>e.deselect())}),this.options.changes.pipe(hs(null),gr(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let t=this._getTriggerAriaLabelledby(),e=this.ngControl;if(t!==this._triggerAriaLabelledBy){let r=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?r.setAttribute("aria-labelledby",t):r.removeAttribute("aria-labelledby")}e&&(this._previousControl!==e.control&&(this._previousControl!==void 0&&e.disabled!==null&&e.disabled!==this.disabled&&(this.disabled=e.disabled),this._previousControl=e.control),this.updateErrorState())}ngOnChanges(t){(t.disabled||t.userAriaDescribedBy)&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(xo(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let t=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let e=`${this.id}-panel`;this._trackedModal&&t2(this._trackedModal,"aria-owns",e),AT(t,"aria-owns",e),this._trackedModal=t}_clearFromModal(){if(!this._trackedModal)return;let t=`${this.id}-panel`;t2(this._trackedModal,"aria-owns",t),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{e(),clearTimeout(r),this._cleanupDetach=void 0};let t=this.panel.nativeElement,e=this._renderer.listen(t,"animationend",a=>{a.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),r=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);t.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(t){this._assignValue(t)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let t=this._selectionModel.selected.map(e=>e.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){let e=t.keyCode,r=e===40||e===38||e===37||e===39,a=e===13||e===32,c=this._keyManager;if(!c.isTyping()&&a&&!Do(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;c.onKeydown(t);let u=this.selected;u&&d!==u&&this._liveAnnouncer.announce(u.viewValue,1e4)}}_handleOpenKeydown(t){let e=this._keyManager,r=t.keyCode,a=r===40||r===38,c=e.isTyping();if(a&&t.altKey)t.preventDefault(),this.close();else if(!c&&(r===13||r===32)&&e.activeItem&&!Do(t))t.preventDefault(),e.activeItem._selectViaInteraction();else if(!c&&this._multiple&&r===65&&t.ctrlKey){t.preventDefault();let d=this.options.some(u=>!u.disabled&&!u.selected);this.options.forEach(u=>
391{u.disabled||(d?u.select():u.deselect())})}else{let d=e.activeItemIndex;e.onKeydown(t),this._multiple&&a&&t.shiftKey&&e.activeItem&&e.activeItemIndex!==d&&e.activeItem._selectViaInteraction()}}_handleOverlayKeydown(t){t.keyCode===27&&!Do(t)&&(t.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this.options.forEach(e=>e.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(e=>this._selectOptionByValue(e)),this._sortValues();else{let e=this._selectOptionByValue(t);e?this._keyManager.updateActiveItem(e):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(t){let e=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return(r.value!=null||this.canSelectNullableOptions)&&this._compareWith(r.value,t)}catch{return!1}});return e&&this._selectionModel.select(e),e}_assignValue(t){return t!==this._value||this._multiple&&Array.isArray(t)?(this.options&&this._setSelectionByValue(t),this._value=t,!0):!1}_skipPredicate=t=>this.panelOpen?!1:t.disabled;_getOverlayWidth(t){return this.panelWidth==="auto"?(t instanceof Zh?t.elementRef:t||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new cv(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let t=Sd(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(gr(t)).subscribe(e=>{this._onSelect(e.source,e.isUserInput),e.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Sd(...this.options.map(e=>e._stateChanges)).pipe(gr(t)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(t,e){let r=this._selectionModel.isSelected(t);!this.canSelectNullableOptions&&t.value==null&&!this._multiple?(t.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(t.value)):(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),e&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),e&&this.focus())),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let t=this.options.toArray();this._selectionModel.sort((e,r)=>this.sortComparator?this.sortComparator(e,r,t):t.indexOf(e)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let e;this.multiple?e=this.selected.map(r=>r.value):e=this.selected?this.selected.value:t,this._value=e,this.valueChange.emit(e),this._onChange(e),this.selectionChange.emit(this._getChangeEvent(e)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let t=-1;for(let e=0;e<this.options.length;e++)if(!this.options.get(e).disabled){t=e;break}this._keyManager.setActiveItem(t)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let t=this._parentFormField?.getLabelId()||null,e=t?t+" ":"";return this.ariaLabelledby?e+this.ariaLabelledby:t}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let t=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(t+=" "+this.ariaLabelledby),t||(t=this._valueId),t}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["mat-select"]],contentQueries:function(e,r,a){if(e&1&&(Js(a,rTe,5),Js(a,Rf,5),Js(a,l3,5)),e&2){let c;on(c=sn())&&(r.customTrigger=c.first),on(c=sn())&&(r.options=c),on(c=sn())&&(r.optionGroups=c)}},viewQuery:function(e,r){if(e&1&&(An(zwe,5),An(Ywe,5),An(Xb,5)),e&2){let a;on(a=sn())&&(r.trigger=a.first),on(a=sn())&&(r.panel=a.first),on(a=sn())&&(r._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(e,r){e&1&&S("keydown",function(c){return r._handleKeydown(c)})("focus",function(){return r._onFocus()})("blur",function(){return r._onBlur()}),e&2&&(He("id",r.id)("tabindex",r.disabled?-1:r.tabIndex)("aria-controls",r.panelOpen?r.id+"-panel":null)("aria-expanded",r.panelOpen)("aria-label",r.ariaLabel||null)("aria-required",r.required.toString())("aria-disabled",r.disabled.toString())("aria-invalid",r.errorState)("aria-activedescendant",r._getAriaActiveDescendant()),Re("mat-mdc-select-disabled",r.disabled)("mat-mdc-select-invalid",r.errorState)("mat-mdc-select-required",r.required)("mat-mdc-select-empty",r.empty)("mat-mdc-select-multiple",r.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",Cn],disableRipple:[2,"disableRipple","disableRipple",Cn],tabIndex:[2,"tabIndex","tabIndex",t=>t==null?0:Zl(t)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Cn],placeholder:"placeholder",required:[2,"required","required",Cn],multiple:[2,"multiple","multiple",Cn],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",Cn],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",Zl],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",Cn]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Ii([{provide:nf,useExisting:i},{provide:s3,useExisting:i}]),kn],ngContentSelectors:Kwe,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(e,r){if(e&1){let a=he();Ya(qwe),s(0,"div",2,0),S("click",function(){return U(a),j(r.open())}),s(3,"div",3),nr(4,Xwe,2,1,"span",4)(5,Qwe,3,1,"span",5),o(),s(6,"div",6)(7,"div",7),xm(),s(8,"svg",8),B(9,"path",9),o()()()(),T(10,eTe,3,10,"ng-template",10),S("detach",function(){return U(a),j(r.close())})("backdropClick",function(){return U(a),j(r.close())})("overlayKeydown",function(d){return U(a),j(r._handleOverlayKeydown(d))})}if(e&2){let a=Qt(1);m(3),He("id",r._valueId),m(),rr(r.empty?4:5),m(6),p("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",r._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",r._scrollStrategy)("cdkConnectedOverlayOrigin",r._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",r._positions)("cdkConnectedOverlayWidth",r._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Zh,Xb,ue],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}
391}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))} 392`],encapsulation:2,changeDetection:0})}return i})();var sV=(()=>
392{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[nTe],imports:[zd,c3,Wn,R0,nu,c3,Wn]})}return i})();var aTe=["tooltip"],dV=20;var mV=new Gt("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let i=fe(rn);return()=>Qc(i,{scrollThrottle:dV})}});function oTe(i){let n=fe(rn);return()=>Qc(n,{scrollThrottle:dV})}var sTe={provide:mV,deps:[],useFactory:oTe};function lTe(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var cTe=new Gt("mat-tooltip-default-options",{providedIn:"root",factory:lTe});var lV="tooltip-panel",cV=Qm({passive:!0}),dTe=8,mTe=8,uTe=24,pTe=200,uV=(()=>{class i{_elementRef=fe(Ai);_ngZone=fe(Ri);_platform=fe($n);_ariaDescriber=fe(xR);_focusMonitor=fe(A0);_dir=fe(ts);_injector=fe(rn);_viewContainerRef=fe(Ks);_animationsDisabled=Za();_defaultOptions=fe(cTe,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=hTe;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=Yd(t),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(t){let e=Yd(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=Gd(t)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=Gd(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new ci;_isDestroyed=!1;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=dTe}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(gr(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([e,r])=>{t.removeEventListener(e,r,cV)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let r=this._createOverlay(e);this._detach(),this._portal=this._portal||new Zm(this._tooltipComponent,this._viewContainerRef);let a=this._tooltipInstance=r.attach(this._portal).instance;a._triggerElement=this._elementRef.nativeElement,a._mouseLeaveHideDelay=this._hideDelay,a.afterHidden().pipe(gr(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),a.show(t)}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()))}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let c=this._overlayRef.getConfig().positionStrategy;
392if((!this.positionAtOrigin||!t)&&c._origin instanceof Ai)return this._overlayRef;this._detach()}let e=this._injector.get(O0).getAncestorScrollContainers(this._elementRef),r=`${this._cssClassPrefix}-${lV}`,a=sv(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(e);return a.positionChanges.pipe(gr(this._destroyed)).subscribe(c=>{this._updateCurrentPositionClass(c.connectionPair),this._tooltipInstance&&c.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=V0(this._injector,{direction:this._dir,positionStrategy:a,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,r]:r,scrollStrategy:this._injector.get(mV)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(gr(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(gr(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(gr(this._destroyed)).subscribe(c=>{this._isTooltipVisible()&&c.keyCode===27&&!Do(c)&&(c.preventDefault(),c.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(gr(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){let e=t.getConfig().positionStrategy,r=this._getOrigin(),a=this._getOverlayPosition();e.withPositions([this._addOffset(le(le({},r.main),a.main)),this._addOffset(le(le({},r.fallback),a.fallback))])}_addOffset(t){let e=mTe,r=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=r?-e:e:t.originX==="end"&&(t.offsetX=r?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,r;e=="above"||e=="below"?r={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?r={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(r={originX:"end",originY:"center"});let{x:a,y:c}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:a,originY:c}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,r;e=="above"?r={overlayX:"center",overlayY:"bottom"}:e=="below"?r={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?r={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(r={overlayX:"start",overlayY:"center"});let{x:a,y:c}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:a,overlayY:c}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),$o(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:r,originY:a}=t,c;if(e==="center"?this._dir&&this._dir.value==="rtl"?c=r==="end"?"left":"right":c=r==="start"?"left":"right":c=e==="bottom"&&a==="top"?"above":"below",c!==this._currentPosition){let d=this._overlayRef;if(d){let u=`${this._cssClassPrefix}-${lV}-`;d.removePanelClass(u+this._currentPosition),d.addPanelClass(u+c)}this._currentPosition=c}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsM
392ouseEvents()?this._passiveListeners.push(["mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",t=>{let e=t.targetTouches?.[0],r=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let a=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,r)},this._defaultOptions?.touchLongPressShowDelay??a)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",e=>{let r=e.relatedTarget;(!r||!this._overlayRef?.overlayElement.contains(r))&&this.hide()}],["wheel",e=>this._wheelListener(e)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let e=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};t.push(["touchend",e],["touchcancel",e])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([e,r])=>{this._elementRef.nativeElement.addEventListener(e,r,cV)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){let e=this._injector.get(Vi).elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;e!==r&&!r.contains(e)&&this.hide()}}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,r=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),(t==="on"||!e.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||$o({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(e){return new(e||i)};static \u0275dir=Ci({type:i,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,r){e&2&&Re("mat-mdc-tooltip-disabled",r.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return i})(),hTe=(()=>{class i{_changeDetectorRef=fe(Kn);_elementRef=fe(Ai);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=Za();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new ci;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},t)}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},t)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>uTe&&t.width>=pTe}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(t){t?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(t){let e=this._tooltip.nativeElement,r=this._showAnimation,a=this._hideAnimation;if(e.classList.remove(t?a:r),e.classList.add(t?r:a),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let c=getComputedStyle(e);(c.getPropertyValue("animation-duration")==="0s"||c.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["mat-tooltip-component"]],viewQuery:function(e,r){if(e&1&&An(aTe,7),e&2){let a;on(a=sn())&&(r._tooltip=a.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,r){e&1&&S("mouseleave",function(c){return r._handleMouseLeave(c)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,r){if(e&1){let a=he();s(0,"div",1,0),S("animationend",function(d){return U(a),j(r._handleAnimationEnd(d))}),s(2,"div",2),l(3),o()()}e&2&&(Re("mdc-tooltip--multiline",r._isMultiline),p("ngClass",r.tooltipClass),m(3),b(r.message))},dependencies:[ue],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;
392max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards} 393`],encapsulation:2,changeDetection:0})}return i})(),pV=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[sTe],imports:[rv,zd,Wn,Wn,R0]})}return i})();function fTe(i,n){if(i&1&&(s(0,"mat-option",17),l(1),o()),i&2){let t=n.$implicit;p("value",t),m(),_(" ",t," ")}}function gTe(i,n){if(i&1){let t=he();s(0,"mat-form-field",14)(1,"mat-select",16,0),S("selectionChange",function(r){U(t);let a=w(2);return j(a._changePageSize(r.value))}),gk(3,fTe,2,2,"mat-option",17,fk),o(),s(5,"div",18),S("click",function(){U(t);let r=Qt(2);return j(r.open())}),o()()}if(i&2){let t=w(2);p("appearance",t._formFieldAppearance)("color",t.color),m(),p("value",t.pageSize)("disabled",t.disabled)("aria-labelledby",t._pageSizeLabelId)("panelClass",t.selectConfig.panelClass||"")("disableOptionCentering",t.selectConfig.disableOptionCentering),m(2),vk(t._displayedPageSizeOptions)}}function vTe(i,n){if(i&1&&(s(0,"div",15),l(1),o()),i&2){let t=w(2);m(),b(t.pageSize)}}function _Te(i,n){if(i&1&&(s(0,"div",3)(1,"div",13),l(2),o(),nr(3,gTe,6,7,"mat-form-field",14),nr(4,vTe,2,1,"div",15),o()),i&2){let t=w();m(),He("id",t._pageSizeLabelId),m(),_(" ",t._intl.itemsPerPageLabel," "),m(),rr(t._displayedPageSizeOptions.length>1?3:-1),m(),rr(t._displayedPageSizeOptions.length<=1?4:-1)}}
393function yTe(i,n){if(i&1){let t=he();s(0,"button",19),S("click",function(){U(t);let r=w();return j(r._buttonClicked(0,r._previousButtonsDisabled()))}),xm(),s(1,"svg",8),B(2,"path",20),o()()}if(i&2){let t=w();p("matTooltip",t._intl.firstPageLabel)("matTooltipDisabled",t._previousButtonsDisabled())("disabled",t._previousButtonsDisabled())("tabindex",t._previousButtonsDisabled()?-1:null),He("aria-label",t._intl.firstPageLabel)}}function STe(i,n){if(i&1){let t=he();s(0,"button",21),S("click",function(){U(t);let r=w();return j(r._buttonClicked(r.getNumberOfPages()-1,r._nextButtonsDisabled()))}),xm(),s(1,"svg",8),B(2,"path",22),o()()}if(i&2){let t=w();p("matTooltip",t._intl.lastPageLabel)("matTooltipDisabled",t._nextButtonsDisabled())("disabled",t._nextButtonsDisabled())("tabindex",t._nextButtonsDisabled()?-1:null),He("aria-label",t._intl.lastPageLabel)}}var nx=(()=>{class i{changes=new ci;itemsPerPageLabel="Items per page:";nextPageLabel="Next page";previousPageLabel="Previous page";firstPageLabel="First page";lastPageLabel="Last page";getRangeLabel=(t,e,r)=>{if(r==0||e==0)return`0 of ${r}`;r=Math.max(r,0);let a=t*e,c=a<r?Math.min(a+e,r):a+e;return`${a+1} \u2013 ${c} of ${r}`};static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function bTe(i){return i||new nx}var xTe={provide:nx,deps:[[new jp,new R_,nx]],useFactory:bTe},CTe=50;var ETe=new Gt("MAT_PAGINATOR_DEFAULT_OPTIONS"),wTe=(()=>{class i{_intl=fe(nx);_changeDetectorRef=fe(Kn);_formFieldAppearance;_pageSizeLabelId=fe(wa).getId("mat-paginator-page-size-label-");_intlChanges;_isInitialized=!1;_initializedStream=new Hx(1);color;get pageIndex(){return this._pageIndex}set pageIndex(t){this._pageIndex=Math.max(t||0,0),this._changeDetectorRef.markForCheck()}_pageIndex=0;get length(){return this._length}set length(t){this._length=t||0,this._changeDetectorRef.markForCheck()}_length=0;get pageSize(){return this._pageSize}set pageSize(t){this._pageSize=Math.max(t||0,0),this._updateDisplayedPageSizeOptions()}_pageSize;get pageSizeOptions(){return this._pageSizeOptions}set pageSizeOptions(t){this._pageSizeOptions=(t||[]).map(e=>Zl(e,0)),this._updateDisplayedPageSizeOptions()}_pageSizeOptions=[];hidePageSize=!1;showFirstLastButtons=!1;selectConfig={};disabled=!1;page=new xn;_displayedPageSizeOptions;initialized=this._initializedStream;constructor(){let t=this._intl,e=fe(ETe,{optional:!0});if(this._intlChanges=t.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),e){let{pageSize:r,pageSizeOptions:a,hidePageSize:c,showFirstLastButtons:d}=e;r!=null&&(this._pageSize=r),a!=null&&(this._pageSizeOptions=a),c!=null&&(this.hidePageSize=c),d!=null&&(this.show
393FirstLastButtons=d)}this._formFieldAppearance=e?.formFieldAppearance||"outline"}ngOnInit(){this._isInitialized=!0,this._updateDisplayedPageSizeOptions(),this._initializedStream.next()}ngOnDestroy(){this._initializedStream.complete(),this._intlChanges.unsubscribe()}nextPage(){this.hasNextPage()&&this._navigate(this.pageIndex+1)}previousPage(){this.hasPreviousPage()&&this._navigate(this.pageIndex-1)}firstPage(){this.hasPreviousPage()&&this._navigate(0)}lastPage(){this.hasNextPage()&&this._navigate(this.getNumberOfPages()-1)}hasPreviousPage(){return this.pageIndex>=1&&this.pageSize!=0}hasNextPage(){let t=this.getNumberOfPages()-1;return this.pageIndex<t&&this.pageSize!=0}getNumberOfPages(){return this.pageSize?Math.ceil(this.length/this.pageSize):0}_changePageSize(t){let e=this.pageIndex*this.pageSize,r=this.pageIndex;this.pageIndex=Math.floor(e/t)||0,this.pageSize=t,this._emitPageEvent(r)}_nextButtonsDisabled(){return this.disabled||!this.hasNextPage()}_previousButtonsDisabled(){return this.disabled||!this.hasPreviousPage()}_updateDisplayedPageSizeOptions(){this._isInitialized&&(this.pageSize||(this._pageSize=this.pageSizeOptions.length!=0?this.pageSizeOptions[0]:CTe),this._displayedPageSizeOptions=this.pageSizeOptions.slice(),this._displayedPageSizeOptions.indexOf(this.pageSize)===-1&&this._displayedPageSizeOptions.push(this.pageSize),this._displayedPageSizeOptions.sort((t,e)=>t-e),this._changeDetectorRef.markForCheck())}_emitPageEvent(t){this.page.emit({previousPageIndex:t,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})}_navigate(t){let e=this.pageIndex;t!==e&&(this.pageIndex=t,this._emitPageEvent(e))}_buttonClicked(t,e){e||this._navigate(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=te({type:i,selectors:[["mat-paginator"]],hostAttrs:["role","group",1,"mat-mdc-paginator"],inputs:{color:"color",pageIndex:[2,"pageIndex","pageIndex",Zl],length:[2,"length","length",Zl],pageSize:[2,"pageSize","pageSize",Zl],pageSizeOptions:"pageSizeOptions",hidePageSize:[2,"hidePageSize","hidePageSize",Cn],showFirstLastButtons:[2,"showFirstLastButtons","showFirstLastButtons",Cn],selectConfig:"selectConfig",disabled:[2,"disabled","disabled",Cn]},outputs:{page:"page"},exportAs:["matPaginator"],decls:14,vars:14,consts:[["selectRef",""],[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],[1,"mat-mdc-paginator-page-size"],[1,"mat-mdc-paginator-range-actions"],["aria-live","polite",1,"mat-mdc-paginator-range-label"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-previous",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true",1,"mat-mdc-paginator-icon"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-next",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],[1,"mat-mdc-paginator-page-size-label"],[1,"mat-mdc-paginator-page-size-select",3,"appearance","color"],[1,"mat-mdc-paginator-page-size-value"],["hideSingleSelectionIndicator","",3,"selectionChange","value","disabled","aria-labelledby","panelClass","disableOptionCentering"],[3,"value"],[1,"mat-mdc-paginator-touch-target",3,"click"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"]],template:function(e,r){e&1&&(s(0,"div",1)(1,"div",2),nr(2,_Te,5,4,"div",3),s(3,"div",4)(4,"div",5),l(5),o(),nr(6,yTe,3,5,"button",6),s(7,"button",7),S("click",function(){return r._buttonClicked(r.pageIndex-1,r._previousButtonsDisabled())}),xm(),s(8,"svg",8),B(9,"path",9),o()(),K3(),s(10,"button",10),S("click",function(){return r._buttonClicked(r.pageIndex+1,r._nextButtonsDisabled())}),xm(),s(11,"svg",8),B(12,"path",11),o()(),nr(13,STe,3,5,"button",12),o()()()),e&2&&(m(2),rr(r.hidePageSize?-1:2),m(3),_(" ",r._intl.getRangeLabel(r.pageIndex,r.pageSize,r.length)," "),m(),rr(r.showFirstLastButtons?6:-1),m(),p("matTooltip",r._intl.previousPageLabel)("matTooltipDisabled",r._previousButtonsDisabled())("disabled",r._previousButtonsDisabled())("tabindex",r._previousButtonsDisabled()?-1:null),He("aria-label",r._intl.previousPageLabel),m(3),p("matTooltip",r._intl.nextPageLabel)("matTooltipDisabled",r._nextButtonsDisabled())("disabled",r._nextButtonsDisabled())("tabindex",r._nextButtonsDisabled()?-1:null),He("aria-label",r._intl.nextPageLabel),m(3),rr(r.showFirstLastButtons?13:-1))},dependencies:[j0,oV,Rf,GT,uV],styles:[`.mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height: var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding: var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:84px}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;
393fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:84px;height:48px;background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer} 394`],encapsulation:2,changeDetection:0})}return i})(),hV=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[xTe],imports:[a2,sV,pV,wTe]})}return i})();var m3=(()=>{class i{changes=new ci;static \u0275fac=function(e){return new(e||i)};static \u0275prov=nt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function TTe(i){return i||new m3}var DTe={provide:m3,deps:[[new jp,new R_,m3]],useFactory:TTe};var fV=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=_i({type:i});static \u0275inj=vi({providers:[DTe],imports:[Wn]})}return i})();var ITe=Di(Ti());var kTe=Di(Ti());var MTe=Di(Ti());var gV=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=_i({type:n,bootstrap:[GB]}),n.\u0275inj=vi({providers:[St,KB(),{provide:fy,useClass:JB,multi:!0},BC(VC())],imports:[Rg,WB,pM,hM,YB,_M.forRoot({positionClass:"toast-top-right",preventDuplicates:!0}),bw,bw.forRoot(),qB.forRoot({echarts:()=>import("./chunk-4IPOJCE2.js")}),NT,a2,nu,dO,XB,ZB,eV,hV,fV]});let i=n;return i})();ui.production&&(console.log=()=>{},console.warn=()=>{});PC().bootstrapModule(gV).catch(i=>console.error(i));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.