text: (()=>{var e={9072:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var r=s(6252),a=s(3577);const o={class:"flex"},n={class:"flex-shrink-0"},i={class:"ml-3"},l=["textContent"],c={class:"ml-auto pl-3"},d={class:"-mx-1.5 -my-1.5"},u=(0,r._)("span",{class:"sr-only"},"Dismiss",-1);function m(e,t,s,m,g,p){const h=(0,r.up)("XIcon");return g.open?((0,r.wg)(),(0,r.iD)("div",{key:0,class:(0,a.C_)(["rounded-md p-4 mb-10",p.backgroundColor])},[(0,r._)("div",o,[(0,r._)("div",n,[((0,r.wg)(),(0,r.j4)((0,r.LL)(p.icon),{class:(0,a.C_)(["h-5 w-5 text-green-400",p.textColor]),"aria-hidden":"true"},null,8,["class"]))]),(0,r._)("div",i,[(0,r._)("p",{class:(0,a.C_)(["text-sm font-medium",p.textColor]),textContent:(0,a.zw)(s.data.message)},null,10,l)]),(0,r._)("div",c,[(0,r._)("div",d,[(0,r._)("button",{type:"button",class:(0,a.C_)(["inline-flex rounded-md p-1.5 focus:outline-none",p.textColor]),onClick:t[0]||(t[0]=(...e)=>p.close&&p.close(...e))},[u,(0,r.Wm)(h,{class:"h-5 w-5","aria-hidden":"true"})],2)])])])],2)):(0,r.kq)("",!0)}var g=s(318),p=s(3255),h=s(4299),b=s(5237);const y={components:{CheckCircleIcon:g.Z,XIcon:p.Z},props:{data:{type:Object,required:!0}},data(){return{open:!0}},computed:{icon(){switch(this.data.type){case"success":return g.Z;case"error":return h.Z;case"warning":return b.Z;default:return g.Z}},textColor(){switch(this.data.type){case"success":return"text-green-800 dark:text-green-900";case"error":return"text-red-800 dark:text-red-900";case"warning":return"text-yellow-600 dark:text-yellow-700";default:return"text-green-800 dark:text-green-900"}},backgroundColor(){switch(this.data.type){case"success":return"bg-green-50 dark:bg-green-500";case"error":return"bg-red-50 dark:bg-red-500";case"warning":return"bg-yellow-100 dark:bg-yellow-300";default:return"bg-green-50 dark:bg-green-500"}}},methods:{close(){this.open=!1}}};var f=s(3744);const x=(0,f.Z)(y,[["render",m]]),v=x},5166:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var r=s(6252);const a={key:0,class:"relative bg-indigo-600 dark:bg-indigo-400 select-none text-white dark:text-black"},o={class:"max-w-7xl mx-auto py-3 px-3 sm:px-6 lg:px-8"},n=(0,r.uE)('<div class="pr-16 sm:text-center sm:px-16"><p class="font-medium"><span class="md:inline"> Big news! We&#39;re excited to announce a brand new product. </span><span class="block sm:ml-2 sm:inline-block"><a href="#" class="font-bold underline"> Learn more <span aria-hidden="true">→</span></a></span></p></div>',1),i={class:"absolute inset-y-0 right-0 pt-1 pr-1 flex items-start sm:pt-1 sm:pr-2 sm:items-start"};function l(e,t,s,l,c,d){const u=(0,r.up)("XIcon");return e.modals.announcement?((0,r.wg)(),(0,r.iD)("div",a,[(0,r._)("div",o,[n,(0,r._)("div",i,[(0,r._)("button",{type:"button",class:"flex p-2 rounded-md hover:bg-indigo-500 focus:outline-none focus:ring-0",onClick:t[0]||(t[0]=(...e)=>d.close&&d.close(...e))},[(0,r.Wm)(u,{class:"h-6 w-6","aria-hidden":"true"})])])])])):(0,r.kq)("",!0)}var c=s(9318),d=s(6245),u=s(2542);const m={components:{XIcon:c.Z},computed:{...(0,d.rn)(u.h,["modals"])},methods:{close(){this.modals.announcement=!1}}};var g=s(3744);const p=(0,g.Z)(m,[["render",l]]),h=p},2101:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var r=s(6252);const a={ref:"chart",class:"rounded overflow-hidden border-2 border-gray-100 dark:border-gray-600"};function o(e,t,s,o,n,i){return(0,r.wg)(),(0,r.iD)("div",a,null,512)}var n=s(3136),i=s(2542),l=s(6245),c=s(6486),d=s.n(c);const u={name:"CandlesChart",components:{},props:{form:{type:Object,required:!0},results:{type:Object,required:!0},candles:{type:Array,required:!0}},data(){return{chart:null,candleSeries:null,lines:{orderEntries:{}},settings:{width:800,height:380,crosshair:{mode:n.rM.Normal}},lightTheme:{chart:{layout:{backgroundColor:"#ffffff",textColor:"rgba(33, 56, 77, 1)"},grid:{vertLines:{color:"#f1f1f1",visible:!1},horzLines:{color:"#f1f1f1",visible:!1}},priceScale:{borderColor:"rgba(197, 203, 206, 0.6)"},timeScale:{borderColor:"rgba(197, 203, 206, 0.6)",timeVisible:!0,secondsVisible:!1}},series:{color:"#4f46e5"}},darkTheme:{chart:{layout:{backgroundColor:"#333333",textColor:"#D1D5DB"},grid:{vertLines:{color:"#525252",visible:!1},horzLines:{color:"#525252",visible:!1}},priceScale:{borderColor:"#525252"},timeScale:{borderColor:"#525252",timeVisible:!0,secondsVisible:!1}},series:{color:"#818CF8"}}}},computed:{currentCandles(){return this.results.currentCandles},...(0,l.Ah)(i.h,["theme"]),positionEntry(){return this.results.positions[1][3].value},positionType(){return this.results.positions[1][2].value>0?"long":this.results.positions[1][2].value<0?"short":"close"},firstPosition(){return this.results.positions[1]}},watch:{currentCandles(e,t){const s=this.form.routes[0],r=`${s.exchange}-${s.symbol}-${s.timeframe}`;this.updateCurrentCandle(e[r])},theme(e){this.checkTheme(e)},positionEntry(e,t){e!==t&&this.updatePositionEntry()},"results.rawOrders":{handler(e,t){this.updateOrderEntries()},deep:!0}},mounted(){this.settings.width=this.$refs.chart.clientWidth,this.chart=(0,n.C2)(this.$refs.chart,this.settings),this.candleSeries=this.chart.addCandlestickSeries(),this.candleSeries.setData(this.candles),this.chart.timeScale().fitContent(),"light"===this.theme?this.chart.applyOptions(this.lightTheme.chart):this.chart.applyOptions(this.darkTheme.chart),this.updatePositionEntry(),this.updateOrderEntries()},beforeUnmount(){this.chart=null,this.candleSeries=null},methods:{updatePositionEntry(){const e="long"===this.positionType?"#00AB5C":"#FF497D";if(this.lines.positionEntry&&this.candleSeries.removePriceLine(this.lines.positionEntry),this.positionEntry>0){const t={price:this.positionEntry,color:e,lineWidth:1.5,lineStyle:0,axisLabelVisible:!0,title:"Entry Price"};this.lines.positionEntry=this.candleSeries.createPriceLine(t)}},updateOrderEntries(){const e=this.firstPosition[0].value;for(const t in this.lines.orderEntries)this.candleSeries.removePriceLine(this.lines.orderEntries[t]),delete this.lines.orderEntries[t];this.results.rawOrders.forEach((t=>{const s="buy"===t.side?"#00AB5C":"#FF497D",r=d().startCase(d().lowerCase(`${t.side} ${t.type}`));if("ACTIVE"===t.status&&t.symbol===e){const e={price:t.price,color:s,lineWidth:1,lineStyle:3,axisLabelVisible:!0,title:r};this.lines.orderEntries[t.id]=this.candleSeries.createPriceLine(e)}}))},updateCurrentCandle(e){if(void 0===e)throw new TypeError("candle is undefined!");if(0===this.candles.length)return;const t=this.results.candles[this.results.candles.length-1];t.time>e.time||this.candleSeries.update(e)},checkTheme(e){"light"===e?this.chart.applyOptions(this.lightTheme.chart):this.chart.applyOptions(this.darkTheme.chart)}}};var m=s(3744);const g=(0,m.Z)(u,[["render",o]]),p=g},5104:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var r=s(6252);const a={ref:"chart",class:"rounded overflow-hidden border-2 border-gray-100 dark:border-gray-600"};function o(e,t,s,o,n,i){return(0,r.wg)(),(0,r.iD)("div",a,null,512)}var n=s(3136),i=s(2542),l=s(6245);let c=null,d=null;const u={name:"EquityCurve",props:{equityCurve:{type:Array,required:!0,default:()=>[]}},data(){return{settings:{width:800,height:300,priceScale:{borderColor:"rgba(197, 203, 206, 1)"},timeScale:{borderColor:"rgba(197, 203, 206, 1)",timeVisible:!0,secondsVisible:!1}},lightTheme:{chart:{layout:{backgroundColor:"#ffffff",textColor:"rgba(33, 56, 77, 1)"},grid:{vertLines:{color:"#f1f1f1"},horzLines:{color:"#f1f1f1"}},priceScale:{borderColor:"rgba(197, 203, 206, 0.6)"},timeScale:{borderColor:"rgba(197, 203, 206, 0.6)",timeVisible:!0,secondsVisible:!1}},series:{color:"#4f46e5"}},darkTheme:{chart:{layout:{backgroundColor:"#333333",textColor:"#D1D5DB"},grid:{vertLines:{color:"#525252"},horzLines:{color:"#525252"}},priceScale:{borderColor:"#525252"},timeScale:{borderColor:"#525252",timeVisible:!0,secondsVisible:!1}},series:{color:"#818CF8"}}}},computed:{...(0,l.Ah)(i.h,["theme"])},watch:{equityCurve(e){d.setData(e)},theme(e){this.checkTheme(e)}},mounted(){this.settings.width=this.$refs.chart.clientWidth,c=(0,n.C2)(this.$refs.chart,this.settings),d=c.addLineSeries({lineWidth:1.5}),c.timeScale().fitContent(),d.setData(this.equityCurve),"light"===localStorage.theme?(c.applyOptions(this.lightTheme.chart),d.applyOptions(this.lightTheme.series)):(c.applyOptions(this.darkTheme.chart),d.applyOptions(this.darkTheme.series))},beforeUnmount(){c=null,d=null},methods:{checkTheme(e){"light"===e?(c.applyOptions(this.lightTheme.chart),d.applyOptions(this.lightTheme.series)):(c.applyOptions(this.darkTheme.chart),d.applyOptions(this.darkTheme.series))}}};var m=s(3744);const g=(0,m.Z)(u,[["render",o]]),p=g},3394:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(6252),a=s(3577),o=s(9963);const n={class:"flex items-start select-none"},i={class:"h-5 flex items-center"},l=["id","name"],c={class:"ml-3 text-sm"},d=["for"],u={class:"text-gray-500 dark:text-gray-400"};function m(e,t,s,m,g,p){return(0,r.wg)(),(0,r.iD)("div",n,[(0,r._)("div",i,[(0,r.wy)((0,r._)("input",{id:s.name,"onUpdate:modelValue":t[0]||(t[0]=e=>s.object[s.name]=e),"data-test":"checkboxInput",type:"checkbox",name:s.name,class:(0,a.C_)([s.object[s.name]?"dark:border-gray-600":"dark:border-gray-500","focus:ring-0 h-4 w-4 text-indigo-600 dark:text-gray-600 dark:bg-gray-600 border-gray-300 focus:ring-offset-0 rounded cursor-pointer"])},null,10,l),[[o.e8,s.object[s.name]]])]),(0,r._)("div",c,[(0,r._)("label",{for:s.name,class:"font-medium text-gray-700 dark:text-gray-200 cursor-pointer"},(0,a.zw)(s.title),9,d),(0,r._)("p",u,(0,a.zw)(s.description),1)])])}const g={name:"Checkbox",props:{description:{type:String,required:!1,default:""},title:{type:String,required:!0},object:{type:Object,required:!0},name:{type:String,required:!0}}};var p=s(3744);const h=(0,p.Z)(g,[["render",m]]),b=h},285:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var r=s(6252),a=s(3577);const o={class:"relative mb-4 select-none"},n=(0,r._)("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[(0,r._)("div",{class:"w-full border-t-2 border-dashed border-gray-300 dark:border-gray-600"})],-1),i={class:"relative flex justify-start"},l=["textContent"];function c(e,t,s,c,d,u){return(0,r.wg)(),(0,r.iD)("div",o,[n,(0,r._)("div",i,[(0,r._)("span",{class:"pr-3 bg-white dark:bg-backdrop-dark text-lg font-medium text-gray-900 dark:text-gray-100",textContent:(0,a.zw)(s.title)},null,8,l)])])}const d={name:"Divider",props:{title:{type:String,required:!0}}};var u=s(3744);const m=(0,u.Z)(d,[["render",c]]),g=m},4880:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var r=s(6252),a=s(3577);const o={class:"relative mb-4 select-none"},n=(0,r._)("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[(0,r._)("div",{class:"w-full border-t-2 border-dashed border-gray-300 dark:border-gray-600"})],-1),i={class:"relative flex items-center justify-between"},l=["textContent"];function c(e,t,s,c,d,u){return(0,r.wg)(),(0,r.iD)("div",o,[n,(0,r._)("div",i,[(0,r._)("span",{class:"pr-3 bg-white dark:bg-backdrop-dark text-lg font-medium text-gray-900 dark:text-gray-200",textContent:(0,a.zw)(s.title)},null,8,l),(0,r._)("span",null,[(0,r.WI)(e.$slots,"default")])])])}const d={name:"DividerWithButtons",props:{title:{type:String,required:!0}}};var u=s(3744);const m=(0,u.Z)(d,[["render",c]]),g=m},8641:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>U});var r=s(6252),a=s(3577),o=s(9963);const n={key:0,class:"mb-4"},i=(0,r._)("p",null," If the exception you're seeing is not clear and you think it might be a bug, please send us a report to help us debugging and fixing it in a future release. ",-1),l=(0,r._)("br",null,null,-1),c=(0,r._)("label",{class:"font-semibold"},"Exception:",-1),d=["innerHTML"],u=(0,r._)("br",null,null,-1),m=(0,r._)("br",null,null,-1),g=(0,r._)("br",null,null,-1),p=(0,r._)("br",null,null,-1),h={class:"flex justify-end item-center"},b=(0,r._)("span",null,"Report",-1),y={class:"rounded-md bg-red-50 p-4 my-4 select-text"},f={class:"flex"},x={class:"flex-shrink-0"},v={class:"ml-3 overflow-hidden"},w=["textContent"],k=["innerHTML"],_=["value"];function T(e,t,s,T,C,j){const D=(0,r.up)("Alert"),I=(0,r.up)("FormTextarea"),S=(0,r.up)("FormInput"),L=(0,r.up)("ToggleButton"),W=(0,r.up)("SlideOver"),E=(0,r.up)("FlagIcon"),q=(0,r.up)("CheckIcon"),$=(0,r.up)("ClipboardIcon"),Z=(0,r.up)("DividerWithButtons"),R=(0,r.up)("XCircleIcon");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(W,{name:"exceptionReport",object:e.modals,title:"Report"},{default:(0,r.w5)((()=>[j.alert.message?((0,r.wg)(),(0,r.iD)("div",n,[(0,r.Wm)(D,{data:j.alert},null,8,["data"])])):(0,r.kq)("",!0),i,l,c,(0,r._)("pre",{class:"break-all lg:break-normal mt-2 text-sm whitespace-pre-line px-6 py-6 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 dark:border-gray-800 border border-gray-200",innerHTML:s.content},null,8,d),u,(0,r.Wm)(I,{title:"Description (optional):",placeholder:"Describe how the exception occurred...",name:"description",object:C.form,rows:10},null,8,["object"]),m,(0,r.Wm)(S,{title:"Email (optional)",description:"Enter your email address for us to know who sent the feedback and possibly reply back to you.","input-type":"email",placeholder:"Email address...",name:"email",object:C.form},null,8,["object"]),g,j.showLogToggle?((0,r.wg)(),(0,r.j4)(L,{key:1,object:C.form,name:"attachLogs",title:"Attach Debugging Logs",description:"Attach the log file of this session along with this report which helps Jesse's team"},null,8,["object"])):(0,r.kq)("",!0),p,(0,r._)("div",h,[(0,r._)("button",{class:"btn-link text-indigo-600 dark:text-indigo-400 mr-4",onClick:t[0]||(t[0]=t=>e.modals.exceptionReport=!1)},"Cancel"),(0,r._)("button",{class:"btn-primary",onClick:t[1]||(t[1]=(...e)=>j.report&&j.report(...e))},"Submit")])])),_:1},8,["object"]),(0,r.Wm)(Z,{title:"Exception"},{default:(0,r.w5)((()=>[(0,r._)("button",{type:"button",class:"inline-flex items-center shadow-sm px-4 py-1.5 border border-gray-300 dark:border-gray-600 text-sm leading-5 font-medium rounded-l-full text-gray-700 dark:text-gray-100 bg-white dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-800 focus:outline-none",onClick:t[2]||(t[2]=(...e)=>j.openReport&&j.openReport(...e))},[(0,r.Wm)(E,{class:"-ml-1.5 mr-1 h-5 w-5 text-gray-400","aria-hidden":"true"}),b]),(0,r._)("button",{type:"button",class:"inline-flex items-center shadow-sm px-4 py-1.5 border border-gray-300 dark:border-gray-600 text-sm leading-5 font-medium rounded-r-full text-gray-700 dark:text-gray-100 bg-white dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-800 focus:outline-none",onClick:t[3]||(t[3]=(...e)=>j.copy&&j.copy(...e))},[C.copied?((0,r.wg)(),(0,r.j4)(q,{key:0,class:"-ml-1.5 mr-1 h-5 w-5 text-gray-400","aria-hidden":"true"})):((0,r.wg)(),(0,r.j4)($,{key:1,class:"-ml-1.5 mr-1 h-5 w-5 text-gray-400","aria-hidden":"true"})),(0,r._)("span",null,(0,a.zw)(C.copied?"Copied":"Copy"),1)])])),_:1}),(0,r._)("div",y,[(0,r._)("div",f,[(0,r._)("div",x,[(0,r.Wm)(R,{class:"h-5 w-5 text-red-400","aria-hidden":"true"})]),(0,r._)("div",v,[(0,r._)("h3",{class:"text-base font-medium text-red-800 mb-6",textContent:(0,a.zw)(s.title)},null,8,w),s.content?((0,r.wg)(),(0,r.iD)("pre",{key:0,class:"mt-2 text-sm text-red-700 whitespace-pre-line px-6 py-6 rounded-md border-2 border-dashed border-red-200",innerHTML:s.content},null,8,k)):(0,r.kq)("",!0)])]),(0,r.wy)((0,r._)("textarea",{id:"exception-info",value:s.content,class:"fixed left-0 bottom-0 opacity-0"},null,8,_),[[o.F8,C.showException]])])],64)}var C=s(9838),j=s(7345),D=s(9191),I=s(4013),S=s(4880),L=s(6582),W=s(6245),E=s(2542),q=s(9669),$=s.n(q);const Z={name:"Exception",components:{DividerWithButtons:S["default"],FlagIcon:C.Z,ClipboardIcon:j.Z,XCircleIcon:I.Z,SlideOver:L["default"],CheckIcon:D.Z},props:{title:{type:String,required:!0},content:{type:String,default:""},mode:{type:String,required:!0},debugMode:{type:Boolean,default:!1},sessionId:{type:String,required:!1,default:null}},data(){return{showException:"",copied:!1,form:{description:"",attachLogs:!0,email:""}}},computed:{...(0,W.rn)(E.h,["modals"]),alert(){return"backtest"!==this.mode||this.debugMode?{message:"",type:""}:{message:'It is highly recommended to attach log files with reports. To do that, press cancel, enable "Debug Mode", and  run again. ',type:"warning"}},showLogToggle(){return"backtest"===this.mode&&this.debugMode||"live"===this.mode}},methods:{report(){$().post("/report-exception",{description:this.form.description,email:this.form.email,traceback:this.content,mode:this.mode,attach_logs:this.form.attachLogs,session_id:this.sessionId}).then((e=>{"success"===e.data.status?(this.form.description="",this.form.email="",this.notyf.success(e.data.message),this.modals.exceptionReport=!1):"error"===e.data.status&&this.notyf.error(e.data.message)})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))},copy(){this.showException=!0,setTimeout((()=>{const e=document.querySelector("#exception-info");e.setAttribute("type","text"),e.select(),document.execCommand("copy"),this.copied=!0,e.setAttribute("type","hidden"),window.getSelection().removeAllRanges(),this.showException=!1}),10),setTimeout((()=>{this.copied=!1}),3e3)},openReport(){this.modals.exceptionReport=!0}}};var R=s(3744);const O=(0,R.Z)(Z,[["render",T]]),U=O},9233:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252),a=s(3577);const o=e=>((0,r.dD)("data-v-40ffd2eb"),e=e(),(0,r.Cn)(),e),n=o((()=>(0,r._)("div",{class:"left-half-clipper"},[(0,r._)("div",{class:"first50-bar"}),(0,r._)("div",{class:"value-bar"})],-1)));function i(e,t,s,o,i,l){return(0,r.wg)(),(0,r.iD)("div",{class:(0,a.C_)(l.classes)},[(0,r._)("span",null,(0,a.zw)(s.progress)+"%",1),n],2)}const l={name:"CircleProgressbar",props:{progress:{type:Number,required:!0}},computed:{classes(){let e="progress-circle";return this.progress>50&&(e+=" over50"),e+=` p${Math.round(this.progress)}`,e}}};var c=s(3744);const d=(0,c.Z)(l,[["render",i],["__scopeId","data-v-40ffd2eb"]]),u=d},9602:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var r=s(6252);const a=["id","name"];function o(e,t,s,o,n,i){return(0,r.wg)(),(0,r.iD)("input",{id:s.name,type:"date",name:s.name,class:"focus:ring-indigo-500 focus:border-indigo-500 flex justify-center items-center w-48 text-center sm:text-sm border-gray-300 rounded-md"},null,8,a)}const n={name:"DatePicker",props:{name:{type:String,required:!0}}};var i=s(3744);const l=(0,i.Z)(n,[["render",o]]),c=l},8588:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var r=s(6252),a=s(3577),o=s(9963);const n={class:"col-span-6 sm:col-span-3"},i={class:"input-label"},l=["name","autocomplete","placeholder","step"],c=["name","type","autocomplete","placeholder"],d={key:2,class:"mt-2 text-sm text-gray-500"};function u(e,t,s,u,m,g){return(0,r.wg)(),(0,r.iD)("div",n,[(0,r._)("label",i,(0,a.zw)(s.title),1),"number"===s.inputType?(0,r.wy)(((0,r.wg)(),(0,r.iD)("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=e=>s.object[s.name]=e),name:s.name,type:"number",autocomplete:s.name,placeholder:s.placeholder,step:s.step,class:"mt-1 input"},null,8,l)),[[o.nr,s.object[s.name]]]):(0,r.wy)(((0,r.wg)(),(0,r.iD)("input",{key:1,"onUpdate:modelValue":t[1]||(t[1]=e=>s.object[s.name]=e),name:s.name,type:s.inputType,autocomplete:s.name,placeholder:s.placeholder,class:"mt-1 input"},null,8,c)),[[o.YZ,s.object[s.name]]]),s.description?((0,r.wg)(),(0,r.iD)("p",d,(0,a.zw)(s.description),1)):(0,r.kq)("",!0)])}const m={name:"FormInput",props:{title:{type:String,required:!0},object:{type:Object,required:!0},name:{type:String,required:!0},inputType:{type:String,default:"text"},description:{type:String,default:""},placeholder:{type:String,default:""},step:{type:Number,default:1}}};var g=s(3744);const p=(0,g.Z)(m,[["render",u]]),h=p},3710:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var r=s(6252),a=s(3577),o=s(9963);const n={class:"col-span-6 sm:col-span-3"},i={key:0,class:"input-label"},l=["id","name","rows","placeholder"],c={key:1,class:"mt-2 text-sm text-gray-500"};function d(e,t,s,d,u,m){return(0,r.wg)(),(0,r.iD)("div",n,[s.title?((0,r.wg)(),(0,r.iD)("label",i,(0,a.zw)(s.title),1)):(0,r.kq)("",!0),(0,r.wy)((0,r._)("textarea",{id:s.name,"onUpdate:modelValue":t[0]||(t[0]=e=>s.object[s.name]=e),name:s.name,rows:s.rows,class:"mt-1 input",placeholder:s.placeholder},null,8,l),[[o.nr,s.object[s.name]]]),s.description?((0,r.wg)(),(0,r.iD)("p",c,(0,a.zw)(s.description),1)):(0,r.kq)("",!0)])}const u={name:"FormTextarea",props:{title:{type:String,required:!1,default:""},object:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},placeholder:{type:String,default:""},rows:{type:Number,required:!1,default:8}}};var m=s(3744);const g=(0,m.Z)(u,[["render",d]]),p=g},2396:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252),a=s(9963);const o={class:"inline-block relative"};function n(e,t,s,n,i,l){const c=(0,r.up)("Spinner");return(0,r.wg)(),(0,r.iD)("div",o,[(0,r.WI)(e.$slots,"default",{setLoaded:l.setLoaded}),(0,r.wy)((0,r.Wm)(c,{class:"absolute inset-0 h-full w-full bg-gray-300 dark:bg-gray-500"},null,512),[[a.F8,!i.isLoaded]])])}var i=s(1034);const l={name:"ImageLoader",components:{Spinner:i["default"]},data(){return{isLoaded:!1}},computed:{},mounted(){},methods:{setLoaded(){this.isLoaded=!0}}};var c=s(3744);const d=(0,c.Z)(l,[["render",n]]),u=d},8337:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var r=s(6252),a=s(3577),o=s(9963);const n={class:"flex items-center justify-between"},i={class:"font-semibold font-medium text-gray-700 dark:text-gray-200"},l={class:"flex"},c=["name"];function d(e,t,s,d,u,m){return(0,r.wg)(),(0,r.iD)("div",n,[(0,r._)("div",i,(0,a.zw)(s.title),1),(0,r._)("div",l,[(0,r._)("div",{class:"select-none border py-2 px-4 cursor-pointer bg-gray-100 hover:bg-gray-50 dark:bg-black dark:hover:bg-gray-900 dark:border-gray-900 rounded-l",onClick:t[0]||(t[0]=(...e)=>m.decrease&&m.decrease(...e))}," - "),(0,r.wy)((0,r._)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>s.object[s.name]=e),class:"border border-gray-200 p-2 text-center focus:outline-none focus:ring-0 dark:bg-gray-800 dark:border-gray-900",type:"text",name:s.name},null,8,c),[[o.nr,s.object[s.name]]]),(0,r._)("div",{class:"select-none border py-2 px-4 cursor-pointer bg-gray-100 hover:bg-gray-50 dark:bg-black dark:hover:bg-gray-900 dark:border-gray-900 rounded-r",onClick:t[2]||(t[2]=(...e)=>m.increase&&m.increase(...e))}," + ")])])}const u={props:{title:{type:String,required:!0},object:{type:Object,required:!0},name:{type:String,required:!0}},methods:{increase(){this.object[this.name]++},decrease(){this.object[this.name]>1&&this.object[this.name]--}}};var m=s(3744);const g=(0,m.Z)(u,[["render",d]]),p=g},3853:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252);const a=(0,r._)("label",{for:"location",class:"block text-sm font-medium text-gray-700"},"Location",-1),o=(0,r._)("select",{id:"location",name:"location",class:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(0,r._)("option",null,"USA"),(0,r._)("option",{selected:""},"Canada"),(0,r._)("option",null,"EU")],-1),n=[a,o];function i(e,t){return(0,r.wg)(),(0,r.iD)("div",null,n)}var l=s(3744);const c={},d=(0,l.Z)(c,[["render",i]]),u=d},6582:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var r=s(6252),a=s(3577);const o={class:"absolute inset-0 overflow-hidden"},n={class:"fixed inset-y-0 right-0 pl-10 max-w-full flex"},i={class:"h-full flex flex-col py-6 bg-white dark:bg-backdrop-dark shadow-xl overflow-y-scroll"},l={class:"px-4 sm:px-6 border-b-2 dark:border-gray-800 pb-6"},c={class:"flex items-start justify-between"},d={class:"ml-3 h-7 flex items-center"},u={class:"mt-6 relative flex-1 px-4 sm:px-6"},m=(0,r._)("div",{class:"absolute inset-0 px-4 sm:px-6"},[(0,r._)("div",{class:"h-full border-2 border-dashed border-gray-200","aria-hidden":"true"})],-1);function g(e,t,s,g,p,h){const b=(0,r.up)("DialogOverlay"),y=(0,r.up)("TransitionChild"),f=(0,r.up)("DialogTitle"),x=(0,r.up)("XIcon"),v=(0,r.up)("Dialog"),w=(0,r.up)("TransitionRoot");return(0,r.wg)(),(0,r.j4)(w,{as:"template",show:s.object[s.name]},{default:(0,r.w5)((()=>[(0,r.Wm)(v,{as:"div",static:"",class:"fixed inset-0 overflow-hidden z-40",open:s.object[s.name],onClose:t[1]||(t[1]=e=>s.object[s.name]=!1)},{default:(0,r.w5)((()=>[(0,r._)("div",o,[(0,r.Wm)(y,{as:"template",enter:"ease-in-out duration-400","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in-out duration-400","leave-from":"opacity-100","leave-to":"opacity-0"},{default:(0,r.w5)((()=>[(0,r.Wm)(b,{class:"absolute inset-0 bg-gray-500 bg-opacity-95 transition-opacity"})])),_:1}),(0,r._)("div",n,[(0,r.Wm)(y,{as:"template",enter:"transform transition ease-in-out duration-400 sm:duration-400","enter-from":"translate-x-full","enter-to":"translate-x-0",leave:"transform transition ease-in-out duration-400 sm:duration-400","leave-from":"translate-x-0","leave-to":"translate-x-full"},{default:(0,r.w5)((()=>[(0,r._)("div",{class:(0,a.C_)(["w-screen",s.width])},[(0,r._)("div",i,[(0,r._)("div",l,[(0,r._)("div",c,[(0,r.Wm)(f,{"data-cy":"slideover-title",class:"text-lg font-medium text-gray-900 dark:text-gray-100 select-none",textContent:(0,a.zw)(s.title)},null,8,["textContent"]),(0,r._)("div",d,[(0,r.WI)(e.$slots,"buttons"),(0,r._)("button",{id:"slideover-close-button",class:"btn-nav",onClick:t[0]||(t[0]=e=>s.object[s.name]=!1)},[(0,r.Wm)(x,{class:"h-6 w-6","aria-hidden":"true"})])])])]),(0,r._)("div",u,[(0,r.WI)(e.$slots,"default",{},(()=>[m]))])])],2)])),_:3})])])])),_:3},8,["open"])])),_:3},8,["show"])}var p=s(2106),h=s(9318);const b={components:{Dialog:p.Vq,DialogOverlay:p.t9,DialogTitle:p.$N,TransitionChild:p.xY,TransitionRoot:p.Qm,XIcon:h.Z},props:{title:{type:String,required:!1,default:""},object:{type:Object,required:!0},name:{type:String,required:!0},width:{type:String,default:"max-w-4xl"}}};var y=s(3744);const f=(0,y.Z)(b,[["render",g]]),x=f},1034:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var r=s(6252);const a={class:"spinner"};function o(e,t,s,o,n,i){return(0,r.wg)(),(0,r.iD)("div",a)}const n={name:"Spinner",components:{},data(){return{}},computed:{},mounted(){},methods:{}};var i=s(3744);const l=(0,i.Z)(n,[["render",o]]),c=l},7378:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(6252),a=s(3577);const o={class:"flex flex-col"},n={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"},i={class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},l={class:"border dark:border-gray-600 overflow-hidden sm:rounded"},c={class:"min-w-full divide-y divide-gray-200"},d={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-500 dark:text-gray-400"},u={class:"px-6 py-4 whitespace-nowrap text-sm font-bold text-gray-900 dark:text-gray-200"};function m(e,t,s,m,g,p){return(0,r.wg)(),(0,r.iD)("div",o,[(0,r._)("div",n,[(0,r._)("div",i,[(0,r._)("div",l,[(0,r._)("table",c,[(0,r._)("tbody",null,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(s.data,((e,t)=>((0,r.wg)(),(0,r.iD)("tr",{key:t,class:(0,a.C_)(t%2===0?"bg-white dark:bg-gray-700":"bg-gray-50 dark:bg-backdrop-dark")},[(0,r._)("td",d,(0,a.zw)(e[0]),1),(0,r._)("td",u,(0,a.zw)(e[1]),1)],2)))),128))])])])])])])}const g={name:"KeyValueTable",props:{data:{type:Array,required:!0}}};var p=s(3744);const h=(0,p.Z)(g,[["render",m]]),b=h},6312:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var r=s(6252);const a={key:0,class:"animate-spin -ml-1 mr-3 h-3.5 w-3.5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},o=(0,r._)("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n=(0,r._)("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),i=[o,n];function l(e,t,s,o,n,l){return s.object[s.name]?((0,r.wg)(),(0,r.iD)("svg",a,i)):(0,r.kq)("",!0)}const c={name:"LoadingSvg",props:{object:{type:Object,required:!0},name:{type:String,required:!0}}};var d=s(3744);const u=(0,d.Z)(c,[["render",l]]),m=u},243:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252);const a=["innerHTML"],o={key:1,class:"text-center rounded border-2 border-dashed dark:border-gray-800 bg-gray-100 dark:bg-gray-700 py-4 opacity-40 dark:opacity-75 select-none"};function n(e,t,s,n,i,l){return s.logs.length?((0,r.wg)(),(0,r.iD)("pre",{key:0,class:"whitespace-pre-line rounded border dark:border-gray-600 bg-gray-50 dark:bg-gray-700 select-text text-sm dark:text-gray-300 w-full px-4 sm:px-6 py-2",innerHTML:s.logs},null,8,a)):((0,r.wg)(),(0,r.iD)("div",o," No logs available yet "))}var i=s(9614);const l={name:"Logs",props:{logs:{type:String,required:!0}},setup(){return{timestampToTime:i.Z.timestampToTime}}};var c=s(3744);const d=(0,c.Z)(l,[["render",n]]),u=d},7074:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>I});var r=s(6252),a=s(3577);const o={class:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0 select-none"},n=(0,r._)("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},"​",-1),i={class:"inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6"},l={class:"w-full flex justify-between items-center"},c={class:"flex items-center"},d={key:0,class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full sm:mx-0 sm:h-10 sm:w-10"},u={key:1,class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full sm:mx-0 sm:h-10 sm:w-10"},m={key:2,class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-green-100 sm:mx-0 sm:h-10 sm:w-10"},g={key:3,class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full sm:mx-0 sm:h-10 sm:w-10"},p={class:"mt-3 sm:mt-0 sm:ml-4 text-left"},h={key:0,class:"my-4 ml-8"},b={class:"text-sm text-gray-500 dark:text-gray-300"},y={class:"mt-5 sm:mt-4 flex justify-end"};function f(e,t,s,f,x,v){const w=(0,r.up)("DialogOverlay"),k=(0,r.up)("TransitionChild"),_=(0,r.up)("InformationCircleIcon"),T=(0,r.up)("BanIcon"),C=(0,r.up)("CheckIcon"),j=(0,r.up)("ExclamationIcon"),D=(0,r.up)("DialogTitle"),I=(0,r.up)("XIcon"),S=(0,r.up)("Dialog"),L=(0,r.up)("TransitionRoot");return(0,r.wg)(),(0,r.j4)(L,{as:"template",show:s.object[s.name]},{default:(0,r.w5)((()=>[(0,r.Wm)(S,{as:"div",static:"",class:"fixed z-10 inset-0 overflow-y-auto",open:s.object[s.name],onClose:t[2]||(t[2]=e=>s.object[s.name]=!1)},{default:(0,r.w5)((()=>[(0,r._)("div",o,[(0,r.Wm)(k,{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:(0,r.w5)((()=>[(0,r.Wm)(w,{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})])),_:1}),n,(0,r.Wm)(k,{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:(0,r.w5)((()=>[(0,r._)("div",i,[(0,r._)("div",l,[(0,r._)("div",c,["info"===s.type?((0,r.wg)(),(0,r.iD)("div",d,[(0,r.Wm)(_,{"check-icon":"",class:(0,a.C_)([v.colors.text,"h-7 w-7"]),"aria-hidden":"true"},null,8,["class"])])):"danger"===s.type?((0,r.wg)(),(0,r.iD)("div",u,[(0,r.Wm)(T,{"check-icon":"",class:(0,a.C_)([v.colors.text,"h-7 w-7"]),"aria-hidden":"true"},null,8,["class"])])):"success"===s.type?((0,r.wg)(),(0,r.iD)("div",m,[(0,r.Wm)(C,{class:(0,a.C_)([v.colors.text,"h-7 w-7"]),"aria-hidden":"true"},null,8,["class"])])):((0,r.wg)(),(0,r.iD)("div",g,[(0,r.Wm)(j,{class:(0,a.C_)([v.colors.text,"h-7 w-7"]),"check-icon":"","aria-hidden":"true"},null,8,["class"])])),(0,r.Wm)(D,{as:"h3",class:(0,a.C_)([v.colors.text,"font-semibold ml-2"])},{default:(0,r.w5)((()=>[(0,r.Uk)((0,a.zw)(s.title),1)])),_:1},8,["class"])]),(0,r._)("button",{class:"btn-nav",onClick:t[0]||(t[0]=e=>s.object[s.name]=!1)},[(0,r.Wm)(I,{class:"h-5 w-5 text-gray-400 rounded-full"})])]),(0,r._)("div",{class:(0,a.C_)([s.description?"":"items-center","flex items-start justify-start"])},[(0,r._)("div",p,[s.description?((0,r.wg)(),(0,r.iD)("div",h,[(0,r._)("p",b,(0,a.zw)(s.description),1)])):(0,r.kq)("",!0)])],2),(0,r._)("div",y,[(0,r._)("button",{ref:"cancelButtonRef",type:"button",class:"font-medium select-none items-center text-gray-700 dark:text-gray-300 hover:underline focus:outline-none text-base tracking-wide mr-4",onClick:t[1]||(t[1]=e=>s.object[s.name]=!1)},(0,a.zw)("danger"===s.type?"Cancel":"Close"),513),(0,r.WI)(e.$slots,"default")])])])),_:3})])])),_:3},8,["open"])])),_:3},8,["show"])}var x=s(2106),v=s(5407),w=s(9191),k=s(2157),_=s(9318),T=s(5881);const C={name:"ConfirmModal",components:{Dialog:x.Vq,DialogOverlay:x.t9,DialogTitle:x.$N,TransitionChild:x.xY,TransitionRoot:x.Qm,ExclamationIcon:v.Z,CheckIcon:w.Z,BanIcon:k.Z,XIcon:_.Z,InformationCircleIcon:T.Z},props:{object:{type:Object,required:!0},name:{type:String,required:!0},title:{type:String,required:!0},description:{type:String,required:!1,default:""},type:{type:String,required:!0,validator(e){return["success","danger","info","warning"].includes(e)}}},computed:{colors(){const e={};switch(this.type){case"info":return e.text="text-gray-600 dark:text-gray-200",e;case"warning":return e.text="text-yellow-600 dark:text-yellow-400",e;case"success":return e.text="text-green-400 dark:text-green-600",e;case"danger":return e.text="text-red-600 dark:text-red-400",e}return e}}};var j=s(3744);const D=(0,j.Z)(C,[["render",f]]),I=D},6867:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var r=s(6252);const a={class:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},o=(0,r._)("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},"​",-1),n={class:"inline-block align-bottom bg-white dark:bg-gray-700 rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6"},i={class:"w-full flex justify-between items-center"},l={class:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"};function c(e,t,s,c,d,u){const m=(0,r.up)("DialogOverlay"),g=(0,r.up)("TransitionChild"),p=(0,r.up)("Dialog"),h=(0,r.up)("TransitionRoot");return(0,r.wg)(),(0,r.j4)(h,{as:"template",show:s.object[s.name]},{default:(0,r.w5)((()=>[(0,r.Wm)(p,{as:"div",static:"",class:"fixed z-10 inset-0 overflow-y-auto",open:s.object[s.name],onClose:t[0]||(t[0]=e=>s.object[s.name]=!1)},{default:(0,r.w5)((()=>[(0,r._)("div",a,[(0,r.Wm)(g,{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})])),_:1}),o,(0,r.Wm)(g,{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:(0,r.w5)((()=>[(0,r._)("div",n,[(0,r._)("div",i,[(0,r.WI)(e.$slots,"head")]),(0,r.WI)(e.$slots,"main"),(0,r._)("div",l,[(0,r.WI)(e.$slots,"footer")])])])),_:3})])])),_:3},8,["open"])])),_:3},8,["show"])}var d=s(2106);const u={name:"CustomModal",components:{Dialog:d.Vq,DialogOverlay:d.t9,TransitionChild:d.xY,TransitionRoot:d.Qm},props:{object:{type:Object,required:!0},name:{type:String,required:!0}}};var m=s(3744);const g=(0,m.Z)(u,[["render",c]]),p=g},1166:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var r=s(6252),a=s(3577);const o={class:"flex flex-col select-none"},n={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"},i={class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},l={class:"border dark:border-gray-600 overflow-hidden sm:rounded"},c={class:"min-w-full divide-y divide-gray-200 dark:divide-gray-600"},d={key:0,class:"bg-gray-100 dark:bg-gray-800 select-none"},u={key:1},m=["textContent"],g=["textContent"],p=["textContent"],h={key:0,class:"text-center text-xs dark:bg-gray-700 py-4 opacity-30 dark:opacity-75 select-none"};function b(e,t,s,b,y,f){return(0,r.wg)(),(0,r.iD)("div",o,[(0,r._)("div",n,[(0,r._)("div",i,[(0,r._)("div",l,[(0,r._)("table",c,[s.header?((0,r.wg)(),(0,r.iD)("thead",d,[(0,r._)("tr",null,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(f.headerItems,(e=>((0,r.wg)(),(0,r.iD)("th",{key:e,scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400"},(0,a.zw)(e),1)))),128))])])):(0,r.kq)("",!0),f.dataItems.length?((0,r.wg)(),(0,r.iD)("tbody",u,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(f.dataItems,((e,t)=>((0,r.wg)(),(0,r.iD)("tr",{key:t,class:(0,a.C_)(["text-gray-900 dark:text-gray-200",t%2===0?"bg-white dark:bg-backdrop-dark":"bg-gray-50 dark:bg-gray-700"])},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e,((t,s)=>((0,r.wg)(),(0,r.iD)("td",{key:t,class:(0,a.C_)(["px-6 py-4 whitespace-nowrap text-sm font-medium",e[s].style])},["code"===e[s].tag?((0,r.wg)(),(0,r.iD)("code",{key:0,class:"rounded border dark:border-gray-600 bg-gray-50 dark:bg-gray-700 select-text text-sm dark:text-gray-300 w-full px-4 sm:px-6 py-2",textContent:(0,a.zw)(0===e[s].value?"":e[s].value)},null,8,m)):"pre"===e[s].tag?((0,r.wg)(),(0,r.iD)("pre",{key:1,class:"whitespace-pre-line rounded border dark:border-gray-600 bg-gray-50 dark:bg-gray-700 select-text text-sm dark:text-gray-300 w-full px-4 sm:px-6 py-2",textContent:(0,a.zw)(0===e[s].value?"":e[s].value)},null,8,g)):((0,r.wg)(),(0,r.iD)("span",{key:2,textContent:(0,a.zw)(0===e[s].value?"":e[s].value)},null,8,p))],2)))),128))],2)))),128))])):(0,r.kq)("",!0)]),f.dataItems.length?(0,r.kq)("",!0):((0,r.wg)(),(0,r.iD)("div",h," Empty List "))])])])])}const y={name:"MultipleValuesTable",props:{header:{type:Boolean,default:!1},data:{type:Array,required:!0}},computed:{headerItems(){return this.data[0]},dataItems(){return this.header?this.data.slice(1):this.data}}};var f=s(3744);const x=(0,f.Z)(y,[["render",b]]),v=x},2516:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>at});var r=s(6252),a=s(3577),o=s(9963),n=s(1021),i=s(7372);const l={class:"mx-auto px-4 lg:px-6 lg:px-8"},c={class:"flex items-center justify-between h-16"},d={class:"flex items-center"},u=(0,r._)("div",{class:"flex-shrink-0"},[(0,r._)("img",{class:"h-9 w-auto dark:hidden",src:n,alt:"Jesse Logo"}),(0,r._)("img",{class:"hidden dark:block h-10 w-auto",src:i,alt:"Jesse Logo"})],-1),m={class:"hidden lg:block lg:ml-6"},g={class:"flex space-x-4"},p={class:"hidden lg:ml-6 lg:block"},h={class:"flex items-center"},b=(0,r._)("span",{class:"sr-only"},"Settings",-1),y=(0,r._)("span",{class:"sr-only"},"Settings",-1),f={class:"py-1"},x=(0,r.Uk)(" New Strategy "),v={class:"py-1"},w=(0,r.Uk)(" Documentation "),k=(0,r.Uk)(" Sample Strategies "),_=(0,r.Uk)(" Help Center "),T=(0,r.Uk)(" About "),C={class:"-mr-2 flex lg:hidden"},j=(0,r._)("span",{class:"sr-only"},"Open main menu",-1),D={class:"px-2 pt-2 pb-3 space-y-1"},I=["id"],S={class:"flex items-center w-full p-2"},L={class:"px-2 py-2 space-y-1 border-t border-gray-200 dark:border-gray-900"},W=(0,r.Uk)(" New Strategy "),E={class:"px-2 py-2 space-y-1 border-t border-gray-200 dark:border-gray-900"},q={class:"w-full"},$={href:"https://docs.jesse.trade/",class:"flex justify-start items-center w-full text-left px-2 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200 rounded-md",target:"_blank"},Z=(0,r.Uk)(" Documentation "),R={class:"w-full"},O={href:"https://jesse.trade/strategies",class:"flex justify-start items-start w-full text-left px-2 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200 rounded-md",target:"_blank"},U=(0,r.Uk)(" Sample Strategies "),B={class:"w-full"},M={href:"https://jesse.trade/help",class:"flex justify-start items-center w-full text-left px-2 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200 rounded-md",target:"_blank"},z=(0,r.Uk)(" Help Center "),A={class:"w-full"},P=(0,r.Uk)(" > "),V=(0,r.Uk)(" About "),H={class:"flex justify-between items-center px-2 py-2 space-y-1 border-t border-gray-200 dark:border-gray-900"},F=(0,r._)("span",{class:"sr-only"},"Settings",-1);function N(e,t,s,n,i,N){const Y=(0,r.up)("Settings"),K=(0,r.up)("SlideOver"),J=(0,r.up)("Feedback"),X=(0,r.up)("MakeStrategy"),G=(0,r.up)("About"),Q=(0,r.up)("Announcement"),ee=(0,r.up)("router-link"),te=(0,r.up)("ThemeSwitch"),se=(0,r.up)("CogIcon"),re=(0,r.up)("DotsVerticalIcon"),ae=(0,r.up)("MenuButton"),oe=(0,r.up)("DocumentAddIcon"),ne=(0,r.up)("MenuItem"),ie=(0,r.up)("CollectionIcon"),le=(0,r.up)("DocumentTextIcon"),ce=(0,r.up)("QuestionMarkCircleIcon"),de=(0,r.up)("IdentificationIcon"),ue=(0,r.up)("MenuItems"),me=(0,r.up)("Menu"),ge=(0,r.up)("MenuIcon"),pe=(0,r.up)("XIcon"),he=(0,r.up)("DisclosureButton"),be=(0,r.up)("DisclosurePanel"),ye=(0,r.up)("Disclosure");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(K,{name:"settings",object:e.modals,title:"Settings"},{default:(0,r.w5)((()=>[(0,r.Wm)(Y)])),_:1},8,["object"]),(0,r.Wm)(K,{object:e.modals,name:"feedback",title:"Feedback"},{default:(0,r.w5)((()=>[(0,r.Wm)(J)])),_:1},8,["object"]),(0,r.Wm)(K,{object:e.modals,name:"makeStrategy",title:"Make a new strategy",width:"max-w-lg"},{default:(0,r.w5)((()=>[(0,r.Wm)(X)])),_:1},8,["object"]),(0,r.Wm)(K,{object:e.modals,name:"about",title:"About",width:"max-w-lg"},{default:(0,r.w5)((()=>[(0,r.Wm)(G)])),_:1},8,["object"]),(0,r.Wm)(Q),(0,r.Wm)(ye,{as:"nav",class:"bg-gray-100 dark:bg-gray-800 border-b dark:border-gray-900 select-none"},{default:(0,r.w5)((({open:s})=>[(0,r._)("div",l,[(0,r._)("div",c,[(0,r._)("div",d,[u,(0,r._)("div",m,[(0,r._)("div",g,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(N.navigation,(t=>((0,r.wg)(),(0,r.j4)(ee,{id:N.convertToSlug(t.name)+"-page-button",key:t.name,to:t.to,class:(0,a.C_)(["flex items-center text-gray-700 dark:text-gray-300 px-3 py-2 rounded-md text-sm font-medium",e.$route.path.startsWith(t.to)&&"/"!==t.to||e.$route.path===t.to?"bg-gray-200 dark:bg-gray-900":"hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200"])},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.icon),{class:(0,a.C_)([e.$route.path.startsWith(t.to)&&"/"!==t.to||e.$route.path===t.to?"text-gray-700 dark:text-gray-300":"text-gray-400 group-hover:text-gray-500 dark:group-hover:text-gray-400","flex-shrink-0 -ml-1 mr-2 h-6 w-6"]),"aria-hidden":"true"},null,8,["class"])),(0,r.Uk)(" "+(0,a.zw)(t.name),1)])),_:2},1032,["id","to","class"])))),128))])])]),(0,r._)("div",p,[(0,r._)("div",h,[(0,r._)("button",{id:"open-feedback-button",class:"btn-secondary mr-4 text-sm",onClick:t[0]||(t[0]=(...e)=>N.openFeedback&&N.openFeedback(...e))}," Feedback "),(0,r.Wm)(te),(0,r._)("button",{"data-cy":"settings-icon",class:"btn-nav",onClick:t[1]||(t[1]=t=>e.modals.settings=!0)},[b,(0,r.Wm)(se,{class:"h-6 w-6","aria-hidden":"true"})]),(0,r.Wm)(me,{as:"div",class:"relative z-40"},{default:(0,r.w5)((()=>[(0,r.Wm)(ae,{"data-cy":"nav-dropdown-menu-button",class:"btn-nav"},{default:(0,r.w5)((()=>[y,(0,r.Wm)(re,{class:"h-6 w-6","aria-hidden":"true"})])),_:1}),(0,r.Wm)(o.uT,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:(0,r.w5)((()=>[(0,r.Wm)(ue,{"data-cy":"nav-dropdown-menu-items",class:"bg-white dark:bg-gray-700 origin-top-right absolute right-0 mt-2 w-64 rounded-md border-gray-200 dark:border-gray-900 shadow-lg py-1 ring-1 ring-black ring-opacity-5 focus:outline-none divide-y divide-gray-100 dark:divide-gray-900"},{default:(0,r.w5)((()=>[(0,r._)("div",f,[(0,r.Wm)(ne,null,{default:(0,r.w5)((({active:s})=>[(0,r._)("button",{"data-cy":"nav-create-strategy",class:(0,a.C_)([s?"bg-gray-100 dark:bg-gray-800":"","flex justify-left items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300"]),onClick:t[2]||(t[2]=t=>e.modals.makeStrategy=!0)},[(0,r.Wm)(oe,{class:"w-5 h-5 mr-2"}),x],2)])),_:1})]),(0,r._)("div",v,[(0,r.Wm)(ne,null,{default:(0,r.w5)((({active:e})=>[(0,r._)("a",{"data-cy":"nav-documentation-link",href:"https://docs.jesse.trade/",class:(0,a.C_)([e?"bg-gray-100 dark:bg-gray-800":"","flex justify-start items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300"]),target:"_blank"},[(0,r.Wm)(ie,{class:"w-5 h-5 mr-2"}),w],2)])),_:1}),(0,r.Wm)(ne,null,{default:(0,r.w5)((({active:e})=>[(0,r._)("a",{href:"https://jesse.trade/strategies","data-cy":"nav-strategies-link",class:(0,a.C_)([e?"bg-gray-100 dark:bg-gray-800":"","flex justify-start items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300"]),target:"_blank"},[(0,r.Wm)(le,{class:"w-5 h-5 mr-2"}),k],2)])),_:1}),(0,r.Wm)(ne,null,{default:(0,r.w5)((({active:e})=>[(0,r._)("a",{"data-cy":"nav-help-center-link",href:"https://jesse.trade/help",class:(0,a.C_)([e?"bg-gray-100 dark:bg-gray-800":"","flex justify-start items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300"]),target:"_blank"},[(0,r.Wm)(ce,{class:"w-5 h-5 mr-2"}),_],2)])),_:1}),(0,r.Wm)(ne,null,{default:(0,r.w5)((({active:s})=>[(0,r._)("button",{"data-cy":"nav-help-center-link",href:"https://jesse.trade/help",class:(0,a.C_)([s?"bg-gray-100 dark:bg-gray-800":"","flex justify-start items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300"]),target:"_blank",onClick:t[3]||(t[3]=t=>e.modals.about=!0)},[(0,r.Wm)(de,{class:"w-5 h-5 mr-2"}),T],2)])),_:1})])])),_:1})])),_:1})])),_:1})])]),(0,r._)("div",C,[(0,r.Wm)(he,{class:"inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 dark:hover:text-gray-300 dark:hover:bg-gray-600 hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white dark:focus:ring-gray-800"},{default:(0,r.w5)((()=>[j,s?((0,r.wg)(),(0,r.j4)(pe,{key:1,class:"block h-6 w-6","aria-hidden":"true"})):((0,r.wg)(),(0,r.j4)(ge,{key:0,class:"block h-6 w-6","aria-hidden":"true"}))])),_:2},1024)])])]),(0,r.Wm)(be,{class:"lg:hidden"},{default:(0,r.w5)((()=>[(0,r._)("div",D,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(N.navigation,(t=>((0,r.wg)(),(0,r.iD)("div",{id:N.convertToSlug(t.name)+"-page-button",key:t.name,class:(0,a.C_)([e.$route.path.startsWith(t.to)?"bg-gray-200 dark:bg-gray-900":"hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200","rounded-md"])},[(0,r.Wm)(ee,{to:t.to,class:"text-gray-700 dark:text-gray-300 text-sm font-medium"},{default:(0,r.w5)((()=>[(0,r._)("div",S,[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.icon),{class:(0,a.C_)([e.$route.path.startsWith(t.to)?"text-gray-700 dark:text-gray-300":"text-gray-400 group-hover:text-gray-500 dark:group-hover:text-gray-400","flex-shrink-0 mr-2 h-6 w-6"]),"aria-hidden":"true"},null,8,["class"])),(0,r.Uk)(" "+(0,a.zw)(t.name),1)])])),_:2},1032,["to"])],10,I)))),128))]),(0,r._)("div",L,[(0,r._)("button",{class:"flex justify-start items-center w-full text-left px-2 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200 rounded-md",onClick:t[4]||(t[4]=t=>e.modals.makeStrategy=!0)},[(0,r.Wm)(oe,{class:"w-5 h-5 mr-2"}),W])]),(0,r._)("div",E,[(0,r._)("div",q,[(0,r._)("a",$,[(0,r.Wm)(ie,{class:"w-5 h-5 mr-2"}),Z])]),(0,r._)("div",R,[(0,r._)("a",O,[(0,r.Wm)(le,{class:"w-5 h-5 mr-2"}),U])]),(0,r._)("div",B,[(0,r._)("a",M,[(0,r.Wm)(ce,{class:"w-5 h-5 mr-2"}),z])]),(0,r._)("div",A,[(0,r._)("button",{href:"https://jesse.trade/strategies",class:"flex justify-start items-start w-full text-left px-2 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-200 rounded-md",target:"_blank",onClick:t[5]||(t[5]=t=>e.modals.makeStrategy=!0)},[P,(0,r.Wm)(de,{class:"w-5 h-5 mr-2"}),V])])]),(0,r._)("div",H,[(0,r._)("button",{class:"btn-nav ml-0",onClick:t[6]||(t[6]=t=>e.modals.settings=!0)},[F,(0,r.Wm)(se,{class:"h-6 w-6","aria-hidden":"true"})]),(0,r._)("button",{class:"btn-secondary text-sm",onClick:t[7]||(t[7]=(...e)=>N.openFeedback&&N.openFeedback(...e))}," Feedback "),(0,r.Wm)(te)])])),_:1})])),_:1})],64)}s(4916),s(5306);var Y=s(2262),K=s(2106),J=s(2934),X=s(9318),G=s(4693),Q=s(2984),ee=s(9337),te=s(6571),se=s(2606),re=s(2352),ae=s(8451),oe=s(7161),ne=s(5279),ie=s(390),le=s(5275),ce=s(3922),de=s(7833),ue=s(4732),me=s(5300),ge=s(6582),pe=s(6245),he=s(2542);const be={class:"w-full"},ye=(0,r._)("p",{id:"feedback-description"}," I would love to hear your feedback whether it's about a bug, suggestion, something you like, or something you hate about Jesse! ",-1),fe=(0,r._)("br",null,null,-1),xe=(0,r._)("br",null,null,-1),ve=(0,r._)("br",null,null,-1),we={class:"flex justify-end"},ke=["disabled"];function _e(e,t,s,a,o,n){const i=(0,r.up)("FormTextarea"),l=(0,r.up)("FormInput");return(0,r.wg)(),(0,r.iD)("div",be,[ye,fe,(0,r.Wm)(i,{title:"Description",placeholder:"Type here...",name:"description",object:o.form},null,8,["object"]),xe,(0,r.Wm)(l,{title:"Email (optional)",description:"Enter your email address for us to know who sent the feedback and possibly reply back to you.","input-type":"email",placeholder:"Email address...",name:"email",object:o.form},null,8,["object"]),ve,(0,r._)("div",we,[(0,r._)("button",{id:"feedback-cancel-button",class:"btn-link mr-8",onClick:t[0]||(t[0]=(...e)=>n.close&&n.close(...e))}," Cancel "),(0,r._)("button",{id:"feedback-submit-button",class:"btn-primary w-48",disabled:!o.form.description.length,onClick:t[1]||(t[1]=e=>n.submit())}," Submit ",8,ke)])])}var Te=s(9669),Ce=s.n(Te),je=s(8588),De=s(3710);const Ie={name:"Feedback",components:{FormInput:je["default"],FormTextarea:De["default"]},data(){return{form:{email:"",description:""}}},computed:{...(0,pe.rn)(he.h,["modals"])},methods:{submit(){Ce().post("/feedback",{description:this.form.description,email:this.form.email}).then((e=>{"success"===e.data.status?(this.form.description="",this.form.email="",this.notyf.success(e.data.message),this.close()):"error"===e.data.status&&this.notyf.error(e.data.message)})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))},close(){this.modals.feedback=!1}}};var Se=s(3744);const Le=(0,Se.Z)(Ie,[["render",_e]]),We=Le;var Ee=s(470),qe=s(7074);const $e={id:"make-strategy-modal",class:"w-full select-none"},Ze=(0,r._)("p",null," Filling this form will create a new strategy class with all the starting methods in it. ",-1),Re=(0,r._)("br",null,null,-1),Oe=(0,r._)("label",{for:"strategy",class:"input-label mb-2"},"Strategy name:",-1),Ue={key:0},Be=(0,r._)("br",null,null,-1),Me=(0,r._)("p",null,"The strategy will be located at:",-1),ze={class:"mt-2 text-sm whitespace-pre-line px-6 py-3 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 dark:border-gray-800 border border-gray-200 select-text"},Ae={class:"flex justify-end mt-8"};function Pe(e,t,s,n,i,l){return(0,r.wg)(),(0,r.iD)("div",$e,[Ze,Re,Oe,(0,r.wy)((0,r._)("input",{id:"strategy","onUpdate:modelValue":t[0]||(t[0]=e=>i.form.name=e),type:"text",name:"strategy",placeholder:"ex: MyAwesomeStrategy01",class:"input"},null,512),[[o.nr,i.form.name]]),i.form.name.length?((0,r.wg)(),(0,r.iD)("div",Ue,[Be,Me,(0,r._)("pre",ze,"          "+(0,a.zw)(`strategies/${i.form.name}/__init__.py`)+"\n        ",1)])):(0,r.kq)("",!0),(0,r._)("div",Ae,[(0,r._)("button",{"data-cy":"cancel-make-strategy-button",class:"btn-link mr-8",onClick:t[1]||(t[1]=t=>e.modals.makeStrategy=!1)},"Cancel"),(0,r._)("button",{"data-cy":"make-strategy-button",class:"btn-primary w-32",onClick:t[2]||(t[2]=(...e)=>l.create&&l.create(...e))},"Create")])])}const Ve={name:"MakeStrategy",data(){return{form:{name:""}}},computed:{...(0,pe.rn)(he.h,["modals","routes"])},methods:{create(){this.form.name.length?Ce().post("/make-strategy",{name:this.form.name}).then((e=>{"success"===e.data.status?(this.notyf.success("Successfully created strategy"),this.routes.strategies.push(this.form.name),this.routes.strategies.sort(),this.modals.makeStrategy=!1):this.notyf.error(e.data.message)})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)})):this.notyf.error("Please fill the strategy name.")}}},He=(0,Se.Z)(Ve,[["render",Pe]]),Fe=He,Ne={id:"make-strategy-modal",class:"w-full select-none"},Ye={class:"flex justify-end mt-8"};function Ke(e,t,s,a,o,n){const i=(0,r.up)("KeyValueTable");return(0,r.wg)(),(0,r.iD)("div",Ne,[(0,r.Wm)(i,{data:n.tableData},null,8,["data"]),(0,r._)("div",Ye,[(0,r._)("button",{"data-cy":"cancel-make-strategy-button",class:"btn-link mr-8",onClick:t[0]||(t[0]=t=>e.modals.about=!1)}," Close ")])])}var Je=s(7378);const Xe={name:"About",components:{KeyValueTable:Je["default"]},computed:{...(0,pe.rn)(he.h,["modals","systemInfo"]),tableData(){return Object.entries(this.systemInfo).map((([e,t])=>[e,t]))}}},Ge=(0,Se.Z)(Xe,[["render",Ke]]),Qe=Ge;var et=s(3190),tt=s(5166);const st={name:"Nav",components:{Announcement:tt["default"],ConfirmModal:qe["default"],Settings:Ee["default"],Feedback:We,MakeStrategy:Fe,About:Qe,Disclosure:K.pJ,DisclosureButton:K.lG,DisclosurePanel:K.V2,Menu:K.v2,MenuButton:K.j2,MenuItem:K.sN,MenuItems:K.sd,MenuIcon:J.Z,XIcon:X.Z,SlideOver:ge["default"],CogIcon:G.Z,DotsVerticalIcon:Q.Z,CalculatorIcon:ee.Z,ChipIcon:te.Z,CurrencyDollarIcon:se.Z,SaveIcon:re.Z,DocumentAddIcon:ae.Z,LoginIcon:oe.Z,LogoutIcon:ne.Z,DocumentTextIcon:ie.Z,IdentificationIcon:le.Z,QuestionMarkCircleIcon:ce.Z,CollectionIcon:de.Z,HomeIcon:ue.Z,ThemeSwitch:et["default"]},setup(){const e=(0,Y.iH)(!1);return{open:e}},computed:{...(0,pe.rn)(he.h,["modals","hasLivePluginInstalled"]),navigation(){const e=[{name:"Home",to:"/",icon:ue.Z},{name:"Import Candles",to:"/candles/",icon:me.Z},{name:"Backtest",to:"/backtest/",icon:ee.Z},{name:"Optimization",to:"/optimization/",icon:te.Z}];return this.hasLivePluginInstalled&&e.push({name:"Live",to:"/live/",icon:se.Z}),e}},methods:{convertToSlug(e){return e.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")},openFeedback(){this.modals.feedback=!0}}},rt=(0,Se.Z)(st,[["render",N]]),at=rt},7157:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(6252),a=s(3577);const o=["data-cy"],n={class:"font-semibold"},i={class:"bg-white dark:bg-backdrop-dark rounded-md flex"},l=(0,r._)("span",{class:"rounded-full bg-white w-1.5 h-1.5"},null,-1),c=[l],d={class:"ml-3 flex flex-col"};function u(e,t,s,l,u,m){const g=(0,r.up)("RadioGroupLabel"),p=(0,r.up)("RadioGroupOption"),h=(0,r.up)("RadioGroup");return(0,r.wg)(),(0,r.iD)("div",{"data-cy":s.name+"-radio-groups",class:"flex items-center justify-between"},[(0,r._)("div",n,(0,a.zw)(s.title),1),(0,r._)("div",null,[(0,r.Wm)(h,{modelValue:s.object[s.name],"onUpdate:modelValue":t[0]||(t[0]=e=>s.object[s.name]=e)},{default:(0,r.w5)((()=>[(0,r.Wm)(g,{class:"sr-only"},{default:(0,r.w5)((()=>[(0,r.Uk)((0,a.zw)(s.title),1)])),_:1}),(0,r._)("div",i,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(s.options,((e,t)=>((0,r.wg)(),(0,r.j4)(p,{key:e,class:"flex-1",as:"template",value:e},{default:(0,r.w5)((({checked:o})=>[(0,r._)("div",{class:(0,a.C_)([0===t?"rounded-l-md":"",t===s.options.length-1?"rounded-r-md":"",o?"bg-indigo-50 dark:bg-gray-800 border-indigo-200 dark:border-indigo-400 z-10":"border-gray-200 dark:border-gray-800","relative border px-4 py-3 flex cursor-pointer focus:outline-none"])},[(0,r._)("span",{class:(0,a.C_)([o?"bg-indigo-600 dark:bg-indigo-400 border-transparent":"bg-white dark:bg-backdrop-dark border-gray-300 dark:border-gray-700","h-4 w-4 mt-0.5 cursor-pointer rounded-full border flex items-center justify-center"]),"aria-hidden":"true"},c,2),(0,r._)("div",d,[(0,r.Wm)(g,{as:"span",class:(0,a.C_)([o?"text-indigo-900 dark:text-gray-100":"text-gray-900 dark:text-gray-100","capitalize block text-sm font-medium"])},{default:(0,r.w5)((()=>[(0,r.Uk)((0,a.zw)(e),1)])),_:2},1032,["class"])])],2)])),_:2},1032,["value"])))),128))])])),_:1},8,["modelValue"])])],8,o)}var m=s(2106);const g={components:{RadioGroup:m.Ee,RadioGroupLabel:m.Nt,RadioGroupOption:m.$v},props:{title:{type:String,required:!0},object:{type:Object,required:!0},name:{type:String,required:!0},options:{type:Array,required:!0}}};var p=s(3744);const h=(0,p.Z)(g,[["render",u]]),b=h},6105:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ae});var r=s(6252),a=s(3577),o=s(9963);const n={class:"select-none"},i=(0,r._)("span",null,"Trading Route",-1),l=(0,r._)("span",null,"Extra Route",-1),c=["data-cy"],d=["onUpdate:modelValue","data-cy"],u=["onUpdate:modelValue","data-cy"],m=["onUpdate:modelValue","data-cy"],g=["onUpdate:modelValue","data-cy"],p={class:"flex flex-col items-center justify-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 rounded-r-lg"},h={class:"py-1"},b=["name"],y=(0,r.Uk)(" Delete "),f=["name"],x=(0,r.Uk)(" Duplicate "),v={class:"py-1"},w=["name"],k=(0,r.Uk)(" Move Up "),_=["name"],T=(0,r.Uk)(" Move Down "),C=["data-cy"],j=["onUpdate:modelValue","data-cy"],D=["onUpdate:modelValue","data-cy"],I=["onUpdate:modelValue","data-cy"],S={class:"flex flex-col items-center justify-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 rounded-r-lg"},L={class:"py-1"},W=["name"],E=(0,r.Uk)(" Delete "),q=["name"],$=(0,r.Uk)(" Duplicate "),Z={class:"py-1"},R=["name"],O=(0,r.Uk)(" Move Up "),U=["name"],B=(0,r.Uk)(" Move Down "),M={id:"error-section",class:"text-sm text-red-400 p-2 rounded-lg mb-4"},z=["data-cy","innerHTML"];function A(e,t,s,A,P,V){const H=(0,r.up)("PlusSmIcon"),F=(0,r.up)("DividerWithButtons"),N=(0,r.up)("DotsVerticalIcon"),Y=(0,r.up)("MenuButton"),K=(0,r.up)("TrashIcon"),J=(0,r.up)("MenuItem"),X=(0,r.up)("DuplicateIcon"),G=(0,r.up)("ArrowCircleUpIcon"),Q=(0,r.up)("ArrowCircleDownIcon"),ee=(0,r.up)("MenuItems"),te=(0,r.up)("Menu"),se=(0,r.up)("Divider"),re=(0,r.up)("ExclamationIcon");return(0,r.wg)(),(0,r.iD)("div",n,[(0,r.Wm)(F,{title:"Routes"},{default:(0,r.w5)((()=>[(0,r._)("button",{"data-cy":"add-route",type:"button",class:"inline-flex items-center shadow-sm px-4 py-1.5 border border-gray-300 dark:border-gray-900 text-sm leading-5 font-medium rounded-l-full text-gray-700 dark:text-gray-100 bg-white dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none",onClick:t[0]||(t[0]=(...e)=>V.addRoute&&V.addRoute(...e))},[(0,r.Wm)(H,{class:"-ml-1.5 mr-1 h-5 w-5 text-gray-400","aria-hidden":"true"}),i]),(0,r._)("button",{"data-cy":"add-extra-route",type:"button",class:"inline-flex items-center shadow-sm px-4 py-1.5 border border-gray-300 dark:border-gray-900 text-sm leading-5 font-medium rounded-r-full text-gray-700 dark:text-gray-100 bg-white dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none",onClick:t[1]||(t[1]=(...e)=>V.addExtraRoute&&V.addExtraRoute(...e))},[(0,r.Wm)(H,{class:"-ml-1.5 mr-1 h-5 w-5 text-gray-400","aria-hidden":"true"}),l])])),_:1}),((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(s.form.routes,((t,n)=>((0,r.wg)(),(0,r.iD)("div",{key:t.exchange+n,"data-cy":"trading-route"+n,class:"flex border dark:bg-backdrop-dark dark:border-gray-900 rounded-lg mb-4"},[(0,r.wy)((0,r._)("select",{"onUpdate:modelValue":e=>t.exchange=e,"data-cy":"trading-route-exchange"+n,class:"dark:bg-backdrop-dark dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 cursor-pointer w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 rounded-l-lg"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(V.exchanges,(e=>((0,r.wg)(),(0,r.iD)("option",{key:e},(0,a.zw)(e),1)))),128))],8,d),[[o.bM,t.exchange]]),(0,r.wy)((0,r._)("input",{"onUpdate:modelValue":e=>t.symbol=e,"data-cy":"trading-route-symbol"+n,type:"text",class:"dark:bg-backdrop-dark dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500",placeholder:"ex: BTC-USDT"},null,8,u),[[o.nr,t.symbol]]),(0,r.wy)((0,r._)("select",{"onUpdate:modelValue":e=>t.timeframe=e,"data-cy":"trading-route-timeframe"+n,class:"dark:bg-backdrop-dark dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 cursor-pointer w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.routes.timeframes,(e=>((0,r.wg)(),(0,r.iD)("option",{key:e},(0,a.zw)(e),1)))),128))],8,m),[[o.bM,t.timeframe]]),(0,r.wy)((0,r._)("select",{"onUpdate:modelValue":e=>t.strategy=e,"data-cy":"trading-route-strategy"+n,class:"dark:bg-backdrop-dark dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 cursor-pointer w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.routes.strategies,(e=>((0,r.wg)(),(0,r.iD)("option",{key:e},(0,a.zw)(e),1)))),128))],8,g),[[o.bM,t.strategy]]),(0,r._)("div",p,[(0,r.Wm)(te,{as:"div",class:"relative block h-full w-full"},{default:(0,r.w5)((()=>[(0,r.Wm)(Y,{"data-cy":"trading-route-menu-button"+n,class:"px-5 block text-left h-full w-full focus:outline-none"},{default:(0,r.w5)((()=>[(0,r.Wm)(N,{class:"h-8 w-8 text-gray-400"})])),_:2},1032,["data-cy"]),(0,r.Wm)(o.uT,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:(0,r.w5)((()=>[(0,r.Wm)(ee,{class:"origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white dark:bg-backdrop-dark z-10 ring-1 ring-black dark:ring-gray-900 ring-opacity-5 divide-y divide-gray-100 dark:divide-gray-900 focus:outline-none"},{default:(0,r.w5)((()=>[(0,r._)("div",h,[(0,r.Wm)(J,{onClick:e=>V.deleteRoute(t)},{default:(0,r.w5)((()=>[(0,r._)("a",{name:"trading-delete-menu"+n,class:(0,a.C_)([s.form.routes.length>1?"dark:hover:bg-gray-700":"text-gray-200 dark:text-gray-600 cursor-not-allowed","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(K,{class:(0,a.C_)([s.form.routes.length>1?"text-gray-400 group-hover:text-gray-500":"text-gray-200 group-hover:text-gray-200 dark:text-gray-600 dark:group-hover:text-gray-600","mr-3 h-5 w-5"]),"aria-hidden":"true"},null,8,["class"]),y],10,b)])),_:2},1032,["onClick"]),(0,r.Wm)(J,{onClick:e=>V.duplicateRoutes(t)},{default:(0,r.w5)((({active:e})=>[(0,r._)("a",{name:"trading-duplicate-menu"+n,class:(0,a.C_)([e?"bg-gray-100 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100":"text-gray-700 dark:text-gray-300","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(X,{class:"mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500","aria-hidden":"true"}),x],10,f)])),_:2},1032,["onClick"])]),(0,r._)("div",v,[(0,r.Wm)(J,{onClick:e=>V.moveUpRoutes(t)},{default:(0,r.w5)((()=>[(0,r._)("a",{name:"trading-moveup-menu"+n,class:(0,a.C_)([0!==s.form.routes.indexOf(t)?"dark:hover:bg-gray-700":"text-gray-200 dark:text-gray-600 cursor-not-allowed","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(G,{class:(0,a.C_)([0!==s.form.routes.indexOf(t)?"text-gray-400 group-hover:text-gray-500":"text-gray-200 group-hover:text-gray-200 dark:text-gray-600 dark:group-hover:text-gray-600","mr-3 h-5 w-5"]),"aria-hidden":"true"},null,8,["class"]),k],10,w)])),_:2},1032,["onClick"]),(0,r.Wm)(J,{onClick:e=>V.moveDownRoutes(t)},{default:(0,r.w5)((()=>[(0,r._)("a",{name:"trading-movedown-menu"+n,class:(0,a.C_)([s.form.routes.indexOf(t)!==s.form.routes.length-1?"dark:hover:bg-gray-700":"text-gray-200 dark:text-gray-600 cursor-not-allowed","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(Q,{class:(0,a.C_)([s.form.routes.indexOf(t)!==s.form.routes.length-1?"text-gray-400 group-hover:text-gray-500":"text-gray-200 group-hover:text-gray-200 dark:text-gray-600 dark:group-hover:text-gray-600","mr-3 h-5 w-5"]),"aria-hidden":"true"},null,8,["class"]),T],10,_)])),_:2},1032,["onClick"])])])),_:2},1024)])),_:2},1024)])),_:2},1024)])],8,c)))),128)),s.form.extra_routes.length?((0,r.wg)(),(0,r.j4)(se,{key:0,title:"Extra Routes"})):(0,r.kq)("",!0),((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(s.form.extra_routes,((t,n)=>((0,r.wg)(),(0,r.iD)("div",{key:t.exchange+n+t.timeframe,"data-cy":"extra-route"+n,class:"flex border dark:bg-backdrop-dark dark:border-gray-900 rounded-lg mb-4"},[(0,r.wy)((0,r._)("select",{"onUpdate:modelValue":e=>t.exchange=e,"data-cy":"extra-route-exchange"+n,class:"dark:bg-backdrop-dark dark:hover:bg-gray-700 hover:bg-gray-50 cursor-pointer w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 dark:border-gray-900 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 rounded-l-lg"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(V.exchanges,(e=>((0,r.wg)(),(0,r.iD)("option",{key:e},(0,a.zw)(e),1)))),128))],8,j),[[o.bM,t.exchange]]),(0,r.wy)((0,r._)("input",{"onUpdate:modelValue":e=>t.symbol=e,"data-cy":"extra-route-symbol"+n,type:"text",class:"dark:bg-backdrop-dark dark:hover:bg-gray-700 hover:bg-gray-50 w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 dark:border-gray-900 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500",placeholder:"ex: BTC-USDT"},null,8,D),[[o.nr,t.symbol]]),(0,r.wy)((0,r._)("select",{"onUpdate:modelValue":e=>t.timeframe=e,"data-cy":"extra-route-timeframe"+n,class:"dark:bg-backdrop-dark dark:hover:bg-gray-700 hover:bg-gray-50 cursor-pointer w-full pl-3 pr-10 py-6 border-0 border-r border-gray-200 dark:border-gray-900 focus:outline-none focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.routes.timeframes,(e=>((0,r.wg)(),(0,r.iD)("option",{key:e},(0,a.zw)(e),1)))),128))],8,I),[[o.bM,t.timeframe]]),(0,r._)("div",S,[(0,r.Wm)(te,{as:"div",class:"relative block h-full w-full"},{default:(0,r.w5)((()=>[(0,r.Wm)(Y,{"data-cy":"extra-route-menu-button"+n,class:"px-5 block text-left h-full w-full focus:outline-none"},{default:(0,r.w5)((()=>[(0,r.Wm)(N,{class:"h-8 w-8 text-gray-400"})])),_:2},1032,["data-cy"]),(0,r.Wm)(o.uT,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:(0,r.w5)((()=>[(0,r.Wm)(ee,{class:"origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white dark:bg-backdrop-dark dark:border-gray-900 z-10 ring-1 ring-black dark:ring-gray-900 ring-opacity-5 divide-y divide-gray-100 dark:divide-gray-900 focus:outline-none"},{default:(0,r.w5)((()=>[(0,r._)("div",L,[(0,r.Wm)(J,{onClick:e=>V.deleteExtraRoute(t)},{default:(0,r.w5)((()=>[(0,r._)("a",{name:"extra-delete-menu"+n,class:"dark:hover:bg-gray-700 group flex items-center px-4 py-2 text-sm"},[(0,r.Wm)(K,{class:"text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5","aria-hidden":"true"}),E],8,W)])),_:2},1032,["onClick"]),(0,r.Wm)(J,{onClick:e=>V.duplicateExtraRoutes(t)},{default:(0,r.w5)((({active:e})=>[(0,r._)("a",{name:"extra-duplicate-menu"+n,class:(0,a.C_)([e?"bg-gray-100 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100":"text-gray-700 dark:text-gray-300","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(X,{class:"mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500","aria-hidden":"true"}),$],10,q)])),_:2},1032,["onClick"])]),(0,r._)("div",Z,[(0,r.Wm)(J,{onClick:e=>V.moveUpExtraRoutes(t)},{default:(0,r.w5)((()=>[(0,r._)("a",{name:"extra-moveup-menu"+n,class:(0,a.C_)([0!==s.form.extra_routes.indexOf(t)?"dark:hover:bg-gray-700":"text-gray-200 dark:text-gray-600 cursor-not-allowed","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(G,{class:(0,a.C_)([0!==s.form.extra_routes.indexOf(t)?"text-gray-400 group-hover:text-gray-500":"text-gray-200 group-hover:text-gray-200 dark:text-gray-600 dark:group-hover:text-gray-600","mr-3 h-5 w-5"]),"aria-hidden":"true"},null,8,["class"]),O],10,R)])),_:2},1032,["onClick"]),(0,r.Wm)(J,{onClick:e=>V.moveDownExtraRoutes(t)},{default:(0,r.w5)((()=>[(0,r._)("a",{name:"extra-movedown-menu"+n,class:(0,a.C_)([s.form.extra_routes.indexOf(t)!==s.form.extra_routes.length-1?"dark:hover:bg-gray-700":"text-gray-200 dark:text-gray-600 cursor-not-allowed","group flex items-center px-4 py-2 text-sm"])},[(0,r.Wm)(Q,{class:(0,a.C_)([s.form.extra_routes.indexOf(t)!==s.form.extra_routes.length-1?"text-gray-400 group-hover:text-gray-500":"text-gray-200 group-hover:text-gray-200 dark:text-gray-600 dark:group-hover:text-gray-600","mr-3 h-5 w-5"]),"aria-hidden":"true"},null,8,["class"]),B],10,U)])),_:2},1032,["onClick"])])])),_:2},1024)])),_:2},1024)])),_:2},1024)])],8,C)))),128)),(0,r._)("div",M,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(P.totalRoutesError,((e,t)=>((0,r.wg)(),(0,r.iD)("div",{key:t,class:"flex justify-start items-center mb-2"},[(0,r.Wm)(re,{class:"-ml-1.5 mr-1 h-5 w-5"}),(0,r._)("div",{"data-cy":"error"+t,innerHTML:e},null,8,z)])))),128))])])}var P=s(5633),V=s(7198),H=s(9736),F=s(920),N=s(7655),Y=s(1499),K=s(4299),J=s(2106),X=s(285),G=s(6245),Q=s(2542),ee=s(4880);const te={name:"Routes",components:{Divider:X["default"],PlusSmIcon:P.Z,DotsVerticalIcon:V.Z,Menu:J.v2,MenuButton:J.j2,MenuItem:J.sN,MenuItems:J.sd,DuplicateIcon:H.Z,TrashIcon:F.Z,ArrowCircleUpIcon:N.Z,ArrowCircleDownIcon:Y.Z,DividerWithButtons:ee["default"],ExclamationIcon:K.Z},props:{form:{type:Object,required:!0},results:{type:Object,required:!0}},data(){return{copiedExtraRoutes:{extra_routes:this.form.extra_routes},copiedRoutes:{routes:this.form.routes},totalRoutesError:[]}},computed:{...(0,G.rn)(Q.h,["routes"]),exchanges(){const e="Live"===this.$route.name;return e?this.routes.liveExchanges:this.routes.exchanges}},watch:{form(){this.initiate()},copiedRoutes:{handler(){this.checkRoutes()},deep:!0},copiedExtraRoutes:{handler(){this.checkRoutes()},deep:!0}},created(){this.initiate()},methods:{checkRoutes(){this.totalRoutesError=[];const e=[],t={uniqueRoutesErrorMessage:"each exchange-symbol pair can be traded only once! <br> More info: https://docs.jesse.trade/docs/routes.html#trading-multiple-routes",maxSymbolLengthErrorMessage:"Maximum symbol length is exceeded!",mustContainDashErrorMessage:'Symbol parameter must contain "-" character!',timeframeMustBeDifferentErrorMessage:"Extra routes timeframe and routes timeframe must be different"};if(this.form.extra_routes.length>0)for(const i of this.form.extra_routes)if(!e.includes(t.maxSymbolLengthErrorMessage)&&i.symbol.length>9&&e.push(t.maxSymbolLengthErrorMessage),!e.includes(t.mustContainDashErrorMessage)&&i.symbol.length>=5){let s=!1;for(const e of i.symbol.substring(3,5))"-"===e&&(s=!0);s||e.push(t.mustContainDashErrorMessage)}for(const i of this.form.routes)if(!e.includes(t.maxSymbolLengthErrorMessage)&&i.symbol.length>19&&e.push(t.maxSymbolLengthErrorMessage),!e.includes(t.mustContainDashErrorMessage)&&i.symbol.length>=5){let s=!1;for(const e of i.symbol.substring(3,5))"-"===e&&(s=!0);s||e.push(t.mustContainDashErrorMessage)}const s=[];let r=!1;const a=this.form.routes;for(const i of a.slice(0,-1)){if(s.includes(t.uniqueRoutesErrorMessage))break;for(const e of a.slice(a.indexOf(i)+1))if(i.exchange===e.exchange&&i.strategy===e.strategy&&i.symbol===e.symbol&&0!==i.symbol.length){s.push(t.uniqueRoutesErrorMessage),r=!1;break}if(r)break}let o=!1;const n=this.form.extra_routes;for(const i of n.slice(0,-1)){if(s.includes(t.uniqueRoutesErrorMessage))break;for(const e of n.slice(n.indexOf(i)+1))if(i.exchange===e.exchange&&i.timeframe===e.timeframe&&i.symbol===e.symbol&&0!==i.symbol.length){s.push(t.uniqueRoutesErrorMessage),o=!0;break}if(o)break}if(o=!1,this.form.extra_routes.length>0)for(const i of n){if(s.includes(t.timeframeMustBeDifferentErrorMessage))break;for(const e of this.form.routes)if(i.exchange===e.exchange&&i.symbol===e.symbol&&i.timeframe===e.timeframe&&0!==i.symbol.length){s.push(t.timeframeMustBeDifferentErrorMessage),o=!0;break}if(r)break}for(const i of e)this.totalRoutesError.push(i);for(const i of s)this.totalRoutesError.push(i)},initiate(){this.form.routes.length||this.form.routes.push({exchange:this.exchanges[0],symbol:"BTC-USDT",timeframe:this.routes.timeframes[0],strategy:this.routes.strategies[0]})},addRoute(){this.form.routes.push({exchange:this.form.routes[this.form.routes.length-1].exchange,symbol:"",timeframe:this.routes.timeframes[0],strategy:this.routes.strategies[0]})},addExtraRoute(){this.form.extra_routes.push({exchange:this.form.routes[this.form.routes.length-1].exchange,symbol:"",timeframe:this.routes.timeframes[0]})},deleteRoute(e){const t=this.form.routes.indexOf(e);1!==this.form.routes.length&&t>-1&&this.form.routes.splice(t,1)},deleteExtraRoute(e){const t=this.form.extra_routes.indexOf(e);0!==this.form.extra_routes.length&&t>-1&&this.form.extra_routes.splice(t,1)},duplicateRoutes(e){const t=this.form.routes.indexOf(e),s={};s.exchange=e.exchange,s.strategy=e.strategy,s.symbol="",s.timeframe=e.timeframe,this.form.routes.splice(t+1,0,s)},duplicateExtraRoutes(e){const t=this.form.extra_routes.indexOf(e),s={};s.exchange=e.exchange,s.strategy=e.strategy,s.symbol="",s.timeframe=e.timeframe,this.form.extra_routes.splice(t+1,0,s)},moveUpRoutes(e){const t=this.form.routes.indexOf(e);if(0!==t){const s=this.form.routes[t-1];this.form.routes[t]=s,this.form.routes[t-1]=e}},moveUpExtraRoutes(e){const t=this.form.extra_routes.indexOf(e);if(0!==t){const s=this.form.extra_routes[t-1];this.form.extra_routes[t]=s,this.form.extra_routes[t-1]=e}},moveDownRoutes(e){const t=this.form.routes.indexOf(e);if(t!==this.form.routes.length-1){const s=this.form.routes[t+1];this.form.routes[t]=s,this.form.routes[t+1]=e}},moveDownExtraRoutes(e){const t=this.form.extra_routes.indexOf(e);if(t!==this.form.extra_routes.length-1){const s=this.form.extra_routes[t+1];this.form.extra_routes[t]=s,this.form.extra_routes[t+1]=e}}}};var se=s(3744);const re=(0,se.Z)(te,[["render",A]]),ae=re},470:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>le});var r=s(6252),a=s(3577),o=s(9963);const n={class:"lg:grid lg:grid-cols-12 lg:gap-x-5 select-none"},i={class:"py-6 px-2 sm:px-6 lg:py-0 lg:px-0 lg:col-span-3"},l={class:"space-y-1"},c=["data-cy","onClick"],d={class:"truncate"},u={key:0,"data-cy":"backtest-setting-tab",class:"space-y-6 sm:px-6 lg:px-0 lg:col-span-9 w-full"},m=(0,r._)("p",null,[(0,r.Uk)(" Below configurations are used to filter out the extra logging info that are displayed when the "),(0,r._)("code",null,'"--debug"'),(0,r.Uk)(" flag is enabled. ")],-1),g={"data-cy":"backtest-setting-logs-checkboxes",class:"grid grid-cols-1 md:grid-cols-3 gap-4"},p=(0,r._)("br",null,null,-1),h=(0,r._)("br",null,null,-1),b=["data-cy"],y={class:"grid grid-cols-6 gap-6"},f=(0,r._)("br",null,null,-1),x=(0,r._)("br",null,null,-1),v=(0,r._)("br",null,null,-1),w={key:1,"data-cy":"setting-live-tab",class:"space-y-6 sm:px-6 lg:px-0 lg:col-span-9 w-full"},k=(0,r._)("p",null," You can filter the types of events that you want to be logged. Logging is often useful for debugging and recommended. Hence, it doesn't hurt to enable them all: ",-1),_={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},T=(0,r._)("br",null,null,-1),C=(0,r._)("br",null,null,-1),j=(0,r._)("p",null,[(0,r.Uk)(" Jesse can notify every time something interesting happens so you don't have to monitor your bots 24/7. Currently, Telegram and Discord drivers are supported. "),(0,r._)("br"),(0,r._)("br"),(0,r.Uk)(" To enter API keys for Telegram or Discord, check out your project's "),(0,r._)("code",null,".env"),(0,r.Uk)(" file. ")],-1),D={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},I={key:0},S=(0,r._)("p",null," You can choose for which events you want to receive notifications: ",-1),L=(0,r._)("br",null,null,-1),W={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},E=(0,r._)("br",null,null,-1),q=(0,r._)("p",null," You will also receive recurring reports as notifications which are helpful when you have open positions and want to know about latest status of them. You can choose the timeframe for how frequently you want to receive them: ",-1),$=(0,r._)("br",null,null,-1),Z=(0,r._)("br",null,null,-1),R=(0,r._)("br",null,null,-1),O=(0,r._)("p",null,[(0,r.Uk)("Balances and fees will be fetched from the exchange in live trading. But for "),(0,r._)("b",null,"paper trading"),(0,r.Uk)(" you can set them here:")],-1),U=(0,r._)("br",null,null,-1),B={class:"grid grid-cols-6 gap-6"},M=(0,r._)("br",null,null,-1),z={key:2,class:"space-y-6 sm:px-6 lg:px-0 lg:col-span-9 w-full","data-cy":"optimization-setting-tab"},A=(0,r._)("br",null,null,-1),P=(0,r._)("br",null,null,-1),V=(0,r._)("p",null," Because the optimize mode is limited to one route only, it makes sense to have only one configuration section for the exchange values. Depending on the exchange you define in your route, these configurations will be used. ",-1),H={class:"grid grid-cols-6 gap-6"};function F(e,t,s,F,N,Y){const K=(0,r.up)("Divider"),J=(0,r.up)("Checkbox"),X=(0,r.up)("FormInput"),G=(0,r.up)("RadioGroups"),Q=(0,r.up)("NumberInput");return(0,r.wg)(),(0,r.iD)("div",n,[(0,r._)("aside",i,[(0,r._)("nav",l,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(Y.navigation,(e=>((0,r.wg)(),(0,r.iD)("button",{key:e.name,"data-cy":e.name+"-setting",class:(0,a.C_)(["block w-full",[N.currentTab===e.name?"bg-gray-100 dark:bg-gray-800 text-indigo-700 dark:text-indigo-400 hover:text-indigo-700":"hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-300","group rounded-md px-3 py-2 flex items-center text-sm font-medium"]]),onClick:t=>N.currentTab=e.name},[((0,r.wg)(),(0,r.j4)((0,r.LL)(e.icon),{class:(0,a.C_)([N.currentTab===e.name?"text-indigo-500 dark:text-indigo-400 group-hover:text-indigo-500":"text-gray-400 group-hover:text-gray-500 dark:group-hover:text-gray-400","flex-shrink-0 -ml-1 mr-3 h-6 w-6"]),"aria-hidden":"true"},null,8,["class"])),(0,r._)("span",d,(0,a.zw)(e.name),1)],10,c)))),128))])]),"Backtest"===N.currentTab?((0,r.wg)(),(0,r.iD)("div",u,[(0,r.Wm)(K,{title:"Logs"}),m,(0,r._)("div",g,[(0,r.Wm)(J,{name:"order_submission",title:"Order Submission",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"order_cancellation",title:"Order Cancellation",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"order_execution",title:"Order Execution",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_opened",title:"Position Opened",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_increased",title:"Position Increased",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_reduced",title:"Position Reduced",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_closed",title:"Position Closed",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"shorter_period_candles",title:"1m candles",object:e.settings.backtest.logging},null,8,["object"]),(0,r.Wm)(J,{name:"trading_candles",title:"Trading Candles",object:e.settings.backtest.logging},null,8,["object"])]),p,(0,r.Wm)(K,{title:"Data"}),(0,r._)("div",null,[(0,r.Wm)(X,{"data-cy":"backtest-setting-data-input",placeholder:"ex: 210",title:"Warmup Candles",object:e.settings.backtest,description:"Number of warmup candles that is loaded before starting each session",name:"warm_up_candles","input-type":"number"},null,8,["object"])]),h,((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.settings.backtest.exchanges,((e,t)=>((0,r.wg)(),(0,r.iD)("div",{key:t,"data-cy":"backtest-setting-exchange-"+Y.convertToSlug(e.name)},[(0,r.Wm)(K,{title:e.name},null,8,["title"]),(0,r._)("div",y,[(0,r.Wm)(X,{title:`Starting Capital (${e.settlement_currency})`,object:e,name:"balance","input-type":"number",step:1e3},null,8,["title","object"]),(0,r.Wm)(X,{title:`Trading Fee (${Y.round(100*e.fee,2)}%)`,object:e,name:"fee","input-type":"number",step:1e-4},null,8,["title","object","step"])]),f,(0,r.Wm)(G,{title:"Leverage Mode:",object:e,name:"futures_leverage_mode",options:["cross","isolated"]},null,8,["object"]),x,(0,r.Wm)(Q,{title:"Leverage (x):",name:"futures_leverage",object:e},null,8,["object"]),v],8,b)))),128))])):(0,r.kq)("",!0),"Live"===N.currentTab?((0,r.wg)(),(0,r.iD)("div",w,[(0,r.Wm)(K,{title:"Logs"}),k,(0,r._)("div",_,[(0,r.Wm)(J,{name:"order_submission",title:"Order Submission",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"order_cancellation",title:"Order Cancellation",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"order_execution",title:"Order Execution",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_opened",title:"Position Opened",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_increased",title:"Position Increased",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_reduced",title:"Position Reduced",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"position_closed",title:"Position Closed",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"shorter_period_candles",title:"1m candles",object:e.settings.live.logging},null,8,["object"]),(0,r.Wm)(J,{name:"trading_candles",title:"Trading Candles",object:e.settings.live.logging},null,8,["object"])]),T,(0,r.Wm)(K,{title:"Data"}),(0,r._)("div",null,[(0,r.Wm)(X,{"data-cy":"live-setting-warmup-candles-input",placeholder:"ex: 210",title:"Warmup Candles",object:e.settings.live,description:"Number of warmup candles that is loaded before starting each session",name:"warm_up_candles","input-type":"number"},null,8,["object"])]),C,(0,r.Wm)(K,{title:"Notifications"}),j,(0,r._)("div",D,[(0,r.Wm)(J,{"data-cy":"live-setting-enabled-notification",name:"enabled",title:"Enable Notifications",object:e.settings.live.notifications},null,8,["object"])]),e.settings.live.notifications.enabled?((0,r.wg)(),(0,r.iD)("div",I,[S,L,(0,r._)("div",W,[(0,r.Wm)(J,{name:"errors",title:"Errors",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"started_session",title:"Session Start",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"terminated_session",title:"Session Termination",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"submitted_orders",title:"Order Submission",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"cancelled_orders",title:"Order Cancellation",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"executed_orders",title:"Order Execution",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"opened_position",title:"Opened Positions",object:e.settings.live.notifications.events},null,8,["object"]),(0,r.Wm)(J,{name:"updated_position",title:"Updated Position",object:e.settings.live.notifications.events},null,8,["object"])]),E,q,(0,r.wy)((0,r._)("select",{"onUpdate:modelValue":t[0]||(t[0]=t=>e.settings.live.notifications.position_report_timeframe=t),"data-cy":"live-setting-report-notification-timeframe",class:"dark:bg-backdrop-dark dark:hover:bg-gray-800 hover:bg-gray-50 cursor-pointer w-full py-2 my-4 rounded border border-gray-200 dark:border-gray-600 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(N.timeframes,(e=>((0,r.wg)(),(0,r.iD)("option",{key:e},(0,a.zw)(e),1)))),128))],512),[[o.bM,e.settings.live.notifications.position_report_timeframe]]),$])):(0,r.kq)("",!0),((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.settings.live.exchanges,((e,t)=>((0,r.wg)(),(0,r.iD)("div",{key:t},[(0,r.Wm)(K,{title:e.name},null,8,["title"]),(0,r.Wm)(G,{title:"Leverage Mode:",object:e,name:"futures_leverage_mode",options:["cross","isolated"]},null,8,["object"]),Z,(0,r.Wm)(Q,{title:"Leverage (x):",name:"futures_leverage",object:e},null,8,["object"]),R,O,U,(0,r._)("div",B,[(0,r.Wm)(X,{title:`Starting Capital (${e.settlement_currency})`,object:e,name:"balance","input-type":"number",step:1e3},null,8,["title","object"]),(0,r.Wm)(X,{title:`Trading Fee (${Y.round(100*e.fee,2)}%)`,object:e,name:"fee","input-type":"number",step:1e-4},null,8,["title","object","step"])]),M])))),128))])):(0,r.kq)("",!0),"Optimization"===N.currentTab?((0,r.wg)(),(0,r.iD)("div",z,[(0,r.Wm)(K,{title:"CPU"}),(0,r._)("div",null,[(0,r.Wm)(X,{placeholder:"ex: 4",title:`CPU cores to use for optimization (${e.settings.optimization.cpu_cores}/${e.systemInfo.cpu_cores})`,object:e.settings.optimization,description:"How many CPU cores of your machine would you like to be used for optimization?",name:"cpu_cores","input-type":"number"},null,8,["title","object"])]),(0,r.Wm)(K,{title:"Fitness Function"}),(0,r.Wm)(G,{title:"Ratio:",object:e.settings.optimization,name:"ratio",options:["sharpe","calmar","sortino","omega"]},null,8,["object"]),A,(0,r.Wm)(K,{title:"Data"}),(0,r._)("div",null,[(0,r.Wm)(X,{"data-cy":"optimization-warmup-candles-input",placeholder:"ex: 210",title:"Warmup Candles",object:e.settings.optimization,description:"Number of warmup candles that is loaded before starting each session",name:"warm_up_candles","input-type":"number"},null,8,["object"])]),P,(0,r.Wm)(K,{title:"Exchange"}),V,(0,r._)("div",H,[(0,r.Wm)(X,{title:"Starting Capital",object:e.settings.optimization.exchange,name:"balance","input-type":"number",step:1e3},null,8,["object"]),(0,r.Wm)(X,{title:`Trading Fee (${Y.round(100*e.settings.optimization.exchange.fee,2)}%)`,object:e.settings.optimization.exchange,name:"fee","input-type":"number",step:1e-4},null,8,["title","object","step"])]),(0,r.Wm)(G,{title:"Leverage Mode:",object:e.settings.optimization.exchange,name:"futures_leverage_mode",options:["cross","isolated"]},null,8,["object"]),(0,r.Wm)(Q,{title:"Leverage (x):",name:"futures_leverage",object:e.settings.optimization.exchange},null,8,["object"])])):(0,r.kq)("",!0)])}s(4916),s(5306);var N=s(9337),Y=s(6571),K=s(2606),J=s(3394),X=s(285),G=s(7157),Q=s(6245),ee=s(2542),te=s(8588),se=s(8337),re=s(6486),ae=s.n(re);const oe={components:{Checkbox:J["default"],Divider:X["default"],RadioGroups:G["default"],FormInput:te["default"],NumberInput:se["default"]},data(){return{timeframes:["1m","3m","5m","15m","30m","45m","1h","2h","3h","4h","6h","8h","12h","1D"],currentTab:"Backtest"}},computed:{...(0,Q.rn)(ee.h,["settings","systemInfo","hasLivePluginInstalled"]),navigation(){const e=[{name:"Backtest",icon:N.Z},{name:"Optimization",icon:Y.Z}];return this.hasLivePluginInstalled&&e.push({name:"Live",icon:K.Z}),e}},mounted(){this.sortExchanges()},methods:{round:ae().round,sortExchanges(){const e=Object.keys(this.settings.backtest.exchanges).sort(),t=Object.keys(this.settings.live.exchanges).sort(),s={},r={};for(const a of e)s[a]=this.settings.backtest.exchanges[a];this.settings.backtest.exchanges=s;for(const a of t)r[a]=this.settings.live.exchanges[a];this.settings.live.exchanges=r},convertToSlug(e){return e.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")}}};var ne=s(3744);const ie=(0,ne.Z)(oe,[["render",F]]),le=ie},2779:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var r=s(6252),a=s(3577);const o={class:"px-4 py-5 border dark:border-gray-600 rounded overflow-hidden sm:p-6 select-none"},n={class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},i={class:"mt-1 text-base font-semibold text-gray-900 dark:text-gray-100"};function l(e,t,s,l,c,d){return(0,r.wg)(),(0,r.iD)("div",o,[(0,r._)("dt",n,(0,a.zw)(s.name),1),(0,r._)("dd",i,(0,a.zw)(s.value),1)])}const c={name:"StatsBox",props:{name:{type:String,required:!0},value:{type:String,required:!0}}};var d=s(3744);const u=(0,d.Z)(c,[["render",l]]),m=u},9201:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252);const a={class:"border border-gray-300 dark:border-gray-700 rounded-md p-4 w-full mx-auto"},o=(0,r.uE)('<div class="animate-pulse flex space-x-4 mb-8"><div class="flex-1 space-y-4 py-1"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-3/4"></div><div class="space-y-2"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded"></div><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-5/6"></div></div></div><div class="flex-1 space-y-4 py-1"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-3/4"></div><div class="space-y-2"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded"></div><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-5/6"></div></div></div></div><div class="animate-pulse flex space-x-4"><div class="flex-1 space-y-4 py-1"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-3/4"></div><div class="space-y-2"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded"></div><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-2/6"></div></div></div><div class="flex-1 space-y-4 py-1"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-3/4"></div><div class="space-y-2"><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded"></div><div class="h-4 bg-gray-300 dark:bg-gray-700 rounded w-4/6"></div></div></div></div>',2),n=[o];function i(e,t){return(0,r.wg)(),(0,r.iD)("div",a,n)}var l=s(3744);const c={},d=(0,l.Z)(c,[["render",i]]),u=d},3668:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252);const a={class:"flex flex-col"},o=(0,r.uE)('<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"><div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"><div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"><table class="min-w-full divide-y divide-gray-200"><thead class="bg-gray-50"><tr><th colspan="2" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Info logs </th></tr></thead><tbody><tr class="bg-white"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> 16:14:01 </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> OPENED short position: Binance Futures, BTC-USDT, -0.178, $38042.2 </td></tr><tr class="bg-gray-50"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> 16:14:01 </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> Charged 2.03 as fee. Balance for USDT on Binance. </td></tr><tr class="bg-white"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> 16:14:01 </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> EXECUTED order: BTC-USDT, MARKET, sell, -0.178, $38042.2 </td></tr></tbody></table></div></div></div>',1),n=[o];function i(e,t,s,o,i,l){return(0,r.wg)(),(0,r.iD)("div",a,n)}const l={name:"InfoLogsTable",components:{},data(){return{}},computed:{},mounted(){},methods:{}};var c=s(3744);const d=(0,c.Z)(l,[["render",i]]),u=d},8498:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252);const a={class:"flex flex-col max-w-sm"},o=(0,r.uE)('<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"><div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"><div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"><table class="min-w-full divide-y divide-gray-200"><thead class="bg-gray-50"><tr><th colspan="2" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Paper trade </th></tr></thead><tbody><tr class="bg-white"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Started at </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> a minute ago </td></tr><tr class="bg-gray-50"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Current time </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> 2021-06-02T16:14:26 </td></tr><tr class="bg-white"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Errors/info </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> 0/18 </td></tr><tr class="bg-gray-50"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Active orders </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> 2 </td></tr><tr class="bg-white"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Open positions </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> 2 </td></tr><tr class="bg-gray-50"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Started/current balance </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> 10000/9993.7 </td></tr><tr class="bg-white"><td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> Debug mode </td><td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> True </td></tr></tbody></table></div></div></div>',1),n=[o];function i(e,t,s,o,i,l){return(0,r.wg)(),(0,r.iD)("div",a,n)}const l={name:"InfoTable",components:{},data(){return{}},computed:{},mounted(){},methods:{}};var c=s(3744);const d=(0,c.Z)(l,[["render",i]]),u=d},6833:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>k});var r=s(6252),a=s(3577),o=s(9963);const n={class:"mb-4"},i={class:"hidden sm:block"},l={class:"relative rounded-lg shadow flex divide-x divide-gray-200 dark:divide-gray-700","aria-label":"Tabs"},c=["data-cy"],d=["data-cy","onClick"],u={class:"absolute right-[1em] focus:outline-none"},m=(0,r._)("span",{"aria-hidden":"true",class:"absolute inset-x-0 bottom-0 h-0.5 bg-transparent dark:bg-gray-600"},null,-1);function g(e,t,s,g,p,h){const b=(0,r.up)("router-link"),y=(0,r.up)("XIcon"),f=(0,r.up)("PlusSmIcon");return(0,r.wg)(),(0,r.iD)("div",n,[(0,r._)("div",i,[(0,r._)("nav",l,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(s.tabs,((e,t,n)=>((0,r.wg)(),(0,r.iD)("div",{key:e.id,"data-cy":"tab"+n,class:"relative group min-w-0 flex-1 overflow-hidden text-center flex items-center"},[(0,r.Wm)(b,{class:(0,a.C_)([e.id===s.pageId?"text-gray-900 dark:text-gray-100 font-bold ":"text-gray-500 dark:text-gray-300 hover:text-gray-700 font-medium ","py-4 px-4 inline-block select-none cursor-pointer focus:outline-none  w-full text-sm bg-white dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-800"]),to:`${e.id}`},{default:(0,r.w5)((()=>[(0,r._)("span",null,(0,a.zw)(e.results.executing?"":`Tab ${n+1}`)+" "+(0,a.zw)(e.results.executing?`${e.form.symbol?e.form.symbol:e.form.routes[0].symbol}`:"")+" "+(0,a.zw)(e.results.executing&&!e.results.showResults?" | "+e.results.progressbar.current+"%":"")+" "+(0,a.zw)(e.results.showResults?" - Results":""),1),(0,r._)("span",{"aria-hidden":"true",class:(0,a.C_)([e.id===s.pageId&&Object.keys(s.tabs).length>1?"bg-indigo-400":"bg-transparent dark:bg-gray-600","absolute inset-x-0 bottom-0 h-0.5"])},null,2)])),_:2},1032,["class","to"]),(0,r.wy)((0,r._)("button",{"data-cy":"tab-close-button"+n,class:"absolute right-[1em] focus:outline-none",onClick:t=>h.closeTab(e.id)},[(0,r.Wm)(y,{class:"h-5 w-5 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full","aria-hidden":"true"})],8,d),[[o.F8,Object.keys(s.tabs).length>1]])],8,c)))),128)),(0,r._)("div",{class:"select-none cursor-pointer text-gray-400 dark:text-gray-100 hover:text-gray-600 focus:outline-none group relative w-14 overflow-hidden bg-white dark:bg-backdrop-dark py-4 px-4 font-medium hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center justify-center",onClick:t[0]||(t[0]=(...e)=>h.addTab&&h.addTab(...e))},[(0,r._)("button",u,[(0,r.Wm)(f,{class:"h-6 w-6 rounded-full","aria-hidden":"true"})]),m])])])])}var p=s(6299),h=s(9318),b=s(7240),y=s(8214),f=s(4922);const x={name:"Tabs",components:{XIcon:h.Z,PlusSmIcon:b.Z},props:{pageId:{type:Number,required:!0},tabs:{type:Object,required:!0}},created(){1===this.pageId||this.pageId in this.tabs||this.$router.push({name:this.$route.name,params:{id:this.tabs[Object.keys(this.tabs)[0]].id}})},methods:{addTab(){if("Candles"===this.$route.name){const e=(0,y.e)();return e.addTab()}if("Backtest"===this.$route.name){const e=(0,p.D)();return e.addTab()}if("Live"===this.$route.name){const e=(0,f.I)();return e.addTab()}},closeTab(e){delete this.tabs[e],this.pageId===e&&this.$router.push({name:this.$route.name,params:{id:this.tabs[Object.keys(this.tabs)[0]].id}})}}};var v=s(3744);const w=(0,v.Z)(x,[["render",g]]),k=w},3190:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var r=s(6252);function a(e,t,s,a,o,n){const i=(0,r.up)("MoonIcon"),l=(0,r.up)("SunIcon");return(0,r.wg)(),(0,r.iD)("button",{id:"theme-switch-button",class:"btn-nav",onClick:t[0]||(t[0]=(...e)=>n.toggle&&n.toggle(...e))},["light"===e.theme?((0,r.wg)(),(0,r.j4)(i,{key:0,class:"h-6 w-6","aria-hidden":"true"})):(0,r.kq)("",!0),"dark"===e.theme?((0,r.wg)(),(0,r.j4)(l,{key:1,class:"h-6 w-6","aria-hidden":"true"})):(0,r.kq)("",!0)])}var o=s(5945),n=s(9071),i=s(6245),l=s(2542);const c={name:"ThemeSwitch",components:{MoonIcon:o.Z,SunIcon:n.Z},computed:{...(0,i.Ah)(l.h,["theme"])},beforeMount(){"dark"===localStorage.theme||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?this.theme="dark":this.theme="light"},methods:{toggle(){const e="light"===this.theme?"dark":"light";"light"===e?(document.documentElement.classList.remove("dark"),localStorage.theme="light",this.theme="light"):"dark"===e&&(document.documentElement.classList.add("dark"),localStorage.theme="dark",this.theme="dark")}}};var d=s(3744);const u=(0,d.Z)(c,[["render",a]]),m=u},1851:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var r=s(6252),a=s(3577);const o={class:"flex-grow flex flex-col"};function n(e,t,s,n,i,l){const c=(0,r.up)("SwitchLabel"),d=(0,r.up)("SwitchDescription"),u=(0,r.up)("Switch"),m=(0,r.up)("SwitchGroup");return(0,r.wg)(),(0,r.j4)(m,{as:"div",class:"w-full flex items-center justify-between mb-3 select-none"},{default:(0,r.w5)((()=>[(0,r._)("span",o,[(0,r.Wm)(c,{as:"span",class:"font-medium text-gray-700 dark:text-gray-200",passive:""},{default:(0,r.w5)((()=>[(0,r.Uk)((0,a.zw)(s.title),1)])),_:1}),(0,r.Wm)(d,{as:"span",class:"text-sm text-gray-500 dark:text-gray-400"},{default:(0,r.w5)((()=>[(0,r.Uk)((0,a.zw)(s.description),1)])),_:1})]),(0,r.Wm)(u,{modelValue:s.object[s.name],"onUpdate:modelValue":t[0]||(t[0]=e=>s.object[s.name]=e),class:(0,a.C_)([s.object[s.name]?"bg-indigo-600 dark:bg-indigo-400":"bg-gray-200 dark:bg-gray-600","relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none"])},{default:(0,r.w5)((()=>[(0,r._)("span",{"aria-hidden":"true",class:(0,a.C_)([s.object[s.name]?"translate-x-5 dark:bg-backdrop-dark":"translate-x-0 dark:bg-gray-400","bg-white  pointer-events-none inline-block h-5 w-5 rounded-full shadow transform ring-0 transition ease-in-out duration-200"])},null,2)])),_:1},8,["modelValue","class"])])),_:1})}var i=s(2106);const l={name:"ToggleButton",components:{Switch:i.rs,SwitchDescription:i.Zm,SwitchGroup:i.Mv,SwitchLabel:i.$A},props:{description:{type:String,required:!1,default:""},title:{type:String,required:!0},object:{type:Object,required:!0},name:{type:String,required:!0}}};var c=s(3744);const d=(0,c.Z)(l,[["render",n]]),u=d},9614:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var r=s(7484),a=s.n(r),o=s(178),n=s.n(o),i=s(6486),l=s.n(i);a().extend(n());const c={timestampToTime(e){return a()(parseInt(e)).utc().format("YYYY-MM-DD HH:mm:ss")},timestampToTimeOnly(e){return a()(parseInt(e)).utc().format("HH:mm:ss")},timestampToDate(e){return a()(parseInt(e)).utc().format("YYYY-MM-DD")},currentTime(){return a()().utc().format("HH:mm:ss")},localStorageSet(e,t){localStorage.setItem(e,JSON.stringify(t))},localStorageGet(e){return JSON.parse(localStorage.getItem(e))},getDefaultFromLocalStorage(e,t){return l().merge(t,c.localStorageGet(e))},secondsToHumanReadable(e){const t=Math.floor(e/3600),s=Math.floor((e-3600*t)/60),r=l().round(e-3600*t-60*s,2);return`${t}h ${s}m ${r}s`},remainingTimeText(e){if(0===Math.round(e))return"Please wait...";if(e>60){const t=this.secondsToHumanReadable(e);return`${t} remaining...`}return`${Math.round(e)} seconds remaining...`},roundPrice(e){return e>1?l().round(e,2):e}},d=c},5603:(e,t,s)=>{"use strict";s.d(t,{Z:()=>o});var r=s(9669),a=s.n(r);a().defaults.baseURL="/";const o=a()},2424:(e,t,s)=>{"use strict";s(4916);var r=s(9963),a=s(2262),o=s(6252);function n(e,t,s,r,a,n){const i=(0,o.up)("Nav"),l=(0,o.up)("router-view"),c=(0,o.up)("Login");return(0,o.wg)(),(0,o.iD)(o.HY,null,[e.isAuthenticated?((0,o.wg)(),(0,o.j4)(i,{key:0})):(0,o.kq)("",!0),e.isAuthenticated?((0,o.wg)(),(0,o.j4)(l,{key:1})):((0,o.wg)(),(0,o.j4)(c,{key:2}))],64)}var i=s(2516),l=s(6245),c=s(2542),d=s(1021),u=s(7372);const m={key:0,class:"absolute top-o l-0 w-full h-screen bg-white dark:bg-backdrop-dark z-40 select-none flex items-center justify-center"},g={class:"text-center"},p=(0,o._)("div",{class:"w-full text-center"},[(0,o._)("img",{class:"animate-bounce h-32 w-auto mx-auto dark:hidden",src:d,alt:"Jesse Logo"}),(0,o._)("img",{class:"animate-bounce h-32 w-auto mx-auto hidden dark:block",src:u,alt:"Jesse Logo"})],-1),h=(0,o._)("br",null,null,-1),b=(0,o._)("br",null,null,-1),y=(0,o._)("h1",{class:"text-gray-700 dark:text-gray-300"},"Welcome Back!",-1),f=(0,o._)("br",null,null,-1),x=(0,o._)("p",{class:"opacity-70 text-gray-700 dark:text-gray-300"},"Enter your password to continue:",-1),v=(0,o._)("br",null,null,-1),w={class:"mt-1 flex"},k={class:"relative flex items-stretch flex-grow focus-within:z-10"},_={class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},T={type:"submit",class:"relative inline-flex items-center px-4 py-4 rounded bg-indigo-600 dark:bg-indigo-400 hover:bg-indigo-700 dark:hover:bg-indigo-300 focus:outline-none text-white dark:text-black text-base tracking-wide ml-2"};function C(e,t,s,a,n,i){const l=(0,o.up)("LockClosedIcon"),c=(0,o.up)("ArrowNarrowRightIcon");return n.open?((0,o.wg)(),(0,o.iD)("section",m,[(0,o._)("div",g,[p,h,b,y,f,x,v,(0,o._)("div",null,[(0,o._)("form",{action:"/login",onSubmit:t[1]||(t[1]=(0,r.iM)(((...e)=>i.login&&i.login(...e)),["prevent"]))},[(0,o._)("div",w,[(0,o._)("div",k,[(0,o._)("div",_,[(0,o.Wm)(l,{class:"h-5 w-5 text-gray-600 dark:text-gray-400","aria-hidden":"true"})]),(0,o.wy)((0,o._)("input",{id:"password","onUpdate:modelValue":t[0]||(t[0]=e=>n.password=e),type:"password",name:"password",autofocus:"",class:"dark:bg-gray-800 dark:border-gray-900 text-black dark:text-white focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 block w-full rounded pl-10 sm:text-sm border-gray-300",placeholder:"Password..."},null,512),[[r.nr,n.password]])]),(0,o._)("button",T,[(0,o.Wm)(c,{class:"h-5 w-5 text-white","aria-hidden":"true"})])])],32)])])])):(0,o.kq)("",!0)}var j=s(2014),D=s(8633),I=s(5603);const S={name:"Login",components:{LockClosedIcon:j.Z,ArrowNarrowRightIcon:D.Z},data(){return{open:!0,password:""}},computed:{...(0,l.Ah)(c.h,["isAuthenticated"])},created(){null!==sessionStorage.getItem("auth_key")&&(window.Cypress||this.setAuth())},methods:{...(0,l.nv)(c.h,["initiate"]),setAuth(){I.Z.defaults.headers.common.Authorization=sessionStorage.auth_key,this.isAuthenticated=!0,this.initiate(),this.open=!1},login(){I.Z.post("/auth",{password:this.password}).then((e=>{sessionStorage.auth_key=e.data.auth_token,this.setAuth(),this.notyf.success("Logged in successfully")})).catch((e=>{e.response?401===e.response.status?this.notyf.error("Incorrect password"):this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`):this.notyf.error(`${e}`)}))}}};var L=s(3744);const W=(0,L.Z)(S,[["render",C]]),E=W,q={name:"App",components:{Nav:i["default"],Login:E},computed:{...(0,l.rn)(c.h,["routes","settings"]),...(0,l.Ah)(c.h,["isAuthenticated"])},watch:{isAuthenticated(e,t){!0===e&&this.initiate()},settings:{handler:function(e,t){this.updateConfig()},deep:!0}},created(){null!==sessionStorage.getItem("auth_key")&&(window.Cypress||this.setAuth())},methods:{setAuth(){I.Z.defaults.headers.common.Authorization=sessionStorage.auth_key,this.isAuthenticated=!0},...(0,l.nv)(c.h,["initiate","updateConfig"])}},$=(0,L.Z)(q,[["render",n]]),Z=$;var R=s(2119);function O(e,t,s,r,a,n){const i=(0,o.up)("Tabs"),l=(0,o.up)("CandlesTab");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(i,{"page-id":n.pageId,tabs:e.tabs},null,8,["page-id","tabs"]),e.tabs[n.pageId]?((0,o.wg)(),(0,o.j4)(l,{key:0,form:e.tabs[n.pageId].form,results:e.tabs[n.pageId].results},null,8,["form","results"])):(0,o.kq)("",!0)],64)}var U=s(8214),B=s(3577);const M={key:0,class:"flex flex-col items-center justify-center select-none mt-[10%]"},z=["textContent"],A={class:"mt-8"},P=(0,o.Uk)(" Cancel "),V={key:1,class:"mx-auto container mt-8"},H={key:0},F={key:1,"data-cy":"candles-page-content",class:"pb-4"},N={key:0,"data-cy":"symbol-error-section",class:"text-sm text-red-400 p-2 rounded-lg mb-4 mt-2"},Y=["data-cy","innerHTML"],K={class:"flex items-center select-none flex-1"},J={key:0},X={key:0},G={key:1},Q=(0,o.Uk)(" Start "),ee=(0,o.Uk)(" Start in a new tab ");function te(e,t,s,a,n,i){const l=(0,o.up)("CircleProgressbar"),c=(0,o.up)("BanIcon"),d=(0,o.up)("Exception"),u=(0,o.up)("Alert"),m=(0,o.up)("Divider"),g=(0,o.up)("ExclamationIcon"),p=(0,o.up)("LightningBoltIcon"),h=(0,o.up)("PlusSmIcon"),b=(0,o.up)("LayoutWithSidebar");return s.form.debug_mode||!s.results.executing||s.results.showResults?((0,o.wg)(),(0,o.j4)(b,{key:1},{left:(0,o.w5)((()=>[s.results.alert.message?((0,o.wg)(),(0,o.iD)("div",H,[(0,o.Wm)(u,{data:s.results.alert},null,8,["data"])])):(0,o.kq)("",!0),s.results.executing||s.results.showResults?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",F,[(0,o.Wm)(m,{title:"Exchange"}),(0,o.wy)((0,o._)("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>s.form.exchange=e),"data-cy":"candles-exchange",class:"dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer w-full px-6 py-6 border border-gray-200 dark:border-gray-900 focus:outline-none focus:ring-0 dark:focus:border-indigo-400 focus:border-indigo-500 rounded-md"},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.routes.exchanges,(e=>((0,o.wg)(),(0,o.iD)("option",{key:e},(0,B.zw)(e),1)))),128))],512),[[r.bM,s.form.exchange]]),(0,o.Wm)(m,{class:"mt-16",title:"Symbol"}),(0,o.wy)((0,o._)("input",{"onUpdate:modelValue":t[2]||(t[2]=e=>s.form.symbol=e),"data-cy":"candles-symbol",placeholder:"ex: BTC-USDT",class:"dark:bg-backdrop-dark hover:bg-gray-50 dark:hover:bg-gray-800 w-full px-6 py-6 border border-gray-200 focus:outline-none focus:ring-0 dark:focus:border-indigo-400 focus:border-indigo-500 dark:border-gray-900 rounded-md"},null,512),[[r.nr,s.form.symbol]]),n.totalSymbolError.length>>0?((0,o.wg)(),(0,o.iD)("div",N,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(n.totalSymbolError,((e,t)=>((0,o.wg)(),(0,o.iD)("div",{key:t,class:"flex justify-start items-center mb-2"},[(0,o.Wm)(g,{class:"-ml-1.5 mr-1 h-5 w-5"}),(0,o._)("div",{"data-cy":"error"+t,innerHTML:e},null,8,Y)])))),128))])):(0,o.kq)("",!0),(0,o.Wm)(m,{class:"mt-16",title:"Start Date"}),(0,o._)("div",K,[(0,o.wy)((0,o._)("input",{"onUpdate:modelValue":t[3]||(t[3]=e=>s.form.start_date=e),"data-cy":"candles-start-date",type:"date",name:"start_date",class:"dark:hover:bg-gray-800 hover:bg-gray-50 cursor-pointer dark:bg-backdrop-dark flex-1 focus:outline-none focus:ring-0 dark:focus:border-indigo-400 focus:border-indigo-500 flex justify-center items-center py-6 text-center sm:text-sm border border-gray-200 dark:border-gray-900 rounded-md"},null,512),[[r.nr,s.form.start_date]])])]))])),right:(0,o.w5)((()=>[s.results.executing?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",J,[s.results.showResults?((0,o.wg)(),(0,o.iD)("div",X,[(0,o._)("button",{class:"btn-primary text-center block w-full mb-4",onClick:t[4]||(t[4]=t=>e.rerun(e.$route.params.id))}," Rerun "),(0,o._)("button",{class:"btn-secondary text-center block w-full mb-4",onClick:t[5]||(t[5]=t=>e.newBacktest(e.$route.params.id))}," New backtest ")])):((0,o.wg)(),(0,o.iD)("div",G,[(0,o._)("button",{"data-cy":"start-button",class:"flex items-center justify-center btn-primary text-center w-full mb-4",onClick:t[6]||(t[6]=t=>e.start(e.$route.params.id))},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Q]),(0,o._)("button",{"data-cy":"start-new-tab-button",class:"flex items-center justify-center btn-secondary text-center w-full mb-4",onClick:t[7]||(t[7]=t=>e.startInNewTab(e.$route.params.id))},[(0,o.Wm)(h,{class:"w-5 h-5 mr-2"}),ee])]))]))])),_:1})):((0,o.wg)(),(0,o.iD)("div",M,[(0,o._)("div",null,[(0,o.Wm)(l,{progress:s.results.progressbar.current},null,8,["progress"])]),s.results.exception.error?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("h3",{key:0,class:"mt-8 animate-pulse",textContent:(0,B.zw)(i.remainingTimeText)},null,8,z)),(0,o._)("div",A,[(0,o._)("button",{"data-cy":"import-candles-cancel-button",class:"flex items-center justify-center btn-secondary w-64",onClick:t[0]||(t[0]=t=>e.cancel(e.$route.params.id))},[(0,o.Wm)(c,{class:"w-5 h-5 mr-2"}),P])]),s.results.exception.error&&s.results.executing?((0,o.wg)(),(0,o.iD)("div",V,[(0,o.Wm)(d,{title:s.results.exception.error,content:s.results.exception.traceback,mode:"candles"},null,8,["title","content"])])):(0,o.kq)("",!0)]))}var se=s(6657),re=s(7240),ae=s(2157);const oe={class:"grid grid-cols-1 gap-4 items-start lg:grid-cols-3 p-6"},ne={class:"grid grid-cols-1 gap-4 lg:col-span-2"},ie={"aria-labelledby":"section-1-title"},le={class:"rounded-lg overflow-hidden"},ce={class:"grid grid-cols-1 gap-4"},de={"aria-labelledby":"section-2-title"};function ue(e,t,s,r,a,n){return(0,o.wg)(),(0,o.iD)("div",oe,[(0,o._)("div",ne,[(0,o._)("section",ie,[(0,o._)("div",le,[(0,o.WI)(e.$slots,"left")])])]),(0,o._)("div",ce,[(0,o._)("section",de,[(0,o.WI)(e.$slots,"right")])])])}const me={name:"LayoutWithSidebar"},ge=(0,L.Z)(me,[["render",ue]]),pe=ge;var he=s(4299),be=s(9614);const ye={name:"CandlesTab",components:{LayoutWithSidebar:pe,ExclamationIcon:he.Z,LightningBoltIcon:se.Z,PlusSmIcon:re.Z,BanIcon:ae.Z},props:{form:{type:Object,required:!0},results:{type:Object,required:!0}},data(){return{totalSymbolError:[],copiedForm:{symbol:this.form}}},computed:{...(0,l.rn)(c.h,["routes","isInitiated"]),remainingTimeText(){return be.Z.remainingTimeText(this.results.progressbar.estimated_remaining_seconds)}},watch:{form:{handler(){this.initiate(),!0===this.isInitiated&&""!==this.form.exchange&&be.Z.localStorageSet("candlesForm",this.form)},deep:!0},isInitiated(e,t){this.initiate()},copiedForm:{handler(){this.checkSymbol()},deep:!0}},created(){this.initiate()},methods:{...(0,l.nv)(U.e,["addTab","startInNewTab","start","cancel","rerun","newBacktest"]),initiate(){!0===this.isInitiated&&""===this.form.exchange&&(this.form.exchange=this.routes.exchanges[0])},checkSymbol(){this.totalSymbolError=[];const e=[],t={maxSymbolLengthErrorMessage:"Maximum symbol length is exceeded!",mustContainDashErrorMessage:'Symbol parameter must contain "-" character!'};if(!e.includes(t.maxSymbolLengthErrorMessage)&&this.form.symbol.length>19&&e.push(t.maxSymbolLengthErrorMessage),this.form.symbol.length>=5){let s=!1;for(const e of this.form.symbol.substring(3,5))"-"===e&&(s=!0);s||e.push(t.mustContainDashErrorMessage)}for(const s of e)this.totalSymbolError.push(s)}}},fe=(0,L.Z)(ye,[["render",te]]),xe=fe;var ve=s(6833);const we={name:"Candles",components:{Tabs:ve["default"],CandlesTab:xe},computed:{...(0,l.Ah)(U.e,["tabs"]),pageId(){return parseInt(this.$route.params.id)}}},ke=(0,L.Z)(we,[["render",O]]),_e=ke;function Te(e,t,s,r,a,n){const i=(0,o.up)("Tabs"),l=(0,o.up)("BacktestTab");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(i,{"page-id":n.pageId,tabs:e.tabs},null,8,["page-id","tabs"]),e.tabs[n.pageId]?((0,o.wg)(),(0,o.j4)(l,{key:0,form:e.tabs[n.pageId].form,results:e.tabs[n.pageId].results},null,8,["form","results"])):(0,o.kq)("",!0)],64)}var Ce=s(6299);const je=["value"],De={key:1,class:"flex flex-col items-center justify-center select-none mt-[10%]"},Ie=["textContent"],Se={class:"mt-8"},Le=(0,o.Uk)(" Cancel "),We=["href"],Ee=(0,o.Uk)(" Debugging Logs "),qe={key:1,class:"mx-auto container mt-8"},$e={key:0},Ze={key:1,"data-cy":"backtest-content-section"},Re={"data-cy":"backtest-option-section",class:"grid grid-cols-1 gap-6"},Oe={class:"flex items-center select-none flex-1 mb-4"},Ue={key:2,class:"w-full mx-auto"},Be={key:6,class:"text-yellow-500 border-yellow-400 bg-yellow-50 dark:bg-gray-700 dark:text-yellow-400 mt-16 text-center text-2xl rounded border-2 border-dashed dark:border-gray-800 py-16 select-none"},Me={key:0},ze={key:0},Ae=(0,o.Uk)(" Rerun "),Pe=(0,o.Uk)(" New session "),Ve=["href"],He=(0,o.Uk)(" Debugging Logs "),Fe=["href"],Ne=(0,o.Uk)(" Legacy Chart "),Ye=["href"],Ke=(0,o.Uk)(" QuantStats Report "),Je=["href"],Xe=(0,o.Uk)(" CSV "),Ge=["href"],Qe=(0,o.Uk)(" JSON "),et=["href"],tt=(0,o.Uk)(" TradingView Pine Editor "),st={key:1},rt=(0,o.Uk)(" Start "),at=(0,o.Uk)(" Start in a new tab ");function ot(e,t,s,a,n,i){const l=(0,o.up)("Logs"),c=(0,o.up)("CheckIcon"),d=(0,o.up)("ClipboardIcon"),u=(0,o.up)("SlideOver"),m=(0,o.up)("CircleProgressbar"),g=(0,o.up)("BanIcon"),p=(0,o.up)("DocumentDownloadIcon"),h=(0,o.up)("Exception"),b=(0,o.up)("Alert"),y=(0,o.up)("Routes"),f=(0,o.up)("Divider"),x=(0,o.up)("ToggleButton"),v=(0,o.up)("MultipleValuesTable"),w=(0,o.up)("KeyValueTable"),k=(0,o.up)("EquityCurve"),_=(0,o.up)("RefreshIcon"),T=(0,o.up)("ReplyIcon"),C=(0,o.up)("LightningBoltIcon"),j=(0,o.up)("PlusSmIcon"),D=(0,o.up)("LayoutWithSidebar");return(0,o.wg)(),(0,o.iD)(o.HY,null,[s.form.debug_mode?((0,o.wg)(),(0,o.j4)(u,{key:0,name:"logsModal",object:s.results,title:"Logs"},{default:(0,o.w5)((()=>[(0,o.Wm)(l,{logs:s.results.infoLogs},null,8,["logs"])])),buttons:(0,o.w5)((()=>[(0,o._)("button",{class:"btn-nav",onClick:t[0]||(t[0]=(...e)=>i.copyInfoLogs&&i.copyInfoLogs(...e))},[n.copiedLogsInfo?((0,o.wg)(),(0,o.j4)(c,{key:0,class:"h-6 w-6","aria-hidden":"true"})):(0,o.kq)("",!0),n.copiedLogsInfo||0==s.results.infoLogs.length?(0,o.kq)("",!0):((0,o.wg)(),(0,o.j4)(d,{key:1,class:"h-6 w-6","aria-hidden":"true"}))]),(0,o._)("input",{id:"copy-info-logs",type:"hidden",value:s.results.infoLogs},null,8,je)])),_:1},8,["object"])):(0,o.kq)("",!0),s.results.executing&&!s.results.showResults?((0,o.wg)(),(0,o.iD)("div",De,[(0,o._)("div",null,[(0,o.Wm)(m,{progress:s.results.progressbar.current},null,8,["progress"])]),s.results.exception.error?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("h3",{key:0,class:"mt-8 animate-pulse",textContent:(0,B.zw)(i.remainingTimeText)},null,8,Ie)),(0,o._)("div",Se,[(0,o._)("button",{"data-cy":"backtest-cancel-button",class:"flex justify-center items-center btn-cancel mb-4 w-64",onClick:t[1]||(t[1]=t=>e.cancel(e.$route.params.id))},[(0,o.Wm)(g,{class:"w-5 h-5 mr-2"}),Le]),s.form.debug_mode&&s.results.exception.error&&0!==s.results.progressbar.current?((0,o.wg)(),(0,o.iD)("a",{key:0,href:i.logsUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Ee],8,We)):(0,o.kq)("",!0)]),s.results.exception.error&&s.results.executing?((0,o.wg)(),(0,o.iD)("div",qe,[(0,o.Wm)(h,{title:s.results.exception.error,content:s.results.exception.traceback,mode:"backtest","debug-mode":s.form.debug_mode,"session-id":s.results.generalInfo.session_id},null,8,["title","content","debug-mode","session-id"])])):(0,o.kq)("",!0)])):(0,o.kq)("",!0),(0,o.Wm)(D,{else:""},{left:(0,o.w5)((()=>[s.results.showResults&&s.results.alert.message?((0,o.wg)(),(0,o.iD)("div",$e,[(0,o.Wm)(b,{data:s.results.alert},null,8,["data"])])):(0,o.kq)("",!0),s.results.executing||s.results.showResults?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",Ze,[e.isInitiated?((0,o.wg)(),(0,o.j4)(y,{key:0,form:s.form,results:s.results},null,8,["form","results"])):(0,o.kq)("",!0),(0,o.Wm)(f,{class:"mt-16",title:"Options"}),(0,o._)("div",Re,[(0,o.Wm)(x,{object:s.form,name:"debug_mode",title:"Debug Mode",description:"Logs every step of the execution. Very helpful for debugging your strategy but takes a lot longer to execute"},null,8,["object"]),(0,o.Wm)(x,{object:s.form,name:"export_chart",title:"Export Charts",description:"Exports charts for your portfolio's daily balance."},null,8,["object"]),(0,o.Wm)(x,{object:s.form,name:"export_tradingview",title:"Export Tradingview",description:"Exports the executed trades in a format accepted by TradingView's Pine Editor. Useful to look at the executed orders on their chart."},null,8,["object"]),(0,o.Wm)(x,{object:s.form,name:"export_full_reports",title:"Export QuantStats reports",description:"Exports a HTML file generated by QuantStats library."},null,8,["object"]),(0,o.Wm)(x,{object:s.form,name:"export_csv",title:"Export CSV",description:"Exports executed trades in a CSV format"},null,8,["object"]),(0,o.Wm)(x,{object:s.form,name:"export_json",title:"Export JSON",description:"Exports executed trades in a JSON format"},null,8,["object"])]),(0,o.Wm)(f,{class:"mt-16",title:"Duration"}),(0,o._)("div",Oe,[(0,o.wy)((0,o._)("input",{id:"start_date","onUpdate:modelValue":t[2]||(t[2]=e=>s.form.start_date=e),"data-cy":"backtest-start-date",type:"date",name:"start_date",class:"dark:bg-backdrop-dark dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 flex-1 cursor-pointer focus:ring-indigo-500 focus:border-indigo-500 dark:focus:border-indigo-400 flex justify-center items-center w-48 py-4 text-center sm:text-sm border-gray-300 rounded-l-md border-r-0"},null,512),[[r.nr,s.form.start_date]]),(0,o.wy)((0,o._)("input",{id:"finish_date","onUpdate:modelValue":t[3]||(t[3]=e=>s.form.finish_date=e),"data-cy":"backtest-finish-date",type:"date",name:"finish_date",class:"dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 dark:bg-backdrop-dark flex-1 cursor-pointer focus:ring-indigo-500 focus:border-indigo-500 dark:focus:border-indigo-400 flex justify-center items-center w-48 py-4 text-center sm:text-sm border-gray-300 rounded-r-md"},null,512),[[r.nr,s.form.finish_date]])])])),s.results.showResults?((0,o.wg)(),(0,o.iD)("div",Ue,[(0,o._)("div",null,[(0,o.Wm)(f,{title:"Routes"}),(0,o.Wm)(v,{data:s.results.routes_info,header:""},null,8,["data"]),(0,o.Wm)(f,{class:"mt-16",title:"Info"}),(0,o.Wm)(w,{data:s.results.info},null,8,["data"]),s.results.hyperparameters.length?((0,o.wg)(),(0,o.j4)(f,{key:0,class:"mt-16",title:"Hyperparameters"})):(0,o.kq)("",!0),s.results.hyperparameters.length?((0,o.wg)(),(0,o.j4)(w,{key:1,data:s.results.hyperparameters},null,8,["data"])):(0,o.kq)("",!0),i.hasExecutedTrades?((0,o.wg)(),(0,o.j4)(f,{key:2,class:"mt-16",title:"Equity Curve"})):(0,o.kq)("",!0),i.hasExecutedTrades?((0,o.wg)(),(0,o.j4)(k,{key:3,"equity-curve":s.results.charts.equity_curve},null,8,["equity-curve"])):(0,o.kq)("",!0),i.hasExecutedTrades?((0,o.wg)(),(0,o.j4)(f,{key:4,class:"mt-16",title:"Performance"})):(0,o.kq)("",!0),i.hasExecutedTrades?((0,o.wg)(),(0,o.j4)(w,{key:5,data:s.results.metrics},null,8,["data"])):(0,o.kq)("",!0),i.hasExecutedTrades?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",Be," No trades were executed via this strategy! "))])])):(0,o.kq)("",!0)])),right:(0,o.w5)((()=>[s.results.executing?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",Me,[s.results.showResults?((0,o.wg)(),(0,o.iD)("div",ze,[(0,o._)("button",{class:"flex justify-center items-center btn-primary text-center mb-4 w-full",onClick:t[4]||(t[4]=t=>e.rerun(e.$route.params.id))},[(0,o.Wm)(_,{class:"w-5 h-5 mr-2"}),Ae]),(0,o._)("button",{class:"flex justify-center items-center btn-success text-center mb-4 w-full",onClick:t[5]||(t[5]=t=>e.newBacktest(e.$route.params.id))},[(0,o.Wm)(T,{class:"w-5 h-5 mr-2"}),Pe]),s.form.debug_mode?((0,o.wg)(),(0,o.iD)("a",{key:0,href:i.logsUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),He],8,Ve)):(0,o.kq)("",!0),s.form.export_chart&&i.hasExecutedTrades?((0,o.wg)(),(0,o.iD)("a",{key:1,href:i.legacyChartUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Ne],8,Fe)):(0,o.kq)("",!0),s.form.export_full_reports&&i.hasExecutedTrades?((0,o.wg)(),(0,o.iD)("a",{key:2,href:i.fullReportsUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Ke],8,Ye)):(0,o.kq)("",!0),s.form.export_csv&&i.hasExecutedTrades?((0,o.wg)(),(0,o.iD)("a",{key:3,href:i.csvUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Xe],8,Je)):(0,o.kq)("",!0),s.form.export_json&&i.hasExecutedTrades?((0,o.wg)(),(0,o.iD)("a",{key:4,href:i.jsonUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Qe],8,Ge)):(0,o.kq)("",!0),s.form.export_tradingview&&i.hasExecutedTrades?((0,o.wg)(),(0,o.iD)("a",{key:5,href:i.tradingviewUrl,class:"flex justify-center items-center btn-secondary text-center mb-4 w-full"},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),tt],8,et)):(0,o.kq)("",!0)])):((0,o.wg)(),(0,o.iD)("div",st,[(0,o._)("button",{"data-cy":"start-button",class:"flex items-center justify-center btn-primary text-center mb-4 w-full",onClick:t[6]||(t[6]=t=>e.start(e.$route.params.id))},[(0,o.Wm)(C,{class:"w-5 h-5 mr-2"}),rt]),(0,o._)("button",{"data-cy":"start-new-tab-button",class:"flex items-center justify-center btn-secondary text-center mb-4 w-full",onClick:t[7]||(t[7]=t=>e.startInNewTab(e.$route.params.id))},[(0,o.Wm)(j,{class:"w-5 h-5 mr-2"}),at])]))]))])),_:1})],64)}var nt=s(243),it=s(1166),lt=s(3244),ct=s(1315),dt=s(4374),ut=s(9848),mt=s(354),gt=s(6582),pt=s(1851),ht=s(285);const bt={name:"BacktestTab",components:{LayoutWithSidebar:pe,Logs:nt["default"],ToggleButton:pt["default"],MultipleValuesTable:it["default"],ClipboardIcon:lt.Z,CheckIcon:ct.Z,SlideOver:gt["default"],LightningBoltIcon:se.Z,PlusSmIcon:re.Z,RefreshIcon:dt.Z,ReplyIcon:ut.Z,DocumentDownloadIcon:mt.Z,BanIcon:ae.Z,Divider:ht["default"]},props:{form:{type:Object,required:!0},results:{type:Object,required:!0}},data(){return{copiedLogsInfo:!1,svgObject:{display:!1}}},computed:{legacyChartUrl(){let e=`/download/backtest/chart/${this.results.generalInfo.session_id}?token=${this.auth_key}`;return"/"!==this.baseURL&&(e=this.baseURL+e),e},logsUrl(){let e=`/download/backtest/log/${this.results.generalInfo.session_id}?token=${this.auth_key}`;return"/"!==this.baseURL&&(e=this.baseURL+e),e},tradingviewUrl(){let e=`/download/backtest/tradingview/${this.results.generalInfo.session_id}?token=${this.auth_key}`;return"/"!==this.baseURL&&(e=this.baseURL+e),e},fullReportsUrl(){let e=`/download/backtest/full-reports/${this.results.generalInfo.session_id}?token=${this.auth_key}`;return"/"!==this.baseURL&&(e=this.baseURL+e),e},csvUrl(){let e=`/download/backtest/csv/${this.results.generalInfo.session_id}?token=${this.auth_key}`;return"/"!==this.baseURL&&(e=this.baseURL+e),e},jsonUrl(){let e=`/download/backtest/json/${this.results.generalInfo.session_id}?token=${this.auth_key}`;return"/"!==this.baseURL&&(e=this.baseURL+e),e},hasExecutedTrades(){return this.results.metrics.length>0},...(0,l.rn)(c.h,["isInitiated","baseURL"]),auth_key(){return sessionStorage.auth_key},remainingTimeText(){return be.Z.remainingTimeText(this.results.progressbar.estimated_remaining_seconds)}},watch:{form:{handler(){be.Z.localStorageSet("backtestForm",this.form)},deep:!0}},methods:{...(0,l.nv)(Ce.D,["addTab","startInNewTab","start","cancel","rerun","newBacktest"]),copyInfoLogs(){const e=document.querySelector("#copy-info-logs");e.setAttribute("type","text"),e.select(),document.execCommand("copy"),this.copiedLogsInfo=!0,e.setAttribute("type","hidden"),window.getSelection().removeAllRanges(),setTimeout((()=>{this.copiedLogsInfo=!1}),3e3)}}},yt=(0,L.Z)(bt,[["render",ot]]),ft=yt,xt={name:"Backtest",components:{Tabs:ve["default"],BacktestTab:ft},computed:{...(0,l.Ah)(Ce.D,["tabs"]),pageId(){return parseInt(this.$route.params.id)}}},vt=(0,L.Z)(xt,[["render",Te]]),wt=vt,kt={class:"max-w-6xl w-full mx-auto px-4 py-5"},_t=(0,o._)("div",{class:"bg-pink-500"},null,-1),Tt=(0,o._)("div",null,null,-1),Ct=(0,o._)("div",null,null,-1),jt=(0,o._)("div",null,null,-1),Dt=(0,o._)("h1",{class:"mb-1 font-bold"},"Charts",-1),It=(0,o._)("h2",{class:"mb-4"}," Equity curve ",-1);function St(e,t,s,r,a,n){const i=(0,o.up)("EquityCurve");return(0,o.wg)(),(0,o.iD)("div",kt,[_t,Tt,Ct,jt,Dt,It,(0,o.Wm)(i,{class:"mb-8","equity-curve":a.equityCurve},null,8,["equity-curve"]),(0,o._)("button",{class:"btn btn-primary",onClick:t[0]||(t[0]=(...e)=>n.getRandomData&&n.getRandomData(...e))}," Get random data ")])}const Lt=[{value:1e4,time:1612410540},{value:11240.231560725342,time:1612420320},{value:254369.4912485959,time:1612602780},{value:-489028.803655967,time:1612663320},{value:-484197.7802230198,time:1612685580},{value:-244547.05983960393,time:1612788420},{value:-206530.29565983053,time:1612817340},{value:1451947.0971254236,time:1613433600}],Wt=[{time:16225056e5,value:1e4},{time:1622592e6,value:9684.452381828},{time:16226784e5,value:10106.481005982003},{time:16227648e5,value:10068.463634272},{time:16228512e5,value:9917.305238247001},{time:16229376e5,value:10371.068634044},{time:1623024e6,value:10711.963949255003}],Et=[{time:16225056e5,value:11e3},{time:1622592e6,value:19684.452381828},{time:16226784e5,value:12106.481005982003},{time:16227648e5,value:13068.463634272},{time:16228512e5,value:14917.305238247001},{time:16229376e5,value:11371.068634044},{time:1623024e6,value:11711.963949255003}],qt=[{closed_at:161242032e4,PNL_percentage:67.34726608477291,holding_period:9780,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:2},{closed_at:161260278e4,PNL_percentage:411.84403683655006,holding_period:173760,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:12},{closed_at:161266332e4,PNL_percentage:-119.00510807164196,holding_period:29040,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:7},{closed_at:161268558e4,PNL_percentage:131.8049098640655,holding_period:20880,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:4},{closed_at:161278842e4,PNL_percentage:356.68583922713884,holding_period:91440,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:12},{closed_at:161281734e4,PNL_percentage:133.3518678930272,holding_period:9060,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:2},{closed_at:16134336e5,PNL_percentage:361.6758449717392,holding_period:573900,type:"long",symbol:"BTC-USDT",strategy_name:"ScalperLong08mV1",exchange:"Binance",ordersLength:11}],$t=[{time:1612410540,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612420320,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612429020,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612429140,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612429200,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612429920,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612451460,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612452120,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612569660,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612571820,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612574100,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612574700,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612581480,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612602780,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612634280,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612640340,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612642620,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612653060,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612653960,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612656060,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612663320,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612664700,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612673220,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612684140,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612685580,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612696980,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612700700,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612706700,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612710720,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612711140,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612714500,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612782060,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612788300,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612788300,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612788300,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612788360,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612788420,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612808280,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612817340,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1612859700,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612863300,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612868220,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612875540,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612960800,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1612971720,position:"inBar",color:"#28bd14",shape:"circle",text:""},{time:1613049540,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1613049720,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1613088720,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1613282520,position:"inBar",color:"#d43939",shape:"circle",text:""},{time:1613433600,position:"inBar",color:"#d43939",shape:"circle",text:""}],Zt=[{time:1612396800,open:38085.27,high:38288,low:37505.51,close:37896.36,volume:4575.3601739999995},{time:1612407600,open:37896.36,high:38015.5,low:37326.83,close:37578.23,volume:7987.953783999994},{time:1612418400,open:37577.31,high:38708.27,low:37015,close:37338.19,volume:16283.993044999992},{time:1612429200,open:37339.11,high:37922.78,low:36662.45,close:37321.75,volume:14145.931777999987},{time:161244e4,open:37319.43,high:37763.57,low:36626.86,close:36795.15,volume:11015.717127999997},{time:1612450800,open:36795.15,high:37070,low:36161.95,close:36884.34,volume:12896.781704000003},{time:1612461600,open:36884.34,high:37783.83,low:36761.89,close:37613.31,volume:9095.971158999997},{time:1612472400,open:37613.32,high:37729.82,low:36841.77,close:36936.66,volume:7619.473993999996},{time:1612483200,open:36936.65,high:37300,low:36570,close:36958.28,volume:8018.692338999998},{time:1612494e3,open:36958.33,high:37499,low:36909.71,close:37065.97,volume:6247.534039000004},{time:1612504800,open:37065.98,high:37800,low:37021.8,close:37705.27,volume:9092.729166},{time:1612515600,open:37705.27,high:37769.85,low:37200,close:37691.32,volume:7006.510337000003},{time:1612526400,open:37691.32,high:38310.12,low:37527.14,close:38095.02,volume:12273.787349999995},{time:1612537200,open:38095.14,high:38288.19,low:37655.17,close:37894.61,volume:10333.85052},{time:1612548e3,open:37894.61,high:37922.44,low:37230,close:37740.39,volume:8181.450186000005},{time:1612558800,open:37740.4,high:38309,low:37652.79,close:38290.24,volume:5526.780336999998},{time:1612569600,open:38289.32,high:39535.36,low:38215.94,close:39382.1,volume:21313.304470000006},{time:1612580400,open:39383.26,high:39666,low:38600,close:39014.73,volume:9691.425624000001},{time:1612591200,open:39015.08,high:39699.69,low:38989.9,close:39425.02,volume:8423.735182999999},{time:1612602e3,open:39427,high:40479.86,low:39400,close:40199.99,volume:15148.28918499999},{time:1612612800,open:40199.52,high:40574.85,low:39836.72,close:40268.44,volume:10721.810113000003},{time:1612623600,open:40268.44,high:40955.51,low:40134.8,close:40197.01,volume:12784.859879000009},{time:1612634400,open:40197.01,high:40444.44,low:39572.74,close:40087.4,volume:10511.726708999999},{time:1612645200,open:40087.4,high:40469.19,low:39035.33,close:39186.94,volume:10162.160033999997},{time:1612656e3,open:39181.01,high:39611.04,low:38344,close:38747.31,volume:13707.28734499999},{time:1612666800,open:38747.31,high:38926.58,low:37923,close:38511,volume:9812.728970000004},{time:1612677600,open:38511.01,high:39529,low:38282.44,close:39496.96,volume:9350.554096999998},{time:1612688400,open:39496.96,high:39700,low:38762.16,close:39046.6,volume:8992.942919999998},{time:1612699200,open:39044.37,high:39272.69,low:38162.87,close:38214.98,volume:11106.280856000003},{time:161271e4,open:38215.01,high:38395.26,low:37351,close:37870.62,volume:15738.598312999995},{time:1612720800,open:37870.63,high:38492.82,low:37660.97,close:38471.95,volume:8048.343649999998},{time:1612731600,open:38471.96,high:39080,low:38285.1,close:38795.69,volume:7606.943556},{time:1612742400,open:38795.69,high:39130,low:38149,close:38249,volume:7743.556228000002},{time:1612753200,open:38249,high:38872,low:37988.89,close:38677.47,volume:7821.605630000001},{time:1612764e3,open:38677.84,high:39391.78,low:38620,close:39175.38,volume:7502.539377000001},{time:1612774800,open:39175.38,high:39498.99,low:38844.75,close:39423.08,volume:8638.200727000005},{time:1612785600,open:39423.08,high:44918,low:39094.01,close:43558.73,volume:47869.57505800001},{time:1612796400,open:43560.93,high:44280,low:42521.62,close:43079.07,volume:22273.528672999997},{time:1612807200,open:43079.08,high:44350,low:42554.71,close:44151.07,volume:12970.861185000002},{time:1612818e3,open:44151.08,high:46794.45,low:43898.01,close:46374.87,volume:23769.822051000006},{time:1612828800,open:46374.86,high:47498,low:45567,close:45707.38,volume:22809.518822000005},{time:1612839600,open:45707.39,high:47219.13,low:45500,close:46850.12,volume:11770.070168999993},{time:1612850400,open:46852.68,high:48142.19,low:46563.31,close:47109.51,volume:19047.00542399999},{time:1612861200,open:47106.59,high:47160,low:45560.97,close:46380.92,volume:13653.448644999995},{time:1612872e3,open:46390.95,high:46806.41,low:44961.09,close:46624.44,volume:15771.822876000004},{time:1612882800,open:46624.33,high:47110.72,low:46011,close:46483.67,volume:13524.73249300001},{time:1612893600,open:46484.23,high:47499.43,low:46254.02,close:47084.17,volume:10653.707161000002},{time:1612904400,open:47084.16,high:47461.06,low:46201.37,close:46420.42,volume:8269.556040000005},{time:1612915200,open:46420.42,high:46900,low:45979.58,close:46276.51,volume:9942.923362},{time:1612926e3,open:46276.52,high:46743.87,low:45589.98,close:46131.99,volume:10244.634512999995},{time:1612936800,open:46132,high:46944.07,low:46106.04,close:46668.89,volume:9990.731432999995},{time:1612947600,open:46668.89,high:47310,low:46277.31,close:46586.56,volume:10442.731286999999},{time:1612958400,open:46586.55,high:46593.34,low:44500,close:44954.12,volume:20625.967513},{time:1612969200,open:44954.13,high:45227.27,low:43727,close:44963.31,volume:18960.178376999997},{time:161298e4,open:44963.32,high:45240.7,low:44400,close:44555.59,volume:9904.701317000001},{time:1612990800,open:44555.59,high:45322.09,low:44355,close:44807.58,volume:7042.314421999995},{time:1613001600,open:44807.58,high:45051.27,low:43994.02,close:44582.07,volume:7762.676823},{time:1613012400,open:44582.07,high:44999,low:44507,close:44641.72,volume:2359.4098530000006},{time:1613023200,open:44641.71,high:45129.59,low:44397.62,close:45017.02,volume:7826.256129},{time:1613034e3,open:45017.01,high:46546.47,low:44789.11,close:46061.49,volume:12199.760736000002},{time:1613044800,open:46061.48,high:48399,low:46060.03,close:47864.81,volume:22278.318602},{time:1613055600,open:47864.81,high:48298,low:46900,close:47366.42,volume:13416.649687},{time:1613066400,open:47366.43,high:48678.9,low:47e3,close:47027.49,volume:12780.558052999997},{time:1613077200,open:47027.49,high:48125.58,low:46542.29,close:47969.51,volume:10937.451589999997},{time:1613088e3,open:47968.66,high:48985.8,low:47721,close:47935.66,volume:12949.844946999987},{time:1613098800,open:47935.66,high:47988.49,low:46888,close:47257.09,volume:10593.739988000003},{time:1613109600,open:47257.09,high:47700,low:46789,close:47117.86,volume:9811.544634000002},{time:1613120400,open:47117.86,high:47999,low:47027.03,close:47562.42,volume:8343.943457},{time:1613131200,open:47560.06,high:48140,low:46125,close:46547.5,volume:14904.863322},{time:1613142e3,open:46542.6,high:47980,low:46525.25,close:47713.82,volume:12799.143487000005},{time:1613152800,open:47713.83,high:47800,low:46915.32,close:47577.49,volume:8802.413042000004},{time:1613163600,open:47577.49,high:48150,low:47155,close:47287.6,volume:7664.542871999995},{time:1613174400,open:47298.15,high:47944.84,low:47200,close:47839.77,volume:7196.922627999996},{time:1613185200,open:47839.77,high:48150,low:47397.71,close:47888,volume:7035.967839999999},{time:1613196e3,open:47887.99,high:47922.22,low:46618,close:47429.93,volume:8892.624694000006},{time:1613206800,open:47429.92,high:47569.03,low:46251,close:46589.2,volume:12450.285925},{time:1613217600,open:46586.23,high:47209.25,low:46202.53,close:46946.9,volume:9755.21924},{time:1613228400,open:46946.67,high:47400.14,low:46735.83,close:46855.24,volume:7970.953213},{time:1613239200,open:46855.23,high:47086.92,low:46653.58,close:46934.06,volume:5274.300494000004},{time:161325e4,open:46934.07,high:47397.36,low:46700.38,close:47153.69,volume:5191.823385000001},{time:1613260800,open:47156.78,high:47730,low:47014.17,close:47378.87,volume:8311.619846000005},{time:1613271600,open:47378.87,high:48948,low:47204.98,close:48929.18,volume:10315.533145},{time:1613282400,open:48929.18,high:49404.94,low:48389.55,close:48710.17,volume:13167.243362},{time:1613293200,open:48710.17,high:49349.76,low:48610.86,close:49055.16,volume:8534.28841},{time:1613304e3,open:49055.17,high:49707.43,low:48449.76,close:48757.38,volume:12569.785477000005},{time:1613314800,open:48757.39,high:49100,low:48101.38,close:48619.19,volume:9046.312633000001},{time:1613325600,open:48619.2,high:49e3,low:48400.31,close:48929.5,volume:5454.569773},{time:1613336400,open:48929.5,high:49300,low:48505.79,close:48577.79,volume:6336.122980999998},{time:1613347200,open:48580.47,high:49010.92,low:45570.79,close:46874.02,volume:18123.595116999997},{time:1613358e3,open:46874.01,high:47269.09,low:46174.78,close:46722.49,volume:12091.616886999996},{time:1613368800,open:46722.48,high:47772,low:46683.02,close:47599.99,volume:8306.090349999997},{time:1613379600,open:47600,high:47999,low:47201.27,close:47802.66,volume:7989.113143000002},{time:1613390400,open:47802.67,high:48219.23,low:47423.99,close:47564.16,volume:9366.911330000004},{time:1613401200,open:47563.58,high:48800,low:47536.15,close:48562.31,volume:8763.713202},{time:1613412e3,open:48562.31,high:48801,low:48342.22,close:48580.99,volume:7049.480193},{time:1613422800,open:48581,high:48750,low:47643,close:47911.1,volume:7707.636473999998}];var Rt=s(6486),Ot=s.n(Rt);const Ut={name:"Test",data(){return{equityCurve:Wt,trades:qt,orders:$t,candles:Zt}},methods:{getRandomData(){const e=[Lt,Wt,Et];this.equityCurve=e[(0,Rt.random)(0,2)]}}},Bt=(0,L.Z)(Ut,[["render",St]]),Mt=Bt;function zt(e,t,s,r,a,n){(0,o.up)("Tabs");const i=(0,o.up)("LiveTab");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.kq)("",!0),e.tabs[n.pageId]?((0,o.wg)(),(0,o.j4)(i,{key:1,form:e.tabs[n.pageId].form,results:e.tabs[n.pageId].results,modals:e.tabs[n.pageId].modals},null,8,["form","results","modals"])):(0,o.kq)("",!0)],64)}var At=s(4922);const Pt=["value"],Vt=["value"],Ht={key:0,class:"flex flex-col items-center justify-center select-none mt-[10%]"},Ft=["textContent"],Nt={class:"mt-8"},Yt=(0,o.Uk)(" View Logs "),Kt=(0,o.Uk)(" Cancel "),Jt={key:1,class:"mx-auto container mt-8"},Xt={key:0,"data-cy":"live-page-content"},Gt={class:"grid grid-cols-1 gap-6"},Qt={key:1},es={key:0,class:"mb-8"},ts={key:0},ss={key:0},rs=(0,o.Uk)(" New session "),as=["disabled"],os={key:1,"data-cy":"live-action-button"},ns=(0,o.Uk)(" Start "),is={key:1,class:"my-8 border-2 dark:border-gray-600 rounded-full"},ls={key:2,class:"grid grid-cols-1 gap-6 border dark:border-gray-600 rounded py-4 px-6 select-none"},cs={class:"flex justify-between items-center"},ds=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"Current Time:",-1),us={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},ms={class:"flex justify-between items-center"},gs=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"Started:",-1),ps={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},hs={class:"flex justify-between items-center"},bs=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"Started/Current Balance:",-1),ys={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},fs={class:"flex justify-between items-center"},xs=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"Debug Mode:",-1),vs={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},ws={class:"flex justify-between items-center"},ks=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"Paper Trade:",-1),_s={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},Ts={class:"flex justify-between items-center"},Cs=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"PNL:",-1),js={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},Ds={class:"flex justify-between items-center"},Is=(0,o._)("div",{class:"text-sm font-medium text-gray-500 dark:text-gray-400 truncate"},"Trades:",-1),Ss={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},Ls={class:"flex justify-between items-center"},Ws={class:"flex justify-start items-center"},Es=(0,o._)("span",null,"Info Logs:",-1),qs={class:"focus:outline-none flex justify-start items-center"},$s={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},Zs={class:"flex justify-between items-center"},Rs={class:"flex justify-start items-center"},Os=(0,o._)("span",null,"Error Logs:",-1),Us={class:"focus:outline-none flex justify-start items-center"},Bs={class:"text-sm font-semibold text-gray-900 dark:text-gray-100"},Ms={key:3};function zs(e,t,s,r,a,n){const i=(0,o.up)("Logs"),l=(0,o.up)("CheckIcon"),c=(0,o.up)("ClipboardIcon"),d=(0,o.up)("SlideOver"),u=(0,o.up)("ConfirmModal"),m=(0,o.up)("CircleProgressbar"),g=(0,o.up)("ClipboardListIcon"),p=(0,o.up)("BanIcon"),h=(0,o.up)("Exception"),b=(0,o.up)("Routes"),y=(0,o.up)("Divider"),f=(0,o.up)("ToggleButton"),x=(0,o.up)("CandlesChart"),v=(0,o.up)("MultipleValuesTable"),w=(0,o.up)("PlusSmIcon"),k=(0,o.up)("LightningBoltIcon"),_=(0,o.up)("KeyValueTable"),T=(0,o.up)("LayoutWithSidebar");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(d,{name:"infoLogs",object:s.modals,title:"Info Logs"},{default:(0,o.w5)((()=>[(0,o.Wm)(i,{logs:s.results.infoLogs},null,8,["logs"])])),buttons:(0,o.w5)((()=>[(0,o._)("button",{class:"btn-nav",onClick:t[0]||(t[0]=(...e)=>n.copyInfoLogs&&n.copyInfoLogs(...e))},[a.copiedLogsInfo?((0,o.wg)(),(0,o.j4)(l,{key:0,class:"h-6 w-6","aria-hidden":"true"})):(0,o.kq)("",!0),a.copiedLogsInfo||0==s.results.infoLogs.length?(0,o.kq)("",!0):((0,o.wg)(),(0,o.j4)(c,{key:1,class:"h-6 w-6","aria-hidden":"true"}))]),a.displayInfo?((0,o.wg)(),(0,o.iD)("textarea",{key:0,id:"copy-info-logs",class:"fixed left-0 opacity-0",value:s.results.infoLogs},null,8,Pt)):(0,o.kq)("",!0)])),_:1},8,["object"]),(0,o.Wm)(d,{name:"errorLogs",object:s.modals,title:"Error Logs"},{default:(0,o.w5)((()=>[(0,o.Wm)(i,{logs:s.results.errorLogs},null,8,["logs"])])),buttons:(0,o.w5)((()=>[(0,o._)("button",{class:"btn-nav",onClick:t[1]||(t[1]=(...e)=>n.copyErrorLogs&&n.copyErrorLogs(...e))},[a.copiedErrorLogs?((0,o.wg)(),(0,o.j4)(l,{key:0,class:"h-6 w-6","aria-hidden":"true"})):(0,o.kq)("",!0),a.copiedErrorLogs||0==s.results.errorLogs.length?(0,o.kq)("",!0):((0,o.wg)(),(0,o.j4)(c,{key:1,class:"h-6 w-6","aria-hidden":"true"}))]),a.displayErrors?((0,o.wg)(),(0,o.iD)("textarea",{key:0,id:"copy-error-logs",type:"hidden",value:s.results.errorLogs,class:"fixed left-0 opacity-0"},null,8,Vt)):(0,o.kq)("",!0)])),_:1},8,["object"]),(0,o.Wm)(u,{title:"Termination Confirm",description:"Are you sure you want to terminate this session?",type:"info",object:s.modals,name:"terminationConfirm"},{default:(0,o.w5)((()=>[(0,o._)("button",{class:"btn-danger ml-2",onClick:t[2]||(t[2]=t=>e.stop(e.$route.params.id))},"Terminate")])),_:1},8,["object"]),s.results.booting?((0,o.wg)(),(0,o.iD)("div",Ht,[(0,o._)("div",null,[(0,o.Wm)(m,{progress:s.results.progressbar.current},null,8,["progress"])]),s.results.exception.error?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("h3",{key:0,class:"mt-8 animate-pulse",textContent:(0,B.zw)(n.remainingTimeText)},null,8,Ft)),(0,o._)("div",Nt,[s.form.debug_mode?((0,o.wg)(),(0,o.iD)("button",{key:0,class:"flex justify-center items-center btn-primary mb-4 w-64",onClick:t[3]||(t[3]=e=>s.modals.infoLogs=!0)},[(0,o.Wm)(g,{class:"w-5 h-5 mr-2"}),Yt])):(0,o.kq)("",!0),(0,o._)("button",{"data-cy":"live-cancel-button",class:"flex justify-center items-center btn-secondary w-64",onClick:t[4]||(t[4]=t=>e.cancel(e.$route.params.id))},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),Kt])]),s.results.exception.error?((0,o.wg)(),(0,o.iD)("div",Jt,[(0,o.Wm)(h,{title:s.results.exception.error,content:s.results.exception.traceback,mode:"live","debug-mode":s.form.debug_mode,"session-id":s.results.generalInfo.session_id},null,8,["title","content","debug-mode","session-id"])])):(0,o.kq)("",!0)])):((0,o.wg)(),(0,o.j4)(T,{key:1},{left:(0,o.w5)((()=>[s.results.booting||s.results.monitoring||s.results.showResults?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",Xt,[e.isInitiated?((0,o.wg)(),(0,o.j4)(b,{key:0,form:s.form,results:s.results},null,8,["form","results"])):(0,o.kq)("",!0),(0,o.Wm)(y,{class:"mt-16",title:"Options"}),(0,o._)("div",Gt,[(0,o.Wm)(f,{object:s.form,name:"debug_mode",title:"Debug Mode",description:"Logs more details, helpful for debugging. Not recommended for beginners."},null,8,["object"]),(0,o.Wm)(f,{object:s.form,name:"paper_mode",title:"Paper Trade",description:"Trade in real-time using actual exchange data with PAPER money."},null,8,["object"])])])),s.results.monitoring?((0,o.wg)(),(0,o.iD)("div",Qt,[s.results.exception.error?((0,o.wg)(),(0,o.iD)("div",es,[(0,o.Wm)(h,{title:s.results.exception.error,content:s.results.exception.traceback,mode:"live","debug-mode":s.form.debug_mode,"session-id":s.results.generalInfo.session_id},null,8,["title","content","debug-mode","session-id"])])):(0,o.kq)("",!0),(0,o._)("div",null,[s.results.candles.length?((0,o.wg)(),(0,o.j4)(x,{key:0,candles:s.results.candles,results:s.results,form:s.form},null,8,["candles","results","form"])):(0,o.kq)("",!0)]),(0,o.Wm)(y,{class:"mt-12",title:"Routes"}),(0,o.Wm)(v,{data:s.results.routes,header:""},null,8,["data"]),(0,o.Wm)(y,{class:"mt-12",title:"Positions"}),(0,o.Wm)(v,{data:s.results.positions,header:""},null,8,["data"]),(0,o.Wm)(y,{class:"mt-12",title:"Orders"}),(0,o.Wm)(v,{data:s.results.orders,header:""},null,8,["data"])])):(0,o.kq)("",!0)])),right:(0,o.w5)((()=>[s.results.booting?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",ts,[s.results.monitoring?((0,o.wg)(),(0,o.iD)("div",ss,[s.results.finished?((0,o.wg)(),(0,o.iD)("button",{key:0,class:"flex justify-center items-center btn-primary text-center mb-4 w-full",onClick:t[5]||(t[5]=t=>e.newLive(e.$route.params.id))},[(0,o.Wm)(w,{class:"w-5 h-5 mr-2"}),rs])):((0,o.wg)(),(0,o.iD)("button",{key:1,disabled:s.results.terminating,class:"flex items-center justify-center btn-cancel text-center mr-2 w-full mb-4",onClick:t[6]||(t[6]=e=>s.modals.terminationConfirm=!0)},[(0,o.Wm)(p,{class:"w-5 h-5 mr-2"}),(0,o.Uk)(" "+(0,B.zw)(s.results.terminating?"Terminating...":"Terminate"),1)],8,as))])):((0,o.wg)(),(0,o.iD)("div",os,[(0,o._)("button",{"data-cy":"live-start-button",class:"flex justify-center items-center btn-primary text-center mr-2 w-full mb-4",onClick:t[7]||(t[7]=t=>e.start(e.$route.params.id))},[(0,o.Wm)(k,{class:"w-5 h-5 mr-2"}),ns])]))])),s.results.monitoring?((0,o.wg)(),(0,o.iD)("hr",is)):(0,o.kq)("",!0),s.results.monitoring?((0,o.wg)(),(0,o.iD)("dl",ls,[(0,o._)("div",cs,[ds,(0,o._)("div",us,(0,B.zw)(r.timestampToTime(s.results.generalInfo.current_time)),1)]),(0,o._)("div",ms,[gs,(0,o._)("div",ps,(0,B.zw)(r.timestampToTime(s.results.generalInfo.started_at)),1)]),(0,o._)("div",hs,[bs,(0,o._)("div",ys,(0,B.zw)(`${s.results.generalInfo.started_balance}/${s.results.generalInfo.current_balance}`),1)]),(0,o._)("div",fs,[xs,(0,o._)("div",vs,(0,B.zw)(s.results.generalInfo.debug_mode),1)]),(0,o._)("div",ws,[ks,(0,o._)("div",_s,(0,B.zw)(s.results.generalInfo.paper_mode),1)]),(0,o._)("div",Ts,[Cs,(0,o._)("div",js,(0,B.zw)(`${s.results.generalInfo.pnl} USDT (${s.results.generalInfo.pnl_perc}%)`),1)]),(0,o._)("div",Ds,[Is,(0,o._)("div",Ss,(0,B.zw)(s.results.generalInfo.count_trades),1)]),(0,o._)("div",Ls,[(0,o._)("div",Ws,[(0,o._)("button",{class:"text-sm font-medium text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300 truncate flex items-center hover:underline cursor-pointer focus:outline-none",onClick:t[8]||(t[8]=e=>s.modals.infoLogs=!0)},[Es,(0,o._)("div",qs,[(0,o.Wm)(g,{class:"w-6 h-6 ml-2"})])])]),(0,o._)("div",$s,(0,B.zw)(s.results.generalInfo.count_info_logs),1)]),(0,o._)("div",Zs,[(0,o._)("div",Rs,[(0,o._)("button",{class:"text-sm font-medium text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300 truncate flex items-center hover:underline cursor-pointer focus:outline-none",onClick:t[9]||(t[9]=e=>s.modals.errorLogs=!0)},[Os,(0,o._)("div",Us,[(0,o.Wm)(g,{class:"w-6 h-6 ml-2 cursor-pointer"})])])]),(0,o._)("div",Bs,(0,B.zw)(s.results.generalInfo.count_error_logs),1)])])):(0,o.kq)("",!0),s.results.monitoring&&s.results.watchlist.length?((0,o.wg)(),(0,o.iD)("div",Ms,[(0,o.Wm)(y,{class:"mt-8",title:"Watch List"}),(0,o.Wm)(_,{data:s.results.watchlist},null,8,["data"])])):(0,o.kq)("",!0)])),_:1}))],64)}var As=s(596),Ps=s(7345),Vs=s(9191),Hs=s(7074),Fs=s(9233),Ns=s(8641),Ys=s(7378);const Ks={name:"LiveTab",components:{KeyValueTable:Ys["default"],Divider:ht["default"],ToggleButton:pt["default"],LayoutWithSidebar:pe,Logs:nt["default"],ClipboardListIcon:As.Z,ConfirmModal:Hs["default"],SlideOver:gt["default"],CircleProgressbar:Fs["default"],Exception:Ns["default"],MultipleValuesTable:it["default"],ClipboardIcon:Ps.Z,CheckIcon:Vs.Z,LightningBoltIcon:se.Z,PlusSmIcon:re.Z,BanIcon:ae.Z},props:{form:{type:Object,required:!0},results:{type:Object,required:!0},modals:{type:Object,required:!0}},setup(){return{timestampToTime:be.Z.timestampToTime}},data(){return{displayInfo:!1,displayErrors:!1,copiedLogsInfo:!1,copiedErrorLogs:!1}},computed:{...(0,l.rn)(c.h,["isInitiated"]),...(0,l.rn)(c.h,{navModals:"modals"}),remainingTimeText(){return 0===Math.round(this.results.progressbar.estimated_remaining_seconds)?"Please wait...":`${Math.round(this.results.progressbar.estimated_remaining_seconds)} seconds remaining...`}},watch:{form:{handler(){be.Z.localStorageSet("liveForm",this.form)},deep:!0}},methods:{...(0,l.nv)(At.I,["addTab","startInNewTab","start","cancel","stop","newLive"]),copyInfoLogs(){this.displayInfo=!0,setTimeout((()=>{const e=document.querySelector("#copy-info-logs");e.setAttribute("type","text"),e.select(),document.execCommand("copy"),this.copiedLogsInfo=!0,e.setAttribute("type","hidden"),window.getSelection().removeAllRanges(),this.displayInfo=!1}),10),setTimeout((()=>{this.copiedLogsInfo=!1}),3e3)},copyErrorLogs(){this.displayErrors=!0,setTimeout((()=>{const e=document.querySelector("#copy-error-logs");e.setAttribute("type","text"),e.select(),document.execCommand("copy"),this.copiedErrorLogs=!0,e.setAttribute("type","hidden"),window.getSelection().removeAllRanges(),this.displayErrors=!1}),10),setTimeout((()=>{this.copiedErrorLogs=!1}),3e3)}}},Js=(0,L.Z)(Ks,[["render",zs]]),Xs=Js,Gs={name:"Live",components:{Tabs:ve["default"],LiveTab:Xs},computed:{...(0,l.Ah)(At.I,["tabs"]),pageId(){return parseInt(this.$route.params.id)}}},Qs=(0,L.Z)(Gs,[["render",zt]]),er=Qs;function tr(e,t,s,r,a,n){(0,o.up)("Tabs");const i=(0,o.up)("OptimizationTab");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.kq)("",!0),e.tabs[n.pageId]?((0,o.wg)(),(0,o.j4)(i,{key:1,form:e.tabs[n.pageId].form,results:e.tabs[n.pageId].results,modals:e.tabs[n.pageId].modals},null,8,["form","results","modals"])):(0,o.kq)("",!0)],64)}const sr=["value"],rr={key:0},ar={key:1,class:"mb-8"},or={key:2},nr={key:2,class:"mt-16"},ir={key:3},lr={class:"grid grid-cols-1 gap-6"},cr={class:"select-none"},dr=(0,o._)("p",{class:"text-sm text-gray-500 dark:text-gray-400"},[(0,o.Uk)(" The number that tells Jesse how many trades you would find optimal for your strategy in the targeted time period so that it can filter out those DNAs that cause too few trades. "),(0,o._)("a",{href:"https://docs.jesse.trade/docs/optimize/executing-the-optimize-mode.html",target:"_blank",class:"font-semibold hover:underline italic"},"More Details...")],-1),ur=(0,o._)("br",null,null,-1),mr={class:"flex items-center select-none flex-1 mb-4"},gr={key:0},pr=(0,o.Uk)(" Start "),hr={key:1,class:"flex flex-col items-center justify-center select-none"},br={class:"mb-8 w-full"},yr=["textContent"],fr={key:2},xr={class:"mb-8 w-full"},vr=(0,o.Uk)(" New session ");function wr(e,t,s,a,n,i){const l=(0,o.up)("Logs"),c=(0,o.up)("CheckIcon"),d=(0,o.up)("ClipboardIcon"),u=(0,o.up)("SlideOver"),m=(0,o.up)("Alert"),g=(0,o.up)("Exception"),p=(0,o.up)("Divider"),h=(0,o.up)("KeyValueTable"),b=(0,o.up)("TablePlaceholder"),y=(0,o.up)("MultipleValuesTable"),f=(0,o.up)("Routes"),x=(0,o.up)("ToggleButton"),v=(0,o.up)("NumberInput"),w=(0,o.up)("LightningBoltIcon"),k=(0,o.up)("CircleProgressbar"),_=(0,o.up)("ReplyIcon"),T=(0,o.up)("LayoutWithSidebar");return(0,o.wg)(),(0,o.iD)(o.HY,null,[s.form.debug_mode?((0,o.wg)(),(0,o.j4)(u,{key:0,name:"logsModal",object:s.results,title:"Logs"},{default:(0,o.w5)((()=>[(0,o.Wm)(l,{logs:s.results.infoLogs},null,8,["logs"])])),buttons:(0,o.w5)((()=>[(0,o._)("button",{class:"btn-nav",onClick:t[0]||(t[0]=(...e)=>i.copyInfoLogs&&i.copyInfoLogs(...e))},[n.copiedLogsInfo?((0,o.wg)(),(0,o.j4)(c,{key:0,class:"h-6 w-6","aria-hidden":"true"})):(0,o.kq)("",!0),n.copiedLogsInfo||0==s.results.infoLogs.length?(0,o.kq)("",!0):((0,o.wg)(),(0,o.j4)(d,{key:1,class:"h-6 w-6","aria-hidden":"true"}))]),(0,o._)("input",{id:"copy-info-logs",type:"hidden",value:s.results.infoLogs},null,8,sr)])),_:1},8,["object"])):(0,o.kq)("",!0),(0,o.Wm)(T,null,{left:(0,o.w5)((()=>[s.results.alert.message?((0,o.wg)(),(0,o.iD)("div",rr,[(0,o.Wm)(m,{data:s.results.alert},null,8,["data"])])):(0,o.kq)("",!0),s.results.exception.error&&s.results.executing?((0,o.wg)(),(0,o.iD)("div",ar,[(0,o.Wm)(g,{title:s.results.exception.error,content:s.results.exception.traceback,mode:"optimize"},null,8,["title","content"])])):(0,o.kq)("",!0),s.results.executing||s.results.showResults?((0,o.wg)(),(0,o.iD)("div",or,[(0,o.Wm)(p,{title:"Info"}),s.results.generalInfo.length?((0,o.wg)(),(0,o.j4)(h,{key:0,data:s.results.generalInfo},null,8,["data"])):((0,o.wg)(),(0,o.j4)(b,{key:1})),s.results.best_candidates.length?((0,o.wg)(),(0,o.iD)("div",nr,[(0,o.Wm)(p,{title:"Best DNA Candidates"}),(0,o.Wm)(y,{data:s.results.best_candidates,header:""},null,8,["data"])])):(0,o.kq)("",!0)])):(0,o.kq)("",!0),s.results.executing||s.results.showResults?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",ir,[e.isInitiated?((0,o.wg)(),(0,o.j4)(f,{key:0,form:s.form,results:s.results},null,8,["form","results"])):(0,o.kq)("",!0),(0,o.Wm)(p,{class:"mt-16",title:"Options"}),(0,o._)("div",lr,[(0,o.Wm)(x,{object:s.form,name:"debug_mode",title:"Debug Mode",description:"Displays detailed logs about the genetics algorithm. Use it if you are interested in the genetics algorithm and are familiar with its basics."},null,8,["object"])]),(0,o._)("div",cr,[(0,o.Wm)(p,{class:"mt-16",title:"Optimal Trades"}),dr,ur,(0,o.Wm)(v,{title:"Optimal number of trades:",name:"optimal_total",object:s.form},null,8,["object"])]),(0,o.Wm)(p,{class:"mt-16",title:"Duration"}),(0,o._)("div",mr,[(0,o.wy)((0,o._)("input",{id:"start_date","onUpdate:modelValue":t[1]||(t[1]=e=>s.form.start_date=e),type:"date",name:"start_date",class:"dark:bg-backdrop-dark dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 flex-1 cursor-pointer focus:ring-indigo-500 focus:border-indigo-500 dark:focus:border-indigo-400 flex justify-center items-center w-48 py-4 text-center sm:text-sm border-gray-300 rounded-l-md border-r-0"},null,512),[[r.nr,s.form.start_date]]),(0,o.wy)((0,o._)("input",{id:"finish_date","onUpdate:modelValue":t[2]||(t[2]=e=>s.form.finish_date=e),type:"date",name:"finish_date",class:"dark:border-gray-900 dark:hover:bg-gray-700 hover:bg-gray-50 dark:bg-backdrop-dark flex-1 cursor-pointer focus:ring-indigo-500 focus:border-indigo-500 dark:focus:border-indigo-400 flex justify-center items-center w-48 py-4 text-center sm:text-sm border-gray-300 rounded-r-md"},null,512),[[r.nr,s.form.finish_date]])])]))])),right:(0,o.w5)((()=>[s.results.executing||s.results.showResults?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",gr,[(0,o._)("div",null,[(0,o._)("button",{class:"flex justify-center items-center btn-primary text-center mb-4 w-full",onClick:t[3]||(t[3]=t=>e.start(e.$route.params.id))},[(0,o.Wm)(w,{class:"w-5 h-5 mr-2"}),pr])])])),s.results.executing&&!s.results.showResults?((0,o.wg)(),(0,o.iD)("div",hr,[(0,o._)("div",br,[(0,o._)("button",{class:"btn-cancel block mb-4 w-full",onClick:t[4]||(t[4]=t=>e.cancel(e.$route.params.id))}," Cancel ")]),(0,o._)("div",null,[(0,o.Wm)(k,{progress:s.results.progressbar.current},null,8,["progress"])]),s.results.exception.error||s.results.best_candidates.length?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("h3",{key:0,class:"mt-8 animate-pulse",textContent:(0,B.zw)(i.remainingTimeText)},null,8,yr))])):(0,o.kq)("",!0),s.results.showResults?((0,o.wg)(),(0,o.iD)("div",fr,[(0,o._)("div",xr,[(0,o._)("button",{class:"flex justify-center items-center btn-success text-center mb-4 w-full",onClick:t[5]||(t[5]=(...e)=>i.newSession&&i.newSession(...e))},[(0,o.Wm)(_,{class:"w-5 h-5 mr-2"}),vr])])])):(0,o.kq)("",!0)])),_:1})],64)}let kr=0;function _r(){return Ot().cloneDeep({id:++kr,name:"Tab 0",form:be.Z.getDefaultFromLocalStorage("optimizationForm",{start_date:"2021-01-01",finish_date:"2021-06-01",debug_mode:!1,export_csv:!1,export_json:!1,routes:[],extra_routes:[],optimal_total:50}),results:{showResults:!1,executing:!1,logsModal:!1,progressbar:{current:0,estimated_remaining_seconds:0},routes_info:[],best_candidates:[],metrics:[],generalInfo:{},infoLogs:"",exception:{error:"",traceback:""},alert:{message:"",type:""}}})}const Tr=(0,l.Q_)({id:"optimization",state:()=>({tabs:{1:_r()}}),actions:{addTab(){const e=_r();return this.tabs[e.id]=e,this.$router.push(`/optimization/${e.id}`)},startInNewTab(e){const t=_r();t.form=Ot().cloneDeep(this.tabs[e].form),this.tabs[t.id]=t,this.start(t.id)},start(e){this.tabs[e].results.progressbar.current=0,this.tabs[e].results.executing=!0,this.tabs[e].results.infoLogs="",this.tabs[e].results.exception.traceback="",this.tabs[e].results.exception.error="",this.tabs[e].results.alert.message="",this.tabs[e].results.alert.type="",this.tabs[e].results.metrics=[],this.tabs[e].results.generalInfo={},this.tabs[e].results.best_candidates=[],this.tabs[e].results.routes_info=[],this.tabs[e].results.showResults=!1;const t=(0,c.h)(),s={id:e,routes:this.tabs[e].form.routes,extra_routes:this.tabs[e].form.extra_routes,config:t.settings.optimization,start_date:this.tabs[e].form.start_date,finish_date:this.tabs[e].form.finish_date,optimal_total:this.tabs[e].form.optimal_total,debug_mode:this.tabs[e].form.debug_mode,export_csv:this.tabs[e].form.export_csv,export_json:this.tabs[e].form.export_json};I.Z.post("/optimization",s).catch((t=>{this.notyf.error(`[${t.response.status}]: ${t.response.statusText}`),this.tabs[e].results.executing=!1}))},cancel(e){this.tabs[e].results.exception.error?this.tabs[e].results.executing=!1:I.Z["delete"]("/optimization",{headers:{},data:{id:e}}).catch((e=>this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)))},rerun(e){this.tabs[e].results.showResults=!1,this.start(e)},newOptimization(e){this.tabs[e].results.showResults=!1},candlesInfoEvent(e,t){this.tabs[e].results.info=[["Period",t.duration],["Starting-Ending Date",`${be.Z.timestampToDate(t.starting_time)} => ${be.Z.timestampToDate(t.finishing_time)}`]]},routesInfoEvent(e,t){const s=[["Exchange","Symbol","Timeframe","Strategy"]];t.forEach((e=>{s.push([{value:e.exchange,style:""},{value:e.symbol,style:""},{value:e.timeframe,style:""},{value:e.strategy_name,style:""}])})),this.tabs[e].results.routes_info=s},progressbarEvent(e,t){this.tabs[e].results.progressbar=t},infoLogEvent(e,t){this.tabs[e].results.infoLogs+=`[${be.Z.timestampToTime(t.timestamp)}] ${t.message}\n`},exceptionEvent(e,t){this.tabs[e].results.exception.error=t.error,this.tabs[e].results.exception.traceback=t.traceback},generalInfoEvent(e,t){this.tabs[e].results.executing||(this.tabs[e].results.executing=!0),this.tabs[e].results.generalInfo=[["Started at",t.started_at],["Index",t.index],["Average strategy execution time",`${Ot().round(t.average_execution_seconds,2)} seconds`],["Trading route",t.trading_route]],"population_size"in t&&this.tabs[e].results.generalInfo.push(["Population size",t.population_size]),"iterations"in t&&this.tabs[e].results.generalInfo.push(["Iterations",t.iterations]),"solution_length"in t&&this.tabs[e].results.generalInfo.push(["Solution length",t.solution_length])},metricsEvent(e,t){this.tabs[e].results.metrics=null!==t?[["Total Closed Trades",t.total],["Total Net Profit",`${Ot().round(t.net_profit,2)} (${Ot().round(t.net_profit_percentage,2)}%)`],["Starting => Finishing Balance",`${Ot().round(t.starting_balance,2)} => ${Ot().round(t.finishing_balance,2)}`],["Open Trades",t.total_open_trades],["Total Paid Fees",Ot().round(t.fee,2)],["Max Drawdown",Ot().round(t.max_drawdown,2)],["Annual Return",`${Ot().round(t.annual_return,2)}%`],["Expectancy",`${Ot().round(t.expectancy,2)} (${Ot().round(t.expectancy_percentage,2)}%)`],["Avg Win | Avg Loss",`${Ot().round(t.average_win,2)} | ${Ot().round(t.average_loss,2)}`],["Ratio Avg Win / Avg Loss",Ot().round(t.open_pl,2)],["Win-rate",`${Ot().round(100*t.win_rate,2)}%`],["Longs | Shorts",`${Ot().round(t.longs_percentage,2)}% | ${Ot().round(t.shorts_percentage,2)}%`],["Avg Holding Time",t.average_holding_period],["Winning Trades Avg Holding Time",t.average_winning_holding_period],["Losing Trades Avg Holding Time",t.average_losing_holding_period],["Sharpe Ratio",Ot().round(t.sharpe_ratio,2)],["Calmar Ratio",Ot().round(t.calmar_ratio,2)],["Sortino Ratio",Ot().round(t.sortino_ratio,2)],["Omega Ratio",Ot().round(t.omega_ratio,2)],["Winning Streak",t.winning_streak],["Losing Streak",t.losing_streak],["Largest Winning Trade",Ot().round(t.largest_winning_trade,2)],["Largest Losing Trade",Ot().round(t.largest_losing_trade,2)],["Total Winning Trades",t.total_winning_trades],["Total Losing Trades",t.total_losing_trades]]:[]},terminationEvent(e){this.tabs[e].results.executing&&(this.tabs[e].results.executing=!1,this.notyf.success("Session terminated successfully"))},bestCandidatesEvent(e,t){console.log(e,t);const s=[["Rank","DNA","Fitness","Training-Testing Win-rate","Training-Testing total trades","Training-Testing PNL"]];t.forEach((e=>{s.push([{value:`#${e.rank}`,style:""},{value:e.dna,style:"",tag:"code"},{value:e.fitness,style:""},{value:`${e.training_win_rate}% | ${e.testing_win_rate}%`,style:""},{value:`${e.training_total_trades} | ${e.testing_total_trades}`,style:""},{value:`${e.training_pnl}% | ${e.testing_pnl}%`,style:""}])})),this.tabs[e].results.best_candidates=s},alertEvent(e,t){this.tabs[e].results.alert=t,this.tabs[e].results.executing=!1,this.tabs[e].results.showResults=!0}}});var Cr=s(6105);const jr={name:"OptimizationTab",components:{LayoutWithSidebar:pe,Logs:nt["default"],ToggleButton:pt["default"],MultipleValuesTable:it["default"],ClipboardIcon:lt.Z,CheckIcon:ct.Z,SlideOver:gt["default"],Routes:Cr["default"],Divider:ht["default"],CircleProgressbar:Fs["default"],Exception:Ns["default"],LightningBoltIcon:se.Z,ReplyIcon:ut.Z},props:{form:{type:Object,required:!0},results:{type:Object,required:!0}},data(){return{copiedLogsInfo:!1}},computed:{hasExecutedTrades(){return this.results.metrics.length>0},...(0,l.rn)(c.h,["isInitiated"]),auth_key(){return sessionStorage.auth_key},remainingTimeText(){return be.Z.remainingTimeText(this.results.progressbar.estimated_remaining_seconds)}},watch:{form:{handler(){be.Z.localStorageSet("optimizationForm",this.form)},deep:!0}},methods:{...(0,l.nv)(Tr,["addTab","startInNewTab","start","cancel","rerun","newOptimization"]),copyInfoLogs(){const e=document.querySelector("#copy-info-logs");e.setAttribute("type","text"),e.select(),document.execCommand("copy"),this.copiedLogsInfo=!0,e.setAttribute("type","hidden"),window.getSelection().removeAllRanges(),setTimeout((()=>{this.copiedLogsInfo=!1}),3e3)},newSession(){this.results.showResults=!1,this.results.executing=!1,this.results.progressbar.current=0,this.results.progressbar.estimated_remaining_seconds=0,this.results.alert.message="",this.results.alert.type=""}}},Dr=(0,L.Z)(jr,[["render",wr]]),Ir=Dr,Sr={name:"Optimization",components:{Tabs:ve["default"],OptimizationTab:Ir},computed:{...(0,l.Ah)(Tr,["tabs"]),pageId(){return parseInt(this.$route.params.id)}}},Lr=(0,L.Z)(Sr,[["render",tr]]),Wr=Lr,Er={class:"container select-none"},qr=(0,o._)("div",{class:"text-center mt-16"},[(0,o._)("h3",null,[(0,o.Uk)(" Need help? Check out the "),(0,o._)("a",{href:"http://docs.jesse.trade",class:"text-indigo-600 dark:text-indigo-400 hover:underline",target:"_blank"}," docs "),(0,o.Uk)(" or search the help center: ")])],-1),$r={role:"list",class:"border-gray-200 py-6 grid grid-cols-1 gap-6 sm:grid-cols-2"},Zr={class:"relative -m-2 p-2 flex items-center space-x-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 focus-within:ring-2 focus-within:ring-indigo-500"},Rr={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Or=["href"],Ur=(0,o._)("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Br=(0,o._)("span",{"aria-hidden":"true"}," →",-1),Mr={class:"mt-1 text-sm text-gray-600 dark:text-gray-400"};function zr(e,t,s,r,a,n){const i=(0,o.up)("HelpSearch");return(0,o.wg)(),(0,o.iD)("div",Er,[qr,(0,o.Wm)(i),(0,o._)("div",null,[(0,o._)("ul",$r,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(a.items,((e,t)=>((0,o.wg)(),(0,o.iD)("li",{key:t,class:"flow-root"},[(0,o._)("div",Zr,[(0,o._)("div",{class:(0,B.C_)([e.background,"flex-shrink-0 flex items-center justify-center h-16 w-16 rounded-lg"])},[((0,o.wg)(),(0,o.j4)((0,o.LL)(e.icon),{class:"h-6 w-6 text-white","aria-hidden":"true"}))],2),(0,o._)("div",null,[(0,o._)("h3",Rr,[(0,o._)("a",{href:e.url,target:"_blank",class:"focus:outline-none"},[Ur,(0,o.Uk)(" "+(0,B.zw)(e.title),1),Br],8,Or)]),(0,o._)("p",Mr,(0,B.zw)(e.description),1)])])])))),128))])])])}var Ar=s(5198),Pr=s(3124),Vr=s(6618),Hr=s(5168),Fr=s(6590),Nr=s(3264),Yr=s(4159);const Kr={class:"w-full flex justify-center"},Jr={class:"mb-4 mt-8 px-2 w-full md:w-2/3"},Xr={class:"relative"},Gr=(0,o._)("div",{class:"absolute left-2 inset-y-0 pl-3 flex items-center"},[(0,o._)("svg",{class:"fill-current h-6 w-6 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},[(0,o._)("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})])],-1),Qr={key:0,class:"relative"},ea={key:0,class:"w-full absolute bg-white p-2 mt-2 border border-gray-300 rounded shadow-md z-50"},ta=(0,o._)("div",{class:"py-4 px-4 text-gray-600"}," Searching ... ",-1),sa=[ta],ra={key:1,class:"w-full absolute bg-white p-2 mt-2 border border-gray-300 rounded shadow-md"},aa=(0,o._)("div",{class:"py-4 px-4 text-gray-600 flex items-center text-sm md:text-base"},[(0,o._)("span",{class:"mr-4 text-red-500"},[(0,o._)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[(0,o._)("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])]),(0,o.Uk)(" Something went wrong. ")],-1),oa=[aa],na={key:2,class:"w-full absolute bg-white px-2 py-2 mt-2 rounded shadow-lg border border-gray-300 max-h-64 overflow-y-auto z-50"},ia=["href"],la={class:"px-2 py-4 rounded text-gray-600 hover:bg-indigo-500 hover:text-white"},ca=(0,o._)("div",{class:"flex justify-end p-2"},[(0,o._)("img",{src:Yr,alt:"search by Algolia"})],-1),da={key:3,class:"w-full absolute bg-white p-2 mt-2 border border-gray-300 rounded shadow-md z-50"},ua=(0,o._)("div",{class:"py-4 px-4 text-gray-600 flex items-center text-sm md:text-base"},[(0,o._)("span",{class:"mr-4 text-yellow-300"},[(0,o._)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[(0,o._)("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])]),(0,o.Uk)(" No items were found for the entered phrase. ")],-1),ma=[ua];function ga(e,t,s,a,n,i){return(0,o.wg)(),(0,o.iD)("div",Kr,[(0,o._)("div",Jr,[(0,o._)("div",Xr,[Gr,(0,o.wy)((0,o._)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>n.query=e),class:"w-full pl-14 pr-4 py-4 rounded-full outline-none border-2 border-gray-200 focus:border-indigo-600 focus:ring-0 dark:bg-gray-800 dark:border-gray-900",type:"text",placeholder:"Search...",onInput:t[1]||(t[1]=e=>n.typing=!0)},null,544),[[r.nr,n.query]])]),n.query?((0,o.wg)(),(0,o.iD)("div",Qr,[n.loading?((0,o.wg)(),(0,o.iD)("div",ea,sa)):n.error&&n.showResults?((0,o.wg)(),(0,o.iD)("div",ra,oa)):0!=n.results.length&&n.showResults?((0,o.wg)(),(0,o.iD)("div",na,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(n.results,(e=>((0,o.wg)(),(0,o.iD)("div",{key:e.id},[(0,o._)("a",{href:"https://jesse.trade/help/faq/"+e.slug,target:"_blank"},[(0,o._)("div",la,(0,B.zw)(e.title),1)],8,ia)])))),128)),ca])):0===n.results.length&&n.showResults?((0,o.wg)(),(0,o.iD)("div",da,ma)):(0,o.kq)("",!0)])):(0,o.kq)("",!0)])])}var pa=s(9669),ha=s.n(pa);const ba={data(){return{showResults:!1,loading:!1,error:!1,results:"",typing:!1,query:""}},watch:{query:Ot().debounce((function(){this.typing=!1}),1e3),typing:function(e){!e&&this.query?this.searchProducts(this.query):this.results&&0===this.query.length&&(this.results=[],this.showResults=!1)}},methods:{searchProducts(e){this.error=!1,this.loading=!0,ha().get("https://jesse.trade/api/help/search",{params:{item:e}}).then((e=>{this.showResults=!0,this.results=e.data,this.loading=!1})).catch((()=>{this.showResults=!0,this.loading=!1,this.error=!0}))}}},ya=(0,L.Z)(ba,[["render",ga]]),fa=ya,xa={name:"Dashboard",components:{HelpSearch:fa},data(){return{items:[{title:"Docs",description:"Our friendly documentation is the best place to find information about Jesse",icon:Ar.Z,background:"bg-pink-500",url:"https://docs.jesse.trade/"},{title:"Tutorials",description:"Need step-by-step instructions? We have tutorials for for you",icon:Pr.Z,background:"bg-yellow-500",url:"https://jesse.trade/blog/tutorials/"},{title:"Discord",description:"Join our friendly Discord community filled with awesome quants",icon:Vr.Z,background:"bg-green-500",url:"https://jesse.trade/discord"},{title:"Github",description:"Curios to see the source code?",icon:Hr.Z,background:"bg-blue-500",url:"https://github.com/jesse-ai/jesse"},{title:"News",description:"Keep up with our latest developments",icon:Fr.Z,background:"bg-indigo-500",url:"https://jesse.trade/blog/news"},{title:"Roadmap",description:"Wanna know what’s coming next and when?",icon:Nr.Z,background:"bg-purple-500",url:"https://docs.jesse.trade/docs/roadmap.html"}]}},computed:{}},va=(0,L.Z)(xa,[["render",zr]]),wa=va,ka=(e,t,s)=>{const r=(0,c.h)();if(r.isConnected)s();else{const e=(0,o.YP)(r,(t=>{t.isConnected&&(e(),s())}),{deep:!0})}},_a=[{path:"/backtest",redirect:"/backtest/1"},{path:"/candles",redirect:"/candles/1"},{path:"/live",redirect:"/live/1"},{path:"/optimization",redirect:"/optimization/1"},{path:"/",component:wa,name:"Home",beforeEnter:ka},{path:"/candles/:id",component:_e,name:"Candles",beforeEnter:ka},{path:"/backtest/:id",component:wt,name:"Backtest",beforeEnter:ka},{path:"/live/:id",component:er,name:"Live",beforeEnter:ka},{path:"/optimization/:id",component:Wr,name:"Optimization",beforeEnter:ka},{path:"/test",component:Mt,name:"Test",beforeEnter:ka}],Ta=(0,R.p7)({history:(0,R.r5)("/"),mode:"hash",routes:_a}),Ca=Ta;var ja=s(5937),Da=s.n(ja);function Ia(){const e=(0,Ce.D)(),t=(0,U.e)(),s=(0,At.I)(),r=Tr();return new Map([["backtest.candles_info",[e.candlesInfoEvent]],["backtest.routes_info",[e.routesInfoEvent]],["backtest.progressbar",[e.progressbarEvent]],["backtest.metrics",[e.metricsEvent]],["backtest.hyperparameters",[e.hyperparametersEvent]],["backtest.info_log",[e.infoLogEvent]],["backtest.equity_curve",[e.equityCurveEvent]],["backtest.exception",[e.exceptionEvent]],["backtest.general_info",[e.generalInfoEvent]],["backtest.termination",[e.terminationEvent]],["backtest.alert",[e.alertEvent]],["candles.progressbar",[t.progressbarEvent]],["candles.alert",[t.alertEvent]],["candles.exception",[t.exceptionEvent]],["candles.termination",[t.terminationEvent]],["papertrade.progressbar",[s.progressbarEvent]],["livetrade.progressbar",[s.progressbarEvent]],["papertrade.positions",[s.positionsEvent]],["livetrade.positions",[s.positionsEvent]],["papertrade.order",[s.orderEvent]],["livetrade.order",[s.orderEvent]],["papertrade.general_info",[s.generalInfoEvent]],["livetrade.general_info",[s.generalInfoEvent]],["papertrade.watch_list",[s.watchlistEvent]],["livetrade.watch_list",[s.watchlistEvent]],["papertrade.current_candles",[s.currentCandlesEvent]],["livetrade.current_candles",[s.currentCandlesEvent]],["papertrade.info_log",[s.infoLogEvent]],["livetrade.info_log",[s.infoLogEvent]],["papertrade.error_log",[s.errorLogEvent]],["livetrade.error_log",[s.errorLogEvent]],["papertrade.error_log",[s.errorLogEvent]],["livetrade.error_log",[s.errorLogEvent]],["papertrade.exception",[s.exceptionEvent]],["livetrade.exception",[s.exceptionEvent]],["papertrade.unexpectedTermination",[s.unexpectedTerminationEvent]],["livetrade.unexpectedTermination",[s.unexpectedTerminationEvent]],["papertrade.termination",[s.terminationEvent]],["livetrade.termination",[s.terminationEvent]],["optimize.progressbar",[r.progressbarEvent]],["optimize.general_info",[r.generalInfoEvent]],["optimize.metrics",[r.metricsEvent]],["optimize.exception",[r.exceptionEvent]],["optimize.termination",[r.terminationEvent]],["optimize.alert",[r.alertEvent]],["optimize.best_candidates",[r.bestCandidatesEvent]]])}const Sa={install:(e,t)=>{const s=(0,c.h)(),r=setInterval((function(){if(s.isAuthenticated){let a=t.socketPath;window.Cypress&&(a="ws://127.0.0.1:8001/ws");const o=new(Da())(`${a}?token=${sessionStorage.auth_key}`,{packMessage:e=>JSON.stringify(e),unpackMessage:e=>JSON.parse(e),attachRequestId:(e,t)=>Object.assign({id:t},e),extractRequestId:e=>e&&e.id});let n=null,i=3;function l(){o.open().then((async()=>{s.isConnected=!0,n&&clearInterval(n),i<3&&e.notyf.success("WebSocket reconnected"),i=3})).catch((e=>{console.error("Socket encountered error.",e)}))}o.onClose.addListener((async()=>{console.log("Connection closed."),s.isConnected=!1,n&&clearInterval(n),i>0?n=setInterval((()=>{console.log("Trying to re-open web-socket"),i--,l()}),3e3):console.log("Socket can't re-establish connection!")})),o.onUnpackedMessage.addListener((async e=>{const t=e.event,s=e.data,r=e.id,a=Ia().get(t);void 0!==a&&a.forEach((e=>{e(r,s)}))})),e.config.globalProperties.$wsp=o,e.wsp=e.config.globalProperties.$wsp,l(),clearInterval(r)}}),1e3)}};var La=s(6685);const Wa={install:(e,t)=>{e.config.globalProperties.notyf=new La.Iq(t),e.notyf=e.config.globalProperties.notyf}},Ea=(0,l.WB)(),qa=(0,r.ri)(Z);qa.use(Ea),qa.use(Ca),qa.use(Wa,{duration:5e3,dismissible:!0,ripple:!1,position:{x:"right",y:"bottom"},types:[{type:"info",background:"#009efa"}]});let $a="";$a=("https:"===window.location.protocol?"wss://":"ws://")+window.location.host+"/ws",qa.use(Sa,{socketPath:$a}),Ea.use((({store:e})=>{e.$router=(0,a.Xl)(Ca),e.notyf=(0,a.Xl)(qa.notyf)}));const Za=s(9654);Za.keys().map((e=>qa.component(e.split("/").pop().split(".")[0],Za(e).default))),qa.mount("#app")},6299:(e,t,s)=>{"use strict";s.d(t,{D:()=>u});var r=s(6245),a=s(6486),o=s.n(a),n=s(9614),i=s(5603),l=s(2542);let c=0;function d(){return o().cloneDeep({id:++c,name:"Tab 0",form:n.Z.getDefaultFromLocalStorage("backtestForm",{start_date:"2021-01-01",finish_date:"2021-06-01",debug_mode:!1,export_chart:!1,export_tradingview:!1,export_full_reports:!1,export_csv:!1,export_json:!1,routes:[],extra_routes:[]}),results:{showResults:!1,executing:!1,logsModal:!1,progressbar:{current:0,estimated_remaining_seconds:0},routes_info:[],metrics:[],hyperparameters:[],generalInfo:{},infoLogs:"",exception:{error:"",traceback:""},charts:{equity_curve:[]},alert:{message:"",type:""}}})}const u=(0,r.Q_)({id:"backtest",state:()=>({tabs:{1:d()}}),actions:{addTab(){const e=d();return this.tabs[e.id]=e,this.$router.push(`/backtest/${e.id}`)},startInNewTab(e){const t=d();t.form=o().cloneDeep(this.tabs[e].form),this.tabs[t.id]=t,this.start(t.id)},start(e){this.tabs[e].results.progressbar.current=0,this.tabs[e].results.executing=!0,this.tabs[e].results.infoLogs="",this.tabs[e].results.exception.traceback="",this.tabs[e].results.exception.error="",this.tabs[e].results.alert.message="";const t=(0,l.h)();this.tabs[e].form.routes=this.tabs[e].form.routes.map((e=>(e.symbol=e.symbol.toUpperCase(),e))),this.tabs[e].form.extra_routes=this.tabs[e].form.extra_routes.map((e=>(e.symbol=e.symbol.toUpperCase(),e))),i.Z.post("/backtest",{id:e,routes:this.tabs[e].form.routes,extra_routes:this.tabs[e].form.extra_routes,config:t.settings.backtest,start_date:this.tabs[e].form.start_date,finish_date:this.tabs[e].form.finish_date,debug_mode:this.tabs[e].form.debug_mode,export_csv:this.tabs[e].form.export_csv,export_chart:this.tabs[e].form.export_chart,export_tradingview:this.tabs[e].form.export_tradingview,export_full_reports:this.tabs[e].form.export_full_reports,export_json:this.tabs[e].form.export_json}).catch((t=>{this.notyf.error(`[${t.response.status}]: ${t.response.statusText}`),this.tabs[e].results.executing=!1}))},cancel(e){this.tabs[e].results.exception.error?this.tabs[e].results.executing=!1:i.Z["delete"]("/backtest",{headers:{},data:{id:e}}).then((()=>{window.Cypress&&(this.tabs[e].results.executing=!1)})).catch((e=>this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)))},rerun(e){this.tabs[e].results.showResults=!1,this.start(e)},newBacktest(e){this.tabs[e].results.showResults=!1},candlesInfoEvent(e,t){this.tabs[e].results.info=[["Period",t.duration],["Starting-Ending Date",`${n.Z.timestampToDate(t.starting_time)} => ${n.Z.timestampToDate(t.finishing_time)}`]]},routesInfoEvent(e,t){const s=[["Exchange","Symbol","Timeframe","Strategy"]];t.forEach((e=>{s.push([{value:e.exchange,style:""},{value:e.symbol,style:""},{value:e.timeframe,style:""},{value:e.strategy_name,style:""}])})),this.tabs[e].results.routes_info=s},progressbarEvent(e,t){this.tabs[e].results.progressbar=t},infoLogEvent(e,t){this.tabs[e].results.infoLogs+=`[${n.Z.timestampToTime(t.timestamp)}] ${t.message}\n`},exceptionEvent(e,t){this.tabs[e].results.exception.error=t.error,this.tabs[e].results.exception.traceback=t.traceback},generalInfoEvent(e,t){this.tabs[e].results.generalInfo=t},hyperparametersEvent(e,t){this.tabs[e].results.hyperparameters=t},metricsEvent(e,t){this.tabs[e].results.metrics=null!==t?[["Total Closed Trades",t.total],["Total Net Profit",`${o().round(t.net_profit,2)} (${o().round(t.net_profit_percentage,2)}%)`],["Starting => Finishing Balance",`${o().round(t.starting_balance,2)} => ${o().round(t.finishing_balance,2)}`],["Open Trades",t.total_open_trades],["Total Paid Fees",o().round(t.fee,2)],["Max Drawdown",`${o().round(t.max_drawdown,2)}%`],["Annual Return",`${o().round(t.annual_return,2)}%`],["Expectancy",`${o().round(t.expectancy,2)} (${o().round(t.expectancy_percentage,2)}%)`],["Avg Win | Avg Loss",`${o().round(t.average_win,2)} | ${o().round(t.average_loss,2)}`],["Ratio Avg Win / Avg Loss",o().round(t.open_pl,2)],["Win-rate",`${o().round(100*t.win_rate,2)}%`],["Longs | Shorts",`${o().round(t.longs_percentage,2)}% | ${o().round(t.shorts_percentage,2)}%`],["Avg Holding Time",n.Z.secondsToHumanReadable(t.average_holding_period)],["Winning Trades Avg Holding Time",n.Z.secondsToHumanReadable(t.average_winning_holding_period)],["Losing Trades Avg Holding Time",n.Z.secondsToHumanReadable(t.average_losing_holding_period)],["Sharpe Ratio",o().round(t.sharpe_ratio,2)],["Calmar Ratio",o().round(t.calmar_ratio,2)],["Sortino Ratio",o().round(t.sortino_ratio,2)],["Omega Ratio",o().round(t.omega_ratio,2)],["Winning Streak",t.winning_streak],["Losing Streak",t.losing_streak],["Largest Winning Trade",o().round(t.largest_winning_trade,2)],["Largest Losing Trade",o().round(t.largest_losing_trade,2)],["Total Winning Trades",t.total_winning_trades],["Total Losing Trades",t.total_losing_trades]]:[]},equityCurveEvent(e,t){null===t?this.tabs[e].results.charts.equity_curve=[]:(this.tabs[e].results.charts.equity_curve=[],t.forEach((t=>{this.tabs[e].results.charts.equity_curve.push({value:t.balance,time:t.timestamp})}))),this.tabs[e].results.executing=!1,this.tabs[e].results.showResults=!0},terminationEvent(e){this.tabs[e].results.executing&&(this.tabs[e].results.executing=!1,this.notyf.success("Session terminated successfully"))},alertEvent(e,t){this.tabs[e].results.alert=t}}})},8214:(e,t,s)=>{"use strict";s.d(t,{e:()=>d});var r=s(6245),a=s(6486),o=s.n(a),n=s(9614),i=s(5603);let l=0;function c(){return o().cloneDeep({id:++l,name:"Tab 0",form:n.Z.getDefaultFromLocalStorage("candlesForm",{start_date:"2021-01-01",exchange:"",symbol:""}),results:{showResults:!1,executing:!1,progressbar:{current:0,estimated_remaining_seconds:0},metrics:[],infoLogs:"",exception:{error:"",traceback:""},alert:{message:"",type:""}}})}const d=(0,r.Q_)({id:"candles",state:()=>({tabs:{1:c()}}),actions:{addTab(){const e=c();return this.tabs[e.id]=e,this.$router.push(`/candles/${e.id}`)},startInNewTab(e){const t=c();t.form=o().cloneDeep(this.tabs[e].form),this.tabs[t.id]=t,this.start(t.id)},start(e){this.tabs[e].results.progressbar.current=0,this.tabs[e].results.executing=!0,this.tabs[e].results.infoLogs="",this.tabs[e].results.exception.traceback="",this.tabs[e].results.exception.error="",this.tabs[e].results.alert.message="",i.Z.post("/import-candles",{id:e,exchange:this.tabs[e].form.exchange,symbol:this.tabs[e].form.symbol,start_date:this.tabs[e].form.start_date}).catch((t=>{this.notyf.error(`[${t.response.status}]: ${t.response.statusText}`),this.tabs[e].results.executing=!1}))},cancel(e){this.tabs[e].results.exception.error?this.tabs[e].results.executing=!1:i.Z["delete"]("/import-candles",{headers:{},data:{id:e}}).then((()=>{window.Cypress&&(this.tabs[e].results.executing=!1)})).catch((e=>this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)))},progressbarEvent(e,t){this.tabs[e].results.progressbar=t,this.tabs[e].results.progressbar.current<100&&!1===this.tabs[e].results.executing&&(this.tabs[e].results.executing=!0)},alertEvent(e,t){this.tabs[e].results.alert=t,this.tabs[e].results.progressbar.current=100,this.tabs[e].results.executing=!1,this.tabs[e].results.exception.traceback="",this.tabs[e].results.exception.error=""},infoLogEvent(e,t){this.tabs[e].results.infoLogs+=`[${n.Z.timestampToTime(t.timestamp)}] ${t.message}\n`},exceptionEvent(e,t){this.tabs[e].results.exception.error=t.error,this.tabs[e].results.exception.traceback=t.traceback},terminationEvent(e){this.tabs[e].results.executing&&(this.tabs[e].results.executing=!1,this.notyf.success("Session terminated successfully"))}}})},4922:(e,t,s)=>{"use strict";s.d(t,{I:()=>u});var r=s(6245),a=s(6486),o=s.n(a),n=s(9614),i=s(5603),l=s(2542);let c=0;function d(){return o().cloneDeep({id:++c,session_id:"",name:"Tab 0",form:n.Z.getDefaultFromLocalStorage("liveForm",{debug_mode:!1,paper_mode:!0,routes:[],extra_routes:[]}),modals:{infoLogs:!1,errorLogs:!1,terminationConfirm:!1},results:{showResults:!1,booting:!1,monitoring:!1,finished:!1,terminating:!1,progressbar:{current:0,estimated_remaining_seconds:0},routes_info:[],routes:[],metrics:[],generalInfo:{},positions:[],rawOrders:[],orders:[],watchlist:[],candles:[],currentCandles:{},infoLogs:"",errorLogs:"",exception:{error:"",traceback:""},charts:{equity_curve:[]}}})}const u=(0,r.Q_)({id:"live",state:()=>({tabs:{1:d()}}),actions:{addTab(){const e=d();return this.tabs[e.id]=e,this.$router.push(`/live/${e.id}`)},startInNewTab(e){const t=d();t.form=o().cloneDeep(this.tabs[e].form),this.tabs[t.id]=t,this.start(t.id)},reset(e){this.tabs[e].results.progressbar.current=0,this.tabs[e].results.booting=!0,this.tabs[e].results.finished=!1,this.tabs[e].results.infoLogs="",this.tabs[e].results.errorLogs="",this.tabs[e].results.exception.traceback="",this.tabs[e].results.exception.error="",this.tabs[e].results.routes_info=[],this.tabs[e].results.metrics=[],this.tabs[e].results.generalInfo={},this.tabs[e].results.positions=[],this.tabs[e].results.rawOrders=[],this.tabs[e].results.orders=[],this.tabs[e].results.candles=[],this.tabs[e].results.currentCandles={},this.tabs[e].results.watchlist=[]},start(e){this.reset(e);const t=(0,l.h)();i.Z.post("/live",{id:e,routes:this.tabs[e].form.routes,extra_routes:this.tabs[e].form.extra_routes,config:t.settings.live,debug_mode:this.tabs[e].form.debug_mode,paper_mode:this.tabs[e].form.paper_mode}).catch((t=>{this.notyf.error(`[${t.response.status}]: ${t.response.statusText}`),this.tabs[e].results.booting=!1}))},cancel(e){this.tabs[e].results.booting=!1,i.Z["delete"]("/live",{headers:{},data:{id:e,paper_mode:this.tabs[e].form.paper_mode}}).catch((e=>this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)))},stop(e){i.Z["delete"]("/live",{headers:{},data:{id:e,paper_mode:this.tabs[e].form.paper_mode}}).then((t=>{this.tabs[e].modals.terminationConfirm=!1,this.tabs[e].results.terminating=!0})).catch((e=>this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)))},newLive(e){this.tabs[e].results.monitoring=!1,this.tabs[e].results.finished=!1},candlesInfoEvent(e,t){this.tabs[e].results.info=[["Period",t.duration],["Starting-Ending Date",`${n.Z.timestampToDate(t.starting_time)} => ${n.Z.timestampToDate(t.finishing_time)}`]]},routesInfoEvent(e,t){const s=[];t.forEach((e=>{s.push([e.exchange,e.symbol,e.timeframe,e.strategy_name])})),this.tabs[e].results.routes_info=s},progressbarEvent(e,t){this.tabs[e].results.progressbar=t},infoLogEvent(e,t){this.tabs[e].results.infoLogs+=`[${n.Z.timestampToTime(t.timestamp)}] ${t.message}\n`},errorLogEvent(e,t){this.notyf.error(t.message),this.tabs[e].results.errorLogs+=`[${n.Z.timestampToTime(t.timestamp)}] ${t.message}\n`},exceptionEvent(e,t){this.tabs[e].results.exception.error=t.error,this.tabs[e].results.exception.traceback=t.traceback},generalInfoEvent(e,t){this.tabs[e].results.generalInfo=t,this.tabs[e].form.routes=this.tabs[e].results.generalInfo.routes,this.tabs[e].results.routes=[["Exchange","Symbol","Timeframe","Strategy"]];for(const s of this.tabs[e].form.routes)this.tabs[e].results.routes.push([{value:s.exchange,style:""},{value:s.symbol,style:""},{value:s.timeframe,style:""},{value:s.strategy,style:""}]);this.tabs[e].results.monitoring||(this.tabs[e].results.booting=!1,this.tabs[e].results.monitoring=!0,this.fetchCandles(e),this.fetchLogs(e),this.fetchOrders(e))},fetchCandles(e){i.Z.post("/get-candles",{id:e,exchange:this.tabs[e].form.routes[0].exchange,symbol:this.tabs[e].form.routes[0].symbol,timeframe:this.tabs[e].form.routes[0].timeframe}).then((t=>{this.tabs[e].results.candles=t.data.data,t.data.data.length||this.notyf.error("Could not load candles")})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))},fetchLogs(e){i.Z.post("/get-logs",{id:e,session_id:this.tabs[e].results.generalInfo.session_id,type:"info"}).then((t=>{const s=t.data.data;this.tabs[e].results.infoLogs="",s.forEach((t=>{this.tabs[e].results.infoLogs+=`[${n.Z.timestampToTime(t.timestamp)}] ${t.message}\n`}))})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)})),i.Z.post("/get-logs",{id:e,session_id:this.tabs[e].results.generalInfo.session_id,type:"error"}).then((t=>{const s=t.data.data;this.tabs[e].results.errorLogs="",s.forEach((t=>{this.tabs[e].results.errorLogs+=`[${n.Z.timestampToTime(t.timestamp)}] ${t.message}\n`}))})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))},fetchOrders(e){i.Z.post("/get-orders",{id:e,session_id:this.tabs[e].results.generalInfo.session_id}).then((t=>{const s=t.data.data;s.forEach((t=>{this.tabs[e].results.rawOrders.push(t)})),this.updateOrders(e)})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))},currentCandlesEvent(e,t){this.tabs[e].results.currentCandles=t},watchlistEvent(e,t){this.tabs[e].results.watchlist=t},positionsEvent(e,t){function s(e){return"long"===e?"text-green-600 dark:text-green-400":"short"===e?"text-red-500 dark:text-red-400":"text-gray-900 dark:text-gray-200"}function r(e){return e>0?"text-green-600 dark:text-green-400":e<0?"text-red-500 dark:text-red-400":"text-gray-900 dark:text-gray-200"}this.tabs[e].results.positions=[["Symbol","Strategy","QTY","Entry","Price","PNL"]];for(const a of t)this.tabs[e].results.positions.push([{value:a.symbol,style:""},{value:a.strategy_name,style:""},{value:a.qty,style:s(a.type)},{value:n.Z.roundPrice(a.entry),style:""},{value:n.Z.roundPrice(a.current_price),style:""},{value:`${o().round(a.pnl,2)} (${o().round(a.pnl_perc,2)}%)`,style:r(a.pnl)}])},orderEvent(e,t){const s=t,r=o().findIndex(this.tabs[e].results.rawOrders,{id:s.id});r>-1?this.tabs[e].results.rawOrders[r]=s:this.tabs[e].results.rawOrders.push(s),this.updateOrders(e)},updateOrders(e){function t(e){return"buy"===e?"text-green-600 dark:text-green-400":"sell"===e?"text-red-500 dark:text-red-400":"text-gray-900 dark:text-gray-200"}this.tabs[e].results.orders=[["Created","Symbol","Type","Side","Price","QTY","Status"]];const s=5,r=this.tabs[e].results.rawOrders.length,a=r-s>=0?r-s:0;for(let o=r-1;o>=a;o--){const s=this.tabs[e].results.rawOrders[o];this.tabs[e].results.orders.push([{value:n.Z.timestampToTimeOnly(s.created_at),style:"text-xs"},{value:s.symbol,style:"text-xs"},{value:s.type,style:"text-xs"},{value:s.side,style:t(s.side)},{value:s.price,style:"text-xs"},{value:s.qty,style:t(s.side)},{value:s.status,style:"text-xs"}])}},metricsEvent(e,t){this.tabs[e].results.metrics=[["Total Closed Trades",t.total],["Total Net Profit",`${o().round(t.net_profit,2)} (${o().round(t.net_profit_percentage,2)}%)`],["Starting => Finishing Balance",`${o().round(t.starting_balance,2)} => ${o().round(t.finishing_balance,2)}`],["Open Trades",t.total_open_trades],["Total Paid Fees",o().round(t.fee,2)],["Max Drawdown",o().round(t.max_drawdown,2)],["Annual Return",`${o().round(t.annual_return,2)}%`],["Expectancy",`${o().round(t.expectancy,2)} (${o().round(t.expectancy_percentage,2)}%)`],["Avg Win | Avg Loss",`${o().round(t.average_win,2)} | ${o().round(t.average_loss,2)}`],["Ratio Avg Win / Avg Loss",o().round(t.open_pl,2)],["Win-rate",`${o().round(100*t.win_rate,2)}%`],["Longs | Shorts",`${o().round(t.longs_percentage,2)}% | ${o().round(t.shorts_percentage,2)}%`],["Avg Holding Time",t.average_holding_period],["Winning Trades Avg Holding Time",t.average_winning_holding_period],["Losing Trades Avg Holding Time",t.average_losing_holding_period],["Sharpe Ratio",o().round(t.sharpe_ratio,2)],["Calmar Ratio",o().round(t.calmar_ratio,2)],["Sortino Ratio",o().round(t.sortino_ratio,2)],["Omega Ratio",o().round(t.omega_ratio,2)],["Winning Streak",t.winning_streak],["Losing Streak",t.losing_streak],["Largest Winning Trade",o().round(t.largest_winning_trade,2)],["Largest Losing Trade",o().round(t.largest_losing_trade,2)],["Total Winning Trades",t.total_winning_trades],["Total Losing Trades",t.total_losing_trades]]},equityCurveEvent(e,t){this.tabs[e].results.charts.equity_curve=[],t.forEach((t=>{this.tabs[e].results.charts.equity_curve.push({value:t.balance,time:t.timestamp})})),this.tabs[e].results.booting=!1,this.tabs[e].results.showResults=!0},unexpectedTerminationEvent(e,t){this.tabs[e].results.finished=!0},terminationEvent(e){this.tabs[e].results.finished||(this.tabs[e].results.finished=!0,this.tabs[e].results.terminating=!1,this.notyf.success("Session terminated successfully"))}}})},2542:(e,t,s)=>{"use strict";s.d(t,{h:()=>i});var r=s(6245),a=s(5603),o=s(6486),n=s.n(o);const i=(0,r.Q_)({id:"main",state:()=>({baseURL:"",isConnected:!1,isInitiated:!1,isAuthenticated:!1,hasLivePluginInstalled:!1,systemInfo:{},theme:localStorage.theme,modals:{settings:!1,exceptionReport:!1,feedback:!1,makeStrategy:!1,about:!1,announcement:!1},settings:{backtest:{logging:{order_submission:!0,order_cancellation:!0,order_execution:!0,position_opened:!0,position_increased:!0,position_reduced:!0,position_closed:!0,shorter_period_candles:!1,trading_candles:!0,balance_update:!0},warm_up_candles:210,exchanges:{}},live:{logging:{order_submission:!0,order_cancellation:!0,order_execution:!0,position_opened:!0,position_increased:!0,position_reduced:!0,position_closed:!0,shorter_period_candles:!1,trading_candles:!0,balance_update:!0},warm_up_candles:210,exchanges:{},notifications:{enabled:!0,position_report_timeframe:"1h",events:{errors:!0,started_session:!0,terminated_session:!0,submitted_orders:!0,cancelled_orders:!0,executed_orders:!0,opened_position:!0,updated_position:!0}}},optimization:{cpu_cores:2,ratio:"sharpe",warm_up_candles:210,exchange:{balance:1e4,fee:.001,futures_leverage:3,futures_leverage_mode:"cross"}}},routes:{exchanges:[],liveExchanges:[],timeframes:["1m","3m","5m","15m","30m","45m","1h","2h","3h","4h","6h","8h","12h","1D"],strategies:[]}}),actions:{initiate(){a.Z.post("/general-info").then((e=>{const t=e.data;this.systemInfo=t.system_info,this.routes.exchanges=t.exchanges,this.routes.liveExchanges=t.live_exchanges,this.routes.strategies=t.strategies,this.hasLivePluginInstalled=t.has_live_plugin_installed,this.routes.exchanges.forEach((e=>{this.settings.backtest.exchanges[e]={name:e,fee:.001,futures_leverage_mode:"isolated",futures_leverage:2,balance:1e4,settlement_currency:"USDT"}})),this.routes.liveExchanges.forEach((e=>{this.settings.live.exchanges[e]={name:e,fee:.001,futures_leverage_mode:"cross",futures_leverage:2,balance:1e4,settlement_currency:"USDT"}})),a.Z.post("/get-config",{current_config:this.settings}).then((e=>{this.settings=e.data.data.data,this.isInitiated=!0})).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))})).catch((e=>{console.error(`[${e.response.status}]: ${e.response.statusText}`)})),this.baseURL=a.Z.defaults.baseURL},updateConfig:n().throttle((function(){this.isInitiated&&a.Z.post("/update-config",{current_config:this.settings}).catch((e=>{this.notyf.error(`[${e.response.status}]: ${e.response.statusText}`)}))}),1e3,{leading:!0,trailing:!0})}})},9654:(e,t,s)=>{var r={"./Alert.vue":9072,"./Announcement.vue":5166,"./Charts/Candles/CandlesChart.vue":2101,"./Charts/EquityCurve.vue":5104,"./Checkbox.vue":3394,"./Divider.vue":285,"./DividerWithButtons.vue":4880,"./Exception.vue":8641,"./Functional/CircleProgressbar.vue":9233,"./Functional/DatePicker.vue":9602,"./Functional/FormInput.vue":8588,"./Functional/FormTextarea.vue":3710,"./Functional/ImageLoader.vue":2396,"./Functional/NumberInput.vue":8337,"./Functional/Select.vue":3853,"./Functional/SlideOver.vue":6582,"./Functional/Spinner.vue":1034,"./KeyValueTable.vue":7378,"./LoadingSvg.vue":6312,"./Logs.vue":243,"./Modals/ConfirmModal.vue":7074,"./Modals/CustomModal.vue":6867,"./MultipleValuesTable.vue":1166,"./Nav.vue":2516,"./RadioGroups.vue":7157,"./Routes.vue":6105,"./Settings.vue":470,"./StatsBox.vue":2779,"./TablePlaceholder.vue":9201,"./Tables/InfoLogsTable.vue":3668,"./Tables/InfoTable.vue":8498,"./Tabs.vue":6833,"./ThemeSwitch.vue":3190,"./ToggleButton.vue":1851};function a(e){var t=o(e);return s(t)}function o(e){if(!s.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=9654},7372:(e,t,s)=>{"use strict";e.exports=s.p+"img/logo-dark.374e6085..svg"},4159:(e,t,s)=>{"use strict";e.exports=s.p+"img/search-by-algolia-light-background.47401192..svg"},1021:(e,t,s)=>{"use strict";e.exports=s.p+"img/logo-light.20cb902b..png"}},t={};function s(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,s),o.loaded=!0,o.exports}s.m=e,(()=>{var e=[];s.O=(t,r,a,o)=>{if(!r){var n=1/0;for(d=0;d<e.length;d++){r=e[d][0],a=e[d][1],o=e[d][2];for(var i=!0,l=0;l<r.length;l++)(!1&o||n>=o)&&Object.keys(s.O).every((e=>s.O[e](r[l])))?r.splice(l--,1):(i=!1,o<n&&(n=o));if(i){e.splice(d--,1);var c=a();void 0!==c&&(t=c)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[r,a,o]}})(),(()=>{s.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return s.d(t,{a:t}),t}})(),(()=>{s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{s.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{s.p="/"})(),(()=>{var e={143:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],i=r[1],l=r[2],c=0;if(n.some((t=>0!==e[t]))){for(a in i)s.o(i,a)&&(s.m[a]=i[a]);if(l)var d=l(s)}for(t&&t(r);c<n.length;c++)o=n[c],s.o(e,o)&&e[o]&&e[o][0](),e[n[c]]=0;return s.O(d)},r=self["webpackChunkjesse_dashboard"]=self["webpackChunkjesse_dashboard"]||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var r=s.O(void 0,[998],(()=>s(2424)));r=s.O(r)})();
  //# sourceMappingURL=app.bb9b3d19.js.map