webpackJsonp([80],{UfNt:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:"Admin"===e.profile.UserType,expression:"profile.UserType === 'Admin'"}],staticClass:"TableActions"},[n("ul",{staticClass:"tableOption"},[n("li",{directives:[{name:"show",rawName:"v-show",value:"Buildings"===e.name,expression:"name === 'Buildings'"}]},[n("button",{staticClass:"btn btn-simple btn-link",attrs:{type:"button",rel:"tooltip",title:"Mass Text"},on:{click:function(t){return e.massText()}}},[n("font-awesome-icon",{attrs:{icon:e.mail}})],1)]),n("li",{directives:[{name:"show",rawName:"v-show",value:"Orders"!=e.name&&"Templates"!=e.name&&"HTTPLogs"!=e.name&&"Courier Access Logs"!=e.name&&"User Access Logs"!=e.name&&"PeakDays"!=e.name,expression:"\n          name != 'Orders' &&\n          name != 'Templates' &&\n          name != 'HTTPLogs' &&\n          name != 'Courier Access Logs' &&\n          name != 'User Access Logs' &&\n          name != 'PeakDays'\n        "}]},[n("button",{staticClass:"btn btn-simple btn-link",attrs:{type:"button",rel:"tooltip",title:"Add Row"},on:{click:function(t){return e.addRow()}}},[n("font-awesome-icon",{attrs:{icon:e.plus}})],1)])]),n("button",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],staticClass:"btn inline-block mt-2 deploy-all",attrs:{type:"button",title:"Add Row"},on:{click:function(t){return e.deployAllKiosksPopup()}}},[e._v("\n      Deploy All Banks\n    ")])]),n("div",{directives:[{name:"show",rawName:"v-show",value:"Manager"===e.profile.UserType,expression:"profile.UserType === 'Manager'"}],staticClass:"TableActions"},[n("ul",{staticClass:"tableOption"},[n("li",{directives:[{name:"show",rawName:"v-show",value:"Lockouts"===e.name&&e.profile.permissions&&e.profile.permissions[1]&&e.profile.permissions[1].EditLockout,expression:"\n          name === 'Lockouts' &&\n          profile.permissions &&\n          profile.permissions[1] &&\n          profile.permissions[1].EditLockout\n        "}]},[n("button",{staticClass:"btn btn-simple btn-link",attrs:{type:"button",rel:"tooltip",title:"Add Row"},on:{click:function(t){return e.addRow()}}},[n("font-awesome-icon",{attrs:{icon:e.plus}})],1)]),n("li",{directives:[{name:"show",rawName:"v-show",value:"Customers"===e.name&&e.profile.permissions&&e.profile.permissions[1]&&e.profile.permissions[1].AddResident,expression:"\n          name === 'Customers' &&\n          profile.permissions &&\n          profile.permissions[1] &&\n          profile.permissions[1].AddResident\n        "}]},[n("button",{staticClass:"btn btn-simple btn-link",attrs:{type:"button",rel:"tooltip",title:"Add Row"},on:{click:function(t){return e.addRow()}}},[n("font-awesome-icon",{attrs:{icon:e.plus}})],1)])])])])};a._withStripped=!0;var l={render:a,staticRenderFns:[]};t.a=l},esSM:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("gS36"),l=n("UfNt"),s=!1;var i=function(e){s||n("nGJg")},o=n("VU/8")(a.a,l.a,!1,i,null,null);o.options.__file="components/TableActions.vue",t.default=o.exports},gS36:function(e,t,n){"use strict";var a=n("Xxa5"),l=n.n(a),s=n("exGp"),i=n.n(s),o=n("U0v6"),u=n.n(o),r=n("tYDt"),d=n("1P+R");t.a={components:{FontAwesomeIcon:u.a},props:{name:{type:String,default:""},profile:{type:Object,default:function(){return{}}}},data:function(){return{newBuilding:{BuildingName:"",Address:"",BankIds:[]},newBank:{BankName:"",BankHash:"",BuildingId:0},newLocker:{BankId:0,Column:0,Row:0,Size:"",RelayNumber:0},newCustomer:{FirstName:"",LastName:"",PhoneNumber:"",Email:"",Password:"",PIN:"",DOB:"",AuthorityToLeave:!0,Aliases:"",AccountLevel:"",ApartmentId:"",AutoTopup:!0,AutoTopupAmount:0,BuildingId:"",UnitCode:""},newCourier:{FirstName:"",LastName:"",PhoneNumber:0,Email:"",CourierPassword:"",Type:"",RFIDFob:"",PIN:""},newManager:{FirstName:"",LastName:"",PhoneNumber:0,Email:"",Password:"",Building:0,Permission:{OpenLocker:!1,EditBuildingTemplates:!1,ResendSMS:!1,SoftDeleteCustomer:!1}},newDeveloper:{FirstName:"",LastName:"",PhoneNumber:0,Email:"",Password:"",Building:0},newAdmin:{FirstName:"",LastName:"",PhoneNumber:0,Email:"",Password:""},newApartment:{BuildingId:0,UnitCode:"",CustomerId:[],Notes:""},newSchedule:{LockoutName:"",SundayOpen:"",SundayClosed:"",MondayOpen:"",MondayClosed:"",TuesdayOpen:"",TuesdayClosed:"",WednesdayOpen:"",WednesdayClosed:"",ThursdayOpen:"",ThursdayClosed:"",FridayOpen:"",FridayClosed:"",SaturdayOpen:"",SaturdayClosed:""},newTemplate:{MessageName:"",ResendInterval:0,RegisteredPickupMessage:"",UnregisteredPickupMessage:"",FirstOverdueMessage:"",VeryOverdueMessage:"",FirstCollectionMessage:"",NoTokenDeliveryMessage:"",OverdueMessage:"",ManagerCollectionMessage:"",Notes:"",OverdueInterval:0,FreePeriod:0},newPricing:{AccountLevel:"",LAUNDRY:0,XXL:0,XL:0,L:0,M:0,S:0,TokenQuantity:0,TokenPrice:0,BuildingId:0},UndoContent:{deletedAt:null},massTextData:{message:null,BuildingId:null,phoneNumberArray:[]},option:"",CacApart:"",buildings:[],hashes:[],hashOption:"",banks:[],bankOption:"",companyOption:"",accountLevelList:["Bronze","Silver","Gold"],accountLevelOption:"",companyList:["Australia Post","StarTrack","Couriers Please","DHL Express","Aramex","Toll","FedEx","UPS","TNT","Allied Express","Amazon","Other"]}},computed:{plus:function(){return d.H},mail:function(){return d.r},undo:function(){return d.V}},beforeMount:function(){},methods:{massText:function(){var e=i()(l.a.mark(function e(){var t,n=this;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(r.h)(this);case 2:for(t in this.buildings=e.sent.data,this.option="",this.buildings)this.option=this.option+"<option value="+this.buildings[t].BuildingId+">"+this.buildings[t].Address+"</option>";return e.next=7,this.$swal({title:"Mass Text Customers",html:'<input id="MessageInput" class="swal2-input" placeholder="Message" ><br><select name="Type" id="BuildingInput" class="swal2-input"><option value="" disabled selected>Building Address</option>'+this.option+'</select><br><b>OR</b><br><br>Phone Numbers: <input id="PhoneNumbersInput" class="swal2-input" value="" placeholder="0400000000, 0401000000">',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Send",preConfirm:function(){n.massTextData.message=document.getElementById("MessageInput").value,n.massTextData.buildingId=document.getElementById("BuildingInput").value,n.massTextData.phoneNumberArray=document.getElementById("PhoneNumbersInput").value.split(",")}});case 7:e.sent.value&&(""===this.massTextData.phoneNumberArray[0]&&(this.massTextData.phoneNumberArray=[]),Object(r._50)(this,this.massTextData).then(function(e){console.log(e.data),n.$emit("added"),n.$swal("Sent!","Mass text message was sent correctly","success")}).catch(function(e){console.log("err :",e),n.$swal("Fail to Send Texts!",e.message,"error")}));case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),addRow:function(){var e=i()(l.a.mark(function e(){var t,n,a,s,i,o,u,d,c,p,m,w,h=this;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("Buildings"==this.name&&Object(r.g)(this).then(function(e){h.banks=e.data,h.$swal({title:"Create New Building",html:'<input id="BuildingNameInput" class="swal2-input" placeholder="Building name" ><br><input id="AddressInput" class="swal2-input" placeholder="Address" ><br><input id="SuburbInput" class="swal2-input" placeholder="Suburb" ><br><input id="CityInput" class="swal2-input" placeholder="City" ><br><input id="StateInput" class="swal2-input" placeholder="State" ><br><input id="PostCodeInput" class="swal2-input" placeholder="Post Code" ><br><input id="BankIdsInput" class="swal2-input"  placeholder="Bank IDs"><br><input id="OrganizationInput" class="swal2-input"  placeholder="Organization"><br>Add Apartments by Unit Code: <input id="ApartmentsInput" class="swal2-input" value="" placeholder="1A, 1B, 2A, 2B">',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){if(""!=document.getElementById("BuildingNameInput").value&&""!=document.getElementById("AddressInput").value||h.$swal.showValidationError("Request failed: Building name and address are required"),document.getElementById("BankIdsInput").value){var e=document.getElementById("BankIdsInput").value.split(",");for(var t in e)h.banks.map(function(n){return n.BankId==parseInt(e[t])}).includes(!0)||h.$swal.showValidationError("Request failed: Bank "+e[t]+" does not exist"),h.newBuilding.BankIds=document.getElementById("BankIdsInput").value.split(",");h.newBuilding.BankIds=document.getElementById("BankIdsInput").value.split(",")}h.newBuilding.BuildingName=document.getElementById("BuildingNameInput").value,h.newBuilding.Address=document.getElementById("AddressInput").value,h.newBuilding.Suburb=document.getElementById("SuburbInput").value,h.newBuilding.City=document.getElementById("CityInput").value,h.newBuilding.State=document.getElementById("StateInput").value,h.newBuilding.PostCode=document.getElementById("PostCodeInput").value,h.newBuilding.GroupName=document.getElementById("OrganizationInput").value,h.newBuilding.ApartmentList=document.getElementById("ApartmentsInput").value}}).then(function(e){e.value&&Object(r.t)(h,h.newBuilding).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This building has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})}),"Banks"==this.name&&Object(r.h)(this).then(function(e){for(var t in h.buildings=e.data,console.log(h.buildings),h.option="",h.buildings)h.option=h.option+"<option value="+h.buildings[t].BuildingId+">"+h.buildings[t].Address+"</option>";Object(r.f)(h).then(function(e){for(var t in h.hashes=e.data,console.log(h.hashes),h.hashOption="",h.hashes)h.hashOption=h.hashOption+"<option value="+h.hashes[t].BankHash+">"+h.hashes[t].BankHash+"</option>";h.$swal({title:"Create New Bank",html:'<input id="swal-input1" class="swal2-input" placeholder="Bank name"><br><select name="Type" id="swal-input2" class="swal2-input"><option value="" disabled selected>BankHash</option>'+h.hashOption+'</select><br><select name="Type" id="swal-input3" class="swal2-input"><option value="" disabled selected>Building address</option>'+h.option+"</select>",focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value&&""!=document.getElementById("swal-input3").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.newBank.BankName=document.getElementById("swal-input1").value,h.newBank.BankHash=document.getElementById("swal-input2").value,h.newBank.BuildingId=parseInt(document.getElementById("swal-input3").value)}}).then(function(e){e.value&&Object(r.s)(h,h.newBank).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This bank has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})})}),"Lockers"==this.name&&Object(r.g)(this).then(function(e){for(var t in h.banks=e.data,console.log(h.banks),h.bankOption="",h.banks)h.bankOption=h.bankOption+"<option value="+h.banks[t].BankId+">"+h.banks[t].BankId+"</option>";h.sizeOption="<option value=S>S</option><option value=M>M</option><option value=L>L</option><option value=XL>XL</option><option value=XXL>XXL</option><option value=LAUNDRY>LAUNDRY</option>",h.sideOption="<option value=Right>Right</option><option value=Left>Left</option><option value=Kiosk>Kiosk</option>",h.$swal({title:"Create New Locker",html:'<select name="Type" id="swal-input1" class="swal2-input"><option value="" disabled selected>Bank Id</option>'+h.bankOption+'</select><br><input id="swal-input2" class="swal2-input" placeholder="Column"><br><input id="swal-input3" class="swal2-input" placeholder="Row"><select name="Type" id="swal-input4" class="swal2-input"><option value="" disabled selected>Size</option>'+h.sizeOption+'</select><br><input id="swal-input5" class="swal2-input" placeholder="Relay number"><select name="Type" id="swal-input6" class="swal2-input"><option value="" disabled selected>Relay Side</option>'+h.sideOption+"</select>",focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){""==document.getElementById("swal-input1").value&&h.$swal.showValidationError("Request failed: Bank Id is required"),h.newLocker.BankId=parseInt(document.getElementById("swal-input1").value),h.newLocker.Column=document.getElementById("swal-input2").value,h.newLocker.Row=parseInt(document.getElementById("swal-input3").value),h.newLocker.Size=document.getElementById("swal-input4").value,h.newLocker.RelayNumber=parseInt(document.getElementById("swal-input5").value),h.newLocker.RelaySide=document.getElementById("swal-input6").value}}).then(function(e){e.value&&Object(r.z)(h,h.newLocker).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This locker has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})}),"Customers"!=this.name){e.next=16;break}return console.log("through customers!"),e.next=7,Object(r._49)(this);case 7:if(t=e.sent,console.log("isCAC",t),!t){e.next=15;break}return e.next=12,Object(r._14)(this);case 12:(n=(n=e.sent).data.Apartments).length>0&&(this.CacApart=n[0].UnitCode);case 15:Object(r.h)(this).then(function(e){h.buildings=e.data,console.log(h.buildings);var n="";for(var a in h.buildings)n=n+"<option value="+h.buildings[a].BuildingId+">"+h.buildings[a].Address+"</option>";var l=t?'<input id="swal-input1" class="swal2-input" placeholder="First Name / Company Name"><br><input id="swal-input2" class="swal2-input" placeholder="Last Name"><br><input id="swal-input3" class="swal2-input" placeholder="Mobile *"><br><input id="swal-input5" class="swal2-input" placeholder="Email" type="email"><br><select name="Type" id="swal-input15" class="swal2-input"><option value="" selected disabled>Building Address * </option>'+n+"</select>":'<input id="swal-input1" class="swal2-input" placeholder="First Name"><br><input id="swal-input2" class="swal2-input" placeholder="Last Name"><br><input id="swal-input3" class="swal2-input" placeholder="Mobile *"><br><input id="swal-input5" class="swal2-input" placeholder="Email" type="email"><br><input id="swal-input12" class="swal2-input" placeholder="Password" type="password"><br><input id="swal-input13" class="swal2-input" placeholder="PIN"><br>Date of Birth<input id="swal-input14" class="swal2-input" type="date"><br><select name="Type" id="swal-input15" class="swal2-input"><option value="" selected disabled>Building Address * </option>'+n+'</select><br><input id="swal-input9" class="swal2-input" placeholder="Unit Code *" ><br> <input type="checkbox" id="swal-input6" class="swal1-input" checked > Authority To Leave? <br><br> <input type="checkbox" id="swal-input10" class="swal1-input" checked > Auto Topup & Amount: <input id="swal-input11" type="number" class="swal2-input" min="20"  step="0.01" value="20"><br><input id="swal-input7" class="swal2-input" placeholder="Aliases"><br>Account Level:<select name="Type" id="swal-input8" class="swal2-input"><option value="Bronze">Bronze</option><option value="Silver">Silver</option><option value="Gold">Gold</option></select>';h.$swal({title:"Create New Customer",html:l,focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){if(""===document.getElementById("swal-input5").value||h.validEmail(document.getElementById("swal-input5").value)||h.$swal.showValidationError("Request failed: Email is invalid"),h.validPhone(document.getElementById("swal-input3").value)||h.$swal.showValidationError("Request failed: PhoneNumber is invalid"),h.validPhone(document.getElementById("swal-input3").value)){var e=document.getElementById("swal-input3").value;h.newCustomer.PhoneNumber=document.getElementById("swal-input3").value,"+"===e[0]&&(h.newCustomer.PhoneNumber=e.replace("+61","0")),"6"===e[0]&&(h.newCustomer.PhoneNumber=e.replace("61","0"))}h.newCustomer.FirstName=document.getElementById("swal-input1").value,h.newCustomer.LastName=document.getElementById("swal-input2").value,h.newCustomer.Email=document.getElementById("swal-input5").value.toLowerCase(),t?(h.newCustomer.AutoTopup=!0,h.newCustomer.AutoTopupAmount=2e3,h.newCustomer.AuthorityToLeave=!0,h.newCustomer.Password="",h.newCustomer.PIN="",h.newCustomer.DOB="",h.newCustomer.UnitCode=h.CacApart,h.newCustomer.AccountLevel="Bronze",h.newCustomer.Aliases=""):(document.getElementById("swal-input10").checked&&document.getElementById("swal-input11").value<20&&h.$swal.showValidationError("Request failed: minimum auto topup amount is 20"),""!=document.getElementById("swal-input3").value&&""!=document.getElementById("swal-input9").value&&""!=document.getElementById("swal-input15").value||h.$swal.showValidationError("Request failed: Inputs (*) are required"),h.newCustomer.Aliases=document.getElementById("swal-input7").value,h.newCustomer.AccountLevel=document.getElementById("swal-input8").value,h.newCustomer.AuthorityToLeave=document.getElementById("swal-input6").checked,h.newCustomer.Password=document.getElementById("swal-input12").value,h.newCustomer.PIN=document.getElementById("swal-input13").value,h.newCustomer.DOB=document.getElementById("swal-input14").value,h.newCustomer.UnitCode=document.getElementById("swal-input9").value,h.newCustomer.AutoTopup=document.getElementById("swal-input10").checked,h.newCustomer.AutoTopupAmount=100*document.getElementById("swal-input11").value),h.newCustomer.BuildingId=document.getElementById("swal-input15").value}}).then(function(e){e.value&&Object(r.v)(h,h.newCustomer).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This customer has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})});case 16:if("Couriers"==this.name){for(s in a="",this.companyOption="",this.companyList)this.companyOption=this.companyOption+'<option value="'+this.companyList[s]+'" '+a+">"+this.companyList[s]+"</option>";this.$swal({title:"Create New Courier",html:'<input id="swal-input1" class="swal2-input" placeholder="First Name"><br><input id="swal-input2" class="swal2-input" placeholder="Last Name"><br><input id="swal-input3" class="swal2-input" placeholder="Phone Number"><br><input id="swal-input4" class="swal2-input" placeholder="Email" type="email"><br><input id="swal-input5" class="swal2-input" placeholder="Password" type="password"><br><input id="swal-input6" class="swal2-input" placeholder="Numerical PIN"><br><input id="swal-input7" class="swal2-input" placeholder="RFID Fob"><br><input id="swal-input8" class="swal2-input" placeholder="Bluetooth MAC"><br><select name="Type" id="swal-input9" class="swal2-input"><option value="" selected disabled>Company</option>'+this.companyOption+'</select><br><select name="Type" id="swal-input10" class="swal2-input"><option value="Regular">Regular</option><option value="Admin">Admin</option></select>',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value&&""!=document.getElementById("swal-input3").value&&""!=document.getElementById("swal-input4").value&&""!=document.getElementById("swal-input5").value&&""!=document.getElementById("swal-input6").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.validEmail(document.getElementById("swal-input4").value)||h.$swal.showValidationError("Request failed: Email is invalid"),h.validPhone(document.getElementById("swal-input3").value)||h.$swal.showValidationError("Request failed: PhoneNumber is invalid"),h.newCourier.FirstName=document.getElementById("swal-input1").value,h.newCourier.LastName=document.getElementById("swal-input2").value,h.newCourier.PhoneNumber=document.getElementById("swal-input3").value,h.newCourier.Email=document.getElementById("swal-input4").value.toLowerCase(),h.newCourier.Password=document.getElementById("swal-input5").value,h.newCourier.PIN=document.getElementById("swal-input6").value,h.newCourier.RFIDFob=document.getElementById("swal-input7").value,h.newCourier.BluetoothFob=document.getElementById("swal-input8").value,h.newCourier.Company=document.getElementById("swal-input9").value,h.newCourier.CourierType=document.getElementById("swal-input10").value}}).then(function(e){e.value&&Object(r.u)(h,h.newCourier).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This courier has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})}if("Managers"==this.name&&Object(r._47)(this).then(function(e){h.userGroups=e.data;h.option="";for(var t in h.userGroups)h.option=h.option+"<option value="+h.userGroups[t].UserGroupId+" >"+h.userGroups[t].GroupName+"</option>";h.$swal({title:"Create New Manager",html:'<input id="swal-input1" class="swal2-input" placeholder="First Name"><br><input id="swal-input2" class="swal2-input" placeholder="Last Name"><br><input id="swal-input3" class="swal2-input" placeholder="Phone Number"><br><input id="swal-input4" class="swal2-input" placeholder="Email" type="email"><br>Organization: <select name="Organization" id="swal-input6" class="swal2-input">'+h.option+'</select><br> <input type="checkbox" id="swal-input7" class="swal1-input" > Can Open Locker? <br><br> <input type="checkbox" id="swal-input8" class="swal1-input" > Can Edit Building Templates? <br><br> <input type="checkbox" id="swal-input9" class="swal1-input" > Can Resend SMS? <br><br> <input type="checkbox" id="swal-input10" class="swal1-input" > Can Soft Delete Customer? <br><br> <input type="checkbox" id="swal-input11" class="swal1-input" > Can Edit Lockout? <br><br> <input type="checkbox" id="swal-input12" class="swal1-input" > Can Show CAC QR Generator? <br><br> <input type="checkbox" id="swal-input13" class="swal1-input" > Can Add Resident? <br>',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create and Email",preConfirm:function(){""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value&&""!=document.getElementById("swal-input3").value&&""!=document.getElementById("swal-input4").value&&""!=document.getElementById("swal-input6").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.validEmail(document.getElementById("swal-input4").value)||h.$swal.showValidationError("Request failed: Email is invalid"),h.validPhone(document.getElementById("swal-input3").value)||h.$swal.showValidationError("Request failed: PhoneNumber is invalid"),h.newManager.FirstName=document.getElementById("swal-input1").value,h.newManager.LastName=document.getElementById("swal-input2").value,h.newManager.PhoneNumber=document.getElementById("swal-input3").value,h.newManager.Email=document.getElementById("swal-input4").value.toLowerCase(),h.newManager.UserGroupId=document.getElementById("swal-input6").value,h.newManager.Permission.OpenLocker=document.getElementById("swal-input7").checked,h.newManager.Permission.EditBuildingTemplates=document.getElementById("swal-input8").checked,h.newManager.Permission.ResendSMS=document.getElementById("swal-input9").checked,h.newManager.Permission.SoftDeleteCustomer=document.getElementById("swal-input10").checked,h.newManager.Permission.EditLockout=document.getElementById("swal-input11").checked,h.newManager.Permission.ShowCACQRGenerator=document.getElementById("swal-input12").checked,h.newManager.Permission.AddResident=document.getElementById("swal-input13").checked}}).then(function(e){e.value&&Object(r.B)(h,h.newManager).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This manager has been created and an email has been sent with their credentials.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})}),"Developers"==this.name&&Object(r._47)(this).then(function(e){h.userGroups=e.data,h.option="";for(var t in h.userGroups)h.option=h.option+"<option value="+h.userGroups[t].UserGroupId+" >"+h.userGroups[t].GroupName+"</option>";h.$swal({title:"Create New Developer",html:'<input id="swal-input1" class="swal2-input" placeholder="First Name"><br><input id="swal-input2" class="swal2-input" placeholder="Last Name"><br><input id="swal-input3" class="swal2-input" placeholder="Phone Number"><br><input id="swal-input4" class="swal2-input" placeholder="Email" type="email"><br>Organization: <select name="Organization" id="swal-input6" class="swal2-input">'+h.option+"</select>",focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create and Email",preConfirm:function(){""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value&&""!=document.getElementById("swal-input3").value&&""!=document.getElementById("swal-input4").value&&""!=document.getElementById("swal-input6").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.validEmail(document.getElementById("swal-input4").value)||h.$swal.showValidationError("Request failed: Email is invalid"),h.validPhone(document.getElementById("swal-input3").value)||h.$swal.showValidationError("Request failed: PhoneNumber is invalid"),h.newDeveloper.FirstName=document.getElementById("swal-input1").value,h.newDeveloper.LastName=document.getElementById("swal-input2").value,h.newDeveloper.PhoneNumber=document.getElementById("swal-input3").value,h.newDeveloper.Email=document.getElementById("swal-input4").value.toLowerCase(),h.newDeveloper.UserGroupId=document.getElementById("swal-input6").value}}).then(function(e){e.value&&Object(r.w)(h,h.newDeveloper).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This developer has been created and an email has been sent with their credentials.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})}),"Schedules"!==this.name&&"Lockouts"!==this.name||!("Admin"===this.profile.UserType||"Manager"===this.profile.UserType&&this.profile.permissions&&this.profile.permissions[1]&&this.profile.permissions[1].EditLockout)){e.next=31;break}if(this.option="",i="","Manager"!==this.profile.UserType){e.next=30;break}return e.next=25,Object(r._16)(this);case 25:for(c in o=e.sent,u=o.data,d="",u)this.option=this.option+"<option value="+u[c].BankId+" "+d+">"+u[c].BankName+"</option>";i='<br>Choose a bank to link to: <select name="Banks" id="swal-input9" class="swal2-input">'+this.option+"</select>";case 30:this.$swal({title:"Create New Courier Lockout Schedule",html:i+'<input id="swal-input0" class="swal2-input" placeholder="Lockout name"><br><input id="swal-input1" class="swal2-input" placeholder="Sunday open time"><br><input id="swal-input1a" class="swal2-input" placeholder="Sunday closing time"><br><input id="swal-input2" class="swal2-input" placeholder="Monday open time"><br><input id="swal-input2a" class="swal2-input" placeholder="Monday closing time"><br><input id="swal-input3" class="swal2-input" placeholder="Tuesday open time"><br><input id="swal-input3a" class="swal2-input" placeholder="Tuesday closing time"><br><input id="swal-input4" class="swal2-input" placeholder="Wednesday open time"><br><input id="swal-input4a" class="swal2-input" placeholder="Wednesday closing time"><br><input id="swal-input5" class="swal2-input" placeholder="Thursday open time"><br><input id="swal-input5a" class="swal2-input" placeholder="Thursday closing time"><br><input id="swal-input6" class="swal2-input" placeholder="Friday open time"><br><input id="swal-input6a" class="swal2-input" placeholder="Friday closing time"><br><input id="swal-input7" class="swal2-input" placeholder="Saturday open time"><br><input id="swal-input7a" class="swal2-input" placeholder="Saturday closing time"><br><input id="swal-input8" class="swal2-input" placeholder="Peak days open time"><br><input id="swal-input8a" class="swal2-input" placeholder="Peak days closing time">',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",customClass:"swal-courier",preConfirm:function(){""==document.getElementById("swal-input0").value&&h.$swal.showValidationError("Request failed: Inputs are required");for(var e=1;e<9;e++)h.validTime(document.getElementById("swal-input"+e).value,document.getElementById("swal-input"+e+"a").value)||h.$swal.showValidationError("Request failed: Schedule is invalid");h.newSchedule.LockoutName=document.getElementById("swal-input0").value,h.newSchedule.SundayOpen=document.getElementById("swal-input1").value,h.newSchedule.SundayClosed=document.getElementById("swal-input1a").value,h.newSchedule.MondayOpen=document.getElementById("swal-input2").value,h.newSchedule.MondayClosed=document.getElementById("swal-input2a").value,h.newSchedule.TuesdayOpen=document.getElementById("swal-input3").value,h.newSchedule.TuesdayClosed=document.getElementById("swal-input3a").value,h.newSchedule.WednesdayOpen=document.getElementById("swal-input4").value,h.newSchedule.WednesdayClosed=document.getElementById("swal-input4a").value,h.newSchedule.ThursdayOpen=document.getElementById("swal-input5").value,h.newSchedule.ThursdayClosed=document.getElementById("swal-input5a").value,h.newSchedule.FridayOpen=document.getElementById("swal-input6").value,h.newSchedule.FridayClosed=document.getElementById("swal-input6a").value,h.newSchedule.SaturdayOpen=document.getElementById("swal-input7").value,h.newSchedule.SaturdayClosed=document.getElementById("swal-input7a").value,h.newSchedule.PeakDaysOpen=document.getElementById("swal-input8").value,h.newSchedule.PeakDaysClosed=document.getElementById("swal-input8a").value,h.newSchedule.LinkedBankId=(document.getElementById("swal-input9")||{}).value||null}}).then(function(e){e.value&&(console.log(h.newSchedule),Object(r.A)(h,h.newSchedule).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This schedule has been created.","success")}).catch(function(e){h.$swal("Failed to create!",(((e||{}).response||{}).data||{}).message||"Unknown error","error")}))});case 31:"Admins"==this.name&&this.$swal({title:"Create New Admin",html:'<input id="swal-input1" class="swal2-input" placeholder="First Name"><br><input id="swal-input2" class="swal2-input" placeholder="Last Name"><br><input id="swal-input3" class="swal2-input" placeholder="Phone Number"><br><input id="swal-input4" class="swal2-input" placeholder="Bluetooth MAC"><br><input id="swal-input5" class="swal2-input" placeholder="Email" type="email"><br><input id="swal-input6" class="swal2-input" placeholder="Password" type="password"><br><input id="swal-input7" class="swal2-input" placeholder="Passcode" type="password">',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",customClass:"swal-courier",preConfirm:function(){""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value&&""!=document.getElementById("swal-input3").value&&""!=document.getElementById("swal-input5").value&&""!=document.getElementById("swal-input6").value&&""!=document.getElementById("swal-input7").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.validEmail(document.getElementById("swal-input5").value)||h.$swal.showValidationError("Request failed: Email is invalid"),h.validPhone(document.getElementById("swal-input3").value)||h.$swal.showValidationError("Request failed: PhoneNumber is invalid"),h.validPasscode(document.getElementById("swal-input7").value)||h.$swal.showValidationError("Request failed: Passcode must be numeric and at most SIX digit."),h.newAdmin.FirstName=document.getElementById("swal-input1").value,h.newAdmin.LastName=document.getElementById("swal-input2").value,h.newAdmin.PhoneNumber=document.getElementById("swal-input3").value,h.newAdmin.BluetoothFob=document.getElementById("swal-input4").value,h.newAdmin.Email=document.getElementById("swal-input5").value.toLowerCase(),h.newAdmin.Password=document.getElementById("swal-input6").value,h.newAdmin.Passcode=document.getElementById("swal-input7").value}}).then(function(e){e.value&&Object(r.q)(h,h.newAdmin).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This admin has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})}),"Apartments"==this.name&&Object(r.h)(this).then(function(e){for(var t in h.buildings=e.data,console.log(h.buildings),h.option="",h.buildings)h.option=h.option+"<option value="+h.buildings[t].BuildingId+">"+h.buildings[t].Address+"</option>";h.$swal({title:"Create New Apartment",html:'<select name="Type" id="swal-input1" class="swal2-input"><option value="" disabled selected>Building address</option>'+h.option+'</select><br><input id="swal-input2" class="swal2-input" placeholder="Unit Code"><br><input id="swal-input4" class="swal2-input" placeholder="Notes">',focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.newApartment.BuildingId=document.getElementById("swal-input1").value,h.newApartment.UnitCode=document.getElementById("swal-input2").value,h.newApartment.CustomerIdArray={},""!==document.getElementById("swal-input4").value?h.newApartment.Notes=document.getElementById("swal-input4").value:h.newApartment.Notes=""}}).then(function(e){e.value&&Object(r.r)(h,h.newApartment).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This apartment has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})}),"Templates"==this.name&&(p="Hi, you have a parcel for collection in the My Parcel Locker at <Address>. Please use PIN code:<VerificationCode> within 48 hours to avoid late fees. myparcellocker.com.au",m="Your parcel in the My Parcel Locker at <Address> is overdue for collection and late fees may apply. Please collect it asap. myparcellocker.com.au",w="Your parcel in the My Parcel Locker at <Address> is overdue for collection and late fees will apply. myparcellocker.com.au",this.$swal({title:"Create New Template",html:'<input id="swal-input1" class="swal2-input" placeholder="Name"><br>Resend Interval (in hours): <input id="swal-input2" type="number" id="swal-input2"  min="1" step="1"  class="swal2-input" value="24"><br>Overdue Interval (in hours): <input id="swal-input8" type="number" min="0" step="1"  class="swal2-input" value="24"><br>Free Period (in hours): <input id="swal-input9" type="number" min="0" step="1"  class="swal2-input" value="120"><br>Pickup Message: <textarea id="swal-input3" class="swal2-input" style="height:120px;">'+p+'</textarea><br>Overdue Message: <textarea id="swal-input4" class="swal2-input" style="height:120px;">'+m+'</textarea><br>Manager Collection: <textarea id="swal-input5" class="swal2-input" style="height:100px;">'+w+"</textarea>",focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){""!=document.getElementById("swal-input8").value&&""!=document.getElementById("swal-input1").value&&""!=document.getElementById("swal-input2").value&&""!=document.getElementById("swal-input3").value&&""!=document.getElementById("swal-input4").value&&""!=document.getElementById("swal-input5").value&&""!=document.getElementById("swal-input6").value&&""!=document.getElementById("swal-input7").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.newTemplate.MessageName=document.getElementById("swal-input1").value,h.newTemplate.ResendInterval=document.getElementById("swal-input2").value,h.newTemplate.RegisteredPickupMessage=document.getElementById("swal-input3").value,h.newTemplate.OverdueMessage=document.getElementById("swal-input4").value,h.newTemplate.ManagerCollectionMessage=document.getElementById("swal-input5").value,h.newTemplate.OverdueInterval=document.getElementById("swal-input8").value,h.newTemplate.FreePeriod=document.getElementById("swal-input9").value}}).then(function(e){e.value&&Object(r.D)(h,h.newTemplate).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This template has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})),"Pricing"==this.name&&Object(r.g)(this).then(function(e){for(var t in h.banks=e.data,h.bankOption="",h.banks)h.bankOption=h.bankOption+"<option value="+h.banks[t].BankId+" >"+h.banks[t].BankId+"</option>";for(var n in h.accountLevelOption="",h.accountLevelList)h.accountLevelOption=h.accountLevelOption+"<option value="+h.accountLevelList[n]+">"+h.accountLevelList[n]+"</option>";h.$swal({title:"Create New Pricing",html:'Account Level:<br><select name="Type" id="Pricing-swal-input2" class="swal2-input"><option value="" disabled selected>Account Level</option>'+h.accountLevelOption+'</select><br>Token price ($):  <input type="number" id="Pricing-swal-input3" min="0" step="0.01" class="swal2-input" value="2.5"><br>Token quantity:  <input type="number" id="swal-input5"  min="20"  step="0.01" class="swal2-input" value="30"><br>Overdue Rate:  1 Token<select name="Type" id="swal-input1" class="swal2-input"><option value="" disabled selected>Building Id</option>'+h.bankOption+"</select>",focusConfirm:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Create",preConfirm:function(){""!=document.getElementById("Pricing-swal-input2").value&&""!=document.getElementById("Pricing-swal-input3").value&&""!=document.getElementById("swal-input5").value||h.$swal.showValidationError("Request failed: Inputs are required"),h.newPricing.AccountLevel=document.getElementById("Pricing-swal-input2").value,h.newPricing.TokenPrice=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.LAUNDRY=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.XXL=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.XL=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.L=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.M=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.S=100*document.getElementById("Pricing-swal-input3").value,h.newPricing.TokenQuantity=document.getElementById("swal-input5").value,h.newPricing.BuildingId=document.getElementById("swal-input1").value}}).then(function(e){e.value&&Object(r.C)(h,h.newPricing).then(function(e){console.log(e.data),h.$emit("added"),h.$swal("Created!","This pricing has been created.","success")}).catch(function(e){h.$swal("Failed to create!",((e||{}).response||{}).data||"Unknown error","error")})})});case 35:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),undoRow:function(){var e=this;if(null!=this.$store.state.lastDeleted){var t=this.$store.state.lastDeleted;this.$swal({title:"Undo Delete Action",text:"You are going to undo delete action on id: "+t,type:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, undo it!"}).then(function(){"Orders"==e.name&&Object(r._79)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This order has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Buildings"==e.name&&Object(r._68)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This building has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Apartments"==e.name&&Object(r._66)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This apartment has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Banks"==e.name&&Object(r._67)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This bank has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Lockers"==e.name&&Object(r._76)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This locker has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Customers"==e.name&&Object(r._71)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This customer has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Couriers"==e.name&&Object(r._69)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This courier has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Managers"==e.name&&Object(r._78)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This manager has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Developers"==e.name&&Object(r._73)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This developer has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Admins"==e.name&&Object(r._64)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This admin has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Schedules"==e.name&&Object(r._77)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This admin has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Templates"==e.name&&Object(r._64)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This template has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")}),"Pricings"==e.name&&Object(r._80)(e,t,e.UndoContent).then(function(t){console.log(t.data),e.$emit("updated"),e.$swal("Undo!","This pricing has been undone.","success")}).catch(function(t){console.log(t),e.$swal("Fail to Undo!","error","error")})})}else this.$swal("Unable to undo","No delete action has been done on this table","question")},validEmail:function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},validTime:function(e,t){var n=!1,a=/^\d+$/;return a.test(e)&&a.test(t)&&0<=parseInt(e)&&parseInt(e)<=parseInt(t)&&parseInt(t)<=24&&(n=!0),n},validPasscode:function(e){return/^[0-9]{1,6}$/.test(e)},validPhone:function(e){var t=!1;10===e.length&&("04"===e.substr(0,2)&&(t=!0));11===e.length&&("614"===e.substr(0,3)&&(t=!0));12===e.length&&("+614"===e.substr(0,4)&&(t=!0));return t},deployAllKiosksPopup:function(){var e=i()(l.a.mark(function e(){var t,n,a,s;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(r._32)(this);case 2:return t=e.sent,console.log("getKioskBuilds-TableAction"),e.next=6,this.$swal({title:"Choose a version to deploy",input:"select",inputOptions:t,inputPlaceholder:"Select the version to deploy",showCancelButton:!0,html:'<br><input type="checkbox" id="force-queue" class="swal1-input"> Force queue update'});case 6:if(n=e.sent,!(a=n.value)){e.next=19;break}return e.prev=9,s=document.getElementById("force-queue").checked,e.next=13,Object(r._5)(this,a,s);case 13:this.$swal("Updated!","Deploy routine started for all banks.","success"),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),this.$swal("Failed to Update!",((e.t0||{}).response||{}).data||"Unknown error","error");case 19:case"end":return e.stop()}},e,this,[[9,16]])}));return function(){return e.apply(this,arguments)}}()}}},l2yA:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,".swal-courier{font-size:.6em}.deploy-all{margin-left:.6em}.swal-courier .swal2-input{margin:.6em auto}",""])},nGJg:function(e,t,n){var a=n("l2yA");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);n("rjj0")("e28a7d2a",a,!1,{sourceMap:!1})}});