import{n as m,U as l}from"./index-DDNMzpZj.js";import{C as p}from"./Checkbox-Dc2UYqO9.js";import{D as k}from"./Dropdown-Cks-nQIq.js";const _=new l.LocalStorageMgt("CalcGW"),a=[{name:"Ex",cost_ap:30,cost_meat:0,cost_ep:1,honor:51e3,token_host:22,token_join:20,token_1:14,token_2:0,token_3:0},{name:"Ex+",cost_ap:30,cost_meat:0,cost_ep:1,honor:88e3,token_host:26,token_join:20,token_1:20,token_2:0,token_3:0},{name:"NM 90",cost_ap:30,cost_meat:5,cost_ep:2,honor:26e4,token_host:45,token_join:20,token_1:18,token_2:10,token_3:5},{name:"NM 95",cost_ap:40,cost_meat:10,cost_ep:3,honor:91e4,token_host:55,token_join:30,token_1:26,token_2:18,token_3:10},{name:"NM 100",cost_ap:50,cost_meat:20,cost_ep:3,honor:265e4,token_host:80,token_join:48,token_1:40,token_2:30,token_3:20},{name:"NM 150",cost_ap:50,cost_meat:20,cost_ep:3,honor:41e5,token_host:120,token_join:85,token_1:52,token_2:42,token_3:30},{name:"NM 200",cost_ap:50,cost_meat:20,cost_ep:3,honor:1335e4,token_host:160,token_join:110,token_1:68,token_2:0,token_3:0}],g={components:{Checkbox:p,Dropdown:k},head:{title:"Granblue.Party - Guild Wars Tokens Calculator",desc:"Calculator for Guild Wars tokens and boxes",image:"https://www.granblue.party/img/card_calcgw.jpg",keywords:"Guild Wars, GW, Unite and Fight, U&F, 40 boxes, calculator, eternals, meat, gold bar"},data(){return{boxes_needed:40,boxes_opened:0,total_honor:0,tokens_explained:"",tokens_obtained:0,tokens_total:0,show_fight:[!1,!0,!0,!0,!0,!0,!0],time_fight_ex:[15,15],time_fight_raid:[30,120,300,300,420],quota_fight_raid:[0,40,0,30,30],meat_fight:[5,6.5],chosen_ex:1,show_host:!0,show_join:!0,add_honor:!1,show_result_2nd:!1,show_result_3rd:!1,show_result_other:!0}},methods:{showFight(e){this.$set(this.show_fight,e,!this.show_fight[e])},getFightData(e){let t=[];const o=1+(e.token_2>0&&this.show_result_2nd?1:0)+(e.token_3>0&&this.show_result_3rd?1:0)+(this.show_result_other?1:0);return this.show_host&&(t.push({type:"Host",type_rows:o,finish:"MVP",token:e.token_host+e.token_join+e.token_1+(this.add_honor?e.honor*60/1e6:0),cost_ap:e.cost_ap,cost_meat:e.cost_meat}),e.token_2>0&&this.show_result_2nd&&t.push({finish:"2nd",token:e.token_host+e.token_join+e.token_2+(this.add_honor?e.honor*60/1e6:0),cost_ap:e.cost_ap,cost_meat:e.cost_meat}),e.token_3>0&&this.show_result_3rd&&t.push({finish:"3rd",token:e.token_host+e.token_join+e.token_3+(this.add_honor?e.honor*60/1e6:0),cost_ap:e.cost_ap,cost_meat:e.cost_meat}),this.show_result_other&&t.push({finish:"",token:e.token_host+e.token_join+(this.add_honor?e.honor*60/1e6:0),cost_ap:e.cost_ap,cost_meat:e.cost_meat})),this.show_join&&(t.push({type:"Join",type_rows:o,finish:"MVP",token:e.token_join+e.token_1+(this.add_honor?e.honor*60/1e6:0),cost_ep:e.cost_ep}),e.token_2>0&&this.show_result_2nd&&t.push({finish:"2nd",token:e.token_join+e.token_2+(this.add_honor?e.honor*60/1e6:0),cost_ep:e.cost_ep}),e.token_3>0&&this.show_result_3rd&&t.push({finish:"3rd",token:e.token_join+e.token_3+(this.add_honor?e.honor*60/1e6:0),cost_ep:e.cost_ep}),this.show_result_other&&t.push({finish:"",token:e.token_join+(this.add_honor?e.honor*60/1e6:0),cost_ep:e.cost_ep})),t.length>0&&(t[0].name=e.name,t[0].name_rows=o*(this.show_host&&this.show_join?2:1),t[0].honor=e.honor,t[0].honor_rows=o*(this.show_host&&this.show_join?2:1)),t}},computed:{getData(){return a.flatMap((e,t)=>this.show_fight[t]?this.getFightData(e):[])},getFightNames(){return a.map(e=>e.name)},getBoxesNeeded(){return parseInt(this.boxes_needed,10)},getBoxesOpened(){return parseInt(this.boxes_opened,10)},getTokensObtained(){return parseInt(this.tokens_obtained,10)},getTotalHonor(){return parseInt(this.total_honor,10)},getProgress(){let e=(100-this.tokens_needed/this.tokens_total*100).toFixed(2);return this.tokens_total==0?100 .toFixed(2):e},tokens_needed(){let e=0,t=this.getBoxesNeeded-this.getBoxesOpened;this.tokens_explained="",t===1?this.tokens_explained=t+" box = (":t>1&&(this.tokens_explained=t+" boxes = (");let o=!1;if(this.getBoxesOpened===0&&t>0&&(e+=1600,t--,this.tokens_explained+="1600",o=!0),this.getBoxesOpened<4&&t>0){const n=Math.min(3,t,4-this.getBoxesOpened);e+=2400*n,t-=n,this.tokens_explained+=(o?" + ":"")+n+"x2400",o=!0}if(this.getBoxesOpened<45&&t>0){const n=Math.min(41,t,45-this.getBoxesOpened);e+=2e3*n,t-=n,this.tokens_explained+=(o?" + ":"")+n+"x2000",o=!0}if(this.getBoxesOpened<80&&t>0){const n=Math.min(35,t,80-this.getBoxesOpened);e+=1e4*n,t-=n,this.tokens_explained+=(o?" + ":"")+n+"x10000",o=!0}t>0&&(e+=15e3*t,this.tokens_explained+=(o?" + ":"")+t+"x15000"),this.tokens_total=e,this.tokens_explained&&(this.tokens_explained+=" tokens)"),this.getTokensObtained>0&&(e-=this.getTokensObtained,this.tokens_total>0&&(this.tokens_explained+=" - "+this.getTokensObtained,this.getTokensObtained>1?this.tokens_explained+=" tokens obtained":this.tokens_explained+=" token obtained"));const s=Math.floor(this.getTotalHonor*60/1e6);return s>0&&(e-=s,this.tokens_total>0&&(this.tokens_explained+=" - "+s,s>1?this.tokens_explained+=" final rally tokens":this.tokens_explained+=" final rally token")),Math.max(0,e)},getExFights(){return this.getAllFights.slice(0,2)},getRaidFights(){return this.getAllFights.slice(2,a.length)},getTotalFights(){return this.getAllFights[this.getAllFights.length-1]},getTotalQuota(){return this.quota_fight_raid.reduce((e,t)=>e+t)},getAllFights(){let e=a.map(s=>({name:s.name,fights:0,meat:0,tokens:0,honor:0,time:0,pots:0}));e.push({name:"Total",fights:0,meat:0,tokens:0,honor:0,time:0,pots:0});let t=this.tokens_needed;const o=a[this.chosen_ex];for(let s=0;s=1e6&&(e[s].honor=(e[s].honor/1e6).toFixed(2)+"m"),e[s].time=l.toReadableTime(e[s].time);return e[e.length-1].honor>=1e6&&(e[e.length-1].honor=(e[e.length-1].honor/1e6).toFixed(2)+"m"),e[e.length-1].time=l.toReadableTime(e[e.length-1].time),e}},watch:{boxes_needed(){_.setValue("boxes_needed",this)},boxes_opened(){_.setValue("boxes_opened",this)},show_fight(){_.setValue("show_fight",this)},show_host(){_.setValue("show_host",this)},show_join(){_.setValue("show_join",this)},tokens_obtained(){_.setValue("tokens_obtained",this)},total_honor(){_.setValue("total_honor",this)},add_honor(){_.setValue("add_honor",this)},show_result_2nd(){_.setValue("show_result_2nd",this)},show_result_3rd(){_.setValue("show_result_3rd",this)},show_result_other(){_.setValue("show_result_other",this)},time_fight_ex(){_.setValue("time_fight_ex",this)},time_fight_raid(){_.setValue("time_fight_raid",this)},quota_fight_raid(){_.setValue("quota_fight_raid",this)},meat_fight(){_.setValue("meat_fight",this)},chosen_ex(){_.setValue("chosen_ex",this)}},mounted(){_.getValue(this,"boxes_needed"),_.getValue(this,"boxes_opened"),_.getValue(this,"show_fight"),_.getValue(this,"show_host"),_.getValue(this,"show_join"),_.getValue(this,"tokens_obtained"),_.getValue(this,"total_honor"),_.getValue(this,"add_honor"),_.getValue(this,"show_result_2nd"),_.getValue(this,"show_result_3rd"),_.getValue(this,"show_result_other"),_.getValue(this,"time_fight_ex"),_.getValue(this,"time_fight_raid"),_.getValue(this,"quota_fight_raid"),_.getValue(this,"meat_fight"),_.getValue(this,"chosen_ex")}};var x=function(){var t=this,o=t._self._c;return o("div",{staticClass:"flex flex-col items-center"},[o("h1",{staticClass:"mb-8"},[t._v("Guild Wars tokens and boxes Calculator")]),o("div",{staticClass:"flex flex-col gap-x-4"},[o("span",{staticClass:"flex flex-row flex-wrap items-center gap-4"},[o("label",[t._v("Boxes needed "),o("input",{directives:[{name:"model",rawName:"v-model.lazy",value:t.boxes_needed,expression:"boxes_needed",modifiers:{lazy:!0}}],staticClass:"input input-sm",staticStyle:{width:"7ch"},attrs:{type:"number",min:"1"},domProps:{value:t.boxes_needed},on:{change:function(s){t.boxes_needed=s.target.value}}})]),o("label",[t._v("Already opened "),o("input",{directives:[{name:"model",rawName:"v-model.lazy",value:t.boxes_opened,expression:"boxes_opened",modifiers:{lazy:!0}}],staticClass:"input input-sm",staticStyle:{width:"7ch"},attrs:{type:"number",min:"0"},domProps:{value:t.boxes_opened},on:{change:function(s){t.boxes_opened=s.target.value}}})]),o("span",[t._v("Progress: "+t._s(t.getProgress)+"%")])]),o("span",{staticClass:"flex flex-row flex-wrap items-center gap-4"},[o("label",[t._v("Tokens obtained "),o("input",{directives:[{name:"model",rawName:"v-model.lazy",value:t.tokens_obtained,expression:"tokens_obtained",modifiers:{lazy:!0}}],staticClass:"input input-sm",staticStyle:{width:"10ch"},attrs:{type:"number",min:"0"},domProps:{value:t.tokens_obtained},on:{change:function(s){t.tokens_obtained=s.target.value}}})]),o("span",[o("label",[t._v("Total honor "),o("input",{directives:[{name:"model",rawName:"v-model.lazy",value:t.total_honor,expression:"total_honor",modifiers:{lazy:!0}}],staticClass:"input input-sm",staticStyle:{width:"14ch"},attrs:{type:"number",min:"0"},domProps:{value:t.total_honor},on:{change:function(s){t.total_honor=s.target.value}}})]),t._v(" "+t._s(t.total_honor>=1e6?"(≈"+(t.total_honor/1e6).toFixed(2)+"m)":"")+" ")])])]),o("div",{staticClass:"flex flex-col mb-8 gap-x-4"},[o("span",[t._v(t._s(t.tokens_explained))]),o("span",{staticClass:"text-lg font-bold"},[t._v("Tokens needed: "+t._s(t.tokens_needed))])]),o("h2",{staticClass:"mb-4"},[t._v("Farming time calculator (input in seconds):")]),o("div",{staticClass:"overflow-y-auto w-full"},[o("table",{staticClass:"table bg-secondary table-px w-auto ml-auto mr-auto mb-4"},[t._m(0),o("tbody",[o("tr",[o("td"),o("td",[o("dropdown",{model:{value:t.chosen_ex,callback:function(s){t.chosen_ex=t._n(s)},expression:"chosen_ex"}},t._l(t.getExFights,function(s,n){return o("option",{key:n,domProps:{value:n}},[t._v(t._s(s.name))])}),0)],1),o("td",[o("input",{directives:[{name:"model",rawName:"v-model.lazy",value:t.time_fight_ex[t.chosen_ex],expression:"time_fight_ex[chosen_ex]",modifiers:{lazy:!0}}],staticClass:"input input-sm",staticStyle:{width:"7ch"},attrs:{type:"number",min:"1"},domProps:{value:t.time_fight_ex[t.chosen_ex]},on:{change:function(s){return t.$set(t.time_fight_ex,t.chosen_ex,s.target.value)}}})]),o("td",[t._v(t._s(t.getExFights[t.chosen_ex].fights))]),o("td",[t._v(t._s(t.getExFights[t.chosen_ex].tokens))]),o("td",[t._v(t._s(t.getExFights[t.chosen_ex].honor))]),o("td",[t._v(t._s(t.getExFights[t.chosen_ex].time))]),o("td",[t._v(t._s(Math.ceil(t.getExFights[t.chosen_ex].pots)))]),o("td",[o("input",{directives:[{name:"model",rawName:"v-model.lazy.number",value:t.meat_fight[t.chosen_ex],expression:"meat_fight[chosen_ex]",modifiers:{lazy:!0,number:!0}}],staticClass:"input input-sm",staticStyle:{width:"7ch"},attrs:{type:"number",min:"1",step:".5"},domProps:{value:t.meat_fight[t.chosen_ex]},on:{change:function(s){t.$set(t.meat_fight,t.chosen_ex,t._n(s.target.value))},blur:function(s){return t.$forceUpdate()}}})]),o("td",[t._v(t._s(t.getExFights[t.chosen_ex].meat))])]),t._l(t.getRaidFights,function(s,n){return o("tr",{key:n},[o("td",[o("input",{directives:[{name:"model",rawName:"v-model.lazy.number",value:t.quota_fight_raid[n],expression:"quota_fight_raid[index]",modifiers:{lazy:!0,number:!0}}],staticClass:"input input-sm",staticStyle:{width:"7ch"},attrs:{type:"number",min:"0",max:"100"},domProps:{value:t.quota_fight_raid[n]},on:{change:function(i){t.$set(t.quota_fight_raid,n,t._n(i.target.value))},blur:function(i){return t.$forceUpdate()}}})]),o("td",[t._v(t._s(s.name))]),o("td",[o("input",{directives:[{name:"model",rawName:"v-model.lazy.number",value:t.time_fight_raid[n],expression:"time_fight_raid[index]",modifiers:{lazy:!0,number:!0}}],staticClass:"input input-sm",staticStyle:{width:"7ch"},attrs:{type:"number",min:"1"},domProps:{value:t.time_fight_raid[n]},on:{change:function(i){t.$set(t.time_fight_raid,n,t._n(i.target.value))},blur:function(i){return t.$forceUpdate()}}})]),o("td",[t._v(t._s(t.quota_fight_raid[n]>0?s.fights:""))]),o("td",[t._v(t._s(t.quota_fight_raid[n]>0?s.tokens:""))]),o("td",[t._v(t._s(t.quota_fight_raid[n]>0?s.honor:""))]),o("td",[t._v(t._s(t.quota_fight_raid[n]>0?s.time:""))]),o("td",[t._v(t._s(t.quota_fight_raid[n]>0?s.pots:""))]),o("td"),o("td",[t._v(t._s(t.quota_fight_raid[n]>0?s.meat:""))])])}),o("tr",[o("td"),t._m(1),o("td"),o("td",[t._v(t._s(t.getTotalFights.fights))]),o("td",[t._v(t._s(t.getTotalFights.tokens))]),o("td",[t._v(t._s(t.getTotalFights.honor))]),o("td",[t._v(t._s(t.getTotalFights.time))]),o("td",[t._v(t._s(Math.ceil(t.getTotalFights.pots)))]),o("td"),o("td",[t._v(t._s(t.getTotalFights.meat))])])],2)])]),o("div",{staticClass:"mb-8"},[t.getTotalQuota!=100?o("h3",{staticClass:"text-rose-600"},[t._v(" The sum of all % must be 100 ")]):t._e()]),o("div",{staticClass:"flex flex-row flex-wrap items-center gap-4"},[o("span",{staticClass:"flex flex-row flex-wrap btn-group items-center"},[o("span",{staticClass:"mr-2"},[t._v("Fight")]),t._l(t.getFightNames,function(s,n){return o("button",{key:n,staticClass:"btn btn-sm",class:t.show_fight[n]?"btn-blue":"btn-white",on:{click:function(i){return t.showFight(n)}}},[t._v(" "+t._s(s)+" ")])})],2),o("span",{staticClass:"flex flex-row flex-wrap btn-group items-center"},[o("span",{staticClass:"mr-2"},[t._v("Type")]),o("button",{staticClass:"btn btn-sm",class:t.show_host?"btn-blue":"btn-white",on:{click:function(s){t.show_host=!t.show_host}}},[t._v(" Host ")]),o("button",{staticClass:"btn btn-sm",class:t.show_join?"btn-blue":"btn-white",on:{click:function(s){t.show_join=!t.show_join}}},[t._v(" Join ")])]),o("checkbox",{model:{value:t.add_honor,callback:function(s){t.add_honor=s},expression:"add_honor"}},[t._v("Include honor to tokens sum")])],1),o("div",{staticClass:"flex flex-row flex-wrap mb-4 items-center gap-4"},[t._v(" Show results for "),o("checkbox",{staticClass:"ordinal",model:{value:t.show_result_2nd,callback:function(s){t.show_result_2nd=s},expression:"show_result_2nd"}},[t._v("2nd")]),o("checkbox",{staticClass:"ordinal",model:{value:t.show_result_3rd,callback:function(s){t.show_result_3rd=s},expression:"show_result_3rd"}},[t._v("3rd")]),o("checkbox",{model:{value:t.show_result_other,callback:function(s){t.show_result_other=s},expression:"show_result_other"}},[t._v("Other")])],1),o("div",{staticClass:"overflow-y-auto w-full"},[o("table",{staticClass:"table table-striped bg-secondary table-px w-auto ml-auto mr-auto"},[o("thead",[o("tr",[o("th",[t._v("Name")]),o("th",[t._v("Solo honor")]),t.show_host&&t.show_join?o("th"):t._e(),t.show_result_2nd||t.show_result_3rd||t.show_result_other?o("th"):t._e(),o("th",[t._v("Tokens")]),t.show_host?o("th",[t._v("Tokens/AP")]):t._e(),t.show_host?o("th",[t._v("Tokens/meat")]):t._e(),t.show_join?o("th",[t._v("Tokens/EP")]):t._e(),o("th",[t._v("Fights")]),t.show_host?o("th",[t._v("Meats")]):t._e(),t.show_host?o("th",[t._v("Pots")]):t._e(),t.show_join?o("th",[t._v("Berries")]):t._e()])]),o("tbody",t._l(t.getData,function(s,n){return o("tr",{key:n},[s.name?o("td",{staticClass:"is-td-vcentered bg-secondary",attrs:{rowspan:s.name_rows}},[t._v(t._s(s.name))]):t._e(),s.honor?o("td",{staticClass:"is-td-vcentered bg-secondary",attrs:{rowspan:s.honor_rows}},[t._v(t._s(s.honor))]):t._e(),s.type&&t.show_host&&t.show_join?o("td",{staticClass:"is-td-vcentered bg-secondary",attrs:{rowspan:s.type_rows}},[t._v(t._s(s.type))]):t._e(),t.show_result_2nd||t.show_result_3rd||t.show_result_other?o("td",[t._v(t._s(s.finish))]):t._e(),o("td",[t._v(t._s(s.token))]),t.show_host?o("td",[t._v(t._s(s.cost_ap?(s.token/s.cost_ap).toFixed(2):""))]):t._e(),t.show_host?o("td",[t._v(t._s(s.cost_meat?(s.token/s.cost_meat).toFixed(2):""))]):t._e(),t.show_join?o("td",[t._v(t._s(s.cost_ep?(s.token/s.cost_ep).toFixed(2):""))]):t._e(),o("td",[t._v(t._s(Math.ceil(t.tokens_needed/s.token)))]),t.show_host?o("td",[t._v(t._s(s.cost_meat>0?Math.ceil(t.tokens_needed/s.token*s.cost_meat):""))]):t._e(),t.show_host?o("td",[t._v(t._s(s.cost_ap>0?Math.ceil(t.tokens_needed/s.token*(s.cost_ap/75)):""))]):t._e(),t.show_join?o("td",[t._v(t._s(s.cost_ep>0?Math.ceil(t.tokens_needed/s.token*s.cost_ep):""))]):t._e()])}),0)])])])},f=[function(){var e=this,t=e._self._c;return t("thead",[t("tr",[t("th",[t("abbr",{attrs:{title:"Percentage of tokens coming from this raid"}},[e._v("%")])]),t("th",[e._v("Name")]),t("th",[e._v("Time/fight")]),t("th",[e._v("Fights")]),t("th",[e._v("Tokens")]),t("th",[e._v("Honor")]),t("th",[e._v("Time")]),t("th",[e._v("Pots")]),t("th",[e._v("Meat/fight")]),t("th",[e._v("Meat")])])])},function(){var e=this,t=e._self._c;return t("td",[t("b",[e._v("Total")])])}],v=m(g,x,f,!1,null,null);const C=v.exports;export{C as default};