UNPKG

@railzai/railz-visualizations

Version:
6 lines 80.7 kB
/*! * Accounting Data as a Service™ is the solution that makes sense of your business customers' financial data. * Built with Stencil * Copyright (c) FIS. */ import{r as i,h as t}from"./p-a257e2b5.js";import{T as e}from"./p-dadb736f.js";import{q as n,t as o,p as s,R as l,e as a,g as r,C as d,a as v,b as c,r as h,s as u,u as f,d as p,w as m,x as g,y,z as x,h as b,A as w,i as j,B as I,D as S,l as z,E as O,F as A,G as C,m as M,n as k,H as U,I as E,J as T,o as _}from"./p-fb585e73.js";import{i as R,g as F,F as L,e as D}from"./p-81bde732.js";import{l as N,r as H,i as B}from"./p-6c64b0b5.js";import{i as P}from"./p-a03ff4fe.js";import{A as $}from"./p-b93548b9.js";import{h as V,a as Z}from"./p-c35638e5.js";import{c as W}from"./p-ce5b13e7.js";import{i as q}from"./p-3d5262c3.js";import"./p-7497d5a3.js";var G=/\s/;function Y(i){var t=i.length;while(t--&&G.test(i.charAt(t))){}return t}var J=/^\s+/;function X(i){return i?i.slice(0,Y(i)+1).replace(J,""):i}var K=0/0;var Q=/^[-+]0x[0-9a-f]+$/i;var ii=/^0b[01]+$/i;var ti=/^0o[0-7]+$/i;var ei=parseInt;function ni(i){if(typeof i=="number"){return i}if(n(i)){return K}if(N(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=N(t)?t+"":t}if(typeof i!="string"){return i===0?i:+i}i=X(i);var e=ii.test(i);return e||ti.test(i)?ei(i.slice(2),e?2:8):Q.test(i)?K:+i}function oi(i,t,e){var n=-1,o=i.length;if(t<0){t=-t>o?0:o+t}e=e>o?o:e;if(e<0){e+=o}o=t>e?0:e-t>>>0;t>>>=0;var s=Array(o);while(++n<o){s[n]=i[n+t]}return s}function si(i,t,e){var n=i.length;e=e===undefined?n:e;return!t&&e>=n?i:oi(i,t,e)}var li="\\ud800-\\udfff",ai="\\u0300-\\u036f",ri="\\ufe20-\\ufe2f",di="\\u20d0-\\u20ff",vi=ai+ri+di,ci="\\ufe0e\\ufe0f";var hi="\\u200d";var ui=RegExp("["+hi+li+vi+ci+"]");function fi(i){return ui.test(i)}function pi(i){return i.split("")}var mi="\\ud800-\\udfff",gi="\\u0300-\\u036f",yi="\\ufe20-\\ufe2f",xi="\\u20d0-\\u20ff",bi=gi+yi+xi,wi="\\ufe0e\\ufe0f";var ji="["+mi+"]",Ii="["+bi+"]",Si="\\ud83c[\\udffb-\\udfff]",zi="(?:"+Ii+"|"+Si+")",Oi="[^"+mi+"]",Ai="(?:\\ud83c[\\udde6-\\uddff]){2}",Ci="[\\ud800-\\udbff][\\udc00-\\udfff]",Mi="\\u200d";var ki=zi+"?",Ui="["+wi+"]?",Ei="(?:"+Mi+"(?:"+[Oi,Ai,Ci].join("|")+")"+Ui+ki+")*",Ti=Ui+ki+Ei,_i="(?:"+[Oi+Ii+"?",Ii,Ai,Ci,ji].join("|")+")";var Ri=RegExp(Si+"(?="+Si+")|"+_i+Ti,"g");function Fi(i){return i.match(Ri)||[]}function Li(i){return fi(i)?Fi(i):pi(i)}function Di(i){return function(t){t=o(t);var e=fi(t)?Li(t):undefined;var n=e?e[0]:t.charAt(0);var s=e?si(e,1).join(""):t.slice(1);return n[i]()+s}}var Ni=Di("toUpperCase");function Hi(i,t,e,n){var o=-1,s=i==null?0:i.length;if(n&&s){e=i[++o]}while(++o<s){e=t(e,i[o],o,i)}return e}function Bi(i){return function(t){return i==null?undefined:i[t]}}var Pi={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"};var $i=Bi(Pi);var Vi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var Zi="\\u0300-\\u036f",Wi="\\ufe20-\\ufe2f",qi="\\u20d0-\\u20ff",Gi=Zi+Wi+qi;var Yi="["+Gi+"]";var Ji=RegExp(Yi,"g");function Xi(i){i=o(i);return i&&i.replace(Vi,$i).replace(Ji,"")}var Ki=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qi(i){return i.match(Ki)||[]}var it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tt(i){return it.test(i)}var et="\\ud800-\\udfff",nt="\\u0300-\\u036f",ot="\\ufe20-\\ufe2f",st="\\u20d0-\\u20ff",lt=nt+ot+st,at="\\u2700-\\u27bf",rt="a-z\\xdf-\\xf6\\xf8-\\xff",dt="\\xac\\xb1\\xd7\\xf7",vt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ct="\\u2000-\\u206f",ht=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ut="A-Z\\xc0-\\xd6\\xd8-\\xde",ft="\\ufe0e\\ufe0f",pt=dt+vt+ct+ht;var mt="['’]",gt="["+pt+"]",yt="["+lt+"]",xt="\\d+",bt="["+at+"]",wt="["+rt+"]",jt="[^"+et+pt+xt+at+rt+ut+"]",It="\\ud83c[\\udffb-\\udfff]",St="(?:"+yt+"|"+It+")",zt="[^"+et+"]",Ot="(?:\\ud83c[\\udde6-\\uddff]){2}",At="[\\ud800-\\udbff][\\udc00-\\udfff]",Ct="["+ut+"]",Mt="\\u200d";var kt="(?:"+wt+"|"+jt+")",Ut="(?:"+Ct+"|"+jt+")",Et="(?:"+mt+"(?:d|ll|m|re|s|t|ve))?",Tt="(?:"+mt+"(?:D|LL|M|RE|S|T|VE))?",_t=St+"?",Rt="["+ft+"]?",Ft="(?:"+Mt+"(?:"+[zt,Ot,At].join("|")+")"+Rt+_t+")*",Lt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nt=Rt+_t+Ft,Ht="(?:"+[bt,Ot,At].join("|")+")"+Nt;var Bt=RegExp([Ct+"?"+wt+"+"+Et+"(?="+[gt,Ct,"$"].join("|")+")",Ut+"+"+Tt+"(?="+[gt,Ct+kt,"$"].join("|")+")",Ct+"?"+kt+"+"+Et,Ct+"+"+Tt,Dt,Lt,xt,Ht].join("|"),"g");function Pt(i){return i.match(Bt)||[]}function $t(i,t,e){i=o(i);t=e?undefined:t;if(t===undefined){return tt(i)?Pt(i):Qi(i)}return i.match(t)||[]}var Vt="['’]";var Zt=RegExp(Vt,"g");function Wt(i){return function(t){return Hi($t(Xi(t).replace(Zt,"")),i,"")}}var qt=function(){return H.Date.now()};var Gt="Expected a function";var Yt=Math.max,Jt=Math.min;function Xt(i,t,e){var n,o,s,l,a,r,d=0,v=false,c=false,h=true;if(typeof i!="function"){throw new TypeError(Gt)}t=ni(t)||0;if(N(e)){v=!!e.leading;c="maxWait"in e;s=c?Yt(ni(e.maxWait)||0,t):s;h="trailing"in e?!!e.trailing:h}function u(t){var e=n,s=o;n=o=undefined;d=t;l=i.apply(s,e);return l}function f(i){d=i;a=setTimeout(g,t);return v?u(i):l}function p(i){var e=i-r,n=i-d,o=t-e;return c?Jt(o,s-n):o}function m(i){var e=i-r,n=i-d;return r===undefined||e>=t||e<0||c&&n>=s}function g(){var i=qt();if(m(i)){return y(i)}a=setTimeout(g,p(i))}function y(i){a=undefined;if(h&&n){return u(i)}n=o=undefined;return l}function x(){if(a!==undefined){clearTimeout(a)}d=0;n=r=o=a=undefined}function b(){return a===undefined?l:y(qt())}function w(){var i=qt(),e=m(i);n=arguments;o=this;r=i;if(e){if(a===undefined){return f(r)}if(c){clearTimeout(a);a=setTimeout(g,t);return u(r)}}if(a===undefined){a=setTimeout(g,t)}return l}w.cancel=x;w.flush=b;return w}var Kt=Wt((function(i,t,e){return i+(e?" ":"")+Ni(t)}));const Qt=async({filter:i})=>{let t;const n=Object.assign({},s(i,[R.CONNECTION_UUID]));try{t=await l.getReportData({path:F[i.reportType],filter:n})}catch(i){a(e.RV_NOT_ABLE_TO_RETRIEVE_REPORT_DATA,i);t={error:i}}return t};const ie='@font-face{font-family:Inter;src:url("../assets/fonts/Inter-italic-var.woff2");font-family:Inter;src:url("../assets/fonts/Inter-upright-var.woff2")}body,div[class^=railz-],div[class*=" railz-"]{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-container{display:flex;padding:16px;position:relative;border:1px solid #eee;border-radius:7px;flex-direction:column;height:202px;line-height:21px}.rv-container *{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-container .rv-bank-list{overflow:auto}.rv-header-container{display:flex}.rv-title{display:flex;color:#015b7e;font-size:18px;font-weight:600;margin:0;padding:0;text-align:left;flex-grow:1;line-height:1.235}.rv-bank-accounts-ul{list-style-type:none;font-weight:400;margin:0;padding:8px 0}.rv-bank-accounts-ul-title{padding-top:8px;color:black;line-height:28px;font-size:14px;font-weight:500;text-align:left}.rv-bank-accounts-item-container{display:flex;justify-content:space-between;padding:4px 0}.rv-bank-accounts-item-name{color:#424242;font-size:14px;font-weight:500}.rv-bank-accounts-item-dot{margin:0 16px 8px;display:flex;flex-grow:1;border-bottom:1px dashed #9e9e9e}.rv-bank-accounts-item-value{text-align:end;color:#212121;font-size:14px;font-weight:700}';const te=class{constructor(n){i(this,n);this.loading="";this.propsUpdated=async(i=true)=>{await this.validateParams(this.configuration,this.filter,this.options,i)};this.validateParams=async(i,t,n,o=true)=>{this._configuration=r(i);if(this._configuration){d.configuration=this._configuration;try{this._filter=v(t);this._options=c(n);if(h(this._filter)){if(u(this._filter.reportType)){if(o){await this.requestReportData()}}else{this.errorStatusCode=500;a(e.RV_ERROR_INVALID_REPORT_TYPE)}}else{this.errorStatusCode=204}}catch(i){this.errorStatusCode=500;a(i)}}else{this.errorStatusCode=0}};this.requestReportData=async()=>{var i;this.errorStatusCode=undefined;this.loading=e.RV_LOADING_REPORT;try{const t=await Qt({filter:this._filter});this._summary=t.data;if(((i=t===null||t===void 0?void 0:t.error)===null||i===void 0?void 0:i.message[0])==="Service provider not supported"){a(e.DASHBOARD_FINANCIAL_SUMMARY_CHART_ERROR_ASP_NOT_SUPPORTED);this.errorStatusCode=404}else if(B(this._summary)){this.errorStatusCode=204}}catch(i){a(e.RV_NOT_ABLE_TO_PARSE_REPORT_DATA,i)}finally{this.loading=""}};this.renderMain=()=>{var i,e,n,o;if(this.errorStatusCode!==undefined){return t("railz-error-image",Object.assign({statusCode:this.errorStatusCode||500},(i=this._options)===null||i===void 0?void 0:i.errorIndicator))}if(!B(this.loading)){return t("railz-loading",Object.assign({loadingText:this.loading},(e=this._options)===null||e===void 0?void 0:e.loadingIndicator))}const s=this.getAllBanks();return!B(this._summary)&&t("div",{class:"rv-bank-list"},t("ul",{class:"rv-bank-accounts-ul",style:(o=(n=this._options)===null||n===void 0?void 0:n.table)===null||o===void 0?void 0:o.style},Object.keys(s).map((i=>{var e,n;return t("div",null,t("li",{class:"rv-bank-accounts-ul-title",style:(n=(e=this._options)===null||e===void 0?void 0:e.table)===null||n===void 0?void 0:n.title},i),s[i].map((i=>{var e,n,o,s,l,a,r,d;return t("li",null,t("div",{class:"rv-bank-accounts-item-container",style:(n=(e=this._options)===null||e===void 0?void 0:e.table)===null||n===void 0?void 0:n.itemContainer},t("span",{class:"rv-bank-accounts-item-name",style:(s=(o=this._options)===null||o===void 0?void 0:o.table)===null||s===void 0?void 0:s.itemName},i.accountName),t("span",{class:"rv-bank-accounts-item-dot",style:(a=(l=this._options)===null||l===void 0?void 0:l.table)===null||a===void 0?void 0:a.itemSeperator}),t("span",{class:"rv-bank-accounts-item-value",style:(d=(r=this._options)===null||r===void 0?void 0:r.table)===null||d===void 0?void 0:d.itemValue},"$",f(i.currentBalance,2,2))))})))}))))}}async watchConfiguration(i,t){if(i&&t&&!P(t,i)){await this.validateParams(i,this.filter,this.options)}}async watchFilter(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,i,this.options)}}async watchOptions(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,this.filter,i)}}componentWillLoad(){this.propsUpdated&&this.propsUpdated()}getAllBanks(){var i;const t=(i=this._summary)===null||i===void 0?void 0:i.map((({institutionName:i})=>i));const e=new Set(t);const n={};e.forEach((i=>{var t;n[i]=(t=this._summary)===null||t===void 0?void 0:t.filter((({institutionName:t})=>t===i))}));return n}render(){var i,e,n,o;if(this.errorStatusCode===0){return null}const s=()=>{var i,e,n,o,s,l,a,r,d,v,c,h,u,f,m,g;return t("p",{class:"rv-title",style:(e=(i=this._options)===null||i===void 0?void 0:i.title)===null||e===void 0?void 0:e.style},((o=(n=this._options)===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.title)||p((s=this._filter)===null||s===void 0?void 0:s.reportType)||""," ",((a=(l=this._options)===null||l===void 0?void 0:l.tooltipIndicator)===null||a===void 0?void 0:a.visible)&&((v=(d=(r=this._options)===null||r===void 0?void 0:r.content)===null||d===void 0?void 0:d.tooltip)===null||v===void 0?void 0:v.description)?t("railz-tooltip",{tooltipStyle:Object.assign(Object.assign({position:"bottom-center"},(c=this._options)===null||c===void 0?void 0:c.tooltipIndicator),{style:Object.assign({marginLeft:"5px"},(u=(h=this._options)===null||h===void 0?void 0:h.tooltipIndicator)===null||u===void 0?void 0:u.style)}),tooltipText:(g=(m=(f=this._options)===null||f===void 0?void 0:f.content)===null||m===void 0?void 0:m.tooltip)===null||g===void 0?void 0:g.description}):null)};return t("div",{class:"rv-container",style:(e=(i=this._options)===null||i===void 0?void 0:i.container)===null||e===void 0?void 0:e.style},t("div",{class:"rv-header-container"},((o=(n=this._options)===null||n===void 0?void 0:n.title)===null||o===void 0?void 0:o.visible)===false?"":t(s,null)),this.renderMain())}static get watchers(){return{configuration:["watchConfiguration"],filter:["watchFilter"],options:["watchOptions"]}}};te.style=ie;const ee=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8 0C3.584 0 0 3.584 0 8C0 12.416 3.584 16 8 16C12.416 16 16 12.416 16 8C16 3.584 12.416 0 8 0ZM6.4 12L2.4 8L3.528 6.872L6.4 9.736L12.472 3.664L13.6 4.8L6.4 12Z",fill:"#30A665"}));const ne=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8 0C3.584 0 0 3.584 0 8C0 12.416 3.584 16 8 16C12.416 16 16 12.416 16 8C16 3.584 12.416 0 8 0ZM8.8 12H7.2V10.4H8.8V12ZM8.8 8.8H7.2V4H8.8V8.8Z",fill:"#F2A74C"}));const oe=i=>{let t=0;let e=0;let n=0;let o=0;let s=0;if(i===null||i===void 0?void 0:i.reports){for(const l of i.reports){for(const i of l.data){n+=i.bankTransactionsTotalValue?i.bankTransactionsTotalValue:0;o+=i.accountingTransactionsTotalValue?i.accountingTransactionsTotalValue:0;if(i["unreconciledBankTransactions"]){e+=i["unreconciledBankTransactions"].length}if(i["reconciledBankTransactions"]){for(const e of i["reconciledBankTransactions"]){t++;s+=Math.abs(e.amount)}}}}}return{accuracyScore:Math.round(s/n*100),bankBalance:n,accountingBalance:o,matchedTransactions:t,totalTransations:e+t}};const se=async({filter:i})=>{let t;try{let n;let o;try{n=m(g(i.startDate),y)}catch(i){a(e.RV_ERROR_START_DATE)}try{o=m(g(i.endDate),y)}catch(i){a(e.RV_ERROR_END_DATE)}const r=s(Object.assign(Object.assign({},i),{startDate:n,endDate:o}),["startDate","endDate","connectionUuid"]);r.offset=0;r.limit=100;r.orderBy="-date";t=await l.getReportData({path:F[i.reportType],filter:r})}catch(i){a(e.RV_NOT_ABLE_TO_RETRIEVE_REPORT_DATA,i);t={error:i}}return t};const le='@font-face{font-family:Inter;src:url("../assets/fonts/Inter-italic-var.woff2");font-family:Inter;src:url("../assets/fonts/Inter-upright-var.woff2")}body,div[class^=railz-],div[class*=" railz-"]{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-container{display:flex;gap:24px;position:relative;flex-direction:row}@media screen and (max-width: 600px){.rv-container{flex-direction:column}}.rv-container p{margin-block:0}.rv-container *{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-grid{padding:16px;min-height:102px;box-shadow:0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);border-radius:4px;display:flex;flex-direction:column;gap:24px;width:100%}@media screen and (max-width: 600px){.rv-grid{width:"auto"}}.rv-grid-accuracy-score{padding:16px;min-height:102px;box-shadow:0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);border-radius:4px;display:flex;flex-direction:column;gap:24px;width:100%;max-width:264px}@media screen and (max-width: 600px){.rv-grid-accuracy-score{max-width:100%}}.rv-title{font-size:18px;font-weight:600;color:#616161;line-height:1.235}.rv-subtitle{font-size:12px;font-weight:500;overflow-wrap:break-word;color:rgba(0, 0, 0, 0.87);line-height:1.235}.rv-section-container{display:flex;flex-direction:row;align-items:center;gap:16px}.rv-matched-insight-section-container{align-items:unset}@media screen and (max-width: 600px){.rv-matched-insight-section-container{flex-direction:column}}.rv-section-child-container{display:flex;flex-direction:column;justify-content:space-between;text-align:center;gap:8px;width:calc(100% + 8px);margin:-4px}.rv-bar-text{font-size:12px;font-weight:500;color:rgba(0, 0, 0, 0.87);text-align:center}.rv-section-item{padding:4px;width:100%;max-width:100%}.rv-section-number{font-size:18px;font-weight:600;flex:1}.rv-section-equals{margin-top:-8px;align-self:center}.rv-section-number-icon{font-size:18px;font-weight:600;flex:0}.rv-section-icon{flex:1;gap:8px;display:flex;flex-direction:row;justify-content:center}.rv-icon{margin-top:4px}@media screen and (max-width: 900px){.rv-icon{display:none}}.rv-matched-insight-subtitle{font-weight:600;letter-spacing:0.06em;color:#616161;text-transform:uppercase}@media screen and (max-width: 600px){.rv-matched-insight-subtitle{text-align:center;margin-left:0}}';const ae=class{constructor(t){i(this,t);this.loading="";this.updateBankReconciliationParams=i=>{const t=oe(i);if(t){this.loading="";this.accuracyScore=t.accuracyScore;this.bankBalance=t.bankBalance;this.accountingBalance=t.accountingBalance;this.matchedTransactions=t.matchedTransactions;this.totalTransations=t.totalTransations}};this.validateParams=async(i,t,n,o=true)=>{this._configuration=r(i);if(this._configuration){d.configuration=this._configuration;try{this._filter=v(t);this._options=c(n);if(h(this._filter)){if(x(this._filter.reportType)){if(o){await this.requestReportData()}}else{this.errorStatusCode=500;a(e.RV_ERROR_INVALID_REPORT_TYPE)}}else{this.errorStatusCode=204}}catch(i){this.errorStatusCode=500;a(i)}}else{this.errorStatusCode=0}};this.propsUpdated=async(i=true)=>{await this.validateParams(this.configuration,this.filter,this.options,i)};this.requestReportData=async()=>{var i;this.errorStatusCode=undefined;this.loading=e.RV_LOADING_REPORT;try{const t=await se({filter:this._filter});if(t===null||t===void 0?void 0:t.reports){this.updateBankReconciliationParams(t)}else if(((i=t===null||t===void 0?void 0:t.error)===null||i===void 0?void 0:i.message[0])==="Business has no bank data"){a(e.RV_ERROR_422_TITLE);this.errorStatusCode=422}else{this.errorStatusCode=b(t)}}catch(i){a(e.RV_NOT_ABLE_TO_PARSE_REPORT_DATA,i)}finally{this.loading=""}}}async watchConfiguration(i,t){if(i&&t&&!P(t,i)){await this.validateParams(i,this.filter,this.options)}}async watchFilter(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,i,this.options)}}async watchOptions(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,this.filter,i)}}componentWillLoad(){this._options=w(this.options);this.propsUpdated&&this.propsUpdated()}render(){var i,n,o;if(this.errorStatusCode!==undefined){return t("railz-error-image",Object.assign({statusCode:this.errorStatusCode||500},(i=this._options)===null||i===void 0?void 0:i.errorIndicator))}if(j(this.accuracyScore)||j(this.bankBalance)||j(this.accountingBalance)||j(this.matchedTransactions)||j(this.totalTransations)||!B(this.loading)){return t("span",null)}const s=i=>{if(i<50){return"#FFD738"}if(i<75){return"#009BBD"}return"#00884F"};const l=i=>[i];const a={chart:{height:"64px",width:"64px",type:"circle",gauge:{startAngle:0,endAngle:360,size:"100%",innerRadius:"80%",getColor:s,getData:l,maxScore:100}}};const r=()=>{var i,n,o,s,l,r,d,v,c,h,u,f,p,m,g,y,x;return t("div",{class:"rv-grid-accuracy-score",style:(n=(i=this._options)===null||i===void 0?void 0:i.reconciliation)===null||n===void 0?void 0:n.gridAccuracyScore},t("div",{class:"rv-section-container",style:(s=(o=this._options)===null||o===void 0?void 0:o.reconciliation)===null||s===void 0?void 0:s.sectionContainer},t("p",{class:"rv-title",style:(r=(l=this._options)===null||l===void 0?void 0:l.reconciliation)===null||r===void 0?void 0:r.title},e.RV_BANK_RECONCILIATION_ACCURACY_SCORE),t("railz-tooltip",{tooltipStyle:Object.assign(Object.assign({position:"bottom-center"},(d=this._options)===null||d===void 0?void 0:d.tooltipIndicator),{style:Object.assign({marginLeft:"5px"},(c=(v=this._options)===null||v===void 0?void 0:v.tooltipIndicator)===null||c===void 0?void 0:c.style)}),tooltipText:((p=(f=(u=(h=this._options)===null||h===void 0?void 0:h.reconciliation)===null||u===void 0?void 0:u.accuracyScoreContent)===null||f===void 0?void 0:f.tooltip)===null||p===void 0?void 0:p.description)||e[`RV_TOOLTIP_ACCURACY_SCORE`]})),t("div",{class:"rv-section-container",style:(g=(m=this._options)===null||m===void 0?void 0:m.reconciliation)===null||g===void 0?void 0:g.sectionContainer},t("railz-gauge-chart",{options:a,data:{score:this.accuracyScore,rating:"",lastUpdated:"",percentage:true}}),t("p",{class:"rv-subtitle",style:(x=(y=this._options)===null||y===void 0?void 0:y.reconciliation)===null||x===void 0?void 0:x.subtitle},e.RV_BANK_RECONCILIATION_ACCURACY_SCORE_TRANSACTIONS)))};const d=Math.abs(this.accountingBalance-this.bankBalance);const v=()=>{var i,n,o,s,l,a,r,v,c,h,u,f,p,m,g,y,x,b,w,j,S,z,O,A,C,M,k,U,E,T,_,R,F,L;return t("div",{class:"rv-grid",style:(n=(i=this._options)===null||i===void 0?void 0:i.reconciliation)===null||n===void 0?void 0:n.grid},t("p",{class:"rv-title",style:(s=(o=this._options)===null||o===void 0?void 0:o.reconciliation)===null||s===void 0?void 0:s.title},e.RV_BANK_RECONCILIATION_MATCHED_INSIGHTS),t("div",{class:"rv-section-container rv-matched-insight-section-container",style:(a=(l=this._options)===null||l===void 0?void 0:l.reconciliation)===null||a===void 0?void 0:a.sectionParentContainer},t("div",{class:"rv-section-child-container",style:(v=(r=this._options)===null||r===void 0?void 0:r.reconciliation)===null||v===void 0?void 0:v.sectionChildContainer},t("p",{class:"rv-subtitle rv-matched-insight-subtitle",style:(h=(c=this.options)===null||c===void 0?void 0:c.reconciliation)===null||h===void 0?void 0:h.subtitle},e.RV_BANK_RECONCILIATION_MATCHED_INSIGHTS_SUBHEADING),t("div",{class:"rv-section-item"},t("railz-progress-bar",{paidAmount:this.matchedTransactions,overdueAmount:0,unpaidAmount:this.totalTransations-this.matchedTransactions,options:{hideLabels:true}})),t("p",{class:"rv-bar-text",style:(f=(u=this.options)===null||u===void 0?void 0:u.reconciliation)===null||f===void 0?void 0:f.subtitle},`${(p=this.matchedTransactions)===null||p===void 0?void 0:p.toString()}\n ${e.RV_BANK_RECONCILIATION_MATCHED_INSIGHTS_OF}\n ${(m=this.totalTransations)===null||m===void 0?void 0:m.toString()}`)),t("div",{class:"rv-section-child-container",style:(y=(g=this._options)===null||g===void 0?void 0:g.reconciliation)===null||y===void 0?void 0:y.sectionChildContainer},t("p",{class:"rv-subtitle rv-matched-insight-subtitle",style:(b=(x=this.options)===null||x===void 0?void 0:x.reconciliation)===null||b===void 0?void 0:b.subtitle},e.RV_BANK_RECONCILIATION_MATCHED_INSIGHTS_ACCOUNTING_BALANCE),t("p",{class:"rv-section-number",style:(j=(w=this.options)===null||w===void 0?void 0:w.reconciliation)===null||j===void 0?void 0:j.sectionNumber},I(this.accountingBalance))),t("div",{class:"rv-section-child-container",style:(z=(S=this._options)===null||S===void 0?void 0:S.reconciliation)===null||z===void 0?void 0:z.sectionChildContainer},t("p",{class:"rv-subtitle rv-matched-insight-subtitle",style:(A=(O=this.options)===null||O===void 0?void 0:O.reconciliation)===null||A===void 0?void 0:A.subtitle},e.RV_BANK_RECONCILIATION_MATCHED_INSIGHTS_BANK_BALANCE),t("p",{class:"rv-section-number",style:(M=(C=this._options)===null||C===void 0?void 0:C.reconciliation)===null||M===void 0?void 0:M.sectionNumber},I(this.bankBalance))),t("p",{class:"rv-section-number rv-section-equals",style:(U=(k=this._options)===null||k===void 0?void 0:k.reconciliation)===null||U===void 0?void 0:U.sectionNumber},"="),t("div",{class:"rv-section-child-container",style:(T=(E=this._options)===null||E===void 0?void 0:E.reconciliation)===null||T===void 0?void 0:T.sectionChildContainer},t("p",{class:"rv-subtitle rv-matched-insight-subtitle",style:(R=(_=this._options)===null||_===void 0?void 0:_.reconciliation)===null||R===void 0?void 0:R.subtitle},e.RV_BANK_RECONCILIATION_MATCHED_INSIGHTS_CALCULATION),t("div",{class:"rv-section-icon"},t("div",{class:"rv-icon"},d!==0?t(ne,null):t(ee,null)),t("p",{class:"rv-section-number rv-section-number-icon",style:(L=(F=this._options)===null||F===void 0?void 0:F.reconciliation)===null||L===void 0?void 0:L.sectionNumber},I(d))))))};return t("div",{class:"rv-container",style:(o=(n=this._options)===null||n===void 0?void 0:n.container)===null||o===void 0?void 0:o.style},t(r,null),t(v,null))}static get watchers(){return{configuration:["watchConfiguration"],filter:["watchFilter"],options:["watchOptions"]}}};ae.style=le;const re=(i,t)=>{if(j(i)||j(t)||t===0){return null}return Math.round((i-t)/t*1e4)/100};const de=i=>{var t;let e=null;let n=null;let o=null;let s=null;let l=null;let a=null;let r=null;let d=null;let v=null;if(i===null||i===void 0?void 0:i.reports){const c=i.reports;if(c.length>=1){v=c[0].meta.updatedAt;e=c[0].data.liquidationValue;n=c[0].data.discountedCashflowValue;o=c[0].data.multipleToRevenueValue;s=c[0].data.firstChicagoValue}if(c.length>=2){const i=(t=c[c.length-1])===null||t===void 0?void 0:t.data.liquidationValue;l=re(e,i);const v=c[c.length-1].data.discountedCashflowValue;a=re(n,v);const h=c[c.length-1].data.multipleToRevenueValue;r=re(o,h);const u=c[c.length-1].data.firstChicagoValue;d=re(s,u)}}return{liquidation:e,discountedCashflow:n,multipleToRevenue:o,firstChicago:s,liquidationPercentageChange:l,discountedCashflowPercentageChange:a,multipleToRevenuePercentageChange:r,firstChicagoPercentageChange:d,latestEndDate:v}};const ve=async({filter:i})=>{let t;try{let n;let o;try{n=m(g(i.startDate),y)}catch(i){a(e.RV_ERROR_START_DATE)}try{o=m(g(i.endDate),y)}catch(i){a(e.RV_ERROR_END_DATE)}const r=s(Object.assign(Object.assign({},i),{startDate:n,endDate:o}),["startDate","endDate","connectionUuid"]);r.offset=0;r.limit=100;r.orderBy="-endDate";t=await l.getReportData({path:F[i.reportType],filter:r})}catch(i){a(e.RV_NOT_ABLE_TO_RETRIEVE_REPORT_DATA,i);t={error:i}}return t};const ce='@font-face{font-family:Inter;src:url("../assets/fonts/Inter-italic-var.woff2");font-family:Inter;src:url("../assets/fonts/Inter-upright-var.woff2")}body,div[class^=railz-],div[class*=" railz-"]{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-container{display:flex;padding:16px;position:relative;border:1px solid #eee;border-radius:7px;flex-direction:column;justify-content:space-between;width:auto}.rv-container p{margin-block:0}.rv-container *{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-header-container{display:flex;flex-direction:row;justify-content:space-between}.rv-valuation-group{width:calc(50% - 24px);min-width:480px;display:flex;justify-content:flex-start;margin-right:24px}@media screen and (max-width: 500px){.rv-valuation-group{flex-direction:column;min-width:780px}}.rv-valuation-section{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;padding-bottom:8px;overflow:visible;flex-basis:50%;min-width:240px}@media screen and (min-width: 500px){.rv-valuation-section .rv-valuation-title{padding-left:24px}}@media screen and (min-width: 500px){.rv-valuation-section .rv-valuation-value-row{padding-left:24px;border-left:thin solid #e0e0e0}}@media screen and (min-width: 500px){.rv-valuation-section:first-child .rv-valuation-title{margin-left:-25px}}@media screen and (min-width: 500px){.rv-valuation-section:first-child .rv-valuation-value-row{margin-left:-25px}}.rv-valuation-container{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;width:100%;height:100%;padding-top:8px;overflow:hidden}@media screen and (min-width: 500px){.rv-valuation-container{row-gap:15px}}.rv-title{display:flex;color:#015b7e;font-size:18px;font-weight:600;margin:0;padding:0;text-align:left;flex-grow:1;line-height:1.235;align-items:baseline}.rv-valuation-title{font-weight:600;font-size:14px;color:#000;padding-bottom:6px}.rv-valuation-value-row{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;height:100%}.rv-valuation-value{color:#212121;-webkit-font-smoothing:antialiased;font-size:24px;font-weight:600}.rv-valuation-percentage{font-weight:500;-webkit-font-smoothing:antialiased;font-size:14px}.rv-income-statements-chart-percentage{visibility:inherit;-webkit-font-smoothing:antialiased;margin:0;line-height:1.5;display:flex;flex-direction:row;font-size:14px;font-weight:500;padding-left:8px}.rv-income-statements-chart-percentage .rv-positive{color:#006037}.rv-income-statements-chart-percentage .rv-negative{color:#b30000}.rv-score-last-updated{align-self:center;text-align:center;font-size:12px;color:#757575;font-weight:500;line-height:28px}';const he=(i,e)=>{var n,o,s,l;if(i<0){return t("div",{class:"rv-negative",style:(o=(n=e===null||e===void 0?void 0:e.chart)===null||n===void 0?void 0:n.pie)===null||o===void 0?void 0:o.negative},"▼ ",Math.abs(i),"%")}else{return t("div",{class:"rv-positive",style:(l=(s=e===null||e===void 0?void 0:e.chart)===null||s===void 0?void 0:s.pie)===null||l===void 0?void 0:l.positive},"▲"," ",j(i)||isNaN(i)||Math.abs(i)===Infinity?0:Math.abs(i),"%")}};const ue=(i,e,n,o)=>{const s=I(Math.round(e),0,"N/A");const l=j(n)||isNaN(n)||Math.abs(n)===Infinity?null:he(n,o);return t("div",{class:"rv-valuation-section"},t("p",{class:"rv-valuation-title"},i),t("div",{class:"rv-valuation-value-row"},t("p",{class:"rv-valuation-value"},s),t("div",{class:"rv-income-statements-chart-percentage"},l)))};const fe=class{constructor(t){i(this,t);this.loading="";this.updateBusinessValuationsParams=i=>{const t=de(i);if(t){this.loading="";this.liquidationValue=t.liquidation;this.discountedCashflowValue=t.discountedCashflow;this.multipleToRevenueValue=t.multipleToRevenue;this.firstChicagoValue=t.firstChicago;this.liquidationPercentageChange=t.liquidationPercentageChange;this.discountedCashflowPercentageChange=t.discountedCashflowPercentageChange;this.multipleToRevenuePercentageChange=t.multipleToRevenuePercentageChange;this.firstChicagoPercentageChange=t.firstChicagoPercentageChange}};this.validateParams=async(i,t,n,o=true)=>{this._configuration=r(i);if(this._configuration){d.configuration=this._configuration;try{this._filter=v(t);this._options=c(n);if(h(this._filter)){if(S(this._filter.reportType)){if(o){await this.requestReportData()}}else{this.errorStatusCode=500;a(e.RV_ERROR_INVALID_REPORT_TYPE)}}else{this.errorStatusCode=204}}catch(i){this.errorStatusCode=500;a(i)}}else{this.errorStatusCode=0}};this.propsUpdated=async(i=true)=>{await this.validateParams(this.configuration,this.filter,this.options,i)};this.requestReportData=async()=>{this.errorStatusCode=undefined;this.loading=e.RV_LOADING_REPORT;try{const i=await ve({filter:this._filter});if(i===null||i===void 0?void 0:i.reports){this.updateBusinessValuationsParams(i)}else{this.errorStatusCode=b(i)}}catch(i){a(e.RV_NOT_ABLE_TO_PARSE_REPORT_DATA,i)}finally{this.loading=""}}}async watchConfiguration(i,t){if(i&&t&&!P(t,i)){await this.validateParams(i,this.filter,this.options)}}async watchFilter(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,i,this.options)}}async watchOptions(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,this.filter,i)}}componentWillLoad(){this.propsUpdated&&this.propsUpdated()}render(){var i,n,o,s;const l=()=>{var i,n,o,s,l,a,r,d,v,c,h,u,f;return t("p",{class:"rv-title",style:(n=(i=this._options)===null||i===void 0?void 0:i.title)===null||n===void 0?void 0:n.style},((s=(o=this._options)===null||o===void 0?void 0:o.content)===null||s===void 0?void 0:s.title)||p((l=this._filter)===null||l===void 0?void 0:l.reportType)||""," ",((r=(a=this._options)===null||a===void 0?void 0:a.tooltipIndicator)===null||r===void 0?void 0:r.visible)===false?"":t("railz-tooltip",{tooltipStyle:Object.assign(Object.assign({position:"bottom-center"},(d=this._options)===null||d===void 0?void 0:d.tooltipIndicator),{style:Object.assign({marginLeft:"6px"},(c=(v=this._options)===null||v===void 0?void 0:v.tooltipIndicator)===null||c===void 0?void 0:c.style)}),tooltipText:((f=(u=(h=this._options)===null||h===void 0?void 0:h.content)===null||u===void 0?void 0:u.tooltip)===null||f===void 0?void 0:f.description)||e.RV_TOOLTIP_BUSINESS_VALUATION}))};const a=()=>{var i,n;if(B(this.loading)&&this.errorStatusCode===undefined&&j(this.liquidationValue)&&j(this.discountedCashflowValue)&&j(this.multipleToRevenueValue)&&j(this.firstChicagoValue)){this.errorStatusCode=204}if(this.errorStatusCode!==undefined){return t("railz-error-image",Object.assign({statusCode:this.errorStatusCode||500},(i=this._options)===null||i===void 0?void 0:i.errorIndicator))}if(!B(this.loading)){return t("railz-loading",Object.assign({loadingText:this.loading},(n=this._options)===null||n===void 0?void 0:n.loadingIndicator))}return t("div",{class:"rv-valuation-container"},t("div",{class:"rv-valuation-group"},ue(e.RV_BUSINESS_VALUATIONS_LIQUIDATION_VALUE,this.liquidationValue,this.liquidationPercentageChange,this._options),ue(e.RV_BUSINESS_VALUATIONS_DISCOUNTED_CASH_FLOW,this.discountedCashflowValue,this.discountedCashflowPercentageChange,this._options)),t("div",{class:"rv-valuation-group"},ue(e.RV_BUSINESS_VALUATIONS_MULTIPLE_TO_REVENUE,this.multipleToRevenueValue,this.multipleToRevenuePercentageChange,this._options),ue(e.RV_BUSINESS_VALUATIONS_FIRST_CHICAGO,this.firstChicagoValue,this.firstChicagoPercentageChange,this._options)))};return t("div",{class:"rv-container",style:(n=(i=this._options)===null||i===void 0?void 0:i.container)===null||n===void 0?void 0:n.style},t("div",{class:"rv-header-container"},((s=(o=this._options)===null||o===void 0?void 0:o.title)===null||s===void 0?void 0:s.visible)===false?"":t(l,null)),a())}static get watchers(){return{configuration:["watchConfiguration"],filter:["watchFilter"],options:["watchOptions"]}}};fe.style=ce;const pe=async({filter:i})=>{let t;try{const e=i.endDate?m(g(i.endDate),y):"";const n=s(Object.assign(Object.assign({},i),{endDate:e}),[e&&"endDate",R.CONNECTION_UUID]);t=await l.getReportData({path:F[i.reportType],filter:n})}catch(i){a(e.RV_NOT_ABLE_TO_RETRIEVE_REPORT_DATA,i);t={error:i}}return t};const me='@font-face{font-family:Inter;src:url("../assets/fonts/Inter-italic-var.woff2");font-family:Inter;src:url("../assets/fonts/Inter-upright-var.woff2")}body,div[class^=railz-],div[class*=" railz-"]{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-container{display:flex;padding:16px;position:relative;border:1px solid #eee;border-radius:7px;flex-direction:column;justify-content:space-between;width:auto;height:300px}.rv-container *{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-header-container{display:flex;flex-direction:column}.rv-gauge-chart-container{height:225px}.rv-title{display:flex;color:#015b7e;font-size:18px;font-weight:600;margin:0;padding:0;text-align:left;flex-grow:1;line-height:1.235}.rv-score-last-updated{align-self:center;text-align:center;font-size:12px;font-weight:500;line-height:28px;width:100%}';const ge=class{constructor(n){i(this,n);this.loading="";this.validateParams=async(i,t,n,o=true)=>{this._configuration=r(i);if(this._configuration){d.configuration=this._configuration;try{this._filter=v(t);this._options=c(n);if(h(this._filter)){if(z(this._filter.reportType)){if(o){await this.requestReportData()}}else{this.errorStatusCode=500;a(e.RV_ERROR_INVALID_REPORT_TYPE)}}else{this.errorStatusCode=204}}catch(i){this.errorStatusCode=500;a(i)}}else{this.errorStatusCode=0}};this.propsUpdated=async(i=true)=>{await this.validateParams(this.configuration,this.filter,this.options,i)};this.requestReportData=async()=>{var i;this.errorStatusCode=undefined;this.loading=e.RV_LOADING_REPORT;try{const t=await pe({filter:this._filter});if(t===null||t===void 0?void 0:t.data){this.asOfDate=t.meta.endDate;this._data=t.data}else if(t===null||t===void 0?void 0:t.error){a(e.RV_NOT_ABLE_TO_RETRIEVE_REPORT_DATA);this.errorStatusCode=(i=t.error)===null||i===void 0?void 0:i.statusCode}else{a(e.RV_ERROR_202_TITLE);this.errorStatusCode=t===null||t===void 0?void 0:t.status}}catch(i){a(e.RV_NOT_ABLE_TO_PARSE_REPORT_DATA,i)}finally{this.loading=""}};this.renderMain=()=>{var i,e;if(this.errorStatusCode!==undefined){return t("railz-error-image",Object.assign({statusCode:this.errorStatusCode||500},(i=this._options)===null||i===void 0?void 0:i.errorIndicator))}if(!B(this.loading)){return t("railz-loading",Object.assign({loadingText:this.loading},(e=this._options)===null||e===void 0?void 0:e.loadingIndicator))}return t("div",{class:"rv-gauge-chart-container"},t("railz-gauge-chart",{mode:"inherit",options:this._options,data:this._data}))}}async watchConfiguration(i,t){if(i&&t&&!P(t,i)){await this.validateParams(i,this.filter,this.options)}}async watchFilter(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,i,this.options)}}async watchOptions(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,this.filter,i)}}componentWillLoad(){this.propsUpdated&&this.propsUpdated()}render(){var i,n,o,s,l,a,r,d;if(this.errorStatusCode===0){return null}const v=()=>{var i,n,o,s,l,a,r,d,v,c,h,u,f;return t("p",{class:"rv-title",style:(n=(i=this._options)===null||i===void 0?void 0:i.title)===null||n===void 0?void 0:n.style},((s=(o=this._options)===null||o===void 0?void 0:o.content)===null||s===void 0?void 0:s.title)||p((l=this._filter)===null||l===void 0?void 0:l.reportType)||""," ",((r=(a=this._options)===null||a===void 0?void 0:a.tooltipIndicator)===null||r===void 0?void 0:r.visible)===false?"":t("railz-tooltip",{tooltipStyle:Object.assign(Object.assign({position:"bottom-center"},(d=this._options)===null||d===void 0?void 0:d.tooltipIndicator),{style:Object.assign({marginLeft:"5px"},(c=(v=this._options)===null||v===void 0?void 0:v.tooltipIndicator)===null||c===void 0?void 0:c.style)}),tooltipText:((f=(u=(h=this._options)===null||h===void 0?void 0:h.content)===null||u===void 0?void 0:u.tooltip)===null||f===void 0?void 0:f.description)||e.RV_TOOLTIP_CREDIT_SCORE}))};const c=()=>{var i,n,o,s,l,a,r,d,v,c,h,u,f;return this.errorStatusCode||B(this.asOfDate)||((n=(i=this._options)===null||i===void 0?void 0:i.subTitle)===null||n===void 0?void 0:n.visible)===false?t("span",null):t("p",{class:"rv-score-last-updated",style:Object.assign({fontFamily:((s=(o=this._options)===null||o===void 0?void 0:o.chart)===null||s===void 0?void 0:s.fontFamily)||$},(a=(l=this._options)===null||l===void 0?void 0:l.subTitle)===null||a===void 0?void 0:a.style)},((d=(r=this._options)===null||r===void 0?void 0:r.content)===null||d===void 0?void 0:d.subTitle)||e.RV_AS_OF," ",((c=(v=this._options)===null||v===void 0?void 0:v.subTitle)===null||c===void 0?void 0:c.dateVisible)===false?"":m(g(this.asOfDate),((f=(u=(h=this.options)===null||h===void 0?void 0:h.content)===null||u===void 0?void 0:u.date)===null||f===void 0?void 0:f.format)||"dd MMM yyyy"))};return t("div",{class:"rv-container",style:(n=(i=this._options)===null||i===void 0?void 0:i.container)===null||n===void 0?void 0:n.style},t("div",{class:"rv-header-container"},((s=(o=this._options)===null||o===void 0?void 0:o.title)===null||s===void 0?void 0:s.visible)===false?"":t(v,null),((a=(l=this._options)===null||l===void 0?void 0:l.subTitle)===null||a===void 0?void 0:a.position)==="top"&&t(c,null)),this.renderMain(),((d=(r=this._options)===null||r===void 0?void 0:r.subTitle)===null||d===void 0?void 0:d.position)!=="top"&&t(c,null))}static get watchers(){return{configuration:["watchConfiguration"],filter:["watchFilter"],options:["watchOptions"]}}};ge.style=me;const ye=async({filter:i})=>{let t;try{const e=m(g(i.startDate),y);const n=m(g(i.endDate),y);const o=s(Object.assign(Object.assign({},i),{startDate:e,endDate:n}),[R.START_DATE,R.END_DATE,R.REPORT_FREQUENCY,R.CONNECTION_UUID]);t=await l.getReportData({path:F[i.reportType],filter:o})}catch(i){a(e.RV_NOT_ABLE_TO_RETRIEVE_REPORT_DATA,i);t={error:i}}return t};const xe='@font-face{font-family:Inter;src:url("../assets/fonts/Inter-italic-var.woff2");font-family:Inter;src:url("../assets/fonts/Inter-upright-var.woff2")}body,div[class^=railz-],div[class*=" railz-"]{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-container{display:flex;padding:16px;position:relative;border:1px solid #eee;border-radius:7px;flex-direction:column;width:auto;height:360px}.rv-container *{font-family:Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.rv-header-container{display:flex}.rv-title{display:flex;color:#015b7e;font-size:18px;font-weight:600;margin:0;padding:0;text-align:left;flex-grow:1;line-height:1.235}.rv-financial-ratios{overflow-y:auto;overflow-x:hidden;padding-top:8px;height:100%}.rv-financial-ratio-container-item{display:flex;flex-grow:1;padding-top:8px;border-bottom:thin solid #e0e0e0;padding-bottom:8px;justify-content:space-between;overflow:visible}.rv-financial-ratio-container-item:last-child{border-bottom:none}.rv-financial-ratio-info{display:flex;flex-direction:column}.rv-financial-ratio-info .rv-ratio-name{display:flex;line-height:1.5;color:#424242;font-size:12px;font-weight:600}.rv-financial-ratio-info .rv-ratio-name .rv-ratio-name-text{padding-left:4px}.rv-financial-ratio-info .rv-ratio-values{display:flex;flex-grow:1;align-items:center}.rv-financial-ratio-info .rv-ratio-values .rv-ratio-summary{line-height:1.5;font-size:20px;max-width:70%;font-weight:700;margin-right:8px}.rv-select{border:0;font-size:14px}';const be=class{constructor(n){i(this,n);this.loading="";this.validateParams=async(i,t,n,o=true)=>{this._configuration=r(i);if(this._configuration){d.configuration=this._configuration;try{this._filter=v(t);this._options=c(n);if(h(this._filter)){if(O(this._filter.reportType)){if(o){await this.requestReportData()}}else{this.errorStatusCode=500;a(e.RV_ERROR_INVALID_REPORT_TYPE)}}else{this.errorStatusCode=204}}catch(i){this.errorStatusCode=500;a(i)}}else{this.errorStatusCode=0}};this.propsUpdated=async(i=true)=>{await this.validateParams(this.configuration,this.filter,this.options,i)};this.handleSelected=i=>{const t=Object.keys(this._summary);const e=t[i];this._selected=this._summary[e]};this.requestReportData=async()=>{var i,t;this.errorStatusCode=undefined;this.loading=e.RV_LOADING_REPORT;try{const e=await ye({filter:this._filter});if(e===null||e===void 0?void 0:e.data){this._summary=e===null||e===void 0?void 0:e.data;if(!B(this._summary)){this.handleSelected(0)}else{this.errorStatusCode=(i=e.error)===null||i===void 0?void 0:i.statusCode}}else if(e===null||e===void 0?void 0:e.error){this.errorStatusCode=(t=e.error)===null||t===void 0?void 0:t.statusCode}else{this.errorStatusCode=e===null||e===void 0?void 0:e.status}}catch(i){a(e.RV_NOT_ABLE_TO_PARSE_REPORT_DATA,i)}finally{this.loading=""}};this.renderMain=()=>{var i,n,o;if(this.errorStatusCode!==undefined){return t("railz-error-image",Object.assign({statusCode:this.errorStatusCode||500},(i=this._options)===null||i===void 0?void 0:i.errorIndicator))}if(!B(this.loading)){return t("railz-loading",Object.assign({loadingText:this.loading},(n=this._options)===null||n===void 0?void 0:n.loadingIndicator))}const s=({key:i,ratioValue:n})=>{var o,s,l,a,r,d,v,c,h,u,f,p,m,g,y,x,b,w,j,I,S;const z=(i,t=false)=>{var n,o,s,l,a,r;const d=Object.keys(L).find((t=>L[t]===i));const v=L[d];const c=(s=(o=(n=this._options)===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.label)===null||s===void 0?void 0:s[v];const h=(r=(a=(l=this._options)===null||l===void 0?void 0:l.content)===null||a===void 0?void 0:a.tooltip)===null||r===void 0?void 0:r[v];if(t){if(h)return h;return e["RV_FINANCIAL_RATIO_TOOLTIP_"+d]}if(c)return c;return e["RV_FINANCIAL_RATIO_"+d]||Kt(i)};const O=this._selected[i];const C=z(i,true);return t("div",{class:"rv-financial-ratio-container-item",style:(s=(o=this._options)===null||o===void 0?void 0:o.ratio)===null||s===void 0?void 0:s.itemContainer},t("div",{class:"rv-financial-ratio-info",style:(a=(l=this._options)===null||l===void 0?void 0:l.ratio)===null||a===void 0?void 0:a.itemInfo},t("div",{class:"rv-ratio-name",style:(d=(r=this._options)===null||r===void 0?void 0:r.ratio)===null||d===void 0?void 0:d.itemName},!B(C)&&(((h=(c=(v=this._options)===null||v===void 0?void 0:v.ratio)===null||c===void 0?void 0:c.itemToolTip)===null||h===void 0?void 0:h.visible)===false?"":t("railz-tooltip",{tooltipText:C,tooltipStyle:Object.assign({position:"bottom-right"},(f=(u=this._options)===null||u===void 0?void 0:u.ratio)===null||f===void 0?void 0:f.itemToolTip)})),t("div",{class:"rv-ratio-name-text",style:(m=(p=this._options)===null||p===void 0?void 0:p.ratio)===null||m===void 0?void 0:m.itemNameText},z(i))),t("div",{class:"rv-ratio-values",style:(y=(g=this._options)===null||g===void 0?void 0:g.ratio)===null||y===void 0?void 0:y.itemSummary},t("div",{class:"rv-ratio-summary",style:(b=(x=this._options)===null||x===void 0?void 0:x.ratio)===null||b===void 0?void 0:b.itemValue},A(O.currentValue)),t("div",{class:"rv-ratio-percentage"},t("railz-percentage",{percentage:O.percentageChange,percentageStyle:(j=(w=this._options)===null||w===void 0?void 0:w.ratio)===null||j===void 0?void 0:j.itemPercentage})))),t("railz-sparkline-chart",{data:O.timePeriodData,sparkLineStyle:(S=(I=this._options)===null||I===void 0?void 0:I.ratio)===null||S===void 0?void 0:S.sparkLine}))};return this._selected&&t("div",{class:"rv-financial-ratios"},(o=Object.entries(this._selected))===null||o===void 0?void 0:o.map((([i,e])=>t(s,{key:i,ratioValue:e}))))}}async watchConfiguration(i,t){if(i&&t&&!P(t,i)){await this.validateParams(i,this.filter,this.options)}}async watchFilter(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,i,this.options)}}async watchOptions(i,t){if(i&&t&&!P(t,i)){await this.validateParams(this.configuration,this.filter,i)}}componentWillLoad(){this.propsUpdated&&this.propsUpdated()}render(){var i,n,o,s,l,a;if(this.errorStatusCode===0){return null}const r=()=>{var i,e,n,o,s,l,a,r,d,v,c,h,u,f,m,g;return t("p",{class:"rv-title",style:(e=(i=this._options)===null||i===void 0?void 0:i.title)===null||e===void 0?void 0:e.style},((o=(n=this._options)===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.title)||p((s=this._filter)===null||s===void 0?void 0:s.reportType)||""," ",((a=(l=this._options)===null||l===void 0?void 0:l.tooltipIndicator)===null||a===void 0?void 0:a.visible)&&((v=(d=(r=this._options)===null||r===void 0?void 0:r.content)===null||d===void 0?void 0:d.tooltip)===null||v===void 0?void 0:v.description)?t("railz-tooltip",{tooltipStyle:Object.assign(Object.assign({position:"bottom-center"},(c=this._options)===null||c===void 0?void 0:c.tooltipIndicator),{style:Object.assign({marginLeft:"5px"},(u=(h=this._options)===null||h===void 0?void 0:h.tooltipIndicator)===null||u===void 0?void 0:u.style)}),tooltipText:(g=(m=(f=this._options)===null||f===void 0?void 0:f.content)===null||m===void 0?void 0:m.tooltip)===null||g===void 0?void 0:g.description}):null)};const d=()=>{var i,n;const o=Object.keys(this._summary).map((i=>e[`RV_FINANCIAL_RATIO_TYPE_${i.toUpperCase()}`]));return t("railz-select",{items:o,key:this.loading,selectStyle:(n=(i=this._options)===null||i===void 0?void 0:i.ratio)===null||n===void 0?void 0:n.select,onSelectedItem:i=>{this.handleSelected(i.detail)}})};return t("div",{class:"rv-container",style:(n=(i=this._options)===null||i===void 0?void 0:i.container)===null||n===void 0?void 0:n.style},t("div",{class:"rv-header-container",style:(s=(o=this._options)===null||o===void 0?void 0:o.ratio)===null||s===void 0?void 0:s.header},((a=(l=this._options)===null||l===void 0?void 0:l.title)===null||a===void 0?void 0:a.visible)===false?"":t(r,null),!B(this._summary)&&t(d,null)),this.renderMain())}static get watchers(){return{configuration:["watchConfiguration"],filter:["watchFilter"],options:["watchOptions"]}}};be.style=xe;var we=W((function(i){(function(t){i.exports?(t["default"]=t,i.exports=t):t("undefined"!==typeof Highcharts?Highcharts:void 0)})((function(i){function t(i,t,e,n){i.hasOwnProperty(t)||(i[t]=n.apply(null,e))}i=i?i._modules:{};t(i,"Series/VariablePie/VariablePieSeries.js",[i["Core/Series/SeriesRegistry.js"],i["Core/Utilities.js"]],(function(i,t){var e=this&&this.__extends||function(){var i=function(t,e){i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e])};return i(t,e)};return function(t,e){function n(){this.constructor=t}i(t,e);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),n=i.seriesTypes.pie,o=t.arrayMax,s=t.arrayMin,l=t.clamp,a=t.extend,r=t.fireEvent,d=t.merge,v=t.