(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{242:function(t,e,s){s(413),t.exports=s(418)},245:function(t,e,s){"use strict";s(61)},246:function(t,e,s){(t.exports=s(35)(!1)).push([t.i,".dropdown-item[data-v-03e62f58],.dropdown-item[data-v-03e62f58]:hover{color:#212529}",""])},275:function(t,e,s){var a={"./af":70,"./af.js":70,"./ar":71,"./ar-dz":72,"./ar-dz.js":72,"./ar-kw":73,"./ar-kw.js":73,"./ar-ly":74,"./ar-ly.js":74,"./ar-ma":75,"./ar-ma.js":75,"./ar-sa":76,"./ar-sa.js":76,"./ar-tn":77,"./ar-tn.js":77,"./ar.js":71,"./az":78,"./az.js":78,"./be":79,"./be.js":79,"./bg":80,"./bg.js":80,"./bm":81,"./bm.js":81,"./bn":82,"./bn-bd":83,"./bn-bd.js":83,"./bn.js":82,"./bo":84,"./bo.js":84,"./br":85,"./br.js":85,"./bs":86,"./bs.js":86,"./ca":87,"./ca.js":87,"./cs":88,"./cs.js":88,"./cv":89,"./cv.js":89,"./cy":90,"./cy.js":90,"./da":91,"./da.js":91,"./de":92,"./de-at":93,"./de-at.js":93,"./de-ch":94,"./de-ch.js":94,"./de.js":92,"./dv":95,"./dv.js":95,"./el":96,"./el.js":96,"./en-au":97,"./en-au.js":97,"./en-ca":98,"./en-ca.js":98,"./en-gb":99,"./en-gb.js":99,"./en-ie":100,"./en-ie.js":100,"./en-il":101,"./en-il.js":101,"./en-in":102,"./en-in.js":102,"./en-nz":103,"./en-nz.js":103,"./en-sg":104,"./en-sg.js":104,"./eo":105,"./eo.js":105,"./es":106,"./es-do":107,"./es-do.js":107,"./es-mx":108,"./es-mx.js":108,"./es-us":109,"./es-us.js":109,"./es.js":106,"./et":110,"./et.js":110,"./eu":111,"./eu.js":111,"./fa":112,"./fa.js":112,"./fi":113,"./fi.js":113,"./fil":114,"./fil.js":114,"./fo":115,"./fo.js":115,"./fr":116,"./fr-ca":117,"./fr-ca.js":117,"./fr-ch":118,"./fr-ch.js":118,"./fr.js":116,"./fy":119,"./fy.js":119,"./ga":120,"./ga.js":120,"./gd":121,"./gd.js":121,"./gl":122,"./gl.js":122,"./gom-deva":123,"./gom-deva.js":123,"./gom-latn":124,"./gom-latn.js":124,"./gu":125,"./gu.js":125,"./he":126,"./he.js":126,"./hi":127,"./hi.js":127,"./hr":128,"./hr.js":128,"./hu":129,"./hu.js":129,"./hy-am":130,"./hy-am.js":130,"./id":131,"./id.js":131,"./is":132,"./is.js":132,"./it":133,"./it-ch":134,"./it-ch.js":134,"./it.js":133,"./ja":135,"./ja.js":135,"./jv":136,"./jv.js":136,"./ka":137,"./ka.js":137,"./kk":138,"./kk.js":138,"./km":139,"./km.js":139,"./kn":140,"./kn.js":140,"./ko":141,"./ko.js":141,"./ku":142,"./ku.js":142,"./ky":143,"./ky.js":143,"./lb":144,"./lb.js":144,"./lo":145,"./lo.js":145,"./lt":146,"./lt.js":146,"./lv":147,"./lv.js":147,"./me":148,"./me.js":148,"./mi":149,"./mi.js":149,"./mk":150,"./mk.js":150,"./ml":151,"./ml.js":151,"./mn":152,"./mn.js":152,"./mr":153,"./mr.js":153,"./ms":154,"./ms-my":155,"./ms-my.js":155,"./ms.js":154,"./mt":156,"./mt.js":156,"./my":157,"./my.js":157,"./nb":158,"./nb.js":158,"./ne":159,"./ne.js":159,"./nl":160,"./nl-be":161,"./nl-be.js":161,"./nl.js":160,"./nn":162,"./nn.js":162,"./oc-lnc":163,"./oc-lnc.js":163,"./pa-in":164,"./pa-in.js":164,"./pl":165,"./pl.js":165,"./pt":166,"./pt-br":167,"./pt-br.js":167,"./pt.js":166,"./ro":168,"./ro.js":168,"./ru":169,"./ru.js":169,"./sd":170,"./sd.js":170,"./se":171,"./se.js":171,"./si":172,"./si.js":172,"./sk":173,"./sk.js":173,"./sl":174,"./sl.js":174,"./sq":175,"./sq.js":175,"./sr":176,"./sr-cyrl":177,"./sr-cyrl.js":177,"./sr.js":176,"./ss":178,"./ss.js":178,"./sv":179,"./sv.js":179,"./sw":180,"./sw.js":180,"./ta":181,"./ta.js":181,"./te":182,"./te.js":182,"./tet":183,"./tet.js":183,"./tg":184,"./tg.js":184,"./th":185,"./th.js":185,"./tk":186,"./tk.js":186,"./tl-ph":187,"./tl-ph.js":187,"./tlh":188,"./tlh.js":188,"./tr":189,"./tr.js":189,"./tzl":190,"./tzl.js":190,"./tzm":191,"./tzm-latn":192,"./tzm-latn.js":192,"./tzm.js":191,"./ug-cn":193,"./ug-cn.js":193,"./uk":194,"./uk.js":194,"./ur":195,"./ur.js":195,"./uz":196,"./uz-latn":197,"./uz-latn.js":197,"./uz.js":196,"./vi":198,"./vi.js":198,"./x-pseudo":199,"./x-pseudo.js":199,"./yo":200,"./yo.js":200,"./zh-cn":201,"./zh-cn.js":201,"./zh-hk":202,"./zh-hk.js":202,"./zh-mo":203,"./zh-mo.js":203,"./zh-tw":204,"./zh-tw.js":204};function r(t){var e=n(t);return s(e)}function n(t){if(!s.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}r.keys=function(){return Object.keys(a)},r.resolve=n,t.exports=r,r.id=275},413:function(t,e,s){"use strict";s.r(e);var a=s(34),r=s(51),n=s(50),i=s(52),o=s(53),l={name:"BudgetLimitRow",mounted:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},data:function(){return{locale:"en-US"}},props:{budgetLimit:{type:Object,default:function(){return{}}},budget:{type:Object,default:function(){return{}}}}},c=s(1),d=Object(c.a)(l,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("tr",[s("td",{staticStyle:{width:"25%"}},[s("a",{attrs:{href:"./budgets/show/"+t.budgetLimit.budget_id}},[t._v(t._s(t.budgetLimit.budget_name))])]),t._v(" "),s("td",{staticStyle:{"vertical-align":"middle"}},[s("div",{staticClass:"progress progress active"},[s("div",{staticClass:"progress-bar bg-success progress-bar-striped",style:"width: "+t.budgetLimit.pctGreen+"%;",attrs:{role:"progressbar","aria-valuenow":t.budgetLimit.pctGreen,"aria-valuemin":"0","aria-valuemax":"100"}},[t.budgetLimit.pctGreen>35?s("span",[t._v("\n Spent\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent))+"\n of\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount))+"\n ")]):t._e()]),t._v(" "),s("div",{staticClass:"progress-bar bg-warning progress-bar-striped",style:"width: "+t.budgetLimit.pctOrange+"%;",attrs:{role:"progressbar","aria-valuenow":t.budgetLimit.pctOrange,"aria-valuemin":"0","aria-valuemax":"100"}},[t.budgetLimit.pctRed<=50&&t.budgetLimit.pctOrange>35?s("span",[t._v("\n Spent\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent))+"\n of\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount))+"\n ")]):t._e()]),t._v(" "),s("div",{staticClass:"progress-bar bg-danger progress-bar-striped",style:"width: "+t.budgetLimit.pctRed+"%;",attrs:{role:"progressbar","aria-valuenow":t.budgetLimit.pctRed,"aria-valuemin":"0","aria-valuemax":"100"}},[t.budgetLimit.pctOrange<=50&&t.budgetLimit.pctRed>35?s("span",[t._v("\n Spent\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent))+"\n of\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount))+"\n ")]):t._e()])]),t._v(" "),s("small",{staticClass:"d-none d-lg-block"},[t._v("\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.budgetLimit.start))+"\n →\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.budgetLimit.end))+"\n ")])]),t._v(" "),s("td",{staticClass:"align-middle d-none d-lg-table-cell",staticStyle:{width:"10%"}},[parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)>0?s("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)))+"\n ")]):t._e(),t._v(" "),0===parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)?s("span",{staticClass:"text-muted"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(0))+"\n ")]):t._e(),t._v(" "),parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)<0?s("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)))+"\n ")]):t._e()])])}),[],!1,null,"20d55ede",null).exports,u={name:"BudgetRow",mounted:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},data:function(){return{locale:"en-US"}},props:{budget:{type:Object,default:{}}}},m={name:"BudgetListGroup",components:{BudgetLimitRow:d,BudgetRow:Object(c.a)(u,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("tr",[s("td",{staticStyle:{width:"25%"}},[s("a",{attrs:{href:"./budgets/show/"+t.budget.id}},[t._v(t._s(t.budget.name))])]),t._v(" "),s("td",{staticClass:"align-middle text-right"},[s("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budget.currency_code}).format(parseFloat(t.budget.spent)))+"\n ")])])])}),[],!1,null,"3e0b277e",null).exports},props:{title:String,budgetLimits:Array,budgets:Array}},p={name:"MainBudgetList",components:{BudgetListGroup:Object(c.a)(m,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.title))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",[t._l(t.budgetLimits,(function(t,e){return s("BudgetLimitRow",{key:e,attrs:{budgetLimit:t}})})),t._v(" "),t._l(t.budgets,(function(t,e){return s("BudgetRow",{key:e,attrs:{budget:t}})}))],2)])]),t._v(" "),s("div",{staticClass:"card-footer"},[s("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./budgets"}},[s("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_budgets")))])])])}),[],!1,null,"1480b15a",null).exports},data:function(){return{budgetList:["daily","weekly","monthly","quarterly","half_year","yearly","other"],budgetLimits:{daily:[],weekly:[],monthly:[],quarterly:[],half_year:[],yearly:[],other:[]},budgets:{},rawBudgets:[],locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.collectData()},methods:{collectData:function(){this.getBudgets()},getBudgets:function(){var t=this;axios.get("./api/v1/budgets?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseBudgets(e.data)}))},parseBudgets:function(t){for(var e in t.data)if(t.data.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var s=t.data[e];for(var a in s.attributes.spent)if(s.attributes.spent.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294){var r=s.attributes.spent[a];this.rawBudgets.push({id:parseInt(s.id),name:s.attributes.name,currency_id:parseInt(r.currency_id),currency_code:r.currency_code,spent:r.sum})}}this.getBudgetLimits()},getBudgetLimits:function(){var t=this;axios.get("./api/v1/budgets/limits?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseBudgetLimits(e.data)}))},parseBudgetLimits:function(t){for(var e in t.included)t.included.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294&&(this.budgets[t.included[e].id]={id:t.included[e].id,name:t.included[e].attributes.name});for(var s in t.data)if(t.data.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294){var a,r=0,n=0,i=0;this.filterBudgets(t.data[s].attributes.budget_id,t.data[s].attributes.currency_id),0!==parseFloat(t.data[s].attributes.spent)&&-1*parseFloat(t.data[s].attributes.spent)parseFloat(t.data[s].attributes.amount)&&(i=100-(n=parseFloat(t.data[s].attributes.amount)/parseFloat(t.data[s].attributes.spent)*-1*100));var o={id:t.data[s].id,amount:t.data[s].attributes.amount,budget_id:t.data[s].attributes.budget_id,budget_name:this.budgets[t.data[s].attributes.budget_id].name,currency_id:t.data[s].attributes.currency_id,currency_code:t.data[s].attributes.currency_code,period:t.data[s].attributes.period,start:new Date(t.data[s].attributes.start),end:new Date(t.data[s].attributes.end),spent:t.data[s].attributes.spent,pctGreen:r,pctOrange:n,pctRed:i},l=null!==(a=t.data[s].attributes.period)&&void 0!==a?a:"other";this.budgetLimits[l].push(o)}},filterBudgets:function(t,e){for(var s in this.rawBudgets)this.rawBudgets.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&this.rawBudgets[s].currency_id===e&&this.rawBudgets[s].id===t&&this.rawBudgets.splice(s,1)}}},g=Object(c.a)(p,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"row"},[t.budgetLimits.daily.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.daily_budgets"),budgetLimits:t.budgetLimits.daily}})],1):t._e(),t._v(" "),t.budgetLimits.weekly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.weekly_budgets"),budgetLimits:t.budgetLimits.weekly}})],1):t._e(),t._v(" "),t.budgetLimits.monthly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.monthly_budgets"),budgetLimits:t.budgetLimits.monthly}})],1):t._e(),t._v(" "),t.budgetLimits.quarterly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.quarterly_budgets"),budgetLimits:t.budgetLimits.quarterly}})],1):t._e(),t._v(" "),t.budgetLimits.half_year.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.half_year_budgets"),budgetLimits:t.budgetLimits.half_year}})],1):t._e(),t._v(" "),t.budgetLimits.yearly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.yearly_budgets"),budgetLimits:t.budgetLimits.yearly}})],1):t._e(),t._v(" "),t.budgetLimits.other.length>0||t.rawBudgets.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.other_budgets"),budgetLimits:t.budgetLimits.other,budgets:t.rawBudgets}})],1):t._e()])])}),[],!1,null,"f0d512f0",null).exports,b={name:"MainCreditList",data:function(){return{locale:"en-US",income:[],max:0}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.getExpenses()},methods:{getExpenses:function(){var t=this;axios.get("./api/v1/insight/income/date/basic?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseExpenses(e.data)}))},parseExpenses:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var s=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,s.pct=100),0!==parseInt(e)&&(s.pct=t[e].difference_float/this.max*100),this.income.push(s)}}}},f=Object(c.a)(b,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.revenue_accounts")))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",t._l(t.income,(function(e){return s("tr",[s("td",{staticStyle:{width:"20%"}},[s("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),s("td",{staticClass:"align-middle"},[e.pct>0?s("div",{staticClass:"progress"},[s("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.pct+"%"},attrs:{role:"progressbar","aria-valuenow":e.pct,"aria-valuemin":"0","aria-valuemax":"100"}},[e.pct>20?s("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]),t._v(" "),e.pct<=20?s("span",[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]):t._e()])])})),0)])]),t._v(" "),s("div",{staticClass:"card-footer"},[s("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/deposit"}},[s("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_deposits")))])])])}),[],!1,null,null,null).exports,v={name:"MainDebitList",data:function(){return{locale:"en-US",expenses:[],max:0}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.getExpenses()},methods:{getExpenses:function(){var t=this;axios.get("./api/v1/insight/expense/date/basic?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseExpenses(e.data)}))},parseExpenses:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var s=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,s.pct=100),0!==parseInt(e)&&(s.pct=t[e].difference_float/this.max*100),this.expenses.push(s)}}}},y=Object(c.a)(v,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.expense_accounts")))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",t._l(t.expenses,(function(e){return s("tr",[s("td",{staticStyle:{width:"20%"}},[s("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),s("td",{staticClass:"align-middle"},[e.pct>0?s("div",{staticClass:"progress"},[s("div",{staticClass:"progress-bar progress-bar-striped bg-danger",style:{width:e.pct+"%"},attrs:{role:"progressbar","aria-valuenow":e.pct,"aria-valuemin":"0","aria-valuemax":"100"}},[e.pct>20?s("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]),t._v(" "),e.pct<=20?s("span",[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]):t._e()])])})),0)])]),t._v(" "),s("div",{staticClass:"card-footer"},[s("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/withdrawal"}},[s("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_withdrawals")))])])])}),[],!1,null,null,null).exports,_=s(54),h=s(55),j=s(56),w=s(57),L=s(235),C=s.n(L),x={name:"Calendar",created:function(){},data:function(){return{locale:"en-US",range:{start:new Date(window.sessionStart),end:new Date(window.sessionEnd)},defaultRange:{start:new Date(window.sessionStart),end:new Date(window.sessionEnd)}}}},F=(s(245),Object(c.a)(x,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[t._v("Start")]),t._v(" "),s("div",{staticClass:"col-8"},[t._v(t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.range.start)))])]),t._v(" "),s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[t._v("End")]),t._v(" "),s("div",{staticClass:"col-8"},[t._v(t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.range.end)))])]),t._v(" "),s("date-picker",{attrs:{mode:"date",rows:"2","is-range":""},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.inputValue,r=e.inputEvents,n=e.isDragging,i=e.togglePopover;return[s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[s("div",{staticClass:"btn-group btn-group-sm d-flex"},[s("button",{staticClass:"btn btn-secondary btn-sm",on:{click:function(t){return i({placement:"auto-start",positionFixed:!0})}}},[s("i",{staticClass:"fas fa-calendar-alt"})]),t._v(" "),s("button",{staticClass:"btn btn-secondary"},[s("i",{staticClass:"fas fa-history"})]),t._v(" "),s("button",{staticClass:"btn btn-secondary dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[s("i",{staticClass:"fas fa-list"})]),t._v(" "),s("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"dropdownMenuButton"}},[s("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(prev period)")]),t._v(" "),s("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(next period)")]),t._v(" "),s("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(this week?)")])])]),t._v(" "),s("input",t._g({class:n?"text-gray-600":"text-gray-900",attrs:{type:"hidden"},domProps:{value:a.start}},r.start)),t._v(" "),s("input",t._g({class:n?"text-gray-600":"text-gray-900",attrs:{type:"hidden"},domProps:{value:a.end}},r.end))])])]}}]),model:{value:t.range,callback:function(e){t.range=e},expression:"range"}})],1)}),[],!1,null,"03e62f58",null).exports),k={name:"MainCategoryList",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.getCategories()},data:function(){return{locale:"en-US",categories:[],sortedList:[],spent:0,earned:0}},methods:{getCategories:function(){var t=this;axios.get("./api/v1/categories?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseCategories(e.data)}))},parseCategories:function(t){for(var e in t.data)if(t.data.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var s=t.data[e],a=null,r=parseInt(s.id);for(var n in s.attributes.spent)if(s.attributes.spent.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var i,o=s.attributes.spent[n];a=o.currency_id.toString()+"-"+s.id.toString(),this.categories[a]=null!==(i=this.categories[a])&&void 0!==i?i:{id:r,name:s.attributes.name,currency_code:o.currency_code,currency_symbol:o.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[a].spent=parseFloat(o.sum),this.spent=parseFloat(o.sum)this.earned?parseFloat(d.sum):this.earned}}this.sortCategories()},sortCategories:function(){var t=[];for(var e in this.categories)this.categories.hasOwnProperty(e)&&t.push(this.categories[e]);for(var s in t.sort((function(t,e){return t.spent+t.earned-(e.spent+e.earned)})),t)if(t.hasOwnProperty(s)){var a=t[s];a.spentPct=a.spent/this.spent*100,a.earnedPct=a.earned/this.earned*100,this.sortedList.push(a)}}}},S=Object(c.a)(k,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.categories")))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",t._l(t.sortedList,(function(e){return s("tr",[s("td",{staticStyle:{width:"20%"}},[s("a",{attrs:{href:"./categories/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),s("td",{staticClass:"align-middle"},[e.spentPct>0?s("div",{staticClass:"progress"},[s("div",{staticClass:"progress-bar progress-bar-striped bg-danger",style:{width:e.spentPct+"%"},attrs:{role:"progressbar","aria-valuenow":e.spentPct,"aria-valuemin":"0","aria-valuemax":"100"}},[e.spentPct>20?s("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.spent))+"\n ")]):t._e()]),t._v(" "),e.spentPct<=20?s("span",[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.spent))+"\n ")]):t._e()]):t._e(),t._v(" "),e.earnedPct>0?s("div",{staticClass:"progress justify-content-end",attrs:{title:"hello2"}},[e.earnedPct<=20?s("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n  ")]):t._e(),t._v(" "),s("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.earnedPct+"%"},attrs:{role:"progressbar","aria-valuenow":e.earnedPct,"aria-valuemin":"0","aria-valuemax":"100",title:"hello"}},[e.earnedPct>20?s("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n ")]):t._e()])]):t._e()])])})),0)])])])}),[],!1,null,"00bc733f",null).exports,$=s(2),B=s.n($),O=s(3),P=s(22);s(16),s(274),B.a.component("transaction-list-large",h.a),B.a.component("transaction-list-medium",j.a),B.a.component("transaction-list-small",w.a),B.a.component("date-picker",C.a),B.a.component("dashboard",a.a),B.a.component("top-boxes",r.a),B.a.component("main-account",n.a),B.a.component("main-account-list",i.a),B.a.component("main-bills-list",o.a),B.a.component("main-budget-list",g),B.a.component("main-category-list",S),B.a.component("main-debit-list",y),B.a.component("main-credit-list",f),B.a.component("main-piggy-list",_.a),B.a.use(O.c);var I=s(18),E={};new B.a({i18n:I,store:P.a,el:"#dashboard",render:function(t){return t(a.a,{props:E})},beforeCreate:function(){this.$store.commit("initialiseStore"),this.$store.dispatch("updateCurrencyPreference")}}),new B.a({i18n:I,store:P.a,el:"#calendar",render:function(t){return t(F,{props:E})}})},418:function(t,e){},61:function(t,e,s){var a=s(246);"string"==typeof a&&(a=[[t.i,a,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};s(36)(a,r);a.locals&&(t.exports=a.locals)}},[[242,0,1]]]); //# sourceMappingURL=dashboard.js.map