From 4e835d91c13af3c98caa4e0bc64c3a21496d31d6 Mon Sep 17 00:00:00 2001 From: forevermatt Date: Mon, 25 May 2020 11:22:56 -0400 Subject: [PATCH] Rebuild production JS/CSS bundles --- assets/bundle.css | 3 ++- assets/bundle.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/bundle.css b/assets/bundle.css index d9b8ce1..35ff56e 100644 --- a/assets/bundle.css +++ b/assets/bundle.css @@ -1,3 +1,4 @@ -.category-amount.svelte-azs2am.svelte-azs2am{white-space:nowrap;text-align:right}.category-available.danger.svelte-azs2am.svelte-azs2am{color:red}.category-available.svelte-azs2am>sup.svelte-azs2am{margin-left:0.5ex;margin-right:0.25ex}.category-budgeted.svelte-azs2am.svelte-azs2am{color:#999;font-size:0.8rem;vertical-align:bottom}.category-graph.svelte-azs2am.svelte-azs2am{box-shadow:0px 0px 1px 0px rgba(0, 0, 0, 0.75)}.category-graph.danger.svelte-azs2am.svelte-azs2am{box-shadow:0px 0px 0px 1px rgba(255, 0, 0, 0.75)}.category-graph.svelte-azs2am.svelte-azs2am,.category-graph-line.svelte-azs2am.svelte-azs2am{border-radius:4px}.category-graph.svelte-azs2am .danger.svelte-azs2am{background-color:red}.category-graph.svelte-azs2am .success.svelte-azs2am{background-color:green}.category-graph.svelte-azs2am .warning.svelte-azs2am{background-color:orange}.category-graph-line.svelte-azs2am.svelte-azs2am{height:6px;margin:auto 0}.category-list.svelte-azs2am td.svelte-azs2am{border:none;vertical-align:middle}.category-name.svelte-azs2am.svelte-azs2am{white-space:nowrap}.category-name.svelte-azs2am>.svelte-azs2am{max-width:100%;overflow:hidden}.width-10.svelte-azs2am.svelte-azs2am{width:10%}.width-80.svelte-azs2am.svelte-azs2am{width:80%} +.category-amount.svelte-1g8xb6x.svelte-1g8xb6x{white-space:nowrap;text-align:right}.category-available.danger.svelte-1g8xb6x.svelte-1g8xb6x{color:red}.category-available.svelte-1g8xb6x>sup.svelte-1g8xb6x{margin-left:0.5ex;margin-right:0.25ex}.category-budgeted.svelte-1g8xb6x.svelte-1g8xb6x{color:#999;font-size:0.8rem;vertical-align:bottom}.category-list.svelte-1g8xb6x td.svelte-1g8xb6x{border:none;vertical-align:middle}.category-name.svelte-1g8xb6x.svelte-1g8xb6x{white-space:nowrap}.width-10.svelte-1g8xb6x.svelte-1g8xb6x{width:10%}.width-80.svelte-1g8xb6x.svelte-1g8xb6x{width:80%} +.category-graph.svelte-6b2uyp.svelte-6b2uyp{box-shadow:0px 0px 1px 0px rgba(0, 0, 0, 0.75)}.category-graph.danger.svelte-6b2uyp.svelte-6b2uyp{box-shadow:0px 0px 0px 1px rgba(255, 0, 0, 0.75)}.category-graph.svelte-6b2uyp.svelte-6b2uyp,.category-graph-line.svelte-6b2uyp.svelte-6b2uyp{border-radius:4px}.category-graph.svelte-6b2uyp .danger.svelte-6b2uyp{background-color:red}.category-graph.svelte-6b2uyp .success.svelte-6b2uyp{background-color:green}.category-graph.svelte-6b2uyp .warning.svelte-6b2uyp{background-color:orange}.category-graph-line.svelte-6b2uyp.svelte-6b2uyp{height:6px;margin:auto 0} .keep-line-breaks.svelte-byhjk5{white-space:pre-line} .editable.svelte-1uc4ts5{cursor:pointer} diff --git a/assets/bundle.js b/assets/bundle.js index ce58e59..9b45174 100644 --- a/assets/bundle.js +++ b/assets/bundle.js @@ -1 +1 @@ -var app=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function r(t){t.forEach(n)}function o(t){return"function"==typeof t}function u(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function s(n,...e){if(null==n)return t;const r=n.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function a(t){let n;return s(t,t=>n=t)(),n}function c(t,n,e){t.$$.on_destroy.push(s(n,e))}function i(t,n){t.appendChild(n)}function l(t,n,e){t.insertBefore(n,e||null)}function f(t){t.parentNode.removeChild(t)}function d(t,n){for(let e=0;et.removeEventListener(n,e,r)}function y(t){return function(n){return n.preventDefault(),t.call(this,n)}}function b(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n){n=""+n,t.data!==n&&(t.data=n)}function w(t,n){(null!=n||t.value)&&(t.value=n)}function x(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}let E;function A(t){E=t}function k(){if(!E)throw new Error("Function called outside component initialization");return E}function _(t){k().$$.on_mount.push(t)}function C(){const t=k();return(n,e)=>{const r=t.$$.callbacks[n];if(r){const o=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);r.slice().forEach(n=>{n.call(t,o)})}}}function j(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const N=[],O=[],z=[],S=[],L=Promise.resolve();let R=!1;function T(t){z.push(t)}let D=!1;const M=new Set;function I(){if(!D){D=!0;do{for(let t=0;t{V.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function U(t){t&&t.c()}function W(t,e,u){const{fragment:s,on_mount:a,on_destroy:c,after_update:i}=t.$$;s&&s.m(e,u),T(()=>{const e=a.map(n).filter(o);c?c.push(...e):r(e),t.$$.on_mount=[]}),i.forEach(T)}function G(t,n){const e=t.$$;null!==e.fragment&&(r(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function K(t,n){-1===t.$$.dirty[0]&&(N.push(t),R||(R=!0,L.then(I)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const o=r.length?r[0]:e;return p.ctx&&a(p.ctx[t],p.ctx[t]=o)&&(p.bound[t]&&p.bound[t](o),m&&K(n,t)),e}):[],p.update(),m=!0,r(p.before_update),p.fragment=!!s&&s(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(f)}else p.fragment&&p.fragment.c();o.intro&&F(n.$$.fragment),W(n,o.target,o.anchor),I()}A(l)}class X{$destroy(){G(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}const Y=(t,n)=>{n.update(n=>[t,...n])},Z=Array.isArray,tt=t=>{const n=localStorage.getItem(t),e=JSON.parse(n);return Z(e)?e:[]},nt=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},et=[];function rt(t,n){return{subscribe:ot(t,n).subscribe}}function ot(n,e=t){let r;const o=[];function s(t){if(u(n,t)&&(n=t,r)){const t=!et.length;for(let t=0;t{const t=o.indexOf(c);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function ut(n,e,u){const a=!Array.isArray(n),c=a?[n]:n,i=e.length<2;return rt(u,n=>{let u=!1;const l=[];let f=0,d=t;const p=()=>{if(f)return;d();const r=e(a?l[0]:l,n);i?n(r):d=o(r)?r:t},m=c.map((t,n)=>s(t,t=>{l[n]=t,f&=~(1<{f|=1<dt.set("");function mt(t){let n,e,r,o,u;return{c(){n=p("div"),e=p("button"),e.innerHTML='',r=h(),o=m(t[0]),b(e,"type","button"),b(e,"class","close"),b(e,"aria-label","Close"),b(n,"class","alert alert-danger keep-line-breaks svelte-byhjk5"),b(n,"role","alert")},m(t,s,a){l(t,n,s),i(n,e),i(n,r),i(n,o),a&&u(),u=$(e,"click",pt)},p(t,n){1&n&&v(o,t[0])},d(t){t&&f(n),u()}}}function ht(n){let e,r=n[0]&&mt(n);return{c(){r&&r.c(),e=g()},m(t,n){r&&r.m(t,n),l(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=mt(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&f(e)}}}function gt(t,n,e){let r;return c(t,dt,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;dt.set(n.message)};class $t extends X{constructor(t){super(),Q(this,t,gt,ht,u,{})}}const yt=ot([]),bt=()=>nt("accounts",a(yt)),vt=ot([]),wt=()=>nt("categories",a(vt)),xt=(t,n)=>{((t,n,e)=>{e.update(e=>{const r=e.find(n=>n.uuid===t),o=Object.assign({},r,n);for(let n=0;n{G(t,1)}),B()}r?((o=new r({})).$on("routeEvent",t[10]),U(o.$$.fragment),F(o.$$.fragment,1),W(o,n.parentNode,n)):o=null}},i(t){e||(o&&F(o.$$.fragment,t),e=!0)},o(t){o&&J(o.$$.fragment,t),e=!1},d(t){t&&f(n),o&&G(o,t)}}}function At(t){let n,e;var r=t[0];function o(t){return{props:{params:t[1]}}}if(r){var u=new r(o(t));u.$on("routeEvent",t[9])}return{c(){u&&U(u.$$.fragment),n=g()},m(t,r){u&&W(u,t,r),l(t,n,r),e=!0},p(t,e){const s={};if(2&e&&(s.params=t[1]),r!==(r=t[0])){if(u){P();const t=u;J(t.$$.fragment,1,0,()=>{G(t,1)}),B()}r?((u=new r(o(t))).$on("routeEvent",t[9]),U(u.$$.fragment),F(u.$$.fragment,1),W(u,n.parentNode,n)):u=null}else r&&u.$set(s)},i(t){e||(u&&F(u.$$.fragment,t),e=!0)},o(t){u&&J(u.$$.fragment,t),e=!1},d(t){t&&f(n),u&&G(u,t)}}}function kt(t){let n,e,r,o;const u=[At,Et],s=[];function a(t,n){return t[1]?0:1}return n=a(t),e=s[n]=u[n](t),{c(){e.c(),r=g()},m(t,e){s[n].m(t,e),l(t,r,e),o=!0},p(t,[o]){let c=n;n=a(t),n===c?s[n].p(t,o):(P(),J(s[c],1,1,()=>{s[c]=null}),B(),e=s[n],e||(e=s[n]=u[n](t),e.c()),F(e,1),e.m(r.parentNode,r))},i(t){o||(F(e),o=!0)},o(t){J(e),o=!1},d(t){s[n].d(t),t&&f(r)}}}function _t(){const t=window.location.href.indexOf("#/");let n=t>-1?window.location.href.substr(t+1):"/";const e=n.indexOf("?");let r="";return e>-1&&(r=n.substr(e+1),n=n.substr(0,e)),{location:n,querystring:r}}const Ct=rt(_t(),(function(t){const n=()=>{t(_t())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));ut(Ct,t=>t.location),ut(Ct,t=>t.querystring);function jt(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return Nt(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function Nt(t){return new Promise(n=>{setTimeout(()=>{n(t())},0)})}function Ot(n,e,r){let o,u=t;c(n,Ct,t=>r(4,o=t)),n.$$.on_destroy.push(()=>u());let{routes:s={}}=e,{prefix:a=""}=e;class i{constructor(t,n){if(!n||"function"!=typeof n&&("object"!=typeof n||!0!==n._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:e,keys:r}=function(t,n){if(t instanceof RegExp)return{keys:!1,pattern:t};var e,r,o,u,s=[],a="",c=t.split("/");for(c[0]||c.shift();o=c.shift();)"*"===(e=o[0])?(s.push("wild"),a+="/(.*)"):":"===e?(r=o.indexOf("?",1),u=o.indexOf(".",1),s.push(o.substring(1,~r?r:~u?u:o.length)),a+=~r&&!~u?"(?:/([^/]+?))?":"/([^/]+?)",~u&&(a+=(~r?"?":"")+"\\"+o.substring(u))):a+="/"+o;return{keys:s,pattern:new RegExp("^"+a+(n?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,"object"==typeof n&&!0===n._sveltesparouter?(this.component=n.route,this.conditions=n.conditions||[],this.userData=n.userData):(this.component=n,this.conditions=[],this.userData=void 0),this._pattern=e,this._keys=r}match(t){a&&t.startsWith(a)&&(t=t.substr(a.length)||"/");const n=this._pattern.exec(t);if(null===n)return null;if(!1===this._keys)return n;const e={};let r=0;for(;r{l.push(new i(n,t))}):Object.keys(s).forEach(t=>{l.push(new i(t,s[t]))});let f=null,d=null;const p=C(),m=(t,n)=>{setTimeout(()=>{p(t,n)},0)};return n.$set=t=>{"routes"in t&&r(2,s=t.routes),"prefix"in t&&r(3,a=t.prefix)},n.$$.update=()=>{if(17&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{const n={uuid:ft(),name:t};Y(n,yt),bt()})(r),jt("/accounts")},function(){r=this.value,e(0,r)}]}function Rt(t,n,e){const r=t.slice();return r[1]=n[e],r}function Tt(t){let n,e,r=t[1].name+"";return{c(){n=p("li"),e=m(r)},m(t,r){l(t,n,r),i(n,e)},p(t,n){1&n&&r!==(r=t[1].name+"")&&v(e,r)},d(t){t&&f(n)}}}function Dt(n){let e,r,o,u,s,a,c,i=n[0],m=[];for(let t=0;tAdd new account',a=h(),c=p("p"),c.innerHTML='Budget'},m(t,n){l(t,e,n),l(t,r,n),l(t,o,n);for(let t=0;te(0,r=t)),[r]}const It=t=>Vt(t,2),Ht=t=>Vt(t,0),Vt=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n));function qt(t,n,e){const r=t.slice();return r[5]=n[e],r}function Pt(t){let n,e,r,o,u,s,a,c,d,g,$,y,w,E,A,k,_,C,j,N,O,z,S,L=t[5].name+"",R=It(t[5].remaining)+"",T=Ht(t[5].budgetedAmount)+"";return{c(){n=p("tr"),e=p("td"),r=p("a"),o=m(L),s=h(),a=p("td"),c=p("div"),d=p("div"),y=h(),w=p("td"),E=p("div"),A=p("sup"),A.textContent="$",k=m(R),C=h(),j=p("div"),N=p("span"),O=m("/ "),z=m(T),S=h(),b(r,"href",u="#/category/"+t[5].uuid),b(r,"class","btn btn-outline-secondary svelte-azs2am"),b(e,"class","category-name width-10 svelte-azs2am"),b(d,"class",g="category-graph-line "+t[2](t[5].remaining,t[5].amount)+" svelte-azs2am"),x(d,"width",t[3](t[5].remaining,t[5].budgetedAmount)+"%"),b(c,"class",$="category-graph "+t[1](t[5].remaining)+" svelte-azs2am"),b(a,"class","width-80 svelte-azs2am"),b(A,"class","svelte-azs2am"),b(E,"class",_="category-available "+t[1](t[5].remaining)+" svelte-azs2am"),b(j,"class","category-budgeted svelte-azs2am"),b(w,"class","category-amount width-10 svelte-azs2am")},m(t,u){l(t,n,u),i(n,e),i(e,r),i(r,o),i(n,s),i(n,a),i(a,c),i(c,d),i(n,y),i(n,w),i(w,E),i(E,A),i(E,k),i(w,C),i(w,j),i(j,N),i(N,O),i(N,z),i(n,S)},p(t,n){1&n&&L!==(L=t[5].name+"")&&v(o,L),1&n&&u!==(u="#/category/"+t[5].uuid)&&b(r,"href",u),1&n&&g!==(g="category-graph-line "+t[2](t[5].remaining,t[5].amount)+" svelte-azs2am")&&b(d,"class",g),1&n&&x(d,"width",t[3](t[5].remaining,t[5].budgetedAmount)+"%"),1&n&&$!==($="category-graph "+t[1](t[5].remaining)+" svelte-azs2am")&&b(c,"class",$),1&n&&R!==(R=It(t[5].remaining)+"")&&v(k,R),1&n&&_!==(_="category-available "+t[1](t[5].remaining)+" svelte-azs2am")&&b(E,"class",_),1&n&&T!==(T=Ht(t[5].budgetedAmount)+"")&&v(z,T)},d(t){t&&f(n)}}}function Bt(n){let e,r,o=n[0],u=[];for(let t=0;te(0,r=t));const o=t=>t&&t<0;return[r,t=>o(t)?"danger":"",(t,n)=>null==t?"":t<0?"danger":tt<0?0:0===n?t>0?100:0:t/n*100]}class Jt extends X{constructor(t){super(),Q(this,t,Ft,Bt,u,{})}}function Ut(n){let e,r,o,u,s,a,c;const i=new Jt({});return{c(){e=p("h2"),e.textContent="Budget",r=h(),U(i.$$.fragment),o=h(),u=p("p"),u.innerHTML='Add new category',s=h(),a=p("p"),a.innerHTML='Accounts'},m(t,n){l(t,e,n),l(t,r,n),W(i,t,n),l(t,o,n),l(t,u,n),l(t,s,n),l(t,a,n),c=!0},p:t,i(t){c||(F(i.$$.fragment,t),c=!0)},o(t){J(i.$$.fragment,t),c=!1},d(t){t&&f(e),t&&f(r),G(i,t),t&&f(o),t&&f(u),t&&f(s),t&&f(a)}}}function Wt(n){let e,o,u,s,a,c;return{c(){e=p("form"),o=p("div"),u=p("div"),u.innerHTML='$',s=h(),a=p("input"),b(u,"class","input-group-prepend"),b(a,"type","tel"),b(a,"aria-describedby","amount-input-currency-symbol"),b(a,"aria-label","Amount"),b(a,"class","text-right form-control"),b(o,"class","input-group input-group-lg"),e.noValidate=!0},m(t,f,d){l(t,e,f),i(e,o),i(o,u),i(o,s),i(o,a),n[9](a),d&&r(c),c=[$(a,"keydown",n[1]),$(e,"submit",y(n[2]))]},p:t,i:t,o:t,d(t){t&&f(e),n[9](null),r(c)}}}function Gt(t,n,e){let{amount:r}=n;const o=C();let u,s=[],a=null;function c(t){for(var n="",r=0;r{var t;s=(t=r)?String(t).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],c(s),i(Number(s.join(""))),u.focus()}),t.$set=t=>{"amount"in t&&e(3,r=t.amount)},[u,function(t){var n=t.which;(t=>t>=32&&t<112||t>=123&&t<127||t>=186)(n)&&t.preventDefault();var e=(t=>t>=48&&t<58?String(t-48):t>=96&&t<106?String(t-96):"")(n);e?s.push(e):(t=>8===t)(n)&&(t.preventDefault(),s.pop()),c(s),i(Number(s.join("")))},function(t){o("next",a)},r,s,a,o,c,i,function(t){O[t?"unshift":"push"](()=>{e(0,u=t)})}]}class Kt extends X{constructor(t){super(),Q(this,t,Gt,Wt,u,{amount:3})}}function Qt(t){let n,e,r,o,u,s=t[0].name+"";const a=new Kt({props:{amount:t[1]}});return a.$on("next",t[2]),{c(){n=p("h2"),e=m("Amount for "),r=m(s),o=h(),U(a.$$.fragment)},m(t,s){l(t,n,s),i(n,e),i(n,r),l(t,o,s),W(a,t,s),u=!0},p(t,[n]){(!u||1&n)&&s!==(s=t[0].name+"")&&v(r,s);const e={};2&n&&(e.amount=t[1]),a.$set(e)},i(t){u||(F(a.$$.fragment,t),u=!0)},o(t){J(a.$$.fragment,t),u=!1},d(t){t&&f(n),t&&f(o),G(a,t)}}}function Xt(t,n,e){let r;c(t,vt,t=>e(5,r=t));let o,u,s,{params:a}=n;return t.$set=t=>{"params"in t&&e(3,a=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,o=a.uuid),48&t.$$.dirty&&e(0,u=r.find(t=>t.uuid===o)||{}),1&t.$$.dirty&&e(1,s=u.amount||0)},[u,s,function(t){let n=t.detail;xt(o,{amount:n}),jt("/budget")},a]}function Yt(n){let e,o,u,s,a;return{c(){e=p("h2"),e.textContent="New Category",o=h(),u=p("form"),s=p("input"),b(s,"class","form-control"),b(s,"placeholder","New category name")},m(t,c,f){l(t,e,c),l(t,o,c),l(t,u,c),i(u,s),w(s,n[0]),f&&r(a),a=[$(s,"input",n[2]),$(u,"submit",y(n[1]))]},p(t,[n]){1&n&&s.value!==t[0]&&w(s,t[0])},i:t,o:t,d(t){t&&f(e),t&&f(o),t&&f(u),r(a)}}}function Zt(t,n,e){let r="";return[r,function(){jt(`/category/${(t=>{const n={uuid:ft(),name:t};return Y(n,vt),wt(),n})(r).uuid}/amount`)},function(){r=this.value,e(0,r)}]}function tn(n){let e,r,o,u,s,a,c,d,g,y,w,x,E,A=n[1].name+"",k=It(n[1].amount)+"";return{c(){e=p("h2"),r=p("b"),o=m(A),u=m(":"),s=h(),a=p("a"),c=p("sup"),c.textContent="$",d=h(),g=m(k),w=h(),x=p("hr"),b(r,"class","editable svelte-1uc4ts5"),b(r,"title","(Click to rename)"),b(a,"class","btn btn-default"),b(a,"href",y="#/category/"+n[0]+"/amount"),b(x,"class","small")},m(t,f,p){l(t,e,f),i(e,r),i(r,o),i(r,u),i(e,s),i(e,a),i(a,c),i(a,d),i(a,g),l(t,w,f),l(t,x,f),p&&E(),E=$(r,"click",n[2])},p(t,[n]){2&n&&A!==(A=t[1].name+"")&&v(o,A),2&n&&k!==(k=It(t[1].amount)+"")&&v(g,k),1&n&&y!==(y="#/category/"+t[0]+"/amount")&&b(a,"href",y)},i:t,o:t,d(t){t&&f(e),t&&f(w),t&&f(x),E()}}}function nn(t,n,e){let r;c(t,vt,t=>e(4,r=t));let{params:o={}}=n;let u,s;return t.$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(0,u=o.uuid||""),17&t.$$.dirty&&e(1,s=r.find(t=>t.uuid===u)||{})},[u,s,()=>{var t=prompt("Edit category name:",s.name);null!=t&&xt(u,{name:t})},o]}function en(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");Nt(()=>{const n=("#"==t.charAt(0)?"":"#")+t;try{window.history.replaceState(void 0,void 0,n)}catch(t){console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))})}("/budget"),[]}const rn={"/":class extends X{constructor(t){super(),Q(this,t,en,null,u,{})}},"/account/new":class extends X{constructor(t){super(),Q(this,t,Lt,St,u,{})}},"/accounts":class extends X{constructor(t){super(),Q(this,t,Mt,Dt,u,{})}},"/budget":class extends X{constructor(t){super(),Q(this,t,null,Ut,u,{})}},"/category/new":class extends X{constructor(t){super(),Q(this,t,Zt,Yt,u,{})}},"/category/:uuid":class extends X{constructor(t){super(),Q(this,t,nn,tn,u,{params:3})}},"/category/:uuid/amount":class extends X{constructor(t){super(),Q(this,t,Xt,Qt,u,{params:3})}}};function on(n){let e,r,o;const u=new $t({}),s=new zt({props:{routes:rn}});return{c(){e=p("div"),U(u.$$.fragment),r=h(),U(s.$$.fragment),b(e,"class","container my-3")},m(t,n){l(t,e,n),W(u,e,null),i(e,r),W(s,e,null),o=!0},p:t,i(t){o||(F(u.$$.fragment,t),F(s.$$.fragment,t),o=!0)},o(t){J(u.$$.fragment,t),J(s.$$.fragment,t),o=!1},d(t){t&&f(e),G(u),G(s)}}}function un(t){return _(async()=>{yt.set(tt("accounts")),vt.set(tt("categories"))}),[]}return new class extends X{constructor(t){super(),Q(this,t,un,on,u,{})}}({target:document.body})}(); +var app=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function r(t){t.forEach(n)}function o(t){return"function"==typeof t}function u(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function c(n,...e){if(null==n)return t;const r=n.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function s(t){let n;return c(t,t=>n=t)(),n}function a(t,n,e){t.$$.on_destroy.push(c(n,e))}function i(t,n){t.appendChild(n)}function l(t,n,e){t.insertBefore(n,e||null)}function f(t){t.parentNode.removeChild(t)}function d(t,n){for(let e=0;et.removeEventListener(n,e,r)}function y(t){return function(n){return n.preventDefault(),t.call(this,n)}}function b(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n){n=""+n,t.data!==n&&(t.data=n)}function w(t,n){(null!=n||t.value)&&(t.value=n)}function x(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}let E;function k(t){E=t}function A(){if(!E)throw new Error("Function called outside component initialization");return E}function _(t){A().$$.on_mount.push(t)}function C(){const t=A();return(n,e)=>{const r=t.$$.callbacks[n];if(r){const o=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);r.slice().forEach(n=>{n.call(t,o)})}}}function j(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const N=[],O=[],S=[],M=[],L=Promise.resolve();let D=!1;function R(t){S.push(t)}let T=!1;const I=new Set;function H(){if(!T){T=!0;do{for(let t=0;t{q.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function z(t){t&&t.c()}function U(t,e,u){const{fragment:c,on_mount:s,on_destroy:a,after_update:i}=t.$$;c&&c.m(e,u),R(()=>{const e=s.map(n).filter(o);a?a.push(...e):r(e),t.$$.on_mount=[]}),i.forEach(R)}function W(t,n){const e=t.$$;null!==e.fragment&&(r(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function G(t,n){-1===t.$$.dirty[0]&&(N.push(t),D||(D=!0,L.then(H)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const o=r.length?r[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=o)&&(p.bound[t]&&p.bound[t](o),g&&G(n,t)),e}):[],p.update(),g=!0,r(p.before_update),p.fragment=!!c&&c(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(f)}else p.fragment&&p.fragment.c();o.intro&&J(n.$$.fragment),U(n,o.target,o.anchor),H()}k(l)}class Q{$destroy(){W(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}const X=(t,n)=>{n.update(n=>[t,...n])},Z=(t,n,e,r)=>{r.update(r=>{const o=r.find(e=>e[t]===n),u=Object.assign({},o,e);for(let e=0;e{const n=localStorage.getItem(t),e=JSON.parse(n);return tt(e)?e:[]},et=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},rt=[];function ot(t,n){return{subscribe:ut(t,n).subscribe}}function ut(n,e=t){let r;const o=[];function c(t){if(u(n,t)&&(n=t,r)){const t=!rt.length;for(let t=0;t{const t=o.indexOf(a);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function ct(n,e,u){const s=!Array.isArray(n),a=s?[n]:n,i=e.length<2;return ot(u,n=>{let u=!1;const l=[];let f=0,d=t;const p=()=>{if(f)return;d();const r=e(s?l[0]:l,n);i?n(r):d=o(r)?r:t},g=a.map((t,n)=>c(t,t=>{l[n]=t,f&=~(1<{f|=1<pt.set("");function mt(t){let n,e,r,o,u;return{c(){n=p("div"),e=p("button"),e.innerHTML='',r=m(),o=g(t[0]),b(e,"type","button"),b(e,"class","close"),b(e,"aria-label","Close"),b(n,"class","alert alert-danger keep-line-breaks svelte-byhjk5"),b(n,"role","alert")},m(t,c,s){l(t,n,c),i(n,e),i(n,r),i(n,o),s&&u(),u=$(e,"click",gt)},p(t,n){1&n&&v(o,t[0])},d(t){t&&f(n),u()}}}function ht(n){let e,r=n[0]&&mt(n);return{c(){r&&r.c(),e=h()},m(t,n){r&&r.m(t,n),l(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=mt(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&f(e)}}}function $t(t,n,e){let r;return a(t,pt,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;pt.set(n.message)};class yt extends Q{constructor(t){super(),K(this,t,$t,ht,u,{})}}const bt=ut([]),vt=()=>et("accounts",s(bt)),wt=()=>xt(0,new Date),xt=(t,n)=>{var e=n.getFullYear(),r=n.getMonth(),o=new Date(e,r-t),u=o.getFullYear(),c=o.getMonth()+1;return u+"-"+String("0"+c).slice(-2)},Et=ut([]),kt=t=>s(Et).find(n=>n.yearMonth===t)||{},At=(t,n)=>{((t,n,e)=>{let r=kt(e).plan||{},o={budgeted:n,spent:(r[t]||{}).spent||0};r[t]=o,_t(e,{plan:r})})(t,n,wt())},_t=(t,n)=>{Z("yearMonth",t,n,Et),et("budgets",s(Et))},Ct=ut([]),jt=()=>et("categories",s(Ct));function Nt(t){let n,e;var r=t[0];if(r){var o=new r({});o.$on("routeEvent",t[10])}return{c(){o&&z(o.$$.fragment),n=h()},m(t,r){o&&U(o,t,r),l(t,n,r),e=!0},p(t,e){if(r!==(r=t[0])){if(o){P();const t=o;Y(t.$$.fragment,1,0,()=>{W(t,1)}),B()}r?((o=new r({})).$on("routeEvent",t[10]),z(o.$$.fragment),J(o.$$.fragment,1),U(o,n.parentNode,n)):o=null}},i(t){e||(o&&J(o.$$.fragment,t),e=!0)},o(t){o&&Y(o.$$.fragment,t),e=!1},d(t){t&&f(n),o&&W(o,t)}}}function Ot(t){let n,e;var r=t[0];function o(t){return{props:{params:t[1]}}}if(r){var u=new r(o(t));u.$on("routeEvent",t[9])}return{c(){u&&z(u.$$.fragment),n=h()},m(t,r){u&&U(u,t,r),l(t,n,r),e=!0},p(t,e){const c={};if(2&e&&(c.params=t[1]),r!==(r=t[0])){if(u){P();const t=u;Y(t.$$.fragment,1,0,()=>{W(t,1)}),B()}r?((u=new r(o(t))).$on("routeEvent",t[9]),z(u.$$.fragment),J(u.$$.fragment,1),U(u,n.parentNode,n)):u=null}else r&&u.$set(c)},i(t){e||(u&&J(u.$$.fragment,t),e=!0)},o(t){u&&Y(u.$$.fragment,t),e=!1},d(t){t&&f(n),u&&W(u,t)}}}function St(t){let n,e,r,o;const u=[Ot,Nt],c=[];function s(t,n){return t[1]?0:1}return n=s(t),e=c[n]=u[n](t),{c(){e.c(),r=h()},m(t,e){c[n].m(t,e),l(t,r,e),o=!0},p(t,[o]){let a=n;n=s(t),n===a?c[n].p(t,o):(P(),Y(c[a],1,1,()=>{c[a]=null}),B(),e=c[n],e||(e=c[n]=u[n](t),e.c()),J(e,1),e.m(r.parentNode,r))},i(t){o||(J(e),o=!0)},o(t){Y(e),o=!1},d(t){c[n].d(t),t&&f(r)}}}function Mt(){const t=window.location.href.indexOf("#/");let n=t>-1?window.location.href.substr(t+1):"/";const e=n.indexOf("?");let r="";return e>-1&&(r=n.substr(e+1),n=n.substr(0,e)),{location:n,querystring:r}}const Lt=ot(Mt(),(function(t){const n=()=>{t(Mt())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));ct(Lt,t=>t.location),ct(Lt,t=>t.querystring);function Dt(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return Rt(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function Rt(t){return new Promise(n=>{setTimeout(()=>{n(t())},0)})}function Tt(n,e,r){let o,u=t;a(n,Lt,t=>r(4,o=t)),n.$$.on_destroy.push(()=>u());let{routes:c={}}=e,{prefix:s=""}=e;class i{constructor(t,n){if(!n||"function"!=typeof n&&("object"!=typeof n||!0!==n._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:e,keys:r}=function(t,n){if(t instanceof RegExp)return{keys:!1,pattern:t};var e,r,o,u,c=[],s="",a=t.split("/");for(a[0]||a.shift();o=a.shift();)"*"===(e=o[0])?(c.push("wild"),s+="/(.*)"):":"===e?(r=o.indexOf("?",1),u=o.indexOf(".",1),c.push(o.substring(1,~r?r:~u?u:o.length)),s+=~r&&!~u?"(?:/([^/]+?))?":"/([^/]+?)",~u&&(s+=(~r?"?":"")+"\\"+o.substring(u))):s+="/"+o;return{keys:c,pattern:new RegExp("^"+s+(n?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,"object"==typeof n&&!0===n._sveltesparouter?(this.component=n.route,this.conditions=n.conditions||[],this.userData=n.userData):(this.component=n,this.conditions=[],this.userData=void 0),this._pattern=e,this._keys=r}match(t){s&&t.startsWith(s)&&(t=t.substr(s.length)||"/");const n=this._pattern.exec(t);if(null===n)return null;if(!1===this._keys)return n;const e={};let r=0;for(;r{l.push(new i(n,t))}):Object.keys(c).forEach(t=>{l.push(new i(t,c[t]))});let f=null,d=null;const p=C(),g=(t,n)=>{setTimeout(()=>{p(t,n)},0)};return n.$set=t=>{"routes"in t&&r(2,c=t.routes),"prefix"in t&&r(3,s=t.prefix)},n.$$.update=()=>{if(17&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{const n={uuid:dt(),name:t};X(n,bt),vt()})(r),Dt("/accounts")},function(){r=this.value,e(0,r)}]}function qt(t,n,e){const r=t.slice();return r[1]=n[e],r}function Ft(t){let n,e,r=t[1].name+"";return{c(){n=p("li"),e=g(r)},m(t,r){l(t,n,r),i(n,e)},p(t,n){1&n&&r!==(r=t[1].name+"")&&v(e,r)},d(t){t&&f(n)}}}function Pt(n){let e,r,o,u,c,s,a,i=n[0],g=[];for(let t=0;tAdd new account',s=m(),a=p("p"),a.innerHTML='Budget'},m(t,n){l(t,e,n),l(t,r,n),l(t,o,n);for(let t=0;te(0,r=t)),[r]}const Jt=t=>Wt(t)?"danger":"",Yt=t=>Ut(t,2),zt=t=>Ut(t,0),Ut=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n)),Wt=t=>t&&t<0;function Gt(n){let e,r,o,u;return{c(){e=p("div"),r=p("div"),b(r,"class",o="category-graph-line "+n[1](n[0].remaining,n[0].amount)+" svelte-6b2uyp"),x(r,"width",n[2](n[0].remaining,n[0].budgetedAmount)+"%"),b(e,"class",u="category-graph "+Jt(n[0].remaining)+" svelte-6b2uyp")},m(t,n){l(t,e,n),i(e,r)},p(t,[n]){1&n&&o!==(o="category-graph-line "+t[1](t[0].remaining,t[0].amount)+" svelte-6b2uyp")&&b(r,"class",o),1&n&&x(r,"width",t[2](t[0].remaining,t[0].budgetedAmount)+"%"),1&n&&u!==(u="category-graph "+Jt(t[0].remaining)+" svelte-6b2uyp")&&b(e,"class",u)},i:t,o:t,d(t){t&&f(e)}}}function Kt(t,n,e){let{category:r}=n;return t.$set=t=>{"category"in t&&e(0,r=t.category)},[r,(t,n)=>null==t?"":t<0?"danger":tt<0?0:0===n?t>0?100:0:t/n*100]}class Qt extends Q{constructor(t){super(),K(this,t,Kt,Gt,u,{category:0})}}function Xt(t,n,e){const r=t.slice();return r[5]=n[e].budgeted,r[6]=n[e].spent,r[7]=n[e].category,r}function Zt(t){let n,e,r,o,u,c,s,a,d,h,$,y,w,x,E,k,A,_,C,j,N=t[7].name+"",O=Yt(t[5]-t[6])+"",S=zt(t[5])+"";const M=new Qt({props:{category:t[7]}});return{c(){n=p("tr"),e=p("td"),r=p("a"),o=g(N),c=m(),s=p("td"),z(M.$$.fragment),a=m(),d=p("td"),h=p("div"),$=p("sup"),$.textContent="$",y=g(O),x=m(),E=p("div"),k=p("span"),A=g("/ "),_=g(S),C=m(),b(r,"href",u="#/category/"+t[7].uuid),b(r,"class","btn btn-outline-secondary"),b(e,"class","category-name width-10 svelte-1g8xb6x"),b(s,"class","width-80 svelte-1g8xb6x"),b($,"class","svelte-1g8xb6x"),b(h,"class",w="category-available "+Jt(t[5]-t[6])+" svelte-1g8xb6x"),b(E,"class","category-budgeted svelte-1g8xb6x"),b(d,"class","category-amount width-10 svelte-1g8xb6x")},m(t,u){l(t,n,u),i(n,e),i(e,r),i(r,o),i(n,c),i(n,s),U(M,s,null),i(n,a),i(n,d),i(d,h),i(h,$),i(h,y),i(d,x),i(d,E),i(E,k),i(k,A),i(k,_),i(n,C),j=!0},p(t,n){(!j||1&n)&&N!==(N=t[7].name+"")&&v(o,N),(!j||1&n&&u!==(u="#/category/"+t[7].uuid))&&b(r,"href",u);const e={};1&n&&(e.category=t[7]),M.$set(e),(!j||1&n)&&O!==(O=Yt(t[5]-t[6])+"")&&v(y,O),(!j||1&n&&w!==(w="category-available "+Jt(t[5]-t[6])+" svelte-1g8xb6x"))&&b(h,"class",w),(!j||1&n)&&S!==(S=zt(t[5])+"")&&v(_,S)},i(t){j||(J(M.$$.fragment,t),j=!0)},o(t){Y(M.$$.fragment,t),j=!1},d(t){t&&f(n),W(M)}}}function tn(t){let n,e,r,o=t[0],u=[];for(let n=0;nY(u[t],1,1,()=>{u[t]=null});return{c(){n=p("table"),e=p("tbody");for(let t=0;te(3,r=t));let o,u,{params:c={}}=n,s=c.yearMonth||wt();return t.$set=t=>{"params"in t&&e(1,c=t.params)},t.$$.update=()=>{12&t.$$.dirty&&e(0,u=((t,n)=>{let e=[];for(var r in t)if(t.hasOwnProperty(r)){let o=n.find(t=>t.uuid=r)||{};e.push({budgeted:t.budgeted,spent:budgetCategory.spent,category:o})}return e.sort((t,n)=>(t.category.name||"").localeCompare(n.category.name||""))})(o.plan,r))},e(2,o=kt(s)),[u,c]}class en extends Q{constructor(t){super(),K(this,t,nn,tn,u,{params:1})}}function rn(n){let e,r,o,u,c,s,a;const i=new en({});return{c(){e=p("h2"),e.textContent="Budget",r=m(),z(i.$$.fragment),o=m(),u=p("p"),u.innerHTML='Add new category',c=m(),s=p("p"),s.innerHTML='Accounts'},m(t,n){l(t,e,n),l(t,r,n),U(i,t,n),l(t,o,n),l(t,u,n),l(t,c,n),l(t,s,n),a=!0},p:t,i(t){a||(J(i.$$.fragment,t),a=!0)},o(t){Y(i.$$.fragment,t),a=!1},d(t){t&&f(e),t&&f(r),W(i,t),t&&f(o),t&&f(u),t&&f(c),t&&f(s)}}}function on(n){let e,o,u,c,s,a;return{c(){e=p("form"),o=p("div"),u=p("div"),u.innerHTML='$',c=m(),s=p("input"),b(u,"class","input-group-prepend"),b(s,"type","tel"),b(s,"aria-describedby","amount-input-currency-symbol"),b(s,"aria-label","Amount"),b(s,"class","text-right form-control"),b(o,"class","input-group input-group-lg"),e.noValidate=!0},m(t,f,d){l(t,e,f),i(e,o),i(o,u),i(o,c),i(o,s),n[9](s),d&&r(a),a=[$(s,"keydown",n[1]),$(e,"submit",y(n[2]))]},p:t,i:t,o:t,d(t){t&&f(e),n[9](null),r(a)}}}function un(t,n,e){let{amount:r}=n;const o=C();let u,c=[],s=null;function a(t){for(var n="",r=0;r{var t;c=(t=r)?String(t).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],a(c),i(Number(c.join(""))),u.focus()}),t.$set=t=>{"amount"in t&&e(3,r=t.amount)},[u,function(t){var n=t.which;(t=>t>=32&&t<112||t>=123&&t<127||t>=186)(n)&&t.preventDefault();var e=(t=>t>=48&&t<58?String(t-48):t>=96&&t<106?String(t-96):"")(n);e?c.push(e):(t=>8===t)(n)&&(t.preventDefault(),c.pop()),a(c),i(Number(c.join("")))},function(t){o("next",s)},r,c,s,o,a,i,function(t){O[t?"unshift":"push"](()=>{e(0,u=t)})}]}class cn extends Q{constructor(t){super(),K(this,t,un,on,u,{amount:3})}}function sn(t){let n,e,r,o,u,c=t[0].name+"";const s=new cn({props:{amount:t[1]}});return s.$on("next",t[2]),{c(){n=p("h2"),e=g("Amount for "),r=g(c),o=m(),z(s.$$.fragment)},m(t,c){l(t,n,c),i(n,e),i(n,r),l(t,o,c),U(s,t,c),u=!0},p(t,[n]){(!u||1&n)&&c!==(c=t[0].name+"")&&v(r,c);const e={};2&n&&(e.amount=t[1]),s.$set(e)},i(t){u||(J(s.$$.fragment,t),u=!0)},o(t){Y(s.$$.fragment,t),u=!1},d(t){t&&f(n),t&&f(o),W(s,t)}}}function an(t,n,e){let r;a(t,Ct,t=>e(5,r=t));let o,u,c,{params:s}=n;return t.$set=t=>{"params"in t&&e(3,s=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,o=s.uuid),48&t.$$.dirty&&e(0,u=r.find(t=>t.uuid===o)||{}),1&t.$$.dirty&&e(1,c=u.amount||0)},[u,c,function(t){let n=t.detail;At(o,n),Dt("/budget")},s]}function ln(n){let e,o,u,c,s;return{c(){e=p("h2"),e.textContent="New Category",o=m(),u=p("form"),c=p("input"),b(c,"class","form-control"),b(c,"placeholder","New category name")},m(t,a,f){l(t,e,a),l(t,o,a),l(t,u,a),i(u,c),w(c,n[0]),f&&r(s),s=[$(c,"input",n[2]),$(u,"submit",y(n[1]))]},p(t,[n]){1&n&&c.value!==t[0]&&w(c,t[0])},i:t,o:t,d(t){t&&f(e),t&&f(o),t&&f(u),r(s)}}}function fn(t,n,e){let r="";return[r,function(){Dt(`/category/${(t=>{const n=s(Ct).find(n=>n.name===t);if(n)return n;{const n={uuid:dt(),name:t};return X(n,Ct),jt(),n}})(r).uuid}/amount`)},function(){r=this.value,e(0,r)}]}function dn(n){let e,r,o,u,c,s,a,d,h,y,w,x,E,k=n[1].name+"",A=Yt(n[1].amount)+"";return{c(){e=p("h2"),r=p("b"),o=g(k),u=g(":"),c=m(),s=p("a"),a=p("sup"),a.textContent="$",d=m(),h=g(A),w=m(),x=p("hr"),b(r,"class","editable svelte-1uc4ts5"),b(r,"title","(Click to rename)"),b(s,"class","btn btn-default"),b(s,"href",y="#/category/"+n[0]+"/amount"),b(x,"class","small")},m(t,f,p){l(t,e,f),i(e,r),i(r,o),i(r,u),i(e,c),i(e,s),i(s,a),i(s,d),i(s,h),l(t,w,f),l(t,x,f),p&&E(),E=$(r,"click",n[2])},p(t,[n]){2&n&&k!==(k=t[1].name+"")&&v(o,k),2&n&&A!==(A=Yt(t[1].amount)+"")&&v(h,A),1&n&&y!==(y="#/category/"+t[0]+"/amount")&&b(s,"href",y)},i:t,o:t,d(t){t&&f(e),t&&f(w),t&&f(x),E()}}}function pn(t,n,e){let r;a(t,Ct,t=>e(4,r=t));let{params:o={}}=n;let u,c;return t.$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(0,u=o.uuid||""),17&t.$$.dirty&&e(1,c=r.find(t=>t.uuid===u)||{})},[u,c,()=>{var t=prompt("Edit category name:",c.name);null!=t&&((t,n)=>{Z("uuid",t,n,Ct),jt()})(u,{name:t})},o]}function gn(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");Rt(()=>{const n=("#"==t.charAt(0)?"":"#")+t;try{window.history.replaceState(void 0,void 0,n)}catch(t){console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))})}("/budget"),[]}const mn={"/":class extends Q{constructor(t){super(),K(this,t,gn,null,u,{})}},"/account/new":class extends Q{constructor(t){super(),K(this,t,Vt,Ht,u,{})}},"/accounts":class extends Q{constructor(t){super(),K(this,t,Bt,Pt,u,{})}},"/budget":class extends Q{constructor(t){super(),K(this,t,null,rn,u,{})}},"/category/new":class extends Q{constructor(t){super(),K(this,t,fn,ln,u,{})}},"/category/:uuid":class extends Q{constructor(t){super(),K(this,t,pn,dn,u,{params:3})}},"/category/:uuid/amount":class extends Q{constructor(t){super(),K(this,t,an,sn,u,{params:3})}}};function hn(n){let e,r,o;const u=new yt({}),c=new It({props:{routes:mn}});return{c(){e=p("div"),z(u.$$.fragment),r=m(),z(c.$$.fragment),b(e,"class","container my-3")},m(t,n){l(t,e,n),U(u,e,null),i(e,r),U(c,e,null),o=!0},p:t,i(t){o||(J(u.$$.fragment,t),J(c.$$.fragment,t),o=!0)},o(t){Y(u.$$.fragment,t),Y(c.$$.fragment,t),o=!1},d(t){t&&f(e),W(u),W(c)}}}function $n(t){return _(async()=>{bt.set(nt("accounts")),Ct.set(nt("categories")),Et.set(nt("budgets"))}),[]}return new class extends Q{constructor(t){super(),K(this,t,$n,hn,u,{})}}({target:document.body})}();