'}label(){return'
'}buttonGroup(){return'
'}cancel(){console.log("GenericEditor["+this.options.index+"].cancel()"),console.log(this.element),console.log(this.parent),this.parent.innerHTML=this.options.original}submitInlineEdit(t){console.log("Submit?")}}class b{put(t,n){return d.put("/api/v2/accounts/"+t,n)}}const l=window.location.href.split("/"),g=l[l.length-1];let w=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},totalPages:1,page:1,tableColumns:{name:{enabled:!0}},editors:{},sortingColumn:"",sortDirection:"",accounts:[],sort(e){return this.sortingColumn=e,this.sortDirection=this.sortDirection==="asc"?"desc":"asc",this.loadAccounts(),!1},formatMoney(e,t){return p(e,t)},format(e){return r(e,a.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=a.t("firefly.wait_loading_data"),this.loadAccounts()},submitInlineEdit(e){e.preventDefault();const n=e.currentTarget.dataset.index,i=document.querySelectorAll('[data-index="'+n+'input"]')[0].value??"";if(i==="")return;const o=this.editors[n].options.field,s={};s[o]=i,console.log(s),console.log("New value is "+i+" for account #"+this.editors[n].options.id),new b().put(this.editors[n].options.id,s)},cancelInlineEdit(e){const n=e.currentTarget.dataset.index;this.editors[n].cancel()},triggerEdit(e){const t=e.currentTarget,n=t.dataset.index;this.editors[n]=new f,this.editors[n].setElement(t),this.editors[n].init(),this.editors[n].replace()},loadAccounts(){this.notifications.wait.show=!0,this.notifications.wait.text=a.t("firefly.wait_loading_data"),this.accounts=[];const e=[{column:this.sortingColumn,direction:this.sortDirection}];new m().index({sorting:e,type:g,page:this.page}).then(t=>{for(let n=0;n
{console.log(`Loading page component "${e}"`);let t=c[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),u()});window.bootstrapped&&(console.log("Loaded through window variable."),u());
+import{a as d,d as h,f as p}from"./format-money-89cf90df.js";import{f as r,i as a}from"./vendor-029c0fc2.js";/* empty css */import{G as m}from"./get-23aadb69.js";class f{setElement(t){console.log("GenericEditor.setElement()",t),this.element=t,this.parent=t.parentElement,this.options={}}init(){this.options.type=this.element.dataset.type,this.options.id=this.element.dataset.id,this.options.value=this.element.dataset.value,this.options.index=this.element.dataset.index,this.options.model=this.element.dataset.model,this.options.field=this.element.dataset.field,console.log("GenericEditor["+this.options.index+"].init()")}replace(){console.log("GenericEditor["+this.options.index+"].replace()"),this.options.original=this.element.parentElement.innerHTML,this.options.type==="text"&&this.replaceText()}replaceText(){console.log("GenericEditor["+this.options.index+"].replaceText()");let t=this.formStart()+this.rowStart();t+=this.columnStart("7")+this.label()+this.textField()+this.closeDiv(),t+=this.columnStart("5")+this.buttonGroup()+this.closeDiv(),t+=this.closeDiv()+this.closeForm(),this.element.parentElement.innerHTML=t}textField(){return''}closeDiv(){return"