1import{a as Be}from"./chunk-QMEMY6LO.js";import{a as pi,b as ui,c as pt,d as B,e as R}from"./chunk-G7UK2DFO.js";import{a as Nt,b as $e}from"./chunk-T3AFWRVL.js";import{$ as Me,Q as at,R as It,T as Mt,U as Ae,Z as Ie,aa as Te,da as Ne,ma as Ee,sa as Re,wa as Tt,xa as Fe,ya as Oe,za as Ue}from"./chunk-FQ4WBHHB.js";import{$ as ft,Ac as Vt,Bc as Ce,Cb as Lt,Dc as rt,Ec as H,Ia as G,Ib as ue,Ic as ot,Ja as Z,Lc as Ht,Nb as de,Ob as me,Pa as x,Pb as fe,Qa as b,Qb as he,Ra as U,Sb as ge,Sc as we,Tc as ke,U as bt,V as St,Va as Pt,Vc as ze,Xa as ht,Y as N,Za as j,_ as mt,a as Y,ab as ce,b as dt,bb as le,cb as pe,e as ci,f as xt,g as J,hb as l,ib as Dt,jb as V,jc as ye,kb as Ct,lc as _e,na as A,nc as qt,oc as wt,pc as kt,rc as xe,sc as At,tc as be,uc as Se,vb as O,vc as ve,wb as z,xa as ae,xb as jt,xc as Pe,y as oe,ya as vt,zc as li}from"./chunk-O6WATMO3.js";var He=ci((sn,Ve)=>{"use strict";function yi(o,s){"use strict";this.wndw=s&&s.window?s.window:window,this.tableAutoSize=s&&typeof s.tableAutoSize=="boolean"?s.tableAutoSize:!1,this.imagesByReference=s&&typeof s.imagesByReference=="boolean"?s.imagesByReference:!1,this.removeExtraBlanks=s&&typeof s.removeExtraBlanks=="boolean"?s.removeExtraBlanks:!1,this.showHidden=s&&typeof s.showHidden=="boolean"?s.showHidden:!1,this.removeTagClasses=s&&t
vendor: 14,260 bytes, lines 1-2
1ypeof s.removeTagClasses=="boolean"?s.removeTagClasses:!1,this.ignoreStyles=s&&Array.isArray(s.ignoreStyles)?s.ignoreStyles:[];var p=Math.random().toString(36).slice(2,8);this.fontSizes=s&&Array.isArray(s.fontSizes)?s.fontSizes:[10,14,16,18,20,24,28],this.defaultStyles={b:{bold:!0},strong:{bold:!0},u:{decoration:"underline"},del:{decoration:"lineThrough"},s:{decoration:"lineThrough"},em:{italics:!0},i:{italics:!0},h1:{fontSize:24,bold:!0,marginBottom:5},h2:{fontSize:22,bold:!0,marginBottom:5},h3:{fontSize:20,bold:!0,marginBottom:5},h4:{fontSize:18,bold:!0,marginBottom:5},h5:{fontSize:16,bold:!0,marginBottom:5},h6:{fontSize:14,bold:!0,marginBottom:5},a:{color:"blue",decoration:"underline"},strike:{decoration:"lineThrough"},p:{margin:[0,5,0,10]},ul:{marginBottom:5,marginLeft:5},table:{marginBottom:5},th:{bold:!0,fillColor:"#EEEEEE"}},this.imagesRef=[],this.changeDefaultStyles=function(){for(var e in s.defaultStyles)if(this.defaultStyles.hasOwnProperty(e))if(s.defaultStyles.hasOwnProperty(e)&&!s.defaultStyles[e])delete this.defaultStyles[e];else for(var i in s.defaultStyles[e])s.defaultStyles[e][i]===""?delete this.defaultStyles[e][i]:this.defaultStyles[e][i]=s.defaultStyles[e][i];else{this.defaultStyles[e]={};for(var a in s.defaultStyles[e])this.defaultStyles[e][a]=s.defaultStyles[e][a]}},s&&s.defaultStyles&&this.changeDefaultStyles(),this.convertHtml=function(e){var i=new this.wndw.DOMParser;this.removeExtraBlanks&&(e=e.replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li))/gi,"$1$4").replace(/(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li)([^>]+)?>)\s+(<\/?(div|p|h1|h2|h3|h4|h5|h6|ol|ul|li))/gi,"$1$4").replace(/(<td([^>]+)?>)\s+(<table)/gi,"$1$3").replace(/(<\/table>)\s+(<\/td>)/gi,"$1$2"));var a=i.parseFromString(e,"text/html"),r=this.parseElement(a.body,[]);return r.stack||r.text},this.parseElement=function(e,i){var a=e.nodeName.toUpperCase(),r=a.toLowerCase(),n={text:[]},c,u=!1,d,_,f,S=this;if(["COLGROUP","COL"].indexOf(a)>-1)return"";switch(e.nodeType){case 3:{if(e.textContent){c=e.textContent;var g=this.parseStyle(i[i.length-1],!0),w=i.findIndex(function(C){return C.nodeName==="PRE"})>-1;for(_=0;_<g.length;_++)if(g[_].key==="preserveLeadingSpaces"){w=g[_].value;break}if(w||(c=c.replace(/\s*\n\s*/g," ")),s&&typeof s.replaceText=="function"&&(c=s.replaceText(c,i)),["TABLE","THEAD","TBODY","TFOOT","TR","UL","OL"].indexOf(i[i.length-1].nodeName)>-1&&(c=c.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),c)return n={text:c},n=this.applyStyle({ret:n,parents:i}),n}return""}case 1:{if(!this.showHidden&&e.style.display&&e.style.display==="none"||e.style.visibility&&e.style.visibility==="hidden")return;switch(n.nodeName=a,e.id&&(n.id=e.id),i.push(e),e.childNodes&&e.childNodes.length>0&&([].forEach.call(e.childNodes,function(C){var k=S.parseElement(C,i);k&&(Array.isArray(k.text)&&k.text.length===0&&(k.text=""),n.text.push(k))}),u=this.searchForStack(n),u?(n.stack=n.text.slice(0),delete n.text):n=this.applyStyle({ret:n,parents:i})),i.pop(),a){case"TABLE":{var E;n.table={body:[]};var D=n.stack||n.text;if(Array.isArray(D)){E=0;var I=!1;if(D.forEach(function(C){var k=C.stack||C.text;Array.isArray(k)&&k.forEach(function(T){var Q=T.stack||T.text;Array.isArray(Q)&&(n.table.body[E]=[],Q.forEach(function(q){if(n.table.body[E].push(q),q.colSpan>1)for(_=q.colSpan;--_>0;)n.table.body[E].push({text:""});q.rowSpan>1&&(I=!0)}),E++)})}),I){var y=n.table.body[0];if(Array.isArray(y))for(var m=y.length,h=n.table.body.length,v=0;v<m;v++)for(var P=0;P<h;P++){var L=n.table.body[P];if(Array.isArray(L)){var tt=L[v];if(tt.rowSpan>1){for(var ut=tt.rowSpan,Kt,si=tt.colSpan?tt.colSpan:1,_t=1;_t<=ut-1;_t++)if(Kt=si,n.table.body[P+_t])for(;Kt--;)n.table.body[P+_t].splice(v,0,{text:""});else tt.rowSpan--;P+=ut-1}}}}}if(delete n.stack,delete n.text,n=this.applyStyle({ret:n,parents:i.concat([e])}),this.tableAutoSize){var Ft=[],Ot=[],et=[],lt=[],ri=e.getAttribute("width")==="100%"||e.style.width==="100%",Xt=e.getAttribute("width")||"",Wt=(e.style.width||Xt).endsWith("%");if(Wt)var te=(e.style.width||Xt).replace(/[^0-9.]/g,"");for(var zt=!1,ee=-1,Ut=0;Ut<e.children.length;Ut++){var oi=e.children[Ut];zt||ee++,oi.nodeName.toUpperCase()==="COLGROUP"&&(zt=!0)}n.table.body.forEach(function(C,k){Ft.push([]),Ot.push([]),C.forEach(function(T,Q){var q=typeof T.width<"u"?T.width:"auto";q==="*"&&(q="auto");var st=typeof T.height<"u"?T.height:"auto";if(st==="*"&&(st="auto"),q!=="auto"&&T.colSpan>1&&(isNaN(q)?q="auto":q/=T.colSpan),st!=="auto"&&T.rowSpan>1&&(isNaN(st)?st="auto":st/=T.rowSpan),zt){var ai=e.children[ee],$t=ai.children[Q];if($t){var se=$t.getAttribute("width")||"",re=$t.style.width;(se||re).endsWith("%")&&(q=se||re)}}Ft[k].push(q),Ot[k].push(st)})}),Ft.forEach(function(C){C.forEach(function(k,T){var Q=typeof et[T];if(Q==="undefined"||k!=="auto"&&Q==="number"&&k>et[T]||k!=="auto"&&et[T]==="auto"){if(Wt){var q=k==="auto"?te/C.length:k.toString().replace("%","")*te/100;k=String(q)+"%"}et[T]=k}})}),Ot.forEach(function(C,k){C.forEach(function(T){var Q=typeof lt[k];(Q==="undefined"||T!=="auto"&&Q==="number"&&T>lt[k]||T!=="auto"&<[k]==="auto")&&(lt[k]=T)})}),et.length>0&&(ri&&(et=et.map(function(C){return C==="auto"?"*":C})),n.table.widths=et),lt.length>0&&(n.table.heights=lt)}if(e.dataset&&e.dataset.pdfmake){d=e.dataset.pdfmake.replace(/'/g,'"');try{d=JSON.parse(d);for(f in d)f==="layout"?n.layout=d[f]:n.table[f]=d[f]}catch(C){console.error(C)}}break}case"TH":case"TD":{e.getAttribute("rowspan")&&(n.rowSpan=e.getAttribute("rowspan")*1),e.getAttribute("colspan")&&(n.colSpan=e.getAttribute("colspan")*1),n=this.applyStyle({ret:n,parents:i.concat([e])});break}case"SVG":{n={svg:e.outerHTML.replace(/\n(\s+)?/g,""),nodeName:"SVG"},this.removeTagClasses||(n.style=["html-svg"]);break}case"BR":{n.text=[{text:` 2`}];break}case"SUB":case"SUP":{n[a.toLowerCase()]={offset:"30%",fontSize:8};break}case"HR":{var nt={width:514,type:"line",margin:[0,12,0,12],thickness:.5,color:"#000000",left:0};if(e.dataset&&e.dataset.pdfmake){d=e.dataset.pdfmake.replace(/'/g,'"');try{d=JSON.parse(d);for(f in d)nt[f]=d[f]}catch(C){console.error(C)}}n.margin=nt.margin,n.canvas=[{type:nt.type,x1:nt.left,y1:0,x2:nt.width,y2:0,lineWidth:nt.thickness,lineColor:nt.color}],delete n.text;break}case"OL":case"UL":{switch(n[r]=(n.stack||n.text).slice(0),delete n.stack,delete n.text,n=this.applyStyle({ret:n,parents:i.concat([e])}),e.getAttribute("start")&&(n.start=e.getAttribute("start")*1),e.getAttribute("type")){case"A":n.type="upper-alpha";break;case"a":n.type="lower-alpha";break;case"I":n.type="upper-roman";break;case"i":n.type="lower-roman";break}(n.listStyle||n.listStyleType)&&(n.type=n.listStyle||n.listStyleType);break}case"LI":{n.stack&&!n.stack[n.stack.length-1].text&&(c=n.stack.slice(0,-1),n=[Array.isArray(c)&&c.filter(function(C){return!C.text}).length>0?{stack:c}:{text:c},n.stack[n.stack.length-1]]),Array.isArray(n)&&(n={stack:n});break}case"PRE":{n.preserveLeadingSpaces=!0;break}case"IMG":{if(this.imagesByReference){var ie=e.getAttribute("data-src")||e.getAttribute("src"),ne=this.imagesRef.indexOf(ie);ne>-1?n.image="img_ref_"+p+ne:(n.image="img_ref_"+p+this.imagesRef.length,this.imagesRef.push(ie))}else n.image=e.getAttribute("src");delete n.stack,delete n.text,n=this.applyStyle({ret:n,parents:i.concat([e])});break}case"A":{var Bt=function(C,k){return C=C||{text:""},Array.isArray(C.text)?(C.text=C.text.map(function(T){return Bt(T,k)}),C):Array.isArray(C.stack)?(C.stack=C.stack.map(function(T){return Bt(T,k)}),C):(k.indexOf("#")===0?C.linkToDestination=k.slice(1):C.link=k,C)};e.getAttribute("href")&&(n=Bt(n,e.getAttribute("href")),Array.isArray(n.text)&&n.text.length===1&&(n=n.text[0]),n.nodeName="A");break}default:a==="DIV"&&e.dataset&&e.dataset.pdfmakeType==="columns"?n.stack&&(n.columns=n.stack,delete n.stack):s&&typeof s.customTag=="function"&&(n=s.customTag.call(this,{element:e,parents:i,ret:n}))}if(Array.isArray(n.text)&&n.text.length===1&&n.text[0].text&&!n.text[0].nodeName&&(n.text=n.text[0].text),(i.length>0&&i[i.length-1].nodeName==="LI"||a==="LI")&&(Array.isArray(n.text)&&n.text.length===0||typeof n.text=="string"&&n.text==="")&&(n.text=" "),["HR","TABLE"].indexOf(a)===-1&&e.dataset&&e.dataset.pdfmake){d=e.dataset.pdfmake.replace(/'/g,'"');try{d=JSON.parse(d);for(f in d)n[f]=d[f]}catch(C){console.error(C)}}return n}}},this.searchForStack=function(e){if(Array.isArray(e.text)){for(var i=0;i<e.text.length;i++)if(e.text[i].stack||["P","DIV","TABLE","SVG","UL","OL","IMG","H1","H2","H3","H4","H5","H6"].indexOf(e.text[i].nodeName)>-1||this.searchForStack(e.text[i])===!0)return!0}return!1},this.applyStyle=function(e){var i=[],a=e.parents.length-1,r=this;return e.parents.forEach(function(n,c){var u=n.nodeName.toLowerCase();if(!r.removeTagClasses){var d="html-"+u;d!=="html-body"&&i.indexOf(d)===-1&&i.unshift(d)}var _=(n.getAttribute("class")||"").split(" ");_.forEach(function(g){g&&i.push(g)});var f,S=c!==a;if(r.defaultStyles[u])for(f in r.defaultStyles[u])r.defaultStyles[u].hasOwnProperty(f)&&(!S||S&&f.indexOf("margin")===-1&&f.indexOf("border")===-1)&&(f==="decoration"?(Array.isArray(e.ret[f])||(e.ret[f]=[]),r.defaultStyles[u][f]&&e.ret[f].indexOf(r.defaultStyles[u][f])===-1&&e.ret[f].push(r.defaultStyles[u][f])):e.ret[f]=JSON.parse(JSON.stringify(r.defaultStyles[u][f])));u==="tr"&&(S=!1),f=r.parseStyle(n,S),f.forEach(function(g){if(g.key==="decoration")Array.isArray(e.ret[g.key])||(e.ret[g.key]=[]),e.ret[g.key].push(g.value);else if(!(["UL","OL"].includes(e.ret.nodeName)&&g.key==="alignment"))if(e.ret.margin&&g.key.indexOf("margin")===0)switch(g.key){case"marginLeft":e.ret.margin[0]=g.value;break;case"marginTop":e.ret.margin[1]=g.value;break;case"marginRight":e.ret.margin[2]=g.value;break;case"marginBottom":e.ret.margin[3]=g.value;break}else e.ret[g.key]=g.value})}),i.length>0&&(e.ret.style=i),e.ret},this.borderValueRearrange=function(e){try{var i=e.split(" ");if(i.length!==3)return e;var a="0px",r="none",n="transparent",c=["dotted","dashed","solid","double","groove","ridge","inset","outset","none","hidden","mix"];return i.forEach(function(u){u.match(/^\d/)?a=u:c.indexOf(u)>-1?r=u:n=u}),a+" "+r+" "+n}catch{return e}},this.parseStyle=function(e,i){var a=e.getAttribute("style")||"",r=[];a=a.replace(/!important/g,"").split(";");var n=e.getAttribute("width"),c=e.getAttribute("height");n&&a.unshift("width:"+this.convertToUnit(n+(isNaN(n)?"":"px"))),c&&a.unshift("height:"+this.convertToUnit(c+(isNaN(c)?"":"px")));var u=e.getAttribute("color");u&&r.push({key:"color",value:this.parseColor(u).color});var d=e.getAttribute("size");d!==null&&(d=Math.min(Math.max(1,parseInt(d)),7),r.push({key:"fontSize",value:Math.max(this.fontSizes[0],this.fontSizes[d-1])}));var _=a.map(function(I){return I.toLowerCase().split(":")}),f=[],S=e.nodeName.toUpperCase(),g=this;if(_.forEach(function(I){if(I.length===2){var y=I[0].trim().toLowerCase(),m=I[1].trim(),h;if(g.ignoreStyles.indexOf(y)===-1)switch(y){case"margin":{if(i)break;m=m.split(" "),m.length===1?m=[m[0],m[0],m[0],m[0]]:m.length===2?m=[m[1],m[0]]:m.length===3?m=[m[1],m[0],m[1],m[2]]:m.length===4&&(m=[m[3],m[0],m[1],m[2]]),m.forEach(function(P,L){P==="auto"?m[L]="":m[L]=g.convertToUnit(P)}),m.indexOf(!1)===-1&&r.push({key:y,value:m});break}case"line-height":{typeof m=="string"&&m.slice(-1)==="%"?m=m.slice(0,-1)/100:m=g.convertToUnit(m),r.push({key:"lineHeight",value:m});break}case"text-align":{r.push({key:"alignment",value:m});break}case"font-weight":{m==="bold"||m>=700?r.push({key:"bold",value:!0}):r.push({key:"bold",value:!1});break}case"text-decoration":{m=g.toCamelCase(m),["underline","lineThrough","overline"].includes(m)&&r.push({key:"decoration",value:m});break}case"font-style":{m==="italic"&&r.push({key:"italics",value:!0});break}case"font-family":{r.push({key:"font",value:m.split(",")[0].replace(/"|^'|^\s*|\s*$|'$/g,"").replace(/^([a-z])/g,function(P){return P[0].toUpperCase()}).replace(/ ([a-z])/g,function(P){return P[1].toUpperCase()})});break}case"color":{h=g.parseColor(m),r.push({key:"color",value:h.color}),h.opacity<1&&r.push({key:"opacity",value:h.opacity});break}case"background-color":{h=g.parseColor(m),h.color!=="transparent"&&(r.push({key:S==="TD"||S==="TH"?"fillColor":"background",value:h.color}),h.opacity<1&&r.push({key:S==="TD"||S==="TH"?"fillOpacity":"opacity",value:h.opacity}));break}case"text-indent":{r.push({key:"leadingIndent",value:g.convertToUnit(m)});break}case"white-space":{m==="nowrap"?r.push({key:"noWrap",value:!0}):r.push({key:"preserveLeadingSpaces",value:m==="break-spaces"||m.slice(0,3)==="pre"});break}default:if(y.indexOf("border")===0)i||f.push({key:y,value:m});else{if(i&&(y.indexOf("margin-")===0||y==="width"||y==="height"))break;if(S==="IMG"&&(y==="width"||y==="height")){r.push({key:y,value:g.convertToUnit(m)});break}if(y.indexOf("padding")===0)break;if(y.indexOf("-")>-1&&(y=g.toCamelCase(y)),m){var v=g.convertToUnit(m);if(y==="fontSize"&&v===!1)if(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large"].includes(m))switch(m){case"xx-small":m=7.2;break;case"x-small":m=9;break;case"small":m=10.7;break;case"medium":m=12;break;case"large":m=14.4;break;case"x-large":m=18;break;case"xx-large":m=24;break;case"xxx-large":m=36;break}else break;if(y.indexOf("margin")===0&&m==="auto")break;r.push({key:y,value:v===!1?m:v})}}}}}),f.length>0){var w=[],E=[];f.forEach(function(I){var y=-1,m;I.key.indexOf("-left")>-1?y=0:I.key.indexOf("-top")>-1?y=1:I.key.indexOf("-right")>-1?y=2:I.key.indexOf("-bottom")>-1&&(y=3);var h=I.key.split("-"),v,P;if(h.length===1||h.length===2&&y>=0){if(I.value=g.borderValueRearrange(I.value),v=I.value.split(" "),P=v[0].replace(/(\d*)(\.\d+)?([^\d]+)/g,"$1$2 ").trim(),y>-1)w[y]=P>0;else for(m=0;m<4;m++)w[m]=P>0;if(v.length>2){var L=v.slice(2).join(" ");if(y>-1)E[y]=g.parseColor(L).color;else for(m=0;m<4;m++)E[m]=g.parseColor(L).color}}else y>=0&&h[2]==="color"?E[y]=g.parseColor(I.value).color:y>=0&&h[2]==="width"?w[y]=!/^0[a-z%]*$/.test(String(I.value)):I.key==="border-color"?(v=g.topRightBottomLeftToObject(I.value),E=[g.parseColor(v.left).color,g.parseColor(v.top).color,g.parseColor(v.right).color,g.parseColor(v.bottom).color]):I.key==="border-width"&&(v=g.topRightBottomLeftToObject(I.value),w=[!/^0[a-z%]*$/.test(v.left),
2!/^0[a-z%]*$/.test(v.top),!/^0[a-z%]*$/.test(v.right),!/^0[a-z%]*$/.test(v.bottom)])});for(var D=0;D<4;D++)w.length>0&&typeof w[D]>"u"&&(w[D]=!0),E.length>0&&typeof E[D]>"u"&&(E[D]="#000000");w.length>0&&r.push({key:"border",value:w}),E.length>0&&r.push({key:"borderColor",value:E})}return r},this.toCamelCase=function(e){return e.replace(/-([a-z])/g,function(i){return i[1].toUpperCase()})},this.topRightBottomLeftToObject=function(e){var i=/#[0-9a-fA-F]{3,6}|\b(?:rgba?|hsla?)\([^)]*\)|\b[a-zA-Z]+\b/g,a=e.match(i)||[],r=a[0],n=a[1],c=a[2],u=a[3];switch(a.length){case 1:n=c=u=r;break;case 2:c=r,u=n;break;case 3:u=n;break}return{top:r,right:n,bottom:c,left:u}},this.hsl2rgb=function(e,i,a){var r=i*Math.min(a,1-a),n=function(c){var u=(c+e/30)%12;return Math.min(Math.floor((a-r*Math.max(Math.min(u-3,9-u,1),-1))*256),255)};return"rgb("+n(0)+","+n(8)+","+n(4)+")"},this.parseColor=function(e){var i=1,a=new RegExp("^#([0-9a-f]{3}|[0-9a-f]{6})$","i"),r=/^rgba?\(\s*(\d+(\.\d+)?%?),\s*(\d+(\.\d+)?%?),\s*(\d+(\.\d+)?%?)(,\s*\d+(\.\d+)?)?\)$/,n=new RegExp("^hsl\\((\\d+(\\.\\d+)?%?),\\s*(\\d+(\\.\\d+)?%?),\\s*(\\d+(\\.\\d+)?%?)\\)$"),c=new RegExp("^[a-z]+$","i"),u,d,_,f=[];return a.test(e)?{color:e,opacity:i}:(n.test(e)&&(u=n.exec(e).slice(1),u[0].endsWith("%")?d=u[0].slice(0,-1)*360/100:d=u[0]*1,f.push(d),f.push(u[2].slice(0,-1)/100),f.push(u[4].slice(0,-1)/100),e=this.hsl2rgb(f[0],f[1],f[2]),f=[]),r.test(e)?(u=r.exec(e).slice(1).filter(function(S,g){return g%2===0&&typeof S<"u"}),u.forEach(function(S,g){g===3?i=S.slice(1)*1:(S.endsWith("%")?S=Math.round(S.slice(0,-1)*255/100):S=S*1,S>255&&(S=255),_="0"+S.toString(16),_=_.slice(-2),f.push(_))}),{color:"#"+f.join(""),opacity:i}):c.test(e)?{color:e,opacity:i}:(console.error('Could not parse color "'+e+'"'),{color:e,opacity:i}))},this.convertToUnit=function(e){if(!isNaN(parseFloat(e))&&isFinite(e))return e*1;var i=(e+"").trim().match(/^(-?\d*(\.\d+)?)(pt|px|r?em|cm|in)$/);if(!i)return!1;switch(e=i[1],i[3]){case"px":{e=Math.round(e*.75292857248934);break}case"em":case"rem":{e*=12;break}case"cm":{e=Math.round(e*28.34646);break}case"in":{e*=72;break}}return e*1};var t=this.convertHtml(o);return typeof t=="string"&&(t={text:t}),this.imagesByReference&&(t={content:t,images:{}},this.imagesRef.forEach(function(e,i){t.images["img_ref_"+p+i]=e.startsWith("{")?JSON.parse(e):e})),t}Ve.exports=function(o,s){return new yi(o,s)}});var X=o=>Math.round(Math.max(0,o));function Zt(o,s){let p=s??o?.receipt,t=o?.metadata||{},e=p?.metadata||{};if(t.customPlan===!0||t.customPlan==="true"||e.customPlan===!0||e.customPlan==="true"||t.customPlans===!0||t.customPlans==="true"||e.customPlans===!0||e.customPlans==="true")return!0;let i=p?.customPlans;if(Array.isArray(i)&&i.length>0)return!0;if(typeof i=="string"&&i.trim().length>0)try{let a=JSON.parse(i);return Array.isArray(a)&&a.length>0}catch{return!1}return!1}function di(o,s){let p=o?.invoice?.discount?.coupon;if(!p){let t=Number(o?.checkoutSession?.total_details?.amount_discount||0);return t>0?t:0}if(p.amount_off)return Number(p.amount_off);if(p.percent_off){let t=mi(o),e=Math.max(0,s-t);return X(e*Number(p.percent_off)/100)}return 0}function mi(o){let s=o?.invoice?.line_items||[],p=0;for(let t of s)Gt(t,o)&&(p+=Number(t.price?.unit_amount||t.amount||0));return p}function De(o){return o?.metadata?.isSetupFees===!0||o?.metadata?.isSetupFees==="true"}function Gt(o,s){let p=o?.price?.product?.id;if(!p)return!1;let t=s?.metadata?.processingFeeId||s?.receipt?.processingFees?.id;return!!(t&&p===t)}function fi(o,s){if(!o.length)return;let p=o.reduce((e,i)=>e+Number(i.amount||0),0);if(p<=0||o.length===1){let e=o[0],i=Math.max(1,Number(e.quantity||1));e.amount=s,e.price&&(e.price.unit_amount=X(s/i));return}let t=0;o.forEach((e,i)=>{let a=Math.max(1,Number(e.quantity||1)),r;i===o.length-1?r=s-t:(r=Math.round(Number(e.amount||0)/p*s),t+=r),e.amount=r,e.price&&(e.price.unit_amount=X(r/a))})}function hi(o,s){if(!o.length)return;let p=o.reduce((e,i)=>e+Number(i.amount_subtotal??i.amount??0),0);if(p<=0||o.length===1){let e=o[0],i=Math.max(1,Number(e.quantity||1));e.amount_subtotal=s,e.price&&(e.price.unit_amount=X(s/i));return}let t=0;o.forEach((e,i)=>{let a=Math.max(1,Number(e.quantity||1)),r=Number(e.amount_subtotal??e.amount??0),n;i===o.length-1?n=s-t:(n=Math.round(r/p*s),t+=n),e.amount_subtotal=n,e.price&&(e.price.unit_amount=X(n/a))})}function je(o){return o?.checkoutSession||o?.payment_intent?.checkout_session||null}function gi(o){return je(o)?.line_items?.data||[]}function Le(o){let{payment:s}=o,p=o.receipt??s?.receipt;if(!Zt(s,p)||!s?.invoice)return;let t=Number(s.amount||0);if(t<=0)return;let e=s.inclusive===!0||p?.metadata?.checkoutTaxInclusive===!0||p?.metadata?.checkoutTaxInclusive==="true",i=Number(s.invoice.subtotal||0),a=0;s.invoice.tax!=null&&s.invoice.tax>-1?a=Number(s.invoice.tax):s.invoice.total_taxes?.length?a=Number(s.invoice.total_taxes[0]?.amount||0):s.invoice.total_tax_amounts?.length&&(a=Number(s.invoice.total_tax_amounts[0]?.amount||0));let r=di(s,i),n=e?i-r:i-r+a,c=Math.max(1,Math.round(t*.01));if(Math.abs(n-t)<=c)return;let u=s.invoice.line_items||[],d=gi(s);if(!u.length&&!d.length&&i<=0)return;let _=0,f=0,S=[];for(let P of u)De(P)?f+=Number(P.amount||0):Gt(P,s)?_+=Number(P.price?.unit_amount||P.amount||0):S.push(P);let g=Number(p?.taxPercent||0);if(g<=0&&a>0&&i>0){let P=Math.max(1,i-_-f);g=a/P*100}let w=Math.max(0,t-_-f),E=s.invoice.discount?.coupon,D=Number(E?.percent_off||p?.percent_off||0),I=Number(E?.amount_off||p?.amount_off||0),y,m;if(g>0&&!e)if(D>
20){let P=(1-D/100)*(1+g/100);y=X(w/P);let L=X(y*(100-D)/100);m=Math.max(0,w-L)}else{let P=X(w/(1+g/100));m=Math.max(0,w-P),y=P+I}else g>0&&e?(y=w+I,m=X(w*g/(100+g))):(y=w+I,m=0);S.length&&fi(S,y);let h=y+_+f;s.invoice.subtotal=h,m>0?(s.invoice.tax=m,s.invoice.total_taxes=[{amount:m}],s.invoice.total_tax_amounts=[{amount:m,inclusive:!1,tax_rate:""}]):(delete s.invoice.tax,delete s.invoice.total_taxes,delete s.invoice.total_tax_amounts);let v=je(s);if(v){v.amount_subtotal=h,v.total_details=v.total_details||{},v.total_details.amount_tax=m;let P=d.filter(L=>!De(L)&&!Gt(L,s));P.length&&hi(P,y)}}function M(o){return typeof o=="string"?o:""}function F(o){return typeof o=="number"?o:0}function Yt(o){return o!=null&&typeof o.length=="number"}var qe=(()=>{let s=class s{constructor(){this.receiptService=N(Nt)}resolvePaymentProgress(i){return J(this,arguments,function*(t,e={}){let a=t?.receipt??e.receiptDetails,r=t?.metadata,n=Number(r?.["Max Payment"]??t?.payment_intent?.checkout_session?.metadata?.["Max Payment"]??t?.checkoutSession?.metadata?.["Max Payment"]??e.checkoutSession?.metadata?.["Max Payment"]??0),c=a?.type==="custom"||r?.customPlan===!0||r?.customPlan==="true"||Zt(t,a),u=a?.customPlans??e.receiptDetails?.customPlans??t?.pfInvoice?.customPlans??e.invoiceStore?.customPlans,d=c?this.receiptService.getCustomPlanTotalPayments(u):n>1?n:Number(a?.maxPayments??e.receiptDetails?.maxPayments??0);if(d<=1)return null;let _=this.resolveSubscriptionId(t,a,e);if(!_)return null;try{let f=typeof t?.id=="string"?t.id.trim():"",S=yield this.receiptService.getSubscriptionProcessedPayment(_,f||void 0);return!Number.isFinite(S)||S<=0?null:{current:S,total:d}}catch(f){return console.error("Error resolving payment progress:",f instanceof Error?f.message:f),null}})}resolveSubscriptionId(t,e,i){let a=typeof t?.order=="string"?t.order.trim():"",r=t?.metadata||{},n=(t?.callbacks??[]).find(d=>d?.data?.subscriptionId)?.data?.subscriptionId,c=i.checkoutSession?.subscription??t?.checkoutSession?.subscription,u=typeof c=="string"?c:c?.id;return t?.invoice?.subscription||(a.startsWith("I-")?a:"")||M(r.paypalSubscriptionId)||M(r.subscription_id)||e?.subscriptionId||t?.order||rt(t,"invoice.parent.subscription_details.subscription","")||n||i.subscription?.id||u||""}};s.\u0275fac=function(e){return new(e||s)},s.\u0275prov=bt({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();var Ze=xt(He());var ct=xt(li()),Qt=xt(pi()),gt=xt(ui());var Ge=new kt("PdfMakeService"),Ye=(()=>{let s=class s{constructor(){this.translateService=N(At),this.propPipe=N(Tt),this.zeroDecimalService=N(Ue),this.currencySymbol="usd",this.refundTotal=0,this.conversionCurrencySymbol="usd";let t=gt.default?.pdfMake?.vfs??gt.default?.vfs??gt.default?.default?.pdfMake?.vfs??gt.default?.default?.vfs;t&&(Qt.default.vfs=t)}getHeader(t,e,i,a,r){let n="";return t&&t.account_name?n=t.account_name:e&&e.displayName&&(n=e.displayName),[{alignment:"justify",table:{widths:["50%","50%"],body:[[i&&i.imageUrl?{image:i.imageUrl,width:30,margin:[20,10,0,5],alignment:"left"}:"",{text:this.translateService.instant(this.headerText).toUpperCase(),fontSize:18,bold:!0,margin:[0,10,0,5],alignment:"right"}],[[{text:n,fontSize:18,bold:!0,color:"#6c7070",margin:[0,0,0,10],border:[!1,!1,!1,!0],alignment:"left"},e?.support_address?{table:{headerRows:1,widths:["auto","auto","auto","auto"],body:this.getBusinessDetail(e,t,a)},layout:"noBorders"}:{},e?.additionalInfo?{text:this.getAdditionalInformation(e),fontSize:10,lineHeight:1.3,margin:[0,0,0,0],alignment:"left"}:{}],{table:{widths:["50%","50%"],body:this.getHeaderBody(e,t,r)},margin:[0,0,0,10],layout:"noBorders",alignment:"right"}]]},layout:"noBorders"},{canvas:[{type:"line",x1:0,y1:5,x2:550,y2:5,lineWidth:.5,lineColor:"#999"}],margin:[0,10,0,10]}]}getCustomerEmail(t,e,i){let a;return this.propPipe.transform(e,"customer_email")?a=this.propPipe.transform(e,"customer_email"):this.propPipe.transform(t,"billing.email")?a=this.propPipe.transform(t,"billing.email"):this.propPipe.transform(i,"email")?a=this.propPipe.transform(i,"email"):this.propPipe.transform(t,"re
2ceipt.email")&&(a=this.propPipe.transform(t,"receipt.email")),a}getReceiptNumber(t,e,i){let a=t?.metadata||{},r=typeof a.paypalOrderId=="string"?a.paypalOrderId:"";if(r)return r.toUpperCase();let n=" ";return e&&e.number?n=e.number:i?.invoice_prefix&&t?.id?n=`${i.invoice_prefix}-${t.id.substring(t.id.length-4)}`:t&&t.id&&t.id.indexOf("ch")===-1&&(n=t.id),n===" "&&i?.invoice_prefix&&t?.checkoutSession?.subscription?.customer?.next_invoice_sequence&&(n=`${i.invoice_prefix}-${t?.checkoutSession?.subscription?.customer?.next_invoice_sequence?.toString()?.padStart(4,"0")}`),n.toUpperCase()}getPaymentDate(t){let e="";return t&&t.billing_cycle_anchor?(e=t.billing_cycle_anchor,e=(0,ct.default)(e*1e3).format("LL")):t&&t.created&&(e=(0,ct.default)(t.created*1e3).format("LL")),e}getPaymentMethod(t){let e="";if(t?.payment_method_details?.card){let i=t.payment_method_details.card;i.brand&&(e+=i.brand),i.last4&&(e+=` - ${i.last4}`)}else!t?.payment_method_details&&t?.checkoutSession?.subscription?.default_payment_method?.card?(e+=this.propPipe.transform(t?.checkoutSession?.subscription,"default_payment_method.card.brand"),e+=` - ${this.propPipe.transform(t?.checkoutSession?.subscription,"default_payment_method.card.last4")}`):e=t?.payment_method_details?.type||t?.checkoutSession?.subscription?.default_payment_method?.type;return e}getSupportAddress(t){let e="";return t.support_address&&(e=` 3`+It(t.support_address)),e}getAdditionalInformation(t){let e="";return t.additionalInfo&&(e=` 4`+t.additionalInfo),e}getWidth(t,e,i){let a=["auto","auto","auto","auto"];return(this.propPipe.transform(t,"billing.address")&&this.propPipe.transform(i,"shipping.name")!==""&&this.propPipe.transform(i,"shipping.address","shipping.address.line1","shipping.address.city","shipping.address.state","shipping.address.postal_code")&&t.receipt&&t.receipt.shipping&&i.shipping.name&&i.shipping.name!==""||t.receipt.shipping&&t.receipt.shipping.name&&this.propPipe.transform(t,"receipt.shipping.address","receipt.shipping.address.line1","receipt.shipping.address.city","receipt.shipping.address.state","receipt.shipping.address.postal_code")&&t.receipt.shipping.name!==""||t.receipt&&t.receipt.billing&&!t.receipt.billing.name&&t.receipt.shipping&&t.receipt.shipping&&t.receipt.shipping.name&&this.propPipe.transform(t,"receipt.shipping.address","receipt.shipping.address.line1","receipt.shipping.address.city","receipt.shipping.address.state","receipt.shipping.address.postal_code")&&t.receipt.shipping.name!=="")&&(a=["50%","auto","auto","auto"]),a}getBillingShippingAddress(t,e,i){let a="";i.name?a=i.name:this.propPipe.transform(i,"metadata.Name","shipping.name")?a=pt(this.propPipe.transform(i,"metadata.Name","shipping.name")):rt(e,"customer_name")?a=rt(e,"customer_name"):t?.checkoutSession?.customer_details?.name&&(a=t?.checkoutSession?.customer_details?.name);let r={text:`${a} 5 ${this.getCustomerEmail(t,e,i)??""}`,fontSize:11},n=[[{text:this.translateService.instant("receipts.label.bill_to"),bold:!1,color:"#555",fontSize:11,margin:[0,0,0,0]},{text:"",bold:!1,fontSize:11,margin:[0,0,0,0]},{text:"",margin:[0,15,0,0]},{text:"",margin:[0,15,0,0]}],[r,{text:"",margin:[15,0,0,0]},{text:"",margin:[0,0,0,0]},{text:"",margin:[0,0,0,0]}]],c={text:"",margin:[0,0,0,0]};if(this.propPipe.transform(t,"billing.address"))n=[[this.propPipe.transform(t,"billing.name")&&t.billing_details.name!==""&&this.propPipe.transform(t,"billing.address")?{text:this.translateService.instant("receipts.label.bill_to"),margin:[0,15,0,0],bold:!1,color:"#555",fontSize:11}:c,this.propPipe.transform(i,"shipping.name")!==""?{text:this.translateService.instant("receipts.label.ship_to"),margin:[15,15,0,0],bold:!1,color:"#555",fontSize:11}:c,c,c],[this.propPipe.transform(t,"billing.address","billing.address.line1","billing.address.city","billing.address.state","billing.address.postal_code")&&t?.billing_details?.name?{text:(t.billing_details.name?t.billing_details.name+` 6`:`${i?.name?i.name+` 7`:""}`)+(t.billing_details.address.line1?t.billing_details.address.line1+` 8`:"")+(t.billing_details.address?.line2?t.billing_details.address.line2+` 9`:"")+(t.billing_details.address?.city||t.billing_details.address?.postal_code?`${t.billing_details.address?.city||""} ${t.billing_details.address?.postal_code||""} 10`:"")+(t.billing_details.address.state?t.billing_details.address.state+` 11`:"")+(t.billing_details.address.country?t.billing_details.address.country+` 12`:"")+this.getCustomerEmail(t,e,i),fontSize:11,margin:[0,5,0,0]}:c,this.propPipe.transform(i,"shipping.address","shipping.address.line1","shipping.address.city","shipping.address.state","shipping.address.postal_code")&&i?.shipping?.name?{text:(i.shipping.name?i.shipping.name+` 13`:"")+(i.shipping.address.line1?i.shipping.address.line1+` 14`:"")+(i.shipping.address?.line2?i.shipping.address.line2+` 15`:"")+(i.shipping.address?.city||i.shipping.address?.postal_code?`${i.shipping.address?.city||""} ${i.shipping.address?.postal_code||""} 16`:"")+(i.shipping.address.state?i.shipping.address.state+` 17`:"")+(i.shipping.address.country?i.shipping.address.country:""),fontSize:11,margin:[15,5,0,0]}:c,c,c]];else if(t?.receipt?.billing?.name||t?.receipt?.shipping&&(!t?.receipt?.billing||t?.receipt?.billing?.name))n=[[t?.receipt?.billing?.name&&t?.receipt?.billing?.address?{text:this.translateService.instant("receipts.label.bill_to"),margin:[0,15,0,0],bold:!1,color:"#555",fontSize:11}:c,t?.receipt?.shipping?.name?{text:this.translateService.instant("receipts.label.ship_to"),margin:[15,15,0,0],bold:!1,color:"#555",fontSize:11}
17:c,c,c],[this.propPipe.transform(t,"receipt.billing.address","receipt.billing.address.line1","receipt.billing.address.city","receipt.billing.address.state","receipt.billing.address.postal_code")&&t?.receipt?.billing?.name?{text:t.receipt.billing.name+` 18`+(t.receipt.billing.address.line1?t.receipt.billing.address.line1+` 19`:"")+(t.receipt.billing.address?.line2?t.receipt.billing.address.line2+` 20`:"")+(t.receipt.billing.address?.city||t.receipt.billing.address?.postal_code?`${t.receipt.billing.address?.city||""} ${t.receipt.billing.address?.postal_code||""} 21`:"")+(t.receipt.billing.address.state?t.receipt.billing.address.state+` 22`:"")+(t.receipt.billing.address.country?t.receipt.billing.address.country+` 23`:"")+this.getCustomerEmail(t,e,i),margin:[0,5,0,0],fontSize:11}:c,this.propPipe.transform(t,"receipt.shipping.address","receipt.shipping.address.line1","receipt.shipping.address.city","receipt.shipping.address.state","receipt.shipping.address.postal_code")&&t?.receipt?.shipping?.name?{text:t.receipt.shipping.name+` 24`+(t.receipt.shipping.address.line1?t.receipt.shipping.address.line1+` 25`:"")+(t.receipt.shipping.address?.line2?t.receipt.shipping.address.line2+` 26`:"")+(t.receipt.shipping.address?.city||t.receipt.shipping.address?.postal_code?`${t.receipt.shipping.address?.city||""} ${t.receipt.shipping.address?.postal_code||""} 27`:"")+(t.receipt.shipping.address.state?t.receipt.shipping.address.state+` 28`:"")+(t.receipt.shipping.address.country?t.receipt.shipping.address.country:""),margin:[15,5,0,0],fontSize:11}:c,c,c]];else if(!t?.receipt||t?.shipping?.name&&t?.shipping?.address||t?.billing_details?.name&&t?.billing_details?.address)n=[[t?.billing_details?.name&&t?.billing_details?.address?{text:this.translateService.instant("receipts.label.bill_to"),margin:[0,15,0,0],bold:!1,color:"#555",fontSize:11}:c,t?.shipping?.name&&t?.shipping?.address?{text:this.translateService.instant("receipts.label.ship_to"),margin:[15,15,0,0],bold:!1,color:"#555",fontSize:11}:c,c,c],[this.propPipe.transform(t,"billing_details.address","billing_details.address.line1","billing_details.address.city","billing_details.address.state","billing_details.address.postal_code")&&t?.billing_details?.name?{text:t.billing_details.name+` 29`+(t.billing_details.address.line1?t.billing_details.address.line1+` 30`:"")+(t.billing_details.address?.line2?t.billing_details.address.line2+` 31`:"")+(t.billing_details.address?.city||t.billing_details.address?.postal_code?`${t.billing_details.address?.city||""} ${t.billing_details.address?.postal_code||""} 32`:"")+(t.billing_details.address.state?t.billing_details.address.state+` 33`:"")+(t.billing_details.address.country?t.billing_details.address.country+` 34`:"")+this.getCustomerEmail(t,e,i),margin:[0,5,0,0],fontSize:11}:c,this.propPipe.transform(t,"shipping.address","shipping.address.line1","shipping.address.city","shipping.address.state","shipping.address.postal_code")&&t?.shipping?.name?{text:t.shipping.name+` 35`+(t.shipping.address.line1?t.shipping.address.line1+` 36`:"")+(t.shipping.address?.line2?t.shipping.address.line2+` 37`:"")+(t.shipping.address?.city||t.shipping.address?.postal_code?`${t.shipping.address?.city||""} ${t.shipping.address?.postal_code||""} 38`:"")+(t.shipping.address.state?t.shipping.address.state+` 39`:"")+(t.shipping.address.country?t.shipping.address.country:""),margin:[15,5,0,0],fontSize:11}:c,c,c]];else if(t?.billing_details?.name||t?.receipt?.name){let u=t?.billing_details?.name||t?.receipt?.name;n=[[{text:this.translateService.instant("receipts.label.bill_to"),margin:[0,15,0,0],bold:!1,color:"#555",fontSize:11},c,c,c],[{text:`${u} 40${this.getCustomerEmail(t,e,i)??""}`,margin:[0,5,0,0],fontSize:11},c,c,c]]}return n}getTotalAmountPaid(t,e){let i=0;if(t&&t.amount)i=t.amount;else if(t&&t.amount_captured)i=t.amount_captured;else{let a=this.propPipe.transform(e,"total");if(R(a)&&a.toString())i=B(a);else{let r=this.propPipe.transform(e,"amount_paid");R(r)&&r.toString()&&(i=B(r))}}return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(i,this.currency).toFixed(2)):this.checkAmountByCurrency(i,this.currency).toFixed(2).concat(" ",this.currency.toUpperCase())}getUnitAmount(t,e){let i=0,a=this.propPipe.transform(t,"lines.data");if(R(a)&&a.length===1){let r=this.propPipe.transform(t,"lines.data[0].plan.amount");if(R(r)&&r.toString())i=B(r);else{let n=this.propPipe.transform(t,"lines.data[0].metadata.unit_amount");if(R(n)&&n.toString())i=B(n);else{let c=this.propPipe.transform(t,"lines.data[0].price.unit_amount");R(c)&&c.toString()&&(i=B(c))}}}else if(R(a)&&a.length===2){let r=this.propPipe.transform(t,"lines.data[1].plan.amount");if(R(r)&&r.toString())i=B(r);else{let n=this.propPipe.transform(t,"lines.data[1].metadata.unit_amount");if(R(n)&&n.toString())i=B(n);else{let c=this.propPipe.transform(t,"lines.data[1].price.unit_amount");R(c)&&c.toString()&&(i=B(c))}}}else e&&e?.receipt?.amount?i=e?.receipt?.amount:e&&e.amount&&(i=e.amount);return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(i,this.currency).toFixed(2)):this.checkAmountByCurrency(i,this.currency).toFixed(2)}getSubTotal(t,e){try{let i=0,a=this.propPipe.transform(t,"subtotal");if(R(a)&&a.toString())i=B(a);else if(e?.checkoutSession?.amount_subtotal)i=e.checkoutSession.amount_subtotal;else if(e&&e?.receipt?.amount){i=e?.receipt?.amount*(e?.receipt?.quantity||1);let r=this.getReceiptProcessingFees(e);r&&(i+=r.amountCents)}else e?.amount&&(i=e.amount);return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(i,this.currency).toFixed(2)):this.checkAmountByCurrency(i,this.currency).toFixed(2).concat(" ",this.currency.toUpperCase())}catch(i){Ge.error("getSubTotal: error:",i)}}getAmount(t,e){let i=0,a=this.propPipe.transform(t,"lines.data");if(R(a)&&a.length===1){let r=this.propPipe.transform(t,"lines.data[0].amount");R(r)&&r.toString()&&(i=this.propPipe.transform(t,"lines.data[0].amount"))}else if(R(a)&&a.length===2){let r=this.propPipe.transform(t,"lines.data[1].amount");R(r)&&r.toString()&&(i=this.propPipe.transform(t,"lines.data[1].amount"))}else e&&e?.receipt?.amount?i=e?.receipt?.amount*e?.receipt?.quantity:e&&e.amount&&(i=e.amount);return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(i,this.currency).toFixed(2)):this.checkAmountByCurrency(i,this.currency).toFixed(2)}getTaxAmount(t,e,i){let a=0,r=this.propPipe.transform(t,"tax");if(r)a=B(r);else{let n=this.propPipe.transform(t,"total_tax_amounts[0].amount");if(R(n)&&n.toString())a=B(n);else{let c=this.propPipe.transform(t,"total_taxes[0].amount");if(R(c)&&c.toString())a=B(c);else if(e.checkoutSession?.total_details?.amount_tax)a=e.checkoutSession?.total_details?.amount_tax;else if(e?.receipt?.taxPercent>-1){let u=i?parseFloat((i.match(/([0-9]+(?:\.[0-9]+)?)/)||["","0"])[1]):0;u=u&&this.zeroDecimalService.isZeroDecimalCurrency(this.currency)?u:u*100;let d=(e?.receipt?.quantity||1)*e?.receipt?.amount-u;e?.inclusive?a=d-d/(1+e?.receipt?.taxPercent/100):e?.inclusive||(a=d*e?.receipt?.taxPercent/100)}}}return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(a,this.currency).toFixed(2)):this.checkAmountByCurrency(a,this.currency).toFixed(2).concat(" ",this.currency.toUpperCase())}getInvoiceName(t,e,i){let a="",r=0;return t?.invoice?.lines?.data?.length>1&&(r=1),e?.lines?.data?.[r]?.description?a=pt(this.propPipe.transform(t,`invoice.lines.data[${r}].description`)):t?.receipt?.title?a=t.receipt.title:t?.pfInvoice?.title?a=t.pfInvoice.title:t&&t.metadata&&t.metadata["Invoice Name"]?a=t.metadata["Invoice Name"]:this.propPipe.transform(e,`lines.data[${r}].metadata['Invoice Name']`)?a=pt(this.propPipe.transform(e,`lines.data[${r}].metadata['Invoice Name']`)):this.propPipe.transform(e,`lines.data[${r}].plan.nickname`)?a=pt(this.propPipe.transform(e,`lines.data[${r}].plan.nickname`)):this.propPipe.transform(i,"metadata['Invoice Name']")?a=pt(this.propPipe.transform(i,"metadata['Invoice Name']")):t&&t.description?a=t.description:t&&t.statement_descriptor?a=t.statement_descriptor:t&&t.dis
40playName&&(a=`Payment to ${t.displayName}`),t?.invoice?.subscription&&t?.invoice?.lines?.data?.length>0&&(a=a.concat(` 41`,`${ct.default.unix(t.invoice.lines.data[r].period.start).format("MMM DD")} - ${ct.default.unix(t.invoice.lines.data[r].period.end).format("MMM DD")}, ${ct.default.unix(t.invoice.lines.data[r].period.end).format("YYYY")}`)),a}getQuantity(t,e){let i=1;if(t&&t.receipt&&t.receipt.quantity)i=t.receipt.quantity;else{let a=this.propPipe.transform(e,"lines.data");if(R(a)&&a.length===1){let r=this.propPipe.transform(e,"lines.data[0].quantity ");if(r)i=B(r);else{let n=this.propPipe.transform(e,"lines.data[0].metadata.quantity ");n&&(i=B(n))}}else if(R(a)&&a.length===2){let r=this.propPipe.transform(e,"lines.data[1].quantity ");if(r)i=B(r);else{let n=this.propPipe.transform(e,"lines.data[1].metadata.quantity ");n&&(i=B(n))}}}return i}calculateTotalRefundAmount(t){this.refundTotal=0;let e=this.propPipe.transform(t,"refunds.data");t.refunds&&R(e)&&e.length>0&&t.refunds.data.forEach(i=>{this.refundTotal+=i.amount})}getChargeInformationBody(t,e,i,a,r){let n=[[{text:"#",margin:[0,10,0,5],fontSize:10,fillColor:"#d0d3d7"},{text:this.translateService.instant("receipts.label.description"),margin:[0,10,0,5],fontSize:10,fillColor:"#d0d3d7",bold:!0},{text:this.translateService.instant("receipts.label.qty"),margin:[0,10,15,5],fontSize:10,fillColor:"#d0d3d7",bold:!0},{text:this.translateService.instant("receipts.label.unit_price")+` (${this.currency.toUpperCase()})`,margin:[0,10,0,5],fontSize:10,fillColor:"#d0d3d7",bold:!0,alignment:"right"},{text:this.translateService.instant("receipts.label.amount")+` (${this.currency.toUpperCase()})`,margin:[0,10,10,5],alignment:"right",fontSize:10,fillColor:"#d0d3d7",bold:!0}]];if(t?.checkoutSession?.line_items?.data?.length>0)t.checkoutSession.line_items.data.forEach((c,u)=>{let d=[{text:u+1+".",bold:!0,fontSize:10,margin:[0,5,0,5]},{text:(t?.checkoutSession?.metadata?.isMultipleProducts||c?.metadata?.isMultipleProducts||c?.price?.metadata?.isMultipleProducts?this.getMultipleProductGroupName(c?.price,t?.receipt):"")+(c?.plan?.nickname||c.description),bold:!0,fontSize:10,margin:[0,5,0,5]},{text:c.quantity,fontSize:10,margin:[0,5,15,5]},{text:`${c.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${c.currency.toUpperCase()==="AED"?c.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(c?.price?.unit_amount||c?.pricing?.unit_amount_decimal,c.currency,t?.checkoutSession?.currency_conversion).toFixed(2)):this.checkAmountByCurrency(c?.price?.unit_amount||c?.pricing?.unit_amount_decimal,c.currency,t?.checkoutSession?.currency_conversion).toFixed(2)}`,fontSize:10,margin:[0,5,0,5],alignment:"right"},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(c.amount_subtotal,c.currency).toFixed(2)):this.checkAmountByCurrency(c.amount_subtotal,c.currency).toFixed(2)}`,fontSize:10,margin:[0,5,10,5],alignment:"right"}];n.push(d)});else if(t?.invoice?.line_items?.length>0)t.invoice.line_items.forEach((c,u)=>{let d=[{text:u+1+".",bold:!0,fontSize:10,margin:[0,5,0,5]},{text:(t?.metadata?.isMultipleProducts||c?.metadata?.isMultipleProducts||c?.price?.metadata?.isMultipleProducts?this.getMultipleProductGroupName(c?.price,t?.receipt):"")+(c?.price?.nickname||c?.price?.product?.name||c.description),bold:!0,fontSize:10,margin:[0,5,0,5]},{text:c.quantity,fontSize:10,margin:[0,5,15,5]},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(c?.price?.unit_amount?c?.price?.unit_amount:c?.amount,c?.currency).toFixed(2)):this.checkAmountByCurrency(c?.price?.unit_amount?c?.price?.unit_amount:c?.amount,c?.currency).toFixed(2)}`,fontSize:10,margin:[0,5,0,5],alignment:"right"},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(c.amount,c.currency).toFixed(2)):this.checkAmountByCurrency(c.amount,c.currency).toFixed(2)}`,fontSize:10,margin:[0,5,10,5],alignment:"right"}];n.push(d)});else if(t?.invoice?.lines?.data?.length>0)t.invoice.lines.data.forEach((c,u)=>{let d=[{text:u+1+".",bold:!0,fontSize:10,margin:[0,5,0,5]},{text:(t?.invoice?.metadata?.isMultipleProducts||c?.metadata?.isMultipleProducts||c?.price?.metadata?.isMultipleProducts?this.getMultipleProductGroupName(c?.price,t?.receipt):"")+(c?.plan?.nickname??c?.description),bold:!0,fontSize:10,margin:[0,5,0,5]},{text:c.quantity,fontSize:10,margin:[0,5,15,5]},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(c?.price?.unit_amount||c?.pricing?.unit_amount_decimal,c.currency).toFixed(2)):this.checkAmountByCurrency(c?.price?.unit_amount||c?.pricing?.unit_amount_decimal,c.currency).toFixed(2)}`,fontSize:10,margin:[0,5,0,5],alignment:"right"},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(c.amount,c.currency).toFixed(2)):this.checkAmountByCurrency(c.amount,c.currency).toFixed(2)}`,fontSize:10,margin:[0,5,10,5],alignment:"right"}];n.push(d)});else{let c=[{text:"1.",bold:!0,fontSize:10,margin:[0,5,0,5]},{text:this.getInvoiceName(t,e,i),bold:!0,fontSize:10,margin:[0,5,0,5]},{text:this.getQuantity(t,e),fontSize:10,margin:[0,5,15,5]},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getUnitAmount(e,t)}`,fontSize:10,margin:[0,5,0,5],alignment:"right"},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getAmount(e,t)}`,fontSize:10,margin:[0,5,10,5],alignment:"right"}];n.push(c);let u=this.getReceiptProcessingFees(t);if(u){let d=this.formatPdfCurrencyAmount(u.amountCents);n.push([{text:"2.",bold:!0,fontSize:10,margin:[0,5,0,5]},{text:u.name,bold:!0,fontSize:10,margin:[0,5,0,5]},{text:1,fontSize:10,margin:[0,5,15,5]},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${d}`,fontSize:10,margin:[0,5,0,5],alignment:"right"},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${d}`,fontSize:10,margin:[0,5,10,5],alignment:"right"}])}}return n}getDescriptionHeader(t){let e=[];return t?.pfInvoice?.isShowDescription&&t?.pfInvoice?.description!==""&&(e=[{text:this.translateService.instant("invoice.label.description"),bold:!0,alignment:"center",fontSize:16,fillColor:"#f4f6fa",color:"",margin:[15,5,0,5],border:[!1,!0,!1,!0]}]),e}getInvoiceDescription(t){let e="";return t?.pfInvoice?.isShowDescription&&t?.pfInvoice?.description!==""&&(e=Me(t.pfInvoice.description)),(0,Ze.default)(Ae(e))}getDiscountAmount(t,e){let i=at(this.currency.toUpperCase());if(this.propPipe.transform(t,"discount.coupon.amount_off"))return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(t.discount.coupon.amount_off,this.currency).toFixed(2)):i+this.checkAmountByCurrency(t.discount.coupon.amount_off,this.currency).toFixed(2).concat(" ",this.currency.toUpperCase());if(this.propPipe.transform(t,"discount.coupon.percent_off"))return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(t.discount.coupon.percent_off/100*(t.subtotal-e),this.currency).toFixed(2)):i+this.checkAmountByCurrency(t.discount.coupon.percent_off/100*(t.subtotal-e),this.currency).toFixed(2).concat(" ",this.currency.toUpperCase())}getDiscountAmountFromCharge(t,e){let i=at(this.currency.toUpperCase());
41if(t){if(this.propPipe.transform(t,"receipt.amount_off"))return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(t.receipt.amount_off,this.currency,t?.checkoutSession?.currency_conversion).toFixed(2)):i+this.checkAmountByCurrency(t.receipt.amount_off,this.currency,t?.checkoutSession?.currency_conversion).toFixed(2).concat(" ",this.currency.toUpperCase());if(this.propPipe.transform(t,"receipt.percent_off")){e&&t?.checkoutSession?.currency_conversion&&t?.checkoutSession?.currency_conversion?.fx_rate&&(e=e*t?.checkoutSession?.currency_conversion?.fx_rate);let a=(t?.receipt?.quantity||1)*t?.receipt?.amount,r=(t.checkoutSession.amount_subtotal??a??t.amount??0)-e;return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(t.receipt.percent_off/100*r,this.currency).toFixed(2)):i+this.checkAmountByCurrency(t.receipt.percent_off/100*r,this.currency).toFixed(2).concat(" ",this.currency.toUpperCase())}}}checkAmountByCurrency(t,e,i){try{return i&&i?.fx_rate&&(t=Math.ceil(t*i?.fx_rate),this.zeroDecimalService.isZeroDecimalCurrency(e)&&(t=t/100)),e?this.zeroDecimalService.isZeroDecimalCurrency(e)?Math.round(t):this.conversionCurrency&&this.zeroDecimalService.isZeroDecimalCurrency(this.currency)?t:t/100:t/100}catch(a){Ge.error("error: checkAmountByCurrency",a)}}getAdditionalFields(t){let e=[],i=[];return t&&t.receipt&&t.receipt.additionalFields&&t.receipt.additionalFields!==void 0&&(t.receipt.additionalFields.forEach(function(a){a.display===!0&&i.push(a)}
41),i.forEach(a=>{for(let r in a)if(r!=="display"){let n=a[r].toString().length>27?`${a[r].toString().slice(0,20)}...`:a[r].toString();e.push([{text:r.toString()+":",fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:n,fontSize:11,margin:[5,0,0,0],alignment:"right"}])}})),e}getTermsOfServicesHeader(t){let e=[];return t.isShowTermsOfService&&t.termsOfServices!==""&&(e=[{text:this.translateService.instant("receipts.label.terms_of_service"),bold:!0,alignment:"center",fontSize:16,fillColor:"#f4f6fa",color:"",margin:[15,5,0,5],border:[!1,!0,!1,!0]}]),e}getTermsOfServices(t){let e="";return t.isShowTermsOfService&&t.termsOfServices!==""&&(e=t.termsOfServices),e}getAdditionalFieldsHeading(t){let e=[];return ot(t.receipt?.additionalFields)||(e=[{text:this.translateService.instant("receipts.label.additional_fields"),bold:!0,alignment:"center",fontSize:16,fillColor:"#f4f6fa",color:"",margin:[15,5,0,5],border:[!1,!0,!1,!0]}]),e}getHeaderBody(t,e,i){let a=this.getReceiptNumber(t,e,i),r=[];if(a&&r.push([{text:this.translateService.instant("receipts.label.invoice_number")+":",fontSize:11,bold:!0},{text:"#"+a,fontSize:11,bold:!0,alignment:"right"}]),this.headerText==="receipts.label.receipt"){r.push([{text:this.translateService.instant("receipts.label.payment_date")+":",fontSize:11,bold:!0},{text:this.getPaymentDate(t),fontSize:11,alignment:"right"}],[{text:this.translateService.instant("receipts.label.payment_method")+":",fontSize:11,bold:!0},{text:this.getPaymentMethod(t),fontSize:11,alignment:"right"}]);let n=t?.paymentProgress;n&&n.total>1&&n.current>0&&r.push([{text:this.translateService.instant("receipts.label.payment_progress")+":",fontSize:11,bold:!0,alignment:"right"},{text:`${n.current} of ${n.total} ${this.translateService.instant("receipts.label.payments")}`,fontSize:11,alignment:"right"}])}else r.push([{text:this.translateService.instant("receipts.label.date_of_issue")+":",fontSize:11,bold:!0},{text:this.getPaymentDate(t),fontSize:11,alignment:"right"}],[{text:this.translateService.instant("receipts.label.date_due")+":",fontSize:11,bold:!0},{text:this.getPaymentDate(t),fontSize:11,alignment:"right"}]);return r.push(...this.getAdditionalFields(t)),r}getDescription(t,e){let i=0;return t?.metadata&&t?.metadata["Invoice Name"]?t?.metadata["Invoice Name"]:t?.pfInvoice?.title?t?.pfInvoice?.title:((t?.checkoutSession?.line_items?.data?.length>1||e?.lines?.data?.length>1)&&(i=1),t?.checkoutSession?.line_items?.data?.[i]?.description||t?.description||e?.lines?.data[i]?.description)}getBusinessDetail(t,e,i){return[[{text:`${i?.business_profile?.support_address?.line1?i?.business_profile?.support_address?.line1+` 42`:""} ${i?.business_profile?.support_address?.line2?i?.business_profile?.support_address?.line2+` 43`:""} ${i?.business_profile?.support_address?.city?i?.business_profile?.support_address?.city+",":""} ${i?.business_profile?.support_address?.state&&i?.business_profile?.support_address?.country!=="AE"?i?.business_profile?.support_address?.state:""} ${i?.business_profile?.support_address?.postal_code?i?.business_profile?.support_address?.postal_code:""} 44 ${i?.business_profile?.support_address?.country?i?.business_profile?.support_address?.country+` 45`:""}`,margin:[0,5,0,0],fontSize:10},{text:"",margin:[15,5,0,0]},{text:"",margin:[0,0,0,0]},{text:"",margin:[0,0,0,0]}]]}generateBillingReceipt(t,e,i,a,r,n,c){this.headerText="receipts.label.receipt",this.statusText="receipts.label.paid_on",a||(this.headerText="receipts.label.invoice",this.statusText="receipts.label.due"),t&&t.currency?this.currency=t.currency:e&&e.currency?this.currency=e.currency:i&&i.currency?this.currency=i.currency:t&&t.receipt&&t.receipt.currency&&(this.currency=t.receipt.currency),this.currency&&(this.currencySymbol=at(this.currency.toUpperCase())),t?.checkoutSession?.currency_conversion?.source_currency&&(this.conversionCurrency=t?.checkoutSession?.currency_conversion?.source_currency,this.conversionCurrencySymbol=at(t?.checkoutSession?.currency_conversion?.source_currency.toUpperCase())),this.calculateTotalRefundAmount(t);
45let u={pageMargins:[30,5,30,90],pageSize:"LETTER",footer:(d,_)=>{let f=[];return d===1&&t?.checkoutSession?.currency_conversion&&f.push({alignment:"justify",table:{widths:["100%"],body:[[{text:`${this.translateService.instant("receipts.label.rate")}: ${this.currencySymbol} 1.00 ${this.currency.toUpperCase()} = ${this.conversionCurrencySymbol} ${t?.balance_transaction?.exchange_rate} ${t?.checkoutSession?.currency_conversion?.source_currency.toUpperCase()}`,alignment:"right",fontSize:10,color:"#333",margin:[0,0,15,1]}]]},layout:"noBorders"}),f.push({alignment:"justify",table:{widths:["100%"],body:[[{text:this.translateService.instant("receipts.label.thank_you_for_your_business").toUpperCase(),alignment:"center",fontSize:10,bold:!0,fillColor:"#f4f6fa",color:"grey",margin:d===1&&t?.checkoutSession?.currency_conversion?[0,10,0,10]:[0,22,0,10],border:[!1,!1,!1,!0]}]]},layout:"noBorders"},{alignment:"justify",table:{widths:["41%","59%"],body:[[{image:Ie.LOGO_BASE_64,width:15,alignment:"right",fillColor:"#f4f6fa",margin:[0,2,0,15]},{text:this.translateService.instant("receipts.label.powered_by_payfunnels").toUpperCase(),fontSize:10,bold:!0,fillColor:"#f4f6fa",color:"grey",margin:[0,5,0,0],border:[!1,!1,!1,!0]}]]},layout:"noBorders"}),f},content:[this.getHeader(e,t,n,c,i),{layout:"noBorders",table:{widths:["80%","20%"],layout:"noBorders",body:[[[{table:{headerRows:1,widths:this.getWidth(t,e,i),body:this.getBillingShippingAddress(t,e,i)},layout:"noBorders"}],[]]]}},{margin:[0,20,0,0],table:{headerRows:1,widths:["3%","45%","14%","auto","*"],body:this.getChargeInformationBody(t,e,i,a,r)},layout:{hLineWidth:function(d,_){return d===0||d===1?0:.5},hLineColor:function(d,_){return d===0||d===1?"transparent":"#cccccc"},vLineWidth:function(){return 0}}},[{margin:[0,20,0,0],alignment:"right",table:{widths:["40%","*"],body:[[{},[{table:{widths:["*","40%"],body:this.getChargeTotalBody(t,e,i,a)},margin:[0,0,0,0],layout:"noBorders",alignment:"right"}]]]},layout:"noBorders"}],{alignment:"justify",table:{widths:["100%"],body:[this.getDescriptionHeader(t)]},pageOrientation:"portrait",pageBreak:t?.pfInvoice?.isShowDescription?"before":""},{stack:[this.getInvoiceDescription(t)],margin:[10,10,10,10],fontSize:12,alignment:"justify"},{alignment:"justify",table:{widths:["100%"],body:[this.getTermsOfServicesHeader(t)]},pageOrientation:"portrait",pageBreak:t.isShowTermsOfService?"before":""},{stack:[this.getTermsOfServices(t)],margin:[10,10,10,10],fontSize:12,alignment:"justify"}]};return Qt.default.createPdf(u,null)}getReceiptProcessingFeeBaseMajor(t){let e=t?.receipt;if(!e?.amount)return 0;let i=e.quantity||1,a=e.amount*i,r=this.checkAmountByCurrency(a,this.currency)??0;e.amount_off?r-=this.checkAmountByCurrency(e.amount_off,this.currency)??0:e.percent_off&&(r-=r*e.percent_off/100);let n=e.metadata;return n?.checkoutDiscountAmount!=null&&!e.amount_off&&!e.percent_off&&(r-=Number(n.checkoutDiscountAmount)),Math.max(0,parseFloat(r.toFixed(2)))}majorAmountToCents(t){return this.zeroDecimalService.isZeroDecimalCurrency(this.currency)?Math.round(t):Math.round(t*100)}getReceiptProcessingFees(t){let e=t?.receipt?.processingFees;if(!e)return null;let i=0;if(e.isUseAmount===!0){if(e.amount==null)return null;i=Number(e.amount)}else{if(e.percentage==null)return null;i=this.getReceiptProcessingFeeBaseMajor(t)*Number(e.percentage)/100,this.zeroDecimalService.isZeroDecimalCurrency(this.currency)&&(i=Math.round(i))}return!Number.isFinite(i)||i<.01?null:{name:e.name?.trim()||"Processing fees",amountCents:this.majorAmountToCents(i)}}formatPdfCurrencyAmount(t){return this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(t,this.currency).toFixed(2)):this.checkAmountByCurrency(t,this.currency).toFixed(2)}getProcessingFeesAmount(t){if(t?.receipt?.setupfees&&t.receipt.setupfees!==0)return 0;let e=this.getReceiptProcessingFees(t);if(e)return e.amountCents;if(!t?.metadata?.processingFeeId&&!t.receipt?.processingFees)return 0;let i=[t?.checkoutSession?.line_items?.data,t?.invoice?.line_items,t?.invoice?.lines?.data];for(let a of i)if(a?.length>1){let r=a.filter(n=>{let{product:c}=n?.price||{};
45return c?.id===t?.metadata?.processingFeeId||t?.receipt?.processingFees?.id===c?.id});if(r.length>0)return r[0]?.price?.unit_amount||0}return 0}getChargeTotalBody(t,e,i,a=!0){let r=[];r.push([{text:this.translateService.instant("receipts.label.sub_total"),fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getSubTotal(e,t)}`,fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}]);let n=null;if(e&&e.discount){let u="",d="",_=this.getProcessingFeesAmount(t);e?.discount?.coupon?.amount_off?(u=e.discount.coupon.id,d=this.getDiscountAmount(e,_)):e?.discount?.coupon?.percent_off&&(u=e.discount.coupon.id+" ("+e.discount.coupon.percent_off+"% "+this.translateService.instant("receipts.label.off")+")",d=this.getDiscountAmount(e,_)),n=d,r.push([{text:u,fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:d?"-"+d:"",fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}])}else if(t?.checkoutSession?.discounts?.length&&t?.receipt?.coupon&&(t?.receipt?.percent_off||t?.receipt?.amount_off)){let u="",d="",_=this.getProcessingFeesAmount(t);t?.receipt?.amount_off?(u=t?.receipt?.coupon,d=this.getDiscountAmountFromCharge(t,_)):t?.receipt?.percent_off&&(u=t?.receipt?.coupon+" ("+t?.receipt?.percent_off+"% "+this.translateService.instant("receipts.label.off")+")",d=this.getDiscountAmountFromCharge(t,_)),n=d,r.push([{text:u,fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:d?"-"+d:"",fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}])}else if(t?.provider==="paypal"&&t?.receipt?.coupon&&(t?.receipt?.percent_off||t?.receipt?.amount_off)){let u="",d="",_=this.getProcessingFeesAmount(t);t?.receipt?.amount_off?(u=t?.receipt?.coupon,d=this.getDiscountAmountFromCharge(t,_)):t?.receipt?.percent_off&&(u=t?.receipt?.coupon+" ("+t?.receipt?.percent_off+"% "+this.translateService.instant("receipts.label.off")+")",d=this.getDiscountAmountFromCharge(t,_)),n=d,r.push([{text:u,fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:d?"-"+d:"",fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}])}t&&t.receipt&&t.receipt?.taxName&&t.receipt.taxPercent>-1?r.push([{text:t.receipt?.taxName?t.receipt.taxName.concat(" (",t.receipt.taxPercent,"%",t?.inclusive?" "+this.translateService.instant("receipts.label.inclusive"):"",")"):"TAX",fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getTaxAmount(e,t,n)}`,fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}]):t?.invoice?.tax>0&&r.push([{text:"TAX",fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getTaxAmount(e,t)}`,fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}]);let c=this.propPipe.transform(t,"refunds.data");return t.refunds&&R(c)&&c.length>0&&this.headerText==="receipts.label.receipt"&&t.refunds.data.forEach(u=>{r.push([{text:this.translateService.instant("receipts.label.issued_refund_on")+" "+(0,ct.default)(u.created*1e3).format("LL"),fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0,noWrap:!0},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.currency.toUpperCase()==="AED"?this.currency.toUpperCase().concat(" ",this.checkAmountByCurrency(u.amount,this.currency).toFixed(2)):this.checkAmountByCurrency(u.amount,this.currency).toFixed(2).concat(" ",this.currency.toUpperCase())}`,fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}])}),r.push([{text:this.translateService.instant("receipts.label.total"),fontSize:12,margin:[5,5,0,5],alignment:"right",bold:!0,fillColor:"#050436",color:"#fff"},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getTotalAmountPaid(t,e)}`,fontSize:12,margin:[10,5,0,5],alignment:"center",bold:!0,fillColor:"#050436",color:"#fff"}]),r.push([{text:a?this.translateService.instant("receipts.label.amount_paid"):this.translateService.instant("receipts.label.amount_due"),fontSize:11,margin:[0,0,0,0],alignment:"right",bold:!0},{text:`${this.currency.toUpperCase()==="AED"?"":this.currencySymbol} ${this.getTotalAmountPaid(t,e)}`,fontSize:11,margin:[5,0,0,0],alignment:"right",bold:!0}]),r}getMultipleProductGroupName(t,e){if(t?.metadata?.isChildProduct==="true"&&t?.metadata?.groupName&&t?.metadata?.parentProductId)return`${t?.metadata?.groupName} - `;if(t?.product?.metadata?.isChildProduct==="true"&&t?.product?.metadata?.groupName&&t?.product?.metadata?.parentProductId)return`${t?.product?.metadata?.groupName} - `;if(e?.multipleProducts?.length&&t){let i=e?.multipleProducts?.find(a=>a.id===t?.product?.id);return i?.groupName?`${i?.groupName} - `:""}return""}};s.\u0275fac=function(e){return new(e||s)},s.\u0275prov=bt({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o}
45)();var K=o=>parseFloat(Math.max(0,o).toFixed(2));function Qe(o){let{consolidatedTotalMajor:s,processingFeesMajor:p,discountMajor:t,taxPercent:e,quantity:i,taxInclusive:a}=o;if(s<=0||e<=0&&p<=0)return null;let r=Math.max(1,Math.round(i||1)),n=K(s-Math.max(0,p));if(n<=0)return null;if(e<=0){let f=K(n+Math.max(0,t));return{productSubtotalMajor:f,unitAmountMajor:K(f/r),taxMajor:0}}let c=e/100;if(a){let f=K(n+Math.max(0,t)),S=K(f*c/(1+c));return{productSubtotalMajor:f,unitAmountMajor:K(f/r),taxMajor:S}}let u=K(n/(1+c)),d=K(u+Math.max(0,t)),_=K(u*c);return{productSubtotalMajor:d,unitAmountMajor:K(d/r),taxMajor:_}}function xi(o){let{checkoutTaxAmount:s,taxPercent:p,checkoutTaxInclusive:t,checkoutRecurringAmount:e}=o;return s<=0&&p>0&&(t===!0||e!=null)}function Je(o){return o.checkoutTaxAmount>0?!1:xi(o)?!0:o.checkoutRecurringAmount!=null&&Math.max(0,o.processingFeesMajor??0)>=.01}function Ke(o){return Mt.includes(o.toUpperCase())}function it(o,s){return Ke(s)?Math.round(o):Math.round(o*100)}function yt(o,s){return Ke(s)?o:o/100}function bi(o){let s=o?.metadata||{},p=o?.processingFees||{};return{checkoutTotalAmount:s.checkoutTotalAmount!=null?Number(s.checkoutTotalAmount):null,checkoutItemTotal:s.checkoutItemTotal!=null?Number(s.checkoutItemTotal):null,checkoutTaxAmount:Math.max(0,Number(s.checkoutTaxAmount??0)),checkoutTaxInclusive:s.checkoutTaxInclusive===!0,checkoutSetupFeesAmount:Math.max(0,Number(s.checkoutSetupFeesAmount??0)),checkoutDiscountAmount:Math.max(0,Number(s.checkoutDiscountAmount??0)),checkoutRecurringAmount:s.checkoutRecurringAmount!=null?Number(s.checkoutRecurringAmount):null,processingFeesMajor:Math.max(0,Number(p?.calculatedFees??0))}}function Xe(o){if(!W(o)||!o.receipt)return o;let s=o.receipt,p=M(o.currency||s.currency||"usd").toLowerCase(),t=bi(s),e=s.processingFees,i=[],a=0,r=h=>{let v=Math.max(1,Math.round(h.quantity||1)),P=it(h.unitAmountMajor,p),L=P*v,tt=h.productId||`paypal_product_${o.id}_${a}`,ut=`paypal_price_${o.id}_${a}`;i.push({id:`paypal_li_${o.id}_${a}`,object:"line_item",amount:L,currency:p,description:h.description,quantity:v,metadata:h.metadata||{},price:{id:ut,stripeId:ut,currency:p,unit_amount:P,nickname:h.productName||h.description,product:{id:tt,stripeId:tt,name:h.productName||h.description,metadata:Y(Y({provider:"paypal"},h.metadata?.groupName?{groupName:h.metadata.groupName,isChildProduct:"true"}:{}),h.metadata?.parentProductId?{parentProductId:h.metadata.parentProductId}:{})}}}),a+=1},n=F(s.taxPercent),c=Math.max(1,s.isQuantity&&F(s.quantity)>1?F(s.quantity):1),u=t.checkoutRecurringAmount??t.checkoutItemTotal??yt(F(s.amount),p),d=t.processingFeesMajor;d<.01&&t.checkoutItemTotal!=null&&t.checkoutRecurringAmount!=null&&t.checkoutItemTotal>t.checkoutRecurringAmount&&(d=Math.max(0,t.checkoutItemTotal-t.checkoutRecurringAmount));let f=Je({checkoutTaxAmount:t.checkoutTaxAmount,taxPercent:n,checkoutTaxInclusive:t.checkoutTaxInclusive,checkoutRecurringAmount:t.checkoutRecurringAmount,processingFeesMajor:d})&&u>0?Qe({consolidatedTotalMajor:u,processingFeesMajor:d,discountMajor:t.checkoutDiscountAmount,taxPercent:n,quantity:c,taxInclusive:o.inclusive===!0}):null,S=s.multipleProducts;if(S?.length){for(let h of S)r({description:h.description||h.name||M(s.title)||"Item",quantity:h.quantity||1,unitAmou
45ntMajor:Number(h.amount||0),productId:h.id,productName:h.name||h.description||M(s.title)||"Item",metadata:Y(Y({isMultipleProducts:"true"},h.groupName?{groupName:h.groupName}:{}),h.parentProductId?{parentProductId:h.parentProductId}:{})});o.metadata=dt(Y({},o.metadata||{}),{isMultipleProducts:"true"})}else{let h=c,v=yt(F(s.amount),p),P=f?f.unitAmountMajor:h>1?v/h:v;r({description:M(s.description)||M(s.title)||"Payment",quantity:h,unitAmountMajor:P,productName:M(s.title)||M(s.description)||"Payment"})}let g=t.checkoutSetupFeesAmount>=.01?t.checkoutSetupFeesAmount:F(s.setupfees)>0?yt(F(s.setupfees),p):0;if(g>=.01&&r({description:M(s.setup_fees_name)||"Setup Fee",quantity:1,unitAmountMajor:g,metadata:{isSetupFees:!0}}),d>=.01){let h=e?.id||`paypal_pf_${o.id}`;r({description:e?.name||"Processing Fee",quantity:1,unitAmountMajor:d,productId:h,productName:e?.name||"Processing Fee",metadata:{processingFeeId:h}}),o.metadata=dt(Y({},o.metadata||{}),{processingFeeId:h})}let w=t.checkoutTaxAmount>0?it(t.checkoutTaxAmount,p):0,E=i.reduce((h,v)=>h+yt(F(v.amount),p),0);if(f)w=f.taxMajor>0?it(f.taxMajor,p):0;else if(w===0&&n>0){let h=Math.max(0,E-t.checkoutDiscountAmount-d),v=parseFloat((h*n/100).toFixed(2));w=v>0?it(v,p):0}let D=it(E,p),I=t.checkoutDiscountAmount>0?it(t.checkoutDiscountAmount,p):0,y=o.invoice||{};y.line_items?.length||(y.line_items=i),y.subtotal=D,w>0&&(y.tax=w,y.total_tax_amounts=[{amount:w,inclusive:!1,tax_rate:""}]),!y.discount&&(s.coupon||F(s.percent_off)>0||F(s.amount_off)>0)&&(y.discount={coupon:Y(Y({id:M(s.coupon)||"paypal_coupon"},F(s.percent_off)>0?{percent_off:F(s.percent_off)}:{}),F(s.amount_off)>0?{amount_off:F(s.amount_off)}:{})}),o.invoice=y;let m=i.map(h=>({id:h.id,description:h.price?.product?.name||h.description,quantity:h.quantity,currency:h.currency,amount_subtotal:h.amount,price:h.price,metadata:h.metadata}));if(o.checkoutSession=dt(Y({},o.checkoutSession||{}),{id:o.checkoutSession?.id||`paypal_cs_${o.id}`,amount_subtotal:D,total_details:{amount_tax:w,amount_discount:I},line_items:{data:m},metadata:o.metadata}),o.amount==null){let h;if(t.checkoutTotalAmount!=null)h=it(t.checkoutTotalAmount,p);else{let v=E;w>0&&(v+=yt(w,p)),h=it(Math.max(0,parseFloat(v.toFixed(2))),p)}o.amount=h,o.amount_captured=h}return Le({payment:o,receipt:s}),o}function W(o){if(!o||typeof o!="object")return!1;let s=o,p=s.metadata||{};return s.payment_method_details?.type==="paypal"||p.paymentProvider==="paypal"||typeof p.paypalOrderId=="string"||typeof p.paypalCaptureId=="string"}function Jt(o,s){if(s)return s;let p=o?.metadata||{};return M(p["Receipt ID"])}function We(o){let s=o?.metadata||{},p=M(s.paypalOrderId);if(p)return p.toUpperCase();let t=M(o?.id);return t?t.toUpperCase():""}function ti(o,s,p){let t=p||o?.receipt||{},e=o?.billing_details||{};return dt(Y({},s||{}),{name:M(s?.name)||M(e.name)||M(t.name)||M(o?.customer?.name),email:M(s?.email)||M(e.email)||M(t.email)||M(o?.customer?.email)})}function Rt(o){return!!o&&typeof o=="object"&&Object.keys(o).length>0}var Si=["image"];function vi(o,s){if(o&1&&(l(0,` 46 `),x(1,"h1",4),l(2),b(),l(3,` 47 `)),o&2){let p=j();A(2),V(` 48 `,p.displayName,` 49 `)}}function Pi(o,s){o&1&&(l(0,` 50 `),U(1,"div",5),l(2,` 51 `))}function Ci(o,s){o&1&&(l(0,` 52 `),U(1,"img",10),l(2,` 53 `))}function wi(o,s){o&1&&(l(0,` 54 `),U(1,"img",10),l(2,` 55 `))}function ki(o,s){o&1&&(l(0,` 56 `),U(1,"img",11),l(2,` 57 `))}function Ai(o,s){o&1&&(l(0,` 58 `),x(1,"h2",12),l(2),O(3,"translate"),b(),l(4,` 59 `)),o&2&&(A(2),V(` 60 `,z(3,1,"billings.label.payment_processing"),` 61 `))}function Ii(o,s){o&1&&(l(0,` 62 `),x(1,"h2",13),l(2),O(3,"translate"),b(),l(4,` 63 `)),o&2&&(A(2),V(` 64 `,z(3,1,"billings.label.invoice_paid"),` 65 `))}function Mi(o,s){if(o&1&&(l(0,` 66 `),G(1,Ai,5,3)(2,Ii,5,3)),o&2){let p=j(2);A(),Z(p.paymentStatus==="pending"?1:p.paymentStatus==="succeeded"?2:-1)}}function Ti(o,s){o&1&&(l(0,` 67 `),x(1,"h2",14),l(2,` 68 billings.label.payment_processing 69 `),b(),l(3,` 70 `))}function Ni(o,s){o&1&&(l(0,` 71 `),x(1,"h2",14),l(2,` 72 billings.label.payment_processing 73 `),b(),l(3,` 74 `))}function Ei(o,s){o&1&&(l(0,` 75 `),x(1,"h2",14),l(2,` 76 global.label.success 77 `),b(),l(3,` 78 `))}function Ri(o,s){o&1&&(l(0,` 79 `),x(1,"h2",14),l(2,` 80 global.label.failed 81 `),b(),l(3,` 82 `))}function Fi(o,s){if(o&1&&(l(0,` 83 `),x(1,"span"),l(2),O(3,"titlecase"),b(),l(4,` 84 `)),o&2){let p=j(3);A(2),Ct("",z(3,2,p.brandName)," \u2022\u2022\u2022\u2022 ",p.last4)}}function Oi(o,s){if(o&1&&(l(0,` 85 `),x(1,"span"),l(2),O(3,"uppercase"),b(),l(4,` 86 `)),o&2){let p=j(3);A(2),Dt(z(3,1,p.brandName))}}function zi(o,s){if(o&1&&(l(0,` 87 `),x(1,"div",15),l(2,` 88 `),x(3,"div",16),l(4,` 89 `),x(5,"span",17),l(6),O(7,"translate"),O(8,"titlecase"),b(),l(9,` 90 `),x(10,"span",18),l(11),b(),l(12,` 91 `),b(),l(13,` 92 `),x(14,"div",16),l(15,` 93 `),x(16,"span",17),l(17),O(18,"translate"),O(19,"titlecase"),b(),l(20,` 94 `),x(21,"span",18),l(22),O(23,"date"),b(),l(24,` 95 `),b(),l(25,` 96 `),x(26,"div",16),l(27,` 97 `),x(28,"span",17),l(29),O(30,"translate"),O(31,"titlecase"),b(),l(32,` 98 `),x(33,"span",18),l(34,`
99 `),G(35,Fi,5,4)(36,Oi,5,3),b(),l(37,` 100 `),b(),l(38,` 101 `),b(),l(39,` 102 `)),o&2){let p=j(2);A(6),V(` 103 `,z(8,8,z(7,6,"global.label.receipt_id")),` 104 `),A(5),V(` 105 `,p.invoiceNumber,` 106 `),A(6),V(` 107 `,z(19,12,z(18,10,"invoice.label.payment_date")),` 108 `),A(5),V(` 109 `,z(23,14,p.receiptDetails.timestamp),` 110 `),A(7),V(` 111 `,z(31,18,z(30,16,"global.label.payment_method")),` 112 `),A(6),Z(p.brandName&&p.last4?35:36)}}function Ui(o,s){if(o&1){let p=Pt();l(0,` 113 `),x(1,"button",22),ht("click",function(){mt(p);let e=j(3);return ft(e.navigateToSignIn())}),l(2),O(3,"translate"),b(),l(4,` 114 `)}o&2&&(A(2),V(` 115 `,z(3,1,"billings.label.login_to_view_all_your_invoices"),` 116 `))}function Bi(o,s){if(o&1){let p=Pt();l(0,` 117 `),x(1,"button",23),ht("click",function(){mt(p);let e=j(3);return ft(e.downloadAttachedFile(e.attachment))}),l(2),O(3,"translate"),b(),l(4,` 118 `)}if(o&2){let p=j(3);A(2),Ct(` 119 `,z(3,2,"billings.label.download")," ",p.attachment.Name,` 120 `)}}function $i(o,s){if(o&1){let p=Pt();l(0,` 121 `),x(1,"div",19),l(2,` 122 `),x(3,"div",20),l(4,` 123 `),x(5,"button",21),ht("click",function(){mt(p);let e=j(2);return ft(e.download(e.charge,e.subscription,!1))}),l(6),O(7,"translate"),b(),l(8,` 124 125 `),x(9,"button",21),ht("click",function(){mt(p);let e=j(2);return ft(e.download(e.charge,e.subscription,!0))}),l(10),O(11,"translate"),b(),l(12,` 126 `),b(),l(13,` 127 128 `),G(14,Ui,5,3),G(15,Bi,5,4),b(),l(16,` 129 `)}if(o&2){let p=j(2);A(6),V(` 130 `,z(7,4,"billings.label.download_invoice"),` 131 `),A(4),V(` 132 `,z(11,6,"billings.label.download_receipt"),` 133 `),A(4),Z(p.customerId&&(p.profile!=null&&p.profile.autoSendCustomerInvite)?14:-1),A(),Z(p.attachment&&p.isShowAttachedFile?15:-1)}}function Di(o,s){if(o&1&&(l(0,` 134 `),x(1,"p",24),l(2,` 135 `),x(3,"span"),l(4),O(5,"translate"),b(),l(6,` 136 `),b(),l(7,` 137 `)),o&2){let p=j(3);A(4),V(` 138 `,p.processingMessage||z(5,1,"billings.label.payment_failed_message"),` 139 `)}}function ji(o,s){if(o&1&&(l(0,` 140 `),x(1,"p",24),l(2,` 141 `),x(3,"span"),l(4),b(),l(5,` 142 `),b(),l(6,` 143 `)),o&2){let p=j(3);A(4),Dt(p.processingMessage)}}function Li(o,s){if(o&1&&(l(0,` 144 `),x(1,"div"),l(2,` 145 `),G(3,Di,8,3)(4,ji,7,1),b(),l(5,` 146 `)),o&2){let p=j(2);A(3),Z(p.paymentStatus==="failed"?3:4)}}function qi(o,s){if(o&1&&(l(0,` 147 `),l(1,` 148 `),x(2,"div",6),l(3,` 149 `),x(4,"div",7),l(5,` 150 `),G(6,Ci,3,0)(7,wi,3,0)(8,ki,3,0),b(),l(9,` 151 152 `),G(10,Mi,3,1)(11,Ti,4,0)(12,Ni,4,0)(13,Ei,4,0)(14,Ri,4,0),x(15,"p",8),l(16),O(17,"zerodecimal"),O(18,"number"),x(19,"span",9),l(20),O(21,"uppercase"),b(),l(22,` 153 `),b(),l(23,` 154 155 `),G(24,zi,40,20),G(25,$i,17,8)(26,Li,6,1),b(),l(27,` 156 `)),o&2){let p=j();A(6),Z(p.processingStatus==="succeeded"?6:p.paymentStatus!=="failed"?7:8),A(4),Z(p.processingStatus==="succeeded"?10:p.processingStatus==="pending"?11:p.paymentStatus==="pending"?12:p.paymentStatus!=="failed"&&p.paymentStatus!=="pending"?13:14),A(6),Ct(` 157 `,p.receiptDetails.symbol,` 158 `,jt(18,10,jt(17,7,p.totalAmount,p.receiptDetails.currency),"1.2"),` 159 160 `),A(4),V(` 161 `,z(21,13,p.receiptDetails.currency),` 162 `),A(4),Z(p.processingStatus==="succeeded"&&p.paymentStatus!=="failed"?24:-1),A(),Z(p.processingStatus==="succeeded"?25:26)}}function Vi(o,s){o&1&&(l(0,` 163 `),l(1,` 164 `),x(2,"div",25),l(3,` 165 `),U(4,"div",26),l(5,` 166 `),U(6,"div",27),l(7,` 167 `),U(8,"div",28),l(9,` 168 169 `),x(10,"div",29),l(11,` 170 `),x(12,"div",30),l(13,` 171 `),U(14,"div",31),l(15,` 172 `),U(16,"div",32),l(17,` 173 `),b(),l(18,` 174 `),x(19,"div",30),l(20,` 175 `),U(21,"div",33),l(22,` 176 `),U(23,"div",34),l(24,` 177 `),b(),l(25,` 178 `),x(26,"div",30),l(27,` 179 `),U(28,"div",34),l(29,` 180 `),U(30,"div",31),l(31,` 181 `),b(),l(32,` 182 `),b(),l(33,` 183 184 `),x(34,"div",19),l(35,` 185 `),l(36,` 186 `),x(37,"div",20),l(38,` 187 `),U(39,"div",35),l(40,` 188 `),U(41,"div",35),l(42,` 189 `),b(),l(43,` 190 191 `),l(44,` 192 `),U(45,"div",35),l(46,` 193 `),b(),l(47,` 194 `),b(),l(48,` 195 `))}var $=new kt("ReceiptPageComponent"),Hi=Object.fromEntries(Ne.map(o=>[o.name,o]));function ei(o){let s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);if(!s)return"";let p=parseInt(s[1],16),t=parseInt(s[2],16),e=parseInt(s[3],16);return`${p}, ${t}, ${e}`}var ii=(()=>{let s=class s{constructor(){this.receiptService=N(Nt),this.spinnerService=N(ze),this.route=N(ye),this.propPipe=N(Tt),this.invoiceService=N(Be),this.planService=N(Re),this.eventLogService=N(Ce),this.location=N(ue),this.router=N(_e),this.authenticationService=N(xe),this.routerExtService=N(ke),this.anonymousUserService=N($e),this.i18nService=N(we),this.billingNewInvoiceReceiptPdfService=N(Ye),this.paymentProgressService=N(qe),this.translateService=N(At),this.receiptDetails={},this.displayName="",this.businessLogo="",this.refund=0,this.notCompleted3ds=!1,this.today=new Date,this.additionalFields=[],this.additionalFieldsInfo={},this.totalAmount=0,this.attachment=null,this.isShowAttachedFile=!0,this.previousUrl="",this.customerId=null,this.checkoutSession=null,this.isShowTotalAmount=!0,this.processingMessage="",this.processingStatus="succeeded",this.isShowReceipt=!1,this.paymentProgress=null,this.currentTheme=Lt(()=>{let t=this.invoiceStore?.themeName??"payfunnels-theme-1";return Hi[t]}),this.themeStyles=Lt(()=>
195{let t=this.currentTheme();return{"--theme-color":t?.main,"--theme-hover-color":t?.hover,"--theme-color-rgb":ei(t?.main||"#6366f1")}})}get currentLanguage(){return this.i18nService.language}get languages(){return this.i18nService.supportedLanguages}ngOnInit(){return J(this,null,function*(){if(this.paymentProgress=null,this.authenticationService.removeSession("sessionId"),this.authenticationService.removeSession("stripeUniversalElementKey"),this.receiptService.getIp().then(e=>{this.ip=e.ip}).catch(e=>{$.debug("getIp: error",e)}),this.route&&this.route.snapshot&&this.route.snapshot.params&&this.route.snapshot.params.id?this.chargeId=this.route.snapshot.params.id:this.route&&this.route.snapshot&&this.route.snapshot.queryParams&&this.route.snapshot.queryParams.id&&(this.chargeId=this.route.snapshot.queryParams.id),this.route&&this.route.snapshot&&this.route.snapshot.queryParams&&this.route.snapshot.queryParams.r?this.receiptId=this.route.snapshot.queryParams.r:this.route&&this.route.snapshot&&this.route.snapshot.params&&this.route.snapshot.params.r&&(this.receiptId=this.route.snapshot.params.r),this.receiptId==="showError"&&(this.notCompleted3ds=!0,setTimeout(()=>{window.location.href="https://mail.google.com"},3e3)),this.route&&this.route.snapshot&&this.route.snapshot.queryParams&&this.route.snapshot.queryParams.userId&&(this.userId=this.route.snapshot.queryParams.userId),!this.chargeId&&!this.receiptId&&!this.userId){this.redirectTo404();return}try{yield this.anonymousUserService.loginAnonymousUser()}catch(e){this.spinnerService.hide(),$.error("loginAnonymousUser Error:",e);return}let t=this.authenticationService.getSession("profile");if(this.businessId=t?.business?.id||null,this.chargeId&&!t)try{let e=yield this.receiptService.getBusinessDetails({id:this.chargeId}),i=H(e.data);this.profileTag=i?.getBusinessDetails?.tag}catch(e){this.spinnerService.hide(),$.error("getBusinessDetails",e)}yield this.loadData(),this.eventLogService.track("[ReceiptPageComponent]: Initialize Receipt page",{email:this.charge?.customer?.email,currency:this.receiptDetails?.currency}),this.spinnerService.hide()})}ngAfterViewInit(){this.eventLogService.track&&this.eventLogService.track("[ReceiptPageComponent]: checkout page initialize",{},{IPAddress:this.ip})}redirectTo404(){this.spinnerService.hide(),this.router.navigate(["/404"])}setLanguage(t){this.i18nService.language=t}loadData(){return J(this,null,function*(){if(this.paymentProgress=null,this.chargeId&&this.chargeId!=="showError"){let t={},e={id:this.chargeId};if(this.userId)try{let{data:i}=yield this.receiptService.receiptDetails(e);t=H(i).receiptDetails,t?.charge?.status&&(this.paymentStatus=t.charge.status),t?.checkoutSession&&(this.checkoutSession=t.checkoutSession,this.paymentStatus="succeeded"),t?.charge?.customer?.id?this.customerId=t?.charge?.customer?.id:t?.checkoutSession?.customer&&(this.customerId=t?.checkoutSession?.customer)}catch(i){this.spinnerService.hide(),$.error("[callApi]:receiptDetails",i)}else try{let{data:i}=yield this.receiptService.receiptDetails(e);t=H(i).receiptDetails,t?.charge?.status&&(this.paymentStatus=t.charge.status,this.processingStatus=t.charge.status,this.paymentStatus==="pending"&&(this.processingMessage=this.translateService.instant("status.label.payment_is_submitted",{days:t.charge.payment_method_details?.type?Te[t.charge.payment_method_details.type]:4}))),this.paymentStatus!=="failed"&&t?.checkoutSession&&(this.checkoutSession=t.checkoutSession,this.paymentStatus="succeeded"),t?.charge?.customer?.id?this.customerId=t.charge.customer.id:t?.checkoutSession?.customer&&(this.customerId=t.checkoutSession.customer),this.route?.snapshot?.queryParams?.errorMessage&&(this.processingMessage=decodeURIComponent(this.route?.snapshot?.queryParams?.errorMessage),this.processingStatus="failed",this.paymentStatus="failed")}catch(i){this.spinnerService.hide(),$.error("[callApi]:receiptDetails",i)}!this.customerId&&t?.charge?.customer?.id?this.customerId=t.charge.customer.id:!this.customerId&&t?.subscription?.customer?.id&&(this.customerId=t.subscription.customer.id);try{let i={};i=this.authenticationService.getSession("profile"),i||(i=yield this.invoiceService.getInvoiceSettingsByTag(this.profileTag)),this.payfunnels_id=i.uid,this.stripeAccount={business_profile:{name:i.supportName,support_address:i.supportAddress,support_email:i.supportEmail,support_phone:i.supportPhone}},ot(i)||(this.profile=H(i),this.setLanguage(this.profile?.language||"en-US")),this.profile&&this.drawImage(),this.displayName=this.profile?.displayName?this.profile.displayName:this.displayName,this.businessLogo=this.profile?.image?this.profile.image:null}catch(i){this.spinnerService.hide(),$.error("profile fetch: ",i)}try{let i={},a=this.authenticationService.getSession("planData");
195if(a)i=H(a);else{let{data:r}=yield this.invoiceService.getPlanData(rt(this.profile,"business.id",null));i=H(r)}this.currentPlan=i.getPlanData,this.currentPlan?.planDetails&&this.planService.setPlan(this.currentPlan.planDetails),this.currentPlan||$.error("No plan found!")}catch(i){$.error("getPlanData",i),this.spinnerService.hide()}if(this.isShowAttachedFile=yield this.planService.checkPlanPermissionToAccessFeature("attachFile.read."+this.payfunnels_id+"."+this.currentPlan.plan),Vt.identify(this.payfunnels_id),Vt.people.set(this.payfunnels_id),t?.charge)this.charge=H(t.charge),this.receiptId=Jt(this.charge,this.receiptId),this.totalAmount=this.getTotalAmountPaid(this.charge,this.charge?.invoice),this.invoiceNumber=this.getReceiptNumber(this.charge,this.charge.invoice,this.charge.customer,this.checkoutSession),this.charge?.invoice?.account_name&&(this.displayName=this.charge.invoice.account_name),this.propPipe.transform(this.charge,"payment_method_details.card")?(this.brandName=this.propPipe.transform(this.charge,"payment_method_details.card.brand"),this.last4=this.propPipe.transform(this.charge,"payment_method_details.card.last4")):(this.brandName=this.propPipe.transform(this.charge,"payment_method_details.type"),this.last4=this.propPipe.transform(this.charge,`payment_method_details.${this.brandName}.last4`)),!this.receiptId&&this.propPipe.transform(t,"charge.invoice.metadata['Receipt ID']")?this.receiptId=t.charge.invoice.metadata["Receipt ID"]:!this.receiptId&&this.propPipe.transform(t,"charge.metadata['Receipt ID']")?this.receiptId=M(this.propPipe.transform(t,"charge.metadata['Receipt ID']")):!this.receiptId&&this.propPipe.transform(t,"charge.invoice.lines.data[0].metadata['Receipt ID']")&&(this.receiptId=M(this.propPipe.transform(t,"charge.invoice.lines.data[0].metadata['Receipt ID']")));else if(t?.subscription)this.subscription=t.subscription,this.subscription?.latest_invoice?(this.totalAmount=this.getTotalAmountPaid(this.charge,this.subscription.latest_invoice),this.displayName=this.subscription.latest_invoice?.account_name):this.subscription?.upcoming_invoice&&(this.totalAmount=this.getTotalAmountPaid(this.charge,this.subscription.upcoming_invoice),this.displayName=this.subscription.upcoming_invoice?.account_name),this.invoiceNumber=this.getReceiptNumber(this.charge,this.subscription?.latest_invoice,this.subscription?.customer,this.checkoutSession),this.propPipe.transform(this.subscription,"default_payment_method.card")?(this.brandName=this.propPipe.transform(this.subscription,"default_payment_method.card.brand"),this.last4=this.propPipe.transform(this.subscription,"default_payment_method.card.last4")):(this.brandName=this.propPipe.transform(this.subscription,"default_payment_method.type"),this.last4=this.propPipe.transform(this.subscription,`default_payment_method.${this.brandName}.last4`)),this.checkoutSession?.subscription?.default_payment_method&&!this.brandName&&!this.last4&&(this.brandName=this.propPipe.transform(this.checkoutSession.subscription,"default_payment_method.card.brand"),this.last4=this.propPipe.transform(this.checkoutSession.subscription,"default_payment_method.card.last4"),this.checkoutSession?.subscription?.default_payment_method?.card||(this.brandName=this.propPipe.transform(this.checkoutSession.subscription,"default_payment_method.type"),this.last4=this.propPipe.transform(this.checkoutSession.subscription,`default_payment_method.${this.brandName}.last4`)));else if(!t?.charge&&!t?.subscription){if(this.checkoutSession?.customer_details?.invoice_prefix&&this.checkoutSession?.customer_details?.next_invoice_sequence){let i=`${this.checkoutSession?.customer_details?.invoice_prefix}-${this.checkoutSession?.customer_details?.next_invoice_sequence?.toString()?.padStart(4,"0")}`;this.invoiceNumber=i.toUpperCase()}this.totalAmount=0}ot(t)||(yield this.loadReceipt(),this.charge?(this.receiptDetails.currency=this.charge.currency,this.receiptDetails.timestamp=this.charge.created*1e3):this.subscription?.latest_invoice?(this.receiptDetails.currency=this.subscription.latest_invoice?.currency,this.receiptDetails.timestamp=this.subscription.latest_invoice.created*1e3):this.subscription?.upcoming_invoice&&(this.receiptDetails.currency=this.subscription.upcoming_invoice.currency,this.receiptDetails.timestamp=this.subscription.upcoming_invoice.created*1e3),!this.receiptDetails.currency&&this.invoiceStore?.currency&&(this.receiptDetails.currency=this.invoiceStore.currency),this.receiptDetails?.currency?this.receiptDetails.symbol=at(this.receiptDetails.currency):this.isShowTotalAmount=!1)}})}loadReceipt(){return J(this,null,function*(){try{let t={};if(this.receiptId&&(t=yield this.receiptService.getReceipt(this.receiptId)),t)this.invoiceId=t.invoiceId,this.receiptDetails=Ht(H(t),{id:this.receiptId,refund:this.refund}),this.charge&&W(this.charge)&&this.receiptDetails?.amount!=null&&this.charge.amount==null&&this.charge.amount_captured==null&&(this.totalAmount=this.resolvePayPalTotalAmountPaidCents(this.charge,this.receiptDetails)),this.clearApolloCache();else{this.clearApolloCache();return}if(this.displayName||(this.displayName=t?.displayName),t?.taxId)try{let r=yield this.invoiceService.getTax(t?.taxId);r&&(this.receiptDetails.inclusive=r?.inclusive)}catch(r){$.error("invoiceService.getTax [Error]:",r),this.spinnerService.hide()}this.receiptDetails.displayName=this.displayName;let e={};
195e=this.authenticationService.getSession("invoiceResponse"),!e&&this.invoiceId&&(e=yield this.invoiceService.getInvoice(this.invoiceId)),this.invoiceStore=H(e),this.isPayPalCustomPlanTrialReceipt()&&(this.totalAmount=0);let i=this.currentTheme()??{main:"#6366f1",hover:"#4f46e5"},a=document.documentElement;a.style.setProperty("--theme-color",i.main),a.style.setProperty("--theme-hover-color",i.hover),a.style.setProperty("--theme-color-rgb",ei(i.main)),e?.trial&&!this.charge&&(this.receiptDetails.trial=e.trial),e?.attachment&&(this.attachment=e?.attachment),this.spinnerService.hide(),this.isShowReceipt=!0}catch(t){$.error("Error:",t),this.eventLogService.track("[ReceiptPageComponent]: loadReceipt",t,{IPAddress:this.ip}),this.spinnerService.hide()}})}drawImage(){let t=new Image;if(t.crossOrigin="Anonymous",this.profile&&this.profile.image!==null){let e=`${wt.API_URL_V3}/api/proxy-image?url=${encodeURIComponent(this.profile.image)}`;t.src=e}t.onload=()=>{let e=document.createElement("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i?.clearRect(0,0,t.width,t.height),i?.drawImage(t,0,0),this.dataUrl=e.toDataURL("image/png")}}getAddress(){let t="";return this.profile&&this.profile.supportAddress&&(t=It(this.profile.supportAddress)),t}getTotalAmountPaid(t,e){if(W(t)&&this.receiptDetails?.amount!=null&&t?.amount==null&&t?.amount_captured==null){let a=this.resolvePayPalTotalAmountPaidCents(t,this.receiptDetails);return t?.amount_refunded&&(a-=t.amount_refunded),a}let i=0;if(t&&t.amount)i=t.amount;else if(t&&t.amount_captured)i=t.amount_captured;else{let a=this.propPipe.transform(e,"total");if(Yt(a)&&a.toString())i=F(a);else{let r=this.propPipe.transform(e,"amount_paid");Yt(r)&&r.toString()&&(i=F(r))}}return t&&t.amount_refunded&&(i=i-t.amount_refunded),i}resolvePayPalTotalAmountPaidCents(t,e){let i=M(t?.currency||e?.currency||"usd"),a=Mt.includes(i.toUpperCase()),r=g=>a?g:g/100,n=g=>Math.round(a?g:g*100),c=e?.metadata||{};if(c.checkoutTotalAmount!=null)return n(Number(c.checkoutTotalAmount));let u=r(F(e?.amount)),d=F(e?.percent_off);d&&(u-=u*d/100);let _=F(e?.amount_off);_&&(u-=r(_));let f=Math.max(0,u),S=F(e?.taxPercent);return S>0&&(f+=u*S/100),n(Math.max(0,parseFloat(f.toFixed(2))))}getReceiptNumber(t,e,i,a={}){if(W(t)){let n=We(t);if(n)return n}let r=" ";return e?.number?r=e.number:i?.invoice_prefix&&t?.id?r=`${i.invoice_prefix}-${t.id.substring(t.id.length-4)}`:t?.id?.indexOf("ch")===-1&&(r=t.id),r===" "&&i?.invoice_prefix&&a?.subscription?.customer?.next_invoice_sequence&&(r=`${i.invoice_prefix}-${a?.subscription?.customer?.next_invoice_sequence?.toString()?.padStart(4,"0")}`),r.toUpperCase()}download(t,e,i){return J(this,null,function*(){let a=t||this.charge;if(W(a)&&!(yield this.ensureReceiptDetailsForDownload(a))){$.error("[ReceiptPageComponent]: PayPal receipt details are unavailable for download"),this.eventLogService.track("[ReceiptPageComponent]: Error on download receipt",{error:"PayPal receipt details unavailable"},{IPAddress:this.ip});return}let r={},n,c;t?(r=H(t),n=t.invoice,c=t.customer):e&&(r.created=e.created,(e.billing_cycle_anchor&&e.status!=="active"||e.billing_cycle_anchor&&e.latest_invoice===null||e.billing_cycle_anchor)&&(r.billing_cycle_anchor=e.billing_cycle_anchor),e.latest_invoice?n=e.latest_invoice:e.latest_invoice===null&&e.upcoming_invoice&&(n=e.upcoming_invoice),c=e.customer);let u={fit:[170,170],margin:[30,50,0,0],imageUrl:null};if(this.dataUrl&&(u.fit=[80,80],u.margin=null,u.imageUrl=this.dataUrl),this.profile?.supportAddress&&(r.support_address=this.profile.supportAddress),this.profile?.isShowTermsOfService&&(r.isShowTermsOfService=this.profile.isShowTermsOfService),this.profile?.termsOfServices&&(r.termsOfServices=this.profile.termsOfServices),this.receiptDetails&&(r.receipt=this.buildReceiptPayloadForPdfDownload()),this.profile?.displayName?r.displayName=this.profile.displayName:this.stripeAccount?.business_profile?.name&&(r.displayName=this.stripeAccount.business_profile.name),(this.invoiceStore?.isShowAdditionalInfo===!0||this.profile?.isShowAdditionalInfo===!0)&&!ot(this.profile.additionalInfo)?r.additionalInfo=this.profile.additionalInfo:r.additionalInfo="",this.invoiceStore?.isShowAddress===!1&&(r.support_address=""),!c&&!t&&Rt(this.checkoutSession)&&this.checkoutSession?.customer_details&&(c=this.checkoutSession.customer_details),W(r)&&(c=ti(r,c,this.receiptDetails)),this.receiptDetails&&(r.inclusive=this.receiptDetails?.inclusive),r.pfInvoice=this.invoiceStore,Rt(this.checkoutSession)&&(r.checkoutSession=this.checkoutSession,r.payment_intent={checkout_session:{metadata:this.checkoutSession.metadata}}),i){if(!this.paymentProgress)try{this.paymentProgress=yield this.paymentProgressService.resolvePaymentProgress(r,{receiptDetails:this.receiptDetails,invoiceStore:this.invoiceStore,subscription:this.subscription,checkoutSession:this.checkoutSession})}catch(d){$.error("Error resolvePaymentProgress",d)}this.paymentProgress&&(r.paymentProgress=this.paymentProgress)}try{Rt(this.checkoutSession)&&(r.checkoutSession=this.checkoutSession),W(r)&&(Xe(r),this.isPayPalCustomPlanTrialReceipt(r)&&this.applyPayPalCustomTrialZeroAmountForPdf(r),r.invoice&&(n=r.invoice));let d=this.billingNewInvoiceReceiptPdfService.generateBillingReceipt(r,n,c,i,this.profile,u,this.stripeAccount),_="Payment-receipt",f=this.getReceiptNumber(t||this.charge,n,c,this.checkoutSession);i&&f?_="Receipt-"+f:!i&&f&&(_="Invoice-"+f);try{d.download(`${_}`)}catch(S){$.error("Error",S),this.eventLogService.track("[ReceiptPageComponent]: Error on download receipt",{error:S.message},{IPAddress:this.ip})}this.eventLogService.track("[ReceiptPageComponent]: Receipt Downloaded",{},{IPAddress:this.ip})}catch(d){$.error("Error generateBillingReceipt",d),this.eventLogService.track("[ReceiptPageComponent]: Error on Generate receipt",{error:d.message},{IPAddress:this.ip})}})}isPayPalCustomPlanTrialReceipt(t=this.charge){if(!W(t)||String(this.invoiceStore?.type||"").toLowerCase()!=="custom")return!1;let i=this.invoiceStore?.customPlans;return!Array.isArray(i)||i.length===0?!1:i.some(a=>a?.isTrialEnabled===!0)}applyPayPalCustomTrialZeroAmountForPdf(t){t.amount=0,t.amount_captured=0,t?.receipt&&(t.re
195ceipt.amount=0,t.receipt.amount_off=0,t.receipt.percent_off=0,t.receipt.taxPercent=0,t.receipt.setupfees=0,t.receipt.quantity=t.receipt.quantity||1,t.receipt.processingFees&&(t.receipt.processingFees.calculatedFees=0,t.receipt.processingFees.amount=0,t.receipt.processingFees.percentage=0),t.receipt.metadata&&(t.receipt.metadata.checkoutTotalAmount=0,t.receipt.metadata.checkoutItemTotal=0,t.receipt.metadata.checkoutTaxAmount=0,t.receipt.metadata.checkoutSetupFeesAmount=0,t.receipt.metadata.checkoutDiscountAmount=0,t.receipt.metadata.checkoutRecurringAmount=0)),t?.checkoutSession&&(t.checkoutSession.amount_subtotal=0,t.checkoutSession.total_details||(t.checkoutSession.total_details={}),t.checkoutSession.total_details.amount_tax=0,t.checkoutSession.total_details.amount_discount=0,t.checkoutSession.total_details.amount_shipping=0,t.checkoutSession.metadata&&(t.checkoutSession.metadata.checkoutTotalAmount=0,t.checkoutSession.metadata.checkoutItemTotal=0,t.checkoutSession.metadata.checkoutTaxAmount=0,t.checkoutSession.metadata.checkoutSetupFeesAmount=0,t.checkoutSession.metadata.checkoutDiscountAmount=0,t.checkoutSession.metadata.checkoutRecurringAmount=0),t.checkoutSession.line_items={data:[]}),t?.invoice&&(t.invoice.total=0,t.invoice.subtotal=0,t.invoice.amount_paid=0,t.invoice.tax=0,t.invoice.total_tax_amounts=[],t.invoice.total_taxes=[],t.invoice.line_items=[],t.invoice?.lines?t.invoice.lines.data=[]:t.invoice.lines={data:[]})}buildReceiptPayloadForPdfDownload(){let t=H(this.receiptDetails),e=t.additionalFields;return e!=null&&!Array.isArray(e)&&(t.additionalFields=[e]),t}ensureReceiptDetailsForDownload(t){return J(this,null,function*(){if(this.receiptId=Jt(t,this.receiptId),!this.receiptId)return!1;if(this.receiptDetails?.id)return!0;try{let e=yield this.receiptService.getReceipt(this.receiptId);return e?(this.invoiceId=e.invoiceId,this.receiptDetails=Ht(H(e),{id:this.receiptId,refund:this.refund}),this.receiptDetails.displayName=this.displayName||e?.displayName,!this.invoiceStore&&this.invoiceId&&(this.invoiceStore=H(yield this.invoiceService.getInvoice(this.invoiceId))),!0):!1}catch(e){return $.error("[ReceiptPageComponent]: ensureReceiptDetailsForDownload",e),!1}})}downloadAttachedFile(t){return J(this,null,function*(){this.spinnerService.show();try{let e=yield this.receiptService.getSignedUrl({Key:t.Key,Expires:1800});e||($.error("ERROR [getSignedUrl]"),this.spinnerService.hide(),this.eventLogService.track("Error downloading attached file",{error:"signedUrl missing"})),e&&(yield this.receiptService.downloadAttachment({url:e,name:t?.Name}),this.spinnerService.hide(),this.eventLogService.track("Attached File Downloaded",{File:t.Name}))}catch(e){$.error("ERROR [getSignedUrl]",e),this.spinnerService.hide(),this.eventLogService.track("[ReceiptPageComponent]: Error downloading attached file",{error:e},{IPAddress:this.ip})}})}
195back(){if(this.routerExtService.getPreviousUrl()){let t={queryParams:{e:"PAYMENT_FAILED"},replaceUrl:!0};this.router.navigate([this.routerExtService.getPreviousUrl()],t)}else this.location.back()}clearApolloCache(){oe(3e3).subscribe(()=>localStorage.removeItem("apollo-cache-persist"))}navigateToSignIn(){return J(this,null,function*(){if(this.spinnerService.show(),this.businessId&&this.customerId)try{if(!(yield this.receiptService.verifyCustomer(this.customerId,this.businessId)))return this.spinnerService.hide(),!0}catch(e){console.error("Error: receiptService.verifyCustomer",e),this.spinnerService.hide()}let t=wt.APP_URL;if(this.businessId)try{let e=yield this.receiptService.getBusinessUrl(this.businessId);e?.isActive&&e?.isPlatformVerified&&e?.platformDomain?t=`https://${e?.platformDomain}`:e?.isActive&&e?.platformSubDomain&&(t=`https://${e?.platformSubDomain}`)}catch(e){console.error("Error: navigateToSignIn",e),this.spinnerService.hide(),t=wt.APP_URL}window.location.href=`${t}/cus/signin/${this.profileTag}/${this.customerId}`})}};s.\u0275fac=function(e){return new(e||s)},s.\u0275cmp=ae({type:s,selectors:[["app-receipt-page"]],viewQuery:function(e,i){if(e&1&&ce(Si,5),e&2){let a;le(a=pe())&&(i.myCanvas=a.first)}},standalone:!1,decls:16,vars:2,consts:[[1,"tw-flex","tw-min-h-screen","tw-flex-col","tw-items-center","tw-justify-between","tw-bg-indigo-50/30","tw-p-4","tw-text-slate-600","tw-transition-colors","tw-duration-300","sm:tw-p-6","dark:tw-bg-slate-950","dark:tw-text-slate-400"],[1,"tw-mt-12","tw-w-full","tw-py-6"],[1,"tw-flex","tw-w-full","tw-flex-grow","tw-items-center","tw-justify-center"],[1,"tw-w-full","tw-max-w-md","tw-rounded-2xl","tw-border","tw-border-slate-200/50","tw-bg-white","tw-p-8","tw-text-center","tw-shadow-[0_10px_40px_-10px_rgba(100,116,139,0.1)]","sm:tw-p-10","dark:tw-border-slate-800","dark:tw-bg-slate-900","dark:tw-shadow-[0_10px_40px_-10px_rgba(0,0,0,0.3)]"],[1,"tw-text-center","tw-text-2xl","tw-font-medium","tw-text-slate-800","dark:tw-text-slate-200"],[1,"tw-mx-auto","tw-h-7","tw-w-32","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"fade-in-premium"],[1,"tw-relative","tw-mx-auto","tw-mb-8","tw-size-24"],[1,"tw-mb-6","tw-text-5xl","tw-font-semibold","tw-text-slate-900","dark:tw-text-slate-50"],[1,"tw-text-4xl","tw-text-slate-500","dark:tw-text-slate-400"],["src","../../assets/img/backgrounds/paymentSucceed.gif","alt","payment-succeed",1,"card-img-top","mt-4","mx-auto"],["src","../../assets/img/backgrounds/paymentFailed.gif","alt","payment-failed",1,"card-img-top","mt-4","mx-auto"],[1,"tw-mb-2","tw-text-xl","tw-text-slate-500","dark:tw-text-slate-400"],[1,"tw-mb-2","tw-text-xl","tw-capitalize","tw-text-slate-500","dark:tw-text-slate-400"],["translate","",1,"tw-mb-2","tw-text-xl","tw-text-slate-500","dark:tw-text-slate-400"],[1,"tw-mb-8","tw-space-y-3","tw-border-t","tw-border-slate-200","tw-pt-6","tw-text-left","tw-text-sm","dark:tw-border-slate-700"],[1,"tw-flex","tw-justify-between"],[1,"tw-text-slate-500","dark:tw-text-slate-400"],[1,"tw-font-medium","tw-text-slate-800","dark:tw-text-slate-200"],[1,"tw-space-y-4"],[1,"tw-grid","tw-grid-cols-1","tw-gap-4","sm:tw-grid-cols-2"],[1,"tw-w-full","tw-rounded-xl","tw-bg-primary","tw-px-5","tw-py-3","tw-text-sm","tw-font-semibold","tw-text-white","tw-transition-all","tw-duration-200","hover:tw-shadow-lg","focus:tw-outline-none","focus:tw-ring-2","focus:tw-ring-primary","focus:tw-ring-offset-2","active:tw-scale-[0.98]","dark:tw-bg-primary","dark:tw-ring-offset-slate-900",3,"click"],[1,"tw-w-full","tw-rounded-xl","tw-border","tw-border-primary","tw-bg-white","tw-px-5","tw-py-3","tw-text-sm","tw-font-medium","tw-text-primary","tw-transition-all","tw-duration-200","dark:tw-border-primary","dark:tw-bg-transparent","dark:tw-text-white",3,"click"],[1,"tw-w-full","tw-rounded-xl","tw-border","tw-border-indigo-200/60","tw-bg-white","tw-px-5","tw-py-3","tw-text-sm","tw-font-medium","tw-text-primary","tw-shadow-sm","tw-transition-all","tw-duration-200","hover:tw-shadow","focus:tw-outline-none","focus:tw-ring-2","focus:tw-ring-indigo-500","focus:tw-ring-offset-2","dark:tw-border-primary","dark:tw-bg-slate-900","dark:tw-text-white","dark:focus:tw-ring-offset-slate-900",3,"click"],[1,"tw-mb-8","tw-text-xl","t
195w-text-slate-500","dark:tw-text-slate-400"],[1,"fade-in-premium","tw-animate-pulse"],[1,"tw-mx-auto","tw-mb-8","tw-size-24","tw-animate-pulse","tw-rounded-full","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-mx-auto","tw-mb-2","tw-h-4","tw-w-24","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-mx-auto","tw-mb-6","tw-h-12","tw-w-48","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-mb-8","tw-animate-pulse","tw-space-y-4","tw-border-t","tw-border-slate-200","tw-pt-6","dark:tw-border-slate-700"],[1,"tw-flex","tw-items-center","tw-justify-between"],[1,"tw-h-4","tw-w-28","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-h-4","tw-w-36","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-h-4","tw-w-24","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-h-4","tw-w-32","tw-animate-pulse","tw-rounded-md","tw-bg-slate-200","dark:tw-bg-slate-700"],[1,"tw-h-11","tw-w-full","tw-animate-pulse","tw-rounded-xl","tw-bg-slate-200","dark:tw-bg-slate-700"]],template:function(e,i){e&1&&(x(0,"div",0),l(1,` 196 `),x(2,"header",1),l(3,` 197 `),G(4,vi,4,1)(5,Pi,3,0),b(),l(6,` 198 199 `),x(7,"main",2),l(8,` 200 `),x(9,"div",3),l(10,` 201 `),G(11,qi,28,15)(12,Vi,49,0),b(),l(13,` 202 `),b(),l(14,` 203`),b(),l(15,` 204`)),e&2&&(A(4),Z(i.receiptDetails&&i.invoiceNumber&&i.isShowReceipt?4:5),A(7),Z(i.receiptDetails&&i.invoiceNumber&&i.isShowReceipt?11:12))},dependencies:[be,me,he,de,fe,Se,Fe],styles:["app-receipt-page .brand-img{height:44.5px} app-receipt-page pre, app-receipt-page .pre{font-family:Open Sans,sans-serif;font-size:inherit;display:block;color:#8898aa;border:none;overflow-x:hidden;white-space:normal} app-receipt-page .modal-label{font-size:1.25rem;font-weight:600} app-receipt-page .brand-img-footer{width:30px;height:30px} app-receipt-page .modal-content{word-break:break-word} app-receipt-page .line{border-top:1px solid rgba(0,0,0,.1)} app-receipt-page .canvas{position:absolute;z-index:-15;opacity:0}.invoice-name[_ngcontent-%COMP%]{width:auto;text-overflow:ellipsis;white-space:normal}.margin-top-6[_ngcontent-%COMP%]{margin-top:6px!important}.margin-top-5[_ngcontent-%COMP%]{margin-top:5px!important}.margin-top-8[_ngcontent-%COMP%]{margin-top:8px!important}.modal-body-padding-0[_ngcontent-%COMP%]{padding:0!important}td.text-center.all-taxes[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:17px;font-weight:200;padding-bottom:13px}.text-transform-none[_ngcontent-%COMP%]{text-transform:none}.billing-info[_ngcontent-%COMP%]{margin-bottom:-6px!important}div.header-print[_ngcontent-%COMP%], .footer-space[_ngcontent-%COMP%], .header-space[_ngcontent-%COMP%]{display:none}.receipt-cell[_ngcontent-%COMP%], .receipt-row[_ngcontent-%COMP%], .receipt-tbody[_ngcontent-%COMP%]{display:block}@media print{.modal-header[_ngcontent-%COMP%]{display:none}.footer-logo[_ngcontent-%COMP%]{left:0;position:fixed;bottom:0;margin-bottom:20px;height:150px;font-size:25px}.footer-space[_ngcontent-%COMP%]{display:block;margin-bottom:20px;height:120px}.brand-img-footer[_ngcontent-%COMP%]{width:40px;height:40px;margin-bottom:10px}div.header-print[_ngcontent-%COMP%]{display:block;position:fixed;top:0;left:0;width:100%;height:50px;margin-top:-10px}div.header-print[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{font-size:30px!important}.header-space[_ngcontent-%COMP%]{display:block;margin-top:30px;height:0px}.font-18[_ngcontent-%COMP%]{font-size:18px!important}.font-25[_ngcontent-%COMP%]{font-size:25px}.font-40[_ngcontent-%COMP%]{font-size:40px}.table[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-size:18px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:16px}.table[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:20px}h1[_ngcontent-%COMP%], h6[_ngcontent-%COMP%], .terms-of-service[_ngcontent-%COMP%]{font-size:15px!important;font-weight:600}.receipt-info[_ngcontent-%COMP%]{margin-left:-80px}.brand-img[_ngcontent-%COMP%]{width:100px;height:100px}.brand-img-footer[_ngcontent-%COMP%]{width:50px;height:50px;margin-bottom:10px}
204.close-button[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%]{display:none}#main-body-print[_ngcontent-%COMP%]{zoom:130%;margin-left:-35px;margin-right:-35px;height:10px;page-break-after:avoid;page-break-before:avoid}.modal-label[_ngcontent-%COMP%]{font-size:30px}.receipt-email[_ngcontent-%COMP%]{margin-left:-180px}td.text-center.all-taxes[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:17px;font-weight:200;padding-bottom:10px}.receipt-details[_ngcontent-%COMP%]{margin-bottom:-5px}.table-title[_ngcontent-%COMP%]{color:#3a3f3f;font-size:13px}}@page{margin:0}.additional-field-key-td[_ngcontent-%COMP%]{width:15%;font-size:.8rem}.additional-field-symbol-td[_ngcontent-%COMP%]{width:5%;font-size:.8rem}.additional-field-value-td[_ngcontent-%COMP%]{width:80%;white-space:inherit}.card-img-top[_ngcontent-%COMP%]{max-width:100px}.m-0[_ngcontent-%COMP%]{min-height:calc(100vh - 105px)}.file-name-trim[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px!important}.tw-border[_ngcontent-%COMP%], .tw-border-2[_ngcontent-%COMP%], .tw-border-4[_ngcontent-%COMP%]{border-style:solid}.tw-border-t[_ngcontent-%COMP%]{border-top-style:solid}.tw-border-b[_ngcontent-%COMP%]{border-bottom-style:solid}.tw-border-l[_ngcontent-%COMP%]{border-left-style:solid}.tw-border-r[_ngcontent-%COMP%]{border-right-style:solid}@keyframes _ngcontent-%COMP%_fadeInBlur{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur(0)}}.fade-in-premium[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeInBlur .8s ease-out forwards}"]});let o=s;return o})();var Gi=[{canActivate:[Pe],path:"",component:ii,data:{title:"global.nav.label.receipt"}}],ni=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=vt({type:s}),s.\u0275inj=St({imports:[qt.forChild(Gi),qt]});let o=s;return o})();var us=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=vt({type:s}),s.\u0275inj=St({imports:[ge,ve,ni,Oe,Ee]});let o=s;return o})();export{us as ReceiptPageModule};
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.