@backtest-kit/ui 8.2.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/build/modules/frontend/build/assets/{Article-DDKZjbkz.js → Article-AUYNwpV4.js} +1 -1
  2. package/build/modules/frontend/build/assets/{Background-5Pc2kls4.js → Background-J3D-YWJ5.js} +1 -1
  3. package/build/modules/frontend/build/assets/{IconPhoto-2KIaDXXx.js → IconPhoto-DQE9aB5j.js} +1 -1
  4. package/build/modules/frontend/build/assets/{KeyboardArrowLeft-nUGbVivG.js → KeyboardArrowLeft-BKA83vx6.js} +1 -1
  5. package/build/modules/frontend/build/assets/{PictureAsPdfOutlined-BKzXxbqU.js → PictureAsPdfOutlined-DSKCe3EJ.js} +1 -1
  6. package/build/modules/frontend/build/assets/{Refresh-6IBmzTpL.js → Refresh-kZF-8lkD.js} +1 -1
  7. package/build/modules/frontend/build/assets/emitters-B7Jkz1Yr.js +1 -0
  8. package/build/modules/frontend/build/assets/{hasRouteMatch-Bw2df_bl.js → hasRouteMatch-DuqX5A31.js} +1 -1
  9. package/build/modules/frontend/build/assets/{html2canvas-731slHaR.js → html2canvas-BUyuu1jN.js} +1 -1
  10. package/build/modules/frontend/build/assets/{index-BgpdZ4rO.js → index-79UpKc1N.js} +1 -1
  11. package/build/modules/frontend/build/assets/{index-Cpcp7B0Y.js → index-BN-FXIx5.js} +1 -1
  12. package/build/modules/frontend/build/assets/{index-Dbf0lzpr.js → index-BRkaqbDw.js} +1 -1
  13. package/build/modules/frontend/build/assets/{index-CljWW6CQ.js → index-BizhJELg.js} +1 -1
  14. package/build/modules/frontend/build/assets/{index-is6UARFt.js → index-C9KwLGA7.js} +5 -5
  15. package/build/modules/frontend/build/assets/{index-DywLUAcD.js → index-CATzlC0H.js} +1 -1
  16. package/build/modules/frontend/build/assets/{index-DVsJHggN.js → index-DYzLzsz4.js} +1 -1
  17. package/build/modules/frontend/build/assets/{index-Di2oEk8q.js → index-DZ3TQ1i5.js} +1 -1
  18. package/build/modules/frontend/build/assets/{index-BFZbztqX.js → index-Djjm_4qE.js} +1 -1
  19. package/build/modules/frontend/build/assets/{index-GZdKxtUQ.js → index-DvfPNupk.js} +1 -1
  20. package/build/modules/frontend/build/assets/{index-DbkxgA90.js → index-DxZgG3In.js} +1 -1
  21. package/build/modules/frontend/build/assets/{index-DtUu3BzB.js → index-frdLUVIp.js} +1 -1
  22. package/build/modules/frontend/build/assets/{index-CZUmXlNR.js → index-xN1mBPxH.js} +1 -1
  23. package/build/modules/frontend/build/assets/{index.es-CShnY6Uk.js → index.es-gHyIHqto.js} +1 -1
  24. package/build/modules/frontend/build/assets/{markdownit-DnS0ASYl.js → markdownit-DCEAewhk.js} +1 -1
  25. package/build/modules/frontend/build/index.html +1 -1
  26. package/package.json +3 -3
  27. package/build/modules/frontend/build/assets/emitters-1aP5uqiT.js +0 -1
@@ -1 +1 @@
1
- import{b as c,f as v}from"./index-is6UARFt.js";const h=c(v("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}),"Article");export{h as A};
1
+ import{b as c,f as v}from"./index-C9KwLGA7.js";const h=c(v("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}),"Article");export{h as A};
@@ -1 +1 @@
1
- import{f as n,S as o}from"./index-is6UARFt.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
1
+ import{f as n,S as o}from"./index-C9KwLGA7.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
@@ -1 +1 @@
1
- import{f as e,i as t,B as r,J as s}from"./index-is6UARFt.js";const o=({className:o,symbol:i,style:a,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[i],l=(null==s?void 0:s.logo)||(null==s?void 0:s.icon),c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:a,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:i,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:a,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{o as I};
1
+ import{f as e,i as t,B as r,J as s}from"./index-C9KwLGA7.js";const o=({className:o,symbol:i,style:a,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[i],l=(null==s?void 0:s.logo)||(null==s?void 0:s.icon),c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:a,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:i,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:a,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{o as I};
@@ -1 +1 @@
1
- import{b as o,f as r}from"./index-is6UARFt.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
1
+ import{b as o,f as r}from"./index-C9KwLGA7.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
@@ -1 +1 @@
1
- import{b as h,f as c}from"./index-is6UARFt.js";const v=h(c("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm12 6V9c0-.55-.45-1-1-1h-2v5h2c.55 0 1-.45 1-1zm-2-3h1v3h-1V9zm4 2h1v-1h-1V9h1V8h-2v5h1zm-8 0h1c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9v5h1v-2zm0-2h1v1h-1V9z"}),"PictureAsPdfOutlined");export{v as P};
1
+ import{b as h,f as c}from"./index-C9KwLGA7.js";const v=h(c("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm12 6V9c0-.55-.45-1-1-1h-2v5h2c.55 0 1-.45 1-1zm-2-3h1v3h-1V9zm4 2h1v-1h-1V9h1V8h-2v5h1zm-8 0h1c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9v5h1v-2zm0-2h1v1h-1V9z"}),"PictureAsPdfOutlined");export{v as P};
@@ -1 +1 @@
1
- import{bt as e,d as t,r as a,_ as s,f as i,bu as n,j as o,bv as r,k as d,bw as m,g as u,u as p,s as x,b as c}from"./index-is6UARFt.js";const h=e(),b=["className","component","disableGutters","fixed","maxWidth","classes"],l=m(),f=h("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>r({props:e,name:"MuiContainer",defaultTheme:l});const W=function(e={}){const{createStyledComponent:r=f,useThemeProps:m=g,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:c,component:h="div",disableGutters:l=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,b),k=t({},r,{component:h,disableGutters:l,fixed:f,maxWidth:g}),v=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:h,ownerState:k,className:n(v.root,c),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})}),k=c(i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{W as C,k as R};
1
+ import{bt as e,d as t,r as a,_ as s,f as i,bu as n,j as o,bv as r,k as d,bw as m,g as u,u as p,s as x,b as c}from"./index-C9KwLGA7.js";const h=e(),b=["className","component","disableGutters","fixed","maxWidth","classes"],l=m(),f=h("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>r({props:e,name:"MuiContainer",defaultTheme:l});const W=function(e={}){const{createStyledComponent:r=f,useThemeProps:m=g,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:c,component:h="div",disableGutters:l=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,b),k=t({},r,{component:h,disableGutters:l,fixed:f,maxWidth:g}),v=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:h,ownerState:k,className:n(v.root,c),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})}),k=c(i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{W as C,k as R};
@@ -0,0 +1 @@
1
+ import{Z as o}from"./index-C9KwLGA7.js";const r=new o;export{r};
@@ -1 +1 @@
1
- import{i as a,br as e,bs as r}from"./index-is6UARFt.js";const s=(s,t=a.routerService.location.pathname)=>!!e(r.filter(({path:a})=>s.includes(a)),t);export{s as h};
1
+ import{i as a,br as e,bs as r}from"./index-C9KwLGA7.js";const s=(s,t=a.routerService.location.pathname)=>!!e(r.filter(({path:a})=>s.includes(a)),t);export{s as h};
@@ -1 +1 @@
1
- import{bx as e,bz as t}from"./index-is6UARFt.js";function r(e,t){for(var r=0;r<t.length;r++){const o=t[r];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(o,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=t();const n=r({__proto__:null,default:e(o)},[o]);export{n as h};
1
+ import{bx as e,bz as t}from"./index-C9KwLGA7.js";function r(e,t){for(var r=0;r<t.length;r++){const o=t[r];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(o,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=t();const n=r({__proto__:null,default:e(o)},[o]);export{n as h};
@@ -1 +1 @@
1
- import{h as e,f as t,c as n,r,i,S as o,m as a,U as l}from"./index-is6UARFt.js";const[c,s]=e("pine-code-context"),u=e=>t(c,{initialState:'//@version=5\nindicator("Simple MA", overlay=true)\n\nlength = input.int(20, "Length")\nsma = ta.sma(close, length)\n\nplot(sma, "SMA", color.blue, linewidth=2)',children:e.children}),[d,h]=e("pine-from-date-context"),v=e=>t(d,{initialState:"",children:e.children}),[m,p]=e("pine-limit-context"),g=e=>t(m,{initialState:250,children:e.children}),[f,y]=e("pine-symbol-context"),b=e=>t(f,{initialState:"BTCUSDT",children:e.children}),[C,D]=e("pine-timeframe-context"),x=e=>t(C,{initialState:"1",children:e.children}),[S,w]=e("pine-to-date-context"),T=e=>t(S,{initialState:"",children:e.children}),k=n(e=>t("div",{style:e.v0,children:[t("input",{type:"text",value:e.v1,onChange:e.v2,style:e.v3,placeholder:"BTCUSDT"}),t("select",{value:e.v4,onChange:e.v5,style:e.v6,children:e.v7}),t("input",{type:"number",value:e.v8,min:100,step:100,onChange:e.v9,style:e.v10,title:"Bars limit"}),t("input",{type:"date",value:e.v11,onChange:e.v12,style:e.v13,title:"From date"}),t("input",{type:"date",value:e.v14,onChange:e.v15,style:e.v16,title:"To date"}),t("button",{onClick:e.v17,disabled:e.v18,style:e.v19,children:e.v20}),e.v21]}),{name:"Toolbar_1",portals:["v7","v20","v21"]}),R=function({symbol:e,timeframe:n,fromDate:r,toDate:i,limit:o,running:a,status:l,onSymbolChange:c,onTimeframeChange:s,onFromDateChange:u,onToDateChange:d,onLimitChange:h,onRun:v}){return t(k,{v0:{display:"flex",gap:8,padding:"8px 12px",background:"#1e293b",alignItems:"center",flexShrink:0},v1:e,v2:e=>c(e.target.value.toUpperCase()),v3:{...B,width:100},v4:n,v5:e=>s(e.target.value),v6:B,v7:z.map(e=>t("option",{children:e},e)),v8:o,v9:e=>h(Number(e.target.value)),v10:{...B,width:80},v11:r,v12:e=>u(e.target.value),v13:F,v14:i,v15:e=>d(e.target.value),v16:F,v17:v,v18:a,v19:{background:"#3b82f6",color:"#fff",border:"none",borderRadius:4,padding:"5px 16px",fontSize:13,cursor:"pointer"},v20:a?"...":"▶ Run",v21:l&&t("span",{style:{fontSize:12,color:"#94a3b8",marginLeft:8},children:l})})},z=["1","5","15","60","D"],B={background:"#1e293b",color:"#e2e8f0",border:"1px solid #334155",borderRadius:4,padding:"4px 8px",fontSize:13},F={...B,colorScheme:"dark"},U=n(e=>t("textarea",{value:e.v0,onChange:e.v1,onKeyDown:e.v2,spellCheck:!1,style:e.v3}),{name:"CodeEditor_1"}),E=function({value:e,onChange:n,onRun:r}){return t(U,{v0:e,v1:e=>n(e.target.value),v2:e=>{e.ctrlKey&&"Enter"===e.key&&(e.preventDefault(),r())},v3:{width:320,flexShrink:0,resize:"none",background:"#1e293b",color:"#e2e8f0",border:"none",borderRight:"1px solid #334155",padding:12,fontFamily:"monospace",fontSize:13,lineHeight:1.5,outline:"none"}})},$={1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",60:"1h",120:"2h",240:"4h",360:"6h",480:"8h","1D":"1d",D:"1d"};function L(e){return{time:e.openTime,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}}class I{async getMarketData(e,t,n,r,o){const a=e.toUpperCase().replace(/^BINANCE:|^BYBIT:|^OKX:/,""),l=$[t]??t;return(await i.exchangeViewService.getRangeCandles({symbol:a,interval:l,limit:n,sDate:r,eDate:o})).map(e=>({openTime:e.timestamp,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}))}async getSymbolInfo(e){const t=e.toUpperCase().replace(/^BINANCE:|^BYBIT:|^OKX:/,""),n=t.replace(/USDT$|BUSD$|USD$/,""),r=t.replace(n,"");return{ticker:t,tickerid:t,description:`${n}/${r}`,type:"crypto",basecurrency:n,currency:r||"USDT",timezone:"UTC"}}}const M=()=>t(o,{children:"\n #root > .MuiBox-root {\n padding-left: 0;\n padding-right: 0;\n }\n "}),P=()=>{const e=r.useRef(null),[n,i]=s(),[o,l]=y(),[c,u]=D(),[d,v]=h(),[m,g]=w(),[f,b]=p(),{run:C,status:x,running:S}=function(){const e=r.useRef(null),t=r.useRef(null),n=r.useRef(null),[i,o]=r.useState(""),[a,l]=r.useState(!1);function c(){if(n.current){try{n.current.stop()}catch{}n.current=null}}function s(){e.current&&(e.current.destroy(),e.current=null,t.current=null)}function u(e){o(`Error: ${e.message}`),l(!1)}return r.useEffect(()=>{const t=()=>{var t;return null==(t=e.current)?void 0:t.resize()};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),c(),s()}},[]),{run:function({symbol:r,timeframe:i,fromDate:a,toDate:d,limit:h,code:v,containerRef:m}){if(!m.current)return;l(!0),o("Connecting..."),c(),s();const p=/indicator\([^)]*overlay\s*=\s*true/i.test(v);let g=!1;try{const c=a?new Date(a).getTime():void 0,s=d?new Date(d).getTime():void 0,f=new I,y=new PineTS(f,r,i,h,c,s).stream(v,{pageSize:500,live:!0,interval:3e3});n.current=y,y.on("data",a=>{var c,s;if(n.current===y)if(g)t.current&&a.plots&&t.current.updateData(a.plots),null==(s=e.current)||s.updateData([L(a.marketData[a.marketData.length-1])]);else{g=!0;const n=a.marketData.map(L);m.current.innerHTML="",e.current=new QFChart.QFChart(m.current,{title:`${r} · ${i}`,backgroundColor:"#0f172a",height:"100%",padding:.1,databox:{position:"right",triggerOn:"mousemove"},dataZoom:{visible:!0,position:"top",height:6,start:80,end:101},layout:{mainPaneHeight:"70%",gap:5},controls:{collapse:!1,maximize:!1,fullscreen:!1}}),e.current.setMarketData(n);const s=(null==(c=a.fullContext)?void 0:c.plots)??a.plots;t.current=e.current.addIndicator("indicator",s,{overlay:p,height:p?void 0:30,controls:{collapse:!1,maximize:!1}}),e.current.registerPlugin(new QFChart.MeasureTool),e.current.registerPlugin(new QFChart.LineTool),e.current.registerPlugin(new QFChart.FibonacciTool),o(`${n.length} bars loaded`),l(!1)}}),y.on("error",u)}catch(f){u(f)}},status:i,running:a}}();function T(){C({symbol:o,timeframe:c,fromDate:d,toDate:m,limit:f,code:n,containerRef:e})}return t(a,{children:t("div",{style:{display:"flex",flexDirection:"column",height:"100vh",background:"#0f172a",color:"#e2e8f0",fontFamily:"monospace"},children:[t(R,{symbol:o,timeframe:c,fromDate:d,toDate:m,limit:f,running:S,status:x,onSymbolChange:l,onTimeframeChange:u,onFromDateChange:v,onToDateChange:g,onLimitChange:b,onRun:T}),t("div",{style:{display:"flex",flex:1,overflow:"clip"},children:[t(E,{value:n,onChange:i,onRun:T}),t("div",{style:{flex:1},children:t("div",{ref:e,style:{width:"100%",height:"100%"},children:t("p",{style:{color:"#475569",textAlign:"center",marginTop:"20%"},children:["Press ",t("b",{children:"▶ Run"})," or ",t("b",{children:"Ctrl+Enter"})," to load the chart"]})})})]}),t(M,{})]})})},A=l(e=>t(u,{children:e}),e=>t(v,{children:e}),e=>t(T,{children:e}),e=>t(g,{children:e}),e=>t(b,{children:e}),e=>t(x,{children:e})),N=()=>A(t(P,{}));export{N as PinePage,N as default};
1
+ import{h as e,f as t,c as n,r,i,S as o,m as a,U as l}from"./index-C9KwLGA7.js";const[c,s]=e("pine-code-context"),u=e=>t(c,{initialState:'//@version=5\nindicator("Simple MA", overlay=true)\n\nlength = input.int(20, "Length")\nsma = ta.sma(close, length)\n\nplot(sma, "SMA", color.blue, linewidth=2)',children:e.children}),[d,h]=e("pine-from-date-context"),v=e=>t(d,{initialState:"",children:e.children}),[m,p]=e("pine-limit-context"),g=e=>t(m,{initialState:250,children:e.children}),[f,y]=e("pine-symbol-context"),b=e=>t(f,{initialState:"BTCUSDT",children:e.children}),[C,D]=e("pine-timeframe-context"),x=e=>t(C,{initialState:"1",children:e.children}),[S,w]=e("pine-to-date-context"),T=e=>t(S,{initialState:"",children:e.children}),k=n(e=>t("div",{style:e.v0,children:[t("input",{type:"text",value:e.v1,onChange:e.v2,style:e.v3,placeholder:"BTCUSDT"}),t("select",{value:e.v4,onChange:e.v5,style:e.v6,children:e.v7}),t("input",{type:"number",value:e.v8,min:100,step:100,onChange:e.v9,style:e.v10,title:"Bars limit"}),t("input",{type:"date",value:e.v11,onChange:e.v12,style:e.v13,title:"From date"}),t("input",{type:"date",value:e.v14,onChange:e.v15,style:e.v16,title:"To date"}),t("button",{onClick:e.v17,disabled:e.v18,style:e.v19,children:e.v20}),e.v21]}),{name:"Toolbar_1",portals:["v7","v20","v21"]}),R=function({symbol:e,timeframe:n,fromDate:r,toDate:i,limit:o,running:a,status:l,onSymbolChange:c,onTimeframeChange:s,onFromDateChange:u,onToDateChange:d,onLimitChange:h,onRun:v}){return t(k,{v0:{display:"flex",gap:8,padding:"8px 12px",background:"#1e293b",alignItems:"center",flexShrink:0},v1:e,v2:e=>c(e.target.value.toUpperCase()),v3:{...B,width:100},v4:n,v5:e=>s(e.target.value),v6:B,v7:z.map(e=>t("option",{children:e},e)),v8:o,v9:e=>h(Number(e.target.value)),v10:{...B,width:80},v11:r,v12:e=>u(e.target.value),v13:F,v14:i,v15:e=>d(e.target.value),v16:F,v17:v,v18:a,v19:{background:"#3b82f6",color:"#fff",border:"none",borderRadius:4,padding:"5px 16px",fontSize:13,cursor:"pointer"},v20:a?"...":"▶ Run",v21:l&&t("span",{style:{fontSize:12,color:"#94a3b8",marginLeft:8},children:l})})},z=["1","5","15","60","D"],B={background:"#1e293b",color:"#e2e8f0",border:"1px solid #334155",borderRadius:4,padding:"4px 8px",fontSize:13},F={...B,colorScheme:"dark"},U=n(e=>t("textarea",{value:e.v0,onChange:e.v1,onKeyDown:e.v2,spellCheck:!1,style:e.v3}),{name:"CodeEditor_1"}),E=function({value:e,onChange:n,onRun:r}){return t(U,{v0:e,v1:e=>n(e.target.value),v2:e=>{e.ctrlKey&&"Enter"===e.key&&(e.preventDefault(),r())},v3:{width:320,flexShrink:0,resize:"none",background:"#1e293b",color:"#e2e8f0",border:"none",borderRight:"1px solid #334155",padding:12,fontFamily:"monospace",fontSize:13,lineHeight:1.5,outline:"none"}})},$={1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",60:"1h",120:"2h",240:"4h",360:"6h",480:"8h","1D":"1d",D:"1d"};function L(e){return{time:e.openTime,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}}class I{async getMarketData(e,t,n,r,o){const a=e.toUpperCase().replace(/^BINANCE:|^BYBIT:|^OKX:/,""),l=$[t]??t;return(await i.exchangeViewService.getRangeCandles({symbol:a,interval:l,limit:n,sDate:r,eDate:o})).map(e=>({openTime:e.timestamp,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}))}async getSymbolInfo(e){const t=e.toUpperCase().replace(/^BINANCE:|^BYBIT:|^OKX:/,""),n=t.replace(/USDT$|BUSD$|USD$/,""),r=t.replace(n,"");return{ticker:t,tickerid:t,description:`${n}/${r}`,type:"crypto",basecurrency:n,currency:r||"USDT",timezone:"UTC"}}}const M=()=>t(o,{children:"\n #root > .MuiBox-root {\n padding-left: 0;\n padding-right: 0;\n }\n "}),P=()=>{const e=r.useRef(null),[n,i]=s(),[o,l]=y(),[c,u]=D(),[d,v]=h(),[m,g]=w(),[f,b]=p(),{run:C,status:x,running:S}=function(){const e=r.useRef(null),t=r.useRef(null),n=r.useRef(null),[i,o]=r.useState(""),[a,l]=r.useState(!1);function c(){if(n.current){try{n.current.stop()}catch{}n.current=null}}function s(){e.current&&(e.current.destroy(),e.current=null,t.current=null)}function u(e){o(`Error: ${e.message}`),l(!1)}return r.useEffect(()=>{const t=()=>{var t;return null==(t=e.current)?void 0:t.resize()};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),c(),s()}},[]),{run:function({symbol:r,timeframe:i,fromDate:a,toDate:d,limit:h,code:v,containerRef:m}){if(!m.current)return;l(!0),o("Connecting..."),c(),s();const p=/indicator\([^)]*overlay\s*=\s*true/i.test(v);let g=!1;try{const c=a?new Date(a).getTime():void 0,s=d?new Date(d).getTime():void 0,f=new I,y=new PineTS(f,r,i,h,c,s).stream(v,{pageSize:500,live:!0,interval:3e3});n.current=y,y.on("data",a=>{var c,s;if(n.current===y)if(g)t.current&&a.plots&&t.current.updateData(a.plots),null==(s=e.current)||s.updateData([L(a.marketData[a.marketData.length-1])]);else{g=!0;const n=a.marketData.map(L);m.current.innerHTML="",e.current=new QFChart.QFChart(m.current,{title:`${r} · ${i}`,backgroundColor:"#0f172a",height:"100%",padding:.1,databox:{position:"right",triggerOn:"mousemove"},dataZoom:{visible:!0,position:"top",height:6,start:80,end:101},layout:{mainPaneHeight:"70%",gap:5},controls:{collapse:!1,maximize:!1,fullscreen:!1}}),e.current.setMarketData(n);const s=(null==(c=a.fullContext)?void 0:c.plots)??a.plots;t.current=e.current.addIndicator("indicator",s,{overlay:p,height:p?void 0:30,controls:{collapse:!1,maximize:!1}}),e.current.registerPlugin(new QFChart.MeasureTool),e.current.registerPlugin(new QFChart.LineTool),e.current.registerPlugin(new QFChart.FibonacciTool),o(`${n.length} bars loaded`),l(!1)}}),y.on("error",u)}catch(f){u(f)}},status:i,running:a}}();function T(){C({symbol:o,timeframe:c,fromDate:d,toDate:m,limit:f,code:n,containerRef:e})}return t(a,{children:t("div",{style:{display:"flex",flexDirection:"column",height:"100vh",background:"#0f172a",color:"#e2e8f0",fontFamily:"monospace"},children:[t(R,{symbol:o,timeframe:c,fromDate:d,toDate:m,limit:f,running:S,status:x,onSymbolChange:l,onTimeframeChange:u,onFromDateChange:v,onToDateChange:g,onLimitChange:b,onRun:T}),t("div",{style:{display:"flex",flex:1,overflow:"clip"},children:[t(E,{value:n,onChange:i,onRun:T}),t("div",{style:{flex:1},children:t("div",{ref:e,style:{width:"100%",height:"100%"},children:t("p",{style:{color:"#475569",textAlign:"center",marginTop:"20%"},children:["Press ",t("b",{children:"▶ Run"})," or ",t("b",{children:"Ctrl+Enter"})," to load the chart"]})})})]}),t(M,{})]})})},A=l(e=>t(u,{children:e}),e=>t(v,{children:e}),e=>t(T,{children:e}),e=>t(g,{children:e}),e=>t(b,{children:e}),e=>t(x,{children:e})),N=()=>A(t(P,{}));export{N as PinePage,N as default};
@@ -1 +1 @@
1
- import{b as e,f as t,X as a,i as o,Y as i,Z as n,v as l,w as r,z as d,y as p,A as c,E as s,H as y,x as g,q as m,$ as h,T as u,l as f,B as b,a0 as x,P as w,a1 as v,a2 as k,O as B,a3 as M,a4 as S,a5 as L,a6 as R}from"./index-is6UARFt.js";import{h as V}from"./hasRouteMatch-Bw2df_bl.js";import{P as D}from"./PictureAsPdfOutlined-BKzXxbqU.js";import{C as T,R as C}from"./Refresh-6IBmzTpL.js";import{K as A}from"./KeyboardArrowLeft-nUGbVivG.js";const P=e(t("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings"),_=e(t("path",{d:"M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"}),"Telegram"),E=144,O=[{type:r.Link,action:"back-action",label:t(A,{sx:{display:"block"}})},{type:r.Link,action:"back-action",label:"Dashboard"},{type:r.Link,action:"back-action",label:"Performance"},{type:r.Button,action:"download-pdf",label:"Download PDF",icon:D},{type:r.Fab,action:"setup-action",label:"Settings",icon:P}],j=[{action:"setup-action",label:"Settings",icon:()=>t(d,{icon:P,color:"#4caf50"})},{divider:!0},{action:"download-json",label:"Download JSON",icon:()=>t(d,{icon:p,color:"#4caf50"})},{action:"download-markdown",label:"Download Markdown",icon:()=>t(d,{icon:c,color:"#4caf50"})},{action:"download-pdf",label:"Download PDF",icon:()=>t(d,{icon:s,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>t(d,{icon:C,color:"#4caf50"})}],U=({name:e,title:t})=>({type:y.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",paddingBottom:"8px",alignItems:"center"},fields:[{type:y.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:t},{type:y.Div},{type:y.Typography,typoVariant:"h6",style:{textAlign:"right",fontWeight:"bold"},fieldBottomMargin:"0",fieldRightMargin:"0",compute:({[e]:t})=>t||0===t?"totalEvents"===e?Number(t).toFixed(2):"totalDuration"===e||"avgDuration"===e?`${Number(t).toFixed(2)} ${x("ms")}`:t:"-",name:e}]}),F=({name:e,title:a})=>({type:y.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",paddingBottom:"8px",alignItems:"center"},fields:[{type:y.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:a},{type:y.Div},{type:y.Component,style:{textAlign:"right",fontWeight:"bold"},fieldBottomMargin:"0",fieldRightMargin:"0",element:({[e]:a})=>{const o="github"===e,i=o?"#6A1B9A":"#24A1DE";return t(B,{size:"medium",disabled:!a,startIcon:t(h,{sx:{background:"#eee",height:"25px",width:"25px"},children:t(o?k:_,{sx:{color:i,fontSize:"16px !important",transform:"translate(-0.5px, 0px)"}})}),sx:{background:"white",color:i,"&:hover":{background:"white",color:i}},onClick:()=>{if(o)v(String(a));else{const e=String(a).replaceAll("@","");v(`https://t.me/${e}`)}},children:x(a?"Open":"Not configured")})},name:e}]}),I=[{type:y.Box,sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"80vh"},child:{type:y.Layout,customLayout:({children:e})=>t(w,{sx:{width:"335px"},children:e}),fields:[{type:y.Component,element:()=>t(b,{sx:{background:e=>f(e.palette.background.paper,.13),display:"flex",alignItems:"center",flexDirection:"column",gap:1,p:1},children:[t(h,{sx:{height:E,width:E,marginTop:"36px",marginBottom:"36px"},src:"/logo/icon512_maskable.png"}),t(u,{variant:"subtitle2",sx:{opacity:.5},children:"Backtest Kit"})]})},{type:y.Layout,customLayout:({children:e})=>t(b,{p:1,children:e}),fields:[{type:y.Div,style:{height:"2px"}},{type:y.Div,style:{height:"12px"}},U({name:"totalEvents",title:x("Total events")}),U({name:"totalDuration",title:x("Total time")}),U({name:"avgDuration",title:x("Average time")}),F({name:"channel",title:x("Channel")}),F({name:"github",title:"GitHub"})]}]}}],H=new n,N=[{type:y.Group,fieldRightMargin:"1",phoneColumns:"12",tabletColumns:"12",desktopColumns:"6",fields:[{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"1",typoVariant:"h6",placeholder:"Running mode"},{type:y.Typography,fieldBottomMargin:"1",isVisible:({running_mode:e})=>"backtest"===e,style:{color:"orange"},typoVariant:"body1",placeholder:"Historical data processing"},{type:y.Typography,fieldBottomMargin:"1",isVisible:({running_mode:e})=>"live"===e,style:{color:"green"},typoVariant:"body1",placeholder:"Real-time exchange integration"},{type:y.Typography,fieldBottomMargin:"1",isVisible:({running_mode:e})=>"none"===e,style:{color:"red"},typoVariant:"body1",placeholder:"UI only"},{type:y.Radio,readonly:!0,fieldBottomMargin:"0",name:"running_mode",radioValue:"backtest",title:"Historical data"},{type:y.Radio,readonly:!0,fieldBottomMargin:"0",name:"running_mode",radioValue:"live",title:"Real-time"},{type:y.Radio,readonly:!0,fieldBottomMargin:"0",name:"running_mode",radioValue:"none",title:"Frontend only"}]},{type:y.Paper,fieldBottomMargin:"1",innerPadding:"0px",fields:[{type:y.Box,sx:{paddingTop:"16px",paddingLeft:"16px",paddingRight:"16px"},fields:[{type:y.Typography,fieldBottomMargin:"1",typoVariant:"h6",placeholder:"Log mode"},{type:y.Typography,fieldBottomMargin:"2",style:{opacity:.5},typoVariant:"caption",placeholder:"Logs take up disk space but are needed for debugging"}]},...[{title:"JSONL files",description:"Files processed by Claude Code, HuggingFace, Parquet",name:"recent_enabled"},{title:"Markdown files",description:"Human-readable files. Useful when running without a GUI",name:"markdown_enabled"},{title:"Dump files",description:"Conversation dump with the AI agent used for trading signals",name:"dump_enabled"}].map(({name:e,title:t,description:a},o)=>(({title:e,description:t,name:a,idx:o})=>({type:y.Box,sx:{display:"grid",alignItems:"center",gridTemplateColumns:"1fr auto",paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"4px",background:e=>o%2==0?L(e.palette.getContrastText(e.palette.background.paper),.04):"transparent"},fields:[{type:y.Box,fields:[{type:y.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:e},{type:y.Typography,fieldBottomMargin:"0",style:{opacity:.5},typoVariant:"caption",placeholder:t}]},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",fieldRightMargin:"0",title:"",name:a}]}))({name:e,title:t,description:a,idx:o}))]},{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"1",typoVariant:"h6",placeholder:"User interface"},{type:y.Switch,readonly:!0,fieldBottomMargin:"0",title:"Save notifications",name:"notification_enabled"},{type:y.Typography,fieldBottomMargin:"1",style:{opacity:.5},typoVariant:"caption",placeholder:"Event history is saved to disk"},{type:y.Switch,readonly:!0,fieldBottomMargin:"0",title:"Save signals",name:"storage_enabled"},{type:y.Typography,fieldBottomMargin:"0",style:{opacity:.5},typoVariant:"caption",placeholder:"Latest signal state is saved to disk"}]}]},{type:y.Group,fieldRightMargin:"1",fieldBottomMargin:"2",phoneColumns:"12",tabletColumns:"12",desktopColumns:"6",fields:[{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"3",typoVariant:"h6",placeholder:"Strategy"},{type:y.Typography,placeholder:"Broker"},{type:y.Outline,fieldBottomMargin:"3",fields:[{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Connected to mainnet (production)",name:"broker_enabled"}]},{type:y.Typography,placeholder:"Market signals"},{type:y.Outline,fieldBottomMargin:"4",fields:[{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Use BM25 for RAG",name:"memory_enabled"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Use stateful strategies",name:"state_enabled"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Save previous signal",name:"recent_enabled"}]}]},{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"2",typoVariant:"h6",placeholder:"Risk management"},{type:y.Typography,fieldBottomMargin:"3",style:{opacity:.5},typoVariant:"body1",placeholder:"Use LONG or SHORT positions depending on market conditions"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Enable LONG",name:"enable_long"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"1",title:"Enable SHORT",name:"enable_short"}]}]},{type:y.Component,desktopHidden:!0,fieldBottomMargin:"5",fieldRightMargin:"1",element:({payload:e})=>{const a=M();return t(S,{variant:"contained",size:"large",startIcon:t(C,{}),onClick:async()=>{await e.handleReload(),a()},children:"Refresh"})}}],z=[{type:r.Link,action:"back-action",label:t(A,{sx:{display:"block"}})},{type:r.Link,action:"back-action",label:"Dashboard"},{type:r.Link,action:"back-action",label:"Performance"},{type:r.Link,action:"back-action",label:"Settings"},{type:r.Button,action:"update-now",label:"Refresh",icon:C}],G=[{action:"update-now",label:"Refresh",icon:()=>t(d,{icon:C,color:"#4caf50"})}],$=new n,J=async()=>{o.setupViewService.getSetupData.clear(),await $.next()},K=[{id:"search",element:()=>{const[e,{execute:n,loading:r}]=a(async()=>await o.performanceViewService.getPerformanceData(),{onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1)});i(()=>H.subscribe(n));const[d,{execute:p,loading:c}]=a(async()=>await o.environmentViewService.getEnvironmentData());i(()=>H.subscribe(p));return t(T,{children:[t(l,{items:O,actions:j,onAction:async e=>{"back-action"===e&&o.routerService.push("/main"),"setup-action"===e&&o.routerService.push("/about/setup"),"update-now"===e&&await(async()=>{o.performanceViewService.getPerformanceData.clear(),o.performanceViewService.getPerformanceReport.clear(),o.environmentViewService.getEnvironmentData.clear(),await H.next()})(),"download-markdown"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceReport(),t=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(t);o.layoutService.downloadFile(a,`performance_${Date.now()}.md`)})(),"download-pdf"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceReport();await m(e)})(),"download-json"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceData(),t=JSON.stringify(e,null,2),a=new Blob([t],{type:"text/plain"}),i=URL.createObjectURL(a);o.layoutService.downloadFile(i,`performance_${Date.now()}.md`)})()}}),e&&d?r||c?null:t(g,{handler:()=>{const t=e.totalEvents>0?e.totalDuration/e.totalEvents:0;return{channel:d.telegram_channel,github:"https://github.com/tripolskypetr/backtest-kit",totalEvents:e.totalEvents,totalDuration:e.totalDuration,avgDuration:t}},fields:I}):null]})},isActive:e=>V(["/about"],e)},{id:"main",element:()=>{const[e,{execute:n,loading:r}]=a(async()=>await o.setupViewService.getSetupData(),{onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1)});i(()=>$.subscribe(n));return t(T,{children:[t(l,{items:z,actions:G,onAction:async e=>{"back-action"===e&&o.routerService.push("/about"),"update-now"===e&&await J()}}),e?r?null:t(g,{handler:e,payload:()=>({handleReload:J}),fields:N}):null]})},isActive:e=>V(["/about/setup"],e)}],q=()=>t(R,{history:o.routerService,onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1),routes:K});export{q as AboutPage,q as default};
1
+ import{b as e,f as t,X as a,i as o,Y as i,Z as n,v as l,w as r,z as d,y as p,A as c,E as s,H as y,x as g,q as m,$ as h,T as u,l as f,B as b,a0 as x,P as w,a1 as v,a2 as k,O as B,a3 as M,a4 as S,a5 as L,a6 as R}from"./index-C9KwLGA7.js";import{h as V}from"./hasRouteMatch-DuqX5A31.js";import{P as D}from"./PictureAsPdfOutlined-DSKCe3EJ.js";import{C as T,R as C}from"./Refresh-kZF-8lkD.js";import{K as A}from"./KeyboardArrowLeft-BKA83vx6.js";const P=e(t("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings"),_=e(t("path",{d:"M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"}),"Telegram"),E=144,O=[{type:r.Link,action:"back-action",label:t(A,{sx:{display:"block"}})},{type:r.Link,action:"back-action",label:"Dashboard"},{type:r.Link,action:"back-action",label:"Performance"},{type:r.Button,action:"download-pdf",label:"Download PDF",icon:D},{type:r.Fab,action:"setup-action",label:"Settings",icon:P}],j=[{action:"setup-action",label:"Settings",icon:()=>t(d,{icon:P,color:"#4caf50"})},{divider:!0},{action:"download-json",label:"Download JSON",icon:()=>t(d,{icon:p,color:"#4caf50"})},{action:"download-markdown",label:"Download Markdown",icon:()=>t(d,{icon:c,color:"#4caf50"})},{action:"download-pdf",label:"Download PDF",icon:()=>t(d,{icon:s,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>t(d,{icon:C,color:"#4caf50"})}],U=({name:e,title:t})=>({type:y.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",paddingBottom:"8px",alignItems:"center"},fields:[{type:y.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:t},{type:y.Div},{type:y.Typography,typoVariant:"h6",style:{textAlign:"right",fontWeight:"bold"},fieldBottomMargin:"0",fieldRightMargin:"0",compute:({[e]:t})=>t||0===t?"totalEvents"===e?Number(t).toFixed(2):"totalDuration"===e||"avgDuration"===e?`${Number(t).toFixed(2)} ${x("ms")}`:t:"-",name:e}]}),F=({name:e,title:a})=>({type:y.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",paddingBottom:"8px",alignItems:"center"},fields:[{type:y.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:a},{type:y.Div},{type:y.Component,style:{textAlign:"right",fontWeight:"bold"},fieldBottomMargin:"0",fieldRightMargin:"0",element:({[e]:a})=>{const o="github"===e,i=o?"#6A1B9A":"#24A1DE";return t(B,{size:"medium",disabled:!a,startIcon:t(h,{sx:{background:"#eee",height:"25px",width:"25px"},children:t(o?k:_,{sx:{color:i,fontSize:"16px !important",transform:"translate(-0.5px, 0px)"}})}),sx:{background:"white",color:i,"&:hover":{background:"white",color:i}},onClick:()=>{if(o)v(String(a));else{const e=String(a).replaceAll("@","");v(`https://t.me/${e}`)}},children:x(a?"Open":"Not configured")})},name:e}]}),I=[{type:y.Box,sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"80vh"},child:{type:y.Layout,customLayout:({children:e})=>t(w,{sx:{width:"335px"},children:e}),fields:[{type:y.Component,element:()=>t(b,{sx:{background:e=>f(e.palette.background.paper,.13),display:"flex",alignItems:"center",flexDirection:"column",gap:1,p:1},children:[t(h,{sx:{height:E,width:E,marginTop:"36px",marginBottom:"36px"},src:"/logo/icon512_maskable.png"}),t(u,{variant:"subtitle2",sx:{opacity:.5},children:"Backtest Kit"})]})},{type:y.Layout,customLayout:({children:e})=>t(b,{p:1,children:e}),fields:[{type:y.Div,style:{height:"2px"}},{type:y.Div,style:{height:"12px"}},U({name:"totalEvents",title:x("Total events")}),U({name:"totalDuration",title:x("Total time")}),U({name:"avgDuration",title:x("Average time")}),F({name:"channel",title:x("Channel")}),F({name:"github",title:"GitHub"})]}]}}],H=new n,N=[{type:y.Group,fieldRightMargin:"1",phoneColumns:"12",tabletColumns:"12",desktopColumns:"6",fields:[{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"1",typoVariant:"h6",placeholder:"Running mode"},{type:y.Typography,fieldBottomMargin:"1",isVisible:({running_mode:e})=>"backtest"===e,style:{color:"orange"},typoVariant:"body1",placeholder:"Historical data processing"},{type:y.Typography,fieldBottomMargin:"1",isVisible:({running_mode:e})=>"live"===e,style:{color:"green"},typoVariant:"body1",placeholder:"Real-time exchange integration"},{type:y.Typography,fieldBottomMargin:"1",isVisible:({running_mode:e})=>"none"===e,style:{color:"red"},typoVariant:"body1",placeholder:"UI only"},{type:y.Radio,readonly:!0,fieldBottomMargin:"0",name:"running_mode",radioValue:"backtest",title:"Historical data"},{type:y.Radio,readonly:!0,fieldBottomMargin:"0",name:"running_mode",radioValue:"live",title:"Real-time"},{type:y.Radio,readonly:!0,fieldBottomMargin:"0",name:"running_mode",radioValue:"none",title:"Frontend only"}]},{type:y.Paper,fieldBottomMargin:"1",innerPadding:"0px",fields:[{type:y.Box,sx:{paddingTop:"16px",paddingLeft:"16px",paddingRight:"16px"},fields:[{type:y.Typography,fieldBottomMargin:"1",typoVariant:"h6",placeholder:"Log mode"},{type:y.Typography,fieldBottomMargin:"2",style:{opacity:.5},typoVariant:"caption",placeholder:"Logs take up disk space but are needed for debugging"}]},...[{title:"JSONL files",description:"Files processed by Claude Code, HuggingFace, Parquet",name:"recent_enabled"},{title:"Markdown files",description:"Human-readable files. Useful when running without a GUI",name:"markdown_enabled"},{title:"Dump files",description:"Conversation dump with the AI agent used for trading signals",name:"dump_enabled"}].map(({name:e,title:t,description:a},o)=>(({title:e,description:t,name:a,idx:o})=>({type:y.Box,sx:{display:"grid",alignItems:"center",gridTemplateColumns:"1fr auto",paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"4px",background:e=>o%2==0?L(e.palette.getContrastText(e.palette.background.paper),.04):"transparent"},fields:[{type:y.Box,fields:[{type:y.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:e},{type:y.Typography,fieldBottomMargin:"0",style:{opacity:.5},typoVariant:"caption",placeholder:t}]},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",fieldRightMargin:"0",title:"",name:a}]}))({name:e,title:t,description:a,idx:o}))]},{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"1",typoVariant:"h6",placeholder:"User interface"},{type:y.Switch,readonly:!0,fieldBottomMargin:"0",title:"Save notifications",name:"notification_enabled"},{type:y.Typography,fieldBottomMargin:"1",style:{opacity:.5},typoVariant:"caption",placeholder:"Event history is saved to disk"},{type:y.Switch,readonly:!0,fieldBottomMargin:"0",title:"Save signals",name:"storage_enabled"},{type:y.Typography,fieldBottomMargin:"0",style:{opacity:.5},typoVariant:"caption",placeholder:"Latest signal state is saved to disk"}]}]},{type:y.Group,fieldRightMargin:"1",fieldBottomMargin:"2",phoneColumns:"12",tabletColumns:"12",desktopColumns:"6",fields:[{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"3",typoVariant:"h6",placeholder:"Strategy"},{type:y.Typography,placeholder:"Broker"},{type:y.Outline,fieldBottomMargin:"3",fields:[{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Connected to mainnet (production)",name:"broker_enabled"}]},{type:y.Typography,placeholder:"Market signals"},{type:y.Outline,fieldBottomMargin:"4",fields:[{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Use BM25 for RAG",name:"memory_enabled"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Use stateful strategies",name:"state_enabled"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Save previous signal",name:"recent_enabled"}]}]},{type:y.Paper,fieldBottomMargin:"1",fields:[{type:y.Typography,fieldBottomMargin:"2",typoVariant:"h6",placeholder:"Risk management"},{type:y.Typography,fieldBottomMargin:"3",style:{opacity:.5},typoVariant:"body1",placeholder:"Use LONG or SHORT positions depending on market conditions"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"0",title:"Enable LONG",name:"enable_long"},{type:y.Checkbox,readonly:!0,fieldBottomMargin:"1",title:"Enable SHORT",name:"enable_short"}]}]},{type:y.Component,desktopHidden:!0,fieldBottomMargin:"5",fieldRightMargin:"1",element:({payload:e})=>{const a=M();return t(S,{variant:"contained",size:"large",startIcon:t(C,{}),onClick:async()=>{await e.handleReload(),a()},children:"Refresh"})}}],z=[{type:r.Link,action:"back-action",label:t(A,{sx:{display:"block"}})},{type:r.Link,action:"back-action",label:"Dashboard"},{type:r.Link,action:"back-action",label:"Performance"},{type:r.Link,action:"back-action",label:"Settings"},{type:r.Button,action:"update-now",label:"Refresh",icon:C}],G=[{action:"update-now",label:"Refresh",icon:()=>t(d,{icon:C,color:"#4caf50"})}],$=new n,J=async()=>{o.setupViewService.getSetupData.clear(),await $.next()},K=[{id:"search",element:()=>{const[e,{execute:n,loading:r}]=a(async()=>await o.performanceViewService.getPerformanceData(),{onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1)});i(()=>H.subscribe(n));const[d,{execute:p,loading:c}]=a(async()=>await o.environmentViewService.getEnvironmentData());i(()=>H.subscribe(p));return t(T,{children:[t(l,{items:O,actions:j,onAction:async e=>{"back-action"===e&&o.routerService.push("/main"),"setup-action"===e&&o.routerService.push("/about/setup"),"update-now"===e&&await(async()=>{o.performanceViewService.getPerformanceData.clear(),o.performanceViewService.getPerformanceReport.clear(),o.environmentViewService.getEnvironmentData.clear(),await H.next()})(),"download-markdown"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceReport(),t=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(t);o.layoutService.downloadFile(a,`performance_${Date.now()}.md`)})(),"download-pdf"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceReport();await m(e)})(),"download-json"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceData(),t=JSON.stringify(e,null,2),a=new Blob([t],{type:"text/plain"}),i=URL.createObjectURL(a);o.layoutService.downloadFile(i,`performance_${Date.now()}.md`)})()}}),e&&d?r||c?null:t(g,{handler:()=>{const t=e.totalEvents>0?e.totalDuration/e.totalEvents:0;return{channel:d.telegram_channel,github:"https://github.com/tripolskypetr/backtest-kit",totalEvents:e.totalEvents,totalDuration:e.totalDuration,avgDuration:t}},fields:I}):null]})},isActive:e=>V(["/about"],e)},{id:"main",element:()=>{const[e,{execute:n,loading:r}]=a(async()=>await o.setupViewService.getSetupData(),{onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1)});i(()=>$.subscribe(n));return t(T,{children:[t(l,{items:z,actions:G,onAction:async e=>{"back-action"===e&&o.routerService.push("/about"),"update-now"===e&&await J()}}),e?r?null:t(g,{handler:e,payload:()=>({handleReload:J}),fields:N}):null]})},isActive:e=>V(["/about/setup"],e)}],q=()=>t(R,{history:o.routerService,onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1),routes:K});export{q as AboutPage,q as default};
@@ -1 +1 @@
1
- import{r as e,f as a,P as i,B as r,N as n,$ as t,T as o,al as s,K as c,a0 as l,F as d,aE as p,M as m,aF as u,aG as b,aH as v,aI as y,az as g,aJ as h,aK as x,aL as k,aM as f,aN as $,aO as P,aP as S,i as w,av as C,Z as _,aw as E,v as L,w as F,aQ as z,aR as A,z as O}from"./index-is6UARFt.js";import{C as D,R as j}from"./Refresh-6IBmzTpL.js";import{K as T}from"./KeyboardArrowLeft-nUGbVivG.js";const B=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(P,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(g,{sx:i});case"signal.scheduled":return a(S,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(h,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(f,{sx:i});case"breakeven.available":case"breakeven.commit":return a($,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a(x,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a(k,{sx:i});case"risk.rejection":return a(y,{sx:i});case"error.info":case"error.validation":case"signal.info":return a(b,{sx:i});case"error.critical":return a(v,{sx:i});default:return a(u,{sx:i})}},R=e=>{switch(e.type){case"signal.opened":return`${l("Opened")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.closed":return`${l("Closed")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"signal.scheduled":return`${l("Scheduled")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.cancelled":return`${l("Cancelled")} ${e.symbol}`;case"partial_profit.available":return`${l("Partial profit")} ${e.level}% ${e.symbol}`;case"partial_profit.commit":return`${l("Profit fixed")} ${e.percentToClose}% ${e.symbol}`;case"partial_loss.available":return`${l("Partial loss")} ${e.level}% ${e.symbol}`;case"partial_loss.commit":return`${l("Loss fixed")} ${e.percentToClose}% ${e.symbol}`;case"breakeven.available":return`${l("Breakeven available")} ${e.symbol}`;case"breakeven.commit":return`${l("Breakeven set")} ${e.symbol}`;case"activate_scheduled.commit":return`${l("Activated")} ${e.position.toUpperCase()} ${e.symbol}`;case"average_buy.commit":return`${l("Average Buy")} ${e.symbol}`;case"trailing_stop.commit":return`${l("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${l("Trailing take")} ${e.symbol}`;case"signal_sync.open":return`${l("Sync Open")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal_sync.close":return`${l("Sync Close")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"cancel_scheduled.commit":return`${l("Cancel Scheduled")} ${e.symbol}`;case"close_pending.commit":return`${l("Close Pending")} ${e.symbol}`;case"risk.rejection":return`${l("Rejected")} ${e.position.toUpperCase()} ${e.symbol}`;case"error.info":return`${l("Error")}: ${e.message}`;case"error.validation":return`${l("Validation")}: ${e.message}`;case"error.critical":return`${l("Critical")}: ${e.message}`;case"signal.info":return`${l("Signal Info")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;default:return l("Unknown")}},I=e=>{switch(e.type){case"signal.opened":return l("Signal Opened");case"signal.closed":return l("Signal Closed");case"signal.scheduled":return l("Signal Scheduled");case"signal.cancelled":return l("Signal Cancelled");case"partial_profit.available":return l("Partial Profit Available");case"partial_profit.commit":return l("Partial Profit Commit");case"partial_loss.available":return l("Partial Loss Available");case"partial_loss.commit":return l("Partial Loss Commit");case"breakeven.available":return l("Breakeven Available");case"breakeven.commit":return l("Breakeven Commit");case"activate_scheduled.commit":return l("Activated Scheduled");case"average_buy.commit":return l("Average Buy");case"trailing_stop.commit":return l("Trailing Stop");case"trailing_take.commit":return l("Trailing Take");case"signal_sync.open":return l("Signal Sync Open");case"signal_sync.close":return l("Signal Sync Close");case"cancel_scheduled.commit":return l("Cancel Scheduled");case"close_pending.commit":return l("Close Pending");case"risk.rejection":return l("Risk Rejection");case"error.info":return l("Info Error");case"error.validation":return l("Validation Error");case"error.critical":return l("Critical Error");case"signal.info":return l("Signal Info");default:return l("Unknown")}},N=e=>"symbol"in e,U=e=>"position"in e,W=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,M=e=>"pnlPercentage"in e,H=e=>"level"in e,K=e=>"percentToClose"in e,Y=e=>"currentPrice"in e,V=e=>"duration"in e,q=e=>"closeReason"in e,G=e=>"cancelReason"in e,J=e=>"percentShift"in e,Q=e=>"signal.opened"===e.type?"note"in e&&!!e.note:"signal.info"===e.type?"note"in e&&!!e.note&&!!e.notificationId:"activate_scheduled.commit"===e.type?"note"in e&&!!e.note&&!!e.activateId:"close_pending.commit"===e.type?"note"in e&&!!e.note&&!!e.closeId:"cancel_scheduled.commit"===e.type&&("note"in e&&!!e.note&&!!e.cancelId),Z=e=>"message"in e,X=e=>"rejectionNote"in e,ee=e=>"activePositionCount"in e,ae=e=>"effectivePriceOpen"in e,ie=e=>"totalEntries"in e&&e.totalEntries>1,re=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,ne=e=>"totalPartials"in e&&e.totalPartials>0,te=e=>"cost"in e,oe=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,se=e=>"peakProfitPriceClose"in e,ce=e=>"maxDrawdownPriceClose"in e,le=e.forwardRef(({item:e,className:u,style:b,sx:v},y)=>{const g=(e=>{switch(e.type){case"signal.opened":case"activate_scheduled.commit":case"signal_sync.open":return"#4CAF50";case"signal.closed":case"signal_sync.close":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":case"cancel_scheduled.commit":default:return"#9E9E9E";case"partial_profit.available":case"partial_profit.commit":return"#8BC34A";case"partial_loss.available":case"partial_loss.commit":return"#FF5722";case"breakeven.available":case"breakeven.commit":return"#00BCD4";case"trailing_stop.commit":case"trailing_take.commit":return"#673AB7";case"close_pending.commit":return"#607D8B";case"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";case"signal.info":return"#9C27B0"}})(e),h=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:u,style:b,ref:y,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":w.layoutService.pickRisk(e.id);break;case"signal.opened":w.layoutService.pickSignalOpened(e.id);break;case"signal.closed":w.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":w.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":w.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":w.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":w.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":w.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":w.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":w.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":w.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":w.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":w.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":w.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":w.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":w.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":w.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":w.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":w.layoutService.pickClosePending(e.id);break;case"signal.info":w.layoutService.pickSignalNotify(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...v},children:a(r,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[a(n,{direction:"row",spacing:2,sx:{p:2},children:[a(t,{sx:{width:56,height:56,background:g},children:B(e)}),a(n,{flex:1,spacing:1,children:[a(n,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(o,{variant:"h6",sx:{fontWeight:600},children:R(e)}),a(o,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:s(h).format("HH:mm DD/MM/YYYY")})]}),a(n,{mt:-1,direction:"row",flexWrap:"wrap",children:[a(c,{size:"small",label:I(e),sx:{background:g,mt:1,mr:1,color:"white",fontWeight:500}}),N(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.symbol,variant:"outlined"}),U(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),M(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`PnL: ${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`,color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),H(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Level")}: ${e.level}%`,variant:"outlined"}),K(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Close")}: ${e.percentToClose}%`,variant:"outlined"}),V(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Duration")}: ${e.duration} ${l("min")}`,variant:"outlined"}),q(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.closeReason,variant:"outlined",color:"info"}),G(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.cancelReason,variant:"outlined",color:"info"}),J(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ee(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Active")}: ${e.activePositionCount}`,variant:"outlined"}),ie(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Entries")}: ${e.totalEntries}`,variant:"outlined"}),ne(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Partials")}: ${e.totalPartials}`,variant:"outlined"}),te(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Cost")}: ${e.cost.toFixed(2)}$`,variant:"outlined"}),ae(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Avg entry")}: ${e.effectivePriceOpen}`,variant:"outlined",color:"warning"}),re(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Orig entry")}: ${e.originalPriceOpen}`,variant:"outlined"})]}),W(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[Y(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Current"),":"," "]}),e.currentPrice]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Take Profit"),":"," "]}),e.priceTakeProfit]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Stop Loss"),":"," "]}),e.priceStopLoss]})]})]}),oe(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL Entry"),":"," "]}),e.pnlPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL Exit"),":"," "]}),e.pnlPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL"),":"," "]}),a(o,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:[e.pnlCost>=0?"+":"",e.pnlCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.pnlEntries.toFixed(2),"$"]})]})]}),se(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak Entry"),":"," "]}),e.peakProfitPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak Exit"),":"," "]}),e.peakProfitPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak"),":"," "]}),a(o,{component:"span",color:e.peakProfitCost>=0?"success.main":"error.main",children:[e.peakProfitCost>=0?"+":"",e.peakProfitCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.peakProfitEntries.toFixed(2),"$"]})]})]}),ce(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown Entry"),":"," "]}),e.maxDrawdownPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown Exit"),":"," "]}),e.maxDrawdownPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown"),":"," "]}),a(o,{component:"span",color:e.maxDrawdownCost>=0?"success.main":"error.main",children:[e.maxDrawdownCost>=0?"+":"",e.maxDrawdownCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.maxDrawdownEntries.toFixed(2),"$"]})]})]})]})]}),Q(e)&&a(r,{onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(r,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordWrap:"break-word"},children:a(m,{content:e.note})})]}),X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"error",children:e.rejectionNote})]}),Z(e)&&!Q(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"text.secondary",children:e.message})]}),a(r,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:g}})]})})})}),de=[{action:"update-now",label:"Refresh manually",icon:()=>a(O,{icon:j,color:"#4caf50"})}],pe=[{type:F.Link,action:"back-action",label:a(T,{sx:{display:"block"}})},{type:F.Link,action:"back-action",label:"Main"},{type:F.Link,action:"back-action",label:"Notifications"}],me=new _,ue=()=>{const{data:e,hasMore:i,loading:r,onSkip:n}=C({handler:async(e,a)=>{const i=await w.notificationViewService.getList(),r=E(e,a);for(const n of i)if(r([n]).done)break;return r().rows},onLoadStart:()=>w.layoutService.setAppbarLoader(!0),onLoadEnd:()=>w.layoutService.setAppbarLoader(!1),reloadSubject:me});return a(D,{children:[a(L,{items:pe,actions:de,onAction:async e=>{"back-action"===e&&w.routerService.push("/"),"update-now"===e&&await me.next()}}),a(z,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:r,onDataRequest:n,bufferSize:A,hasMore:i,children:e.map(e=>a(le,{item:e,sx:{mb:1}},e.id))})]})};export{ue as NotificationPage,ue as default};
1
+ import{r as e,f as a,P as i,B as r,N as n,$ as t,T as o,al as s,K as c,a0 as l,F as d,aE as p,M as m,aF as u,aG as b,aH as v,aI as y,az as g,aJ as h,aK as x,aL as k,aM as f,aN as $,aO as P,aP as S,i as w,av as C,Z as _,aw as E,v as L,w as F,aQ as z,aR as A,z as O}from"./index-C9KwLGA7.js";import{C as D,R as j}from"./Refresh-kZF-8lkD.js";import{K as T}from"./KeyboardArrowLeft-BKA83vx6.js";const B=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(P,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(g,{sx:i});case"signal.scheduled":return a(S,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(h,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(f,{sx:i});case"breakeven.available":case"breakeven.commit":return a($,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a(x,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a(k,{sx:i});case"risk.rejection":return a(y,{sx:i});case"error.info":case"error.validation":case"signal.info":return a(b,{sx:i});case"error.critical":return a(v,{sx:i});default:return a(u,{sx:i})}},R=e=>{switch(e.type){case"signal.opened":return`${l("Opened")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.closed":return`${l("Closed")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"signal.scheduled":return`${l("Scheduled")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.cancelled":return`${l("Cancelled")} ${e.symbol}`;case"partial_profit.available":return`${l("Partial profit")} ${e.level}% ${e.symbol}`;case"partial_profit.commit":return`${l("Profit fixed")} ${e.percentToClose}% ${e.symbol}`;case"partial_loss.available":return`${l("Partial loss")} ${e.level}% ${e.symbol}`;case"partial_loss.commit":return`${l("Loss fixed")} ${e.percentToClose}% ${e.symbol}`;case"breakeven.available":return`${l("Breakeven available")} ${e.symbol}`;case"breakeven.commit":return`${l("Breakeven set")} ${e.symbol}`;case"activate_scheduled.commit":return`${l("Activated")} ${e.position.toUpperCase()} ${e.symbol}`;case"average_buy.commit":return`${l("Average Buy")} ${e.symbol}`;case"trailing_stop.commit":return`${l("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${l("Trailing take")} ${e.symbol}`;case"signal_sync.open":return`${l("Sync Open")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal_sync.close":return`${l("Sync Close")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"cancel_scheduled.commit":return`${l("Cancel Scheduled")} ${e.symbol}`;case"close_pending.commit":return`${l("Close Pending")} ${e.symbol}`;case"risk.rejection":return`${l("Rejected")} ${e.position.toUpperCase()} ${e.symbol}`;case"error.info":return`${l("Error")}: ${e.message}`;case"error.validation":return`${l("Validation")}: ${e.message}`;case"error.critical":return`${l("Critical")}: ${e.message}`;case"signal.info":return`${l("Signal Info")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;default:return l("Unknown")}},I=e=>{switch(e.type){case"signal.opened":return l("Signal Opened");case"signal.closed":return l("Signal Closed");case"signal.scheduled":return l("Signal Scheduled");case"signal.cancelled":return l("Signal Cancelled");case"partial_profit.available":return l("Partial Profit Available");case"partial_profit.commit":return l("Partial Profit Commit");case"partial_loss.available":return l("Partial Loss Available");case"partial_loss.commit":return l("Partial Loss Commit");case"breakeven.available":return l("Breakeven Available");case"breakeven.commit":return l("Breakeven Commit");case"activate_scheduled.commit":return l("Activated Scheduled");case"average_buy.commit":return l("Average Buy");case"trailing_stop.commit":return l("Trailing Stop");case"trailing_take.commit":return l("Trailing Take");case"signal_sync.open":return l("Signal Sync Open");case"signal_sync.close":return l("Signal Sync Close");case"cancel_scheduled.commit":return l("Cancel Scheduled");case"close_pending.commit":return l("Close Pending");case"risk.rejection":return l("Risk Rejection");case"error.info":return l("Info Error");case"error.validation":return l("Validation Error");case"error.critical":return l("Critical Error");case"signal.info":return l("Signal Info");default:return l("Unknown")}},N=e=>"symbol"in e,U=e=>"position"in e,W=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,M=e=>"pnlPercentage"in e,H=e=>"level"in e,K=e=>"percentToClose"in e,Y=e=>"currentPrice"in e,V=e=>"duration"in e,q=e=>"closeReason"in e,G=e=>"cancelReason"in e,J=e=>"percentShift"in e,Q=e=>"signal.opened"===e.type?"note"in e&&!!e.note:"signal.info"===e.type?"note"in e&&!!e.note&&!!e.notificationId:"activate_scheduled.commit"===e.type?"note"in e&&!!e.note&&!!e.activateId:"close_pending.commit"===e.type?"note"in e&&!!e.note&&!!e.closeId:"cancel_scheduled.commit"===e.type&&("note"in e&&!!e.note&&!!e.cancelId),Z=e=>"message"in e,X=e=>"rejectionNote"in e,ee=e=>"activePositionCount"in e,ae=e=>"effectivePriceOpen"in e,ie=e=>"totalEntries"in e&&e.totalEntries>1,re=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,ne=e=>"totalPartials"in e&&e.totalPartials>0,te=e=>"cost"in e,oe=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,se=e=>"peakProfitPriceClose"in e,ce=e=>"maxDrawdownPriceClose"in e,le=e.forwardRef(({item:e,className:u,style:b,sx:v},y)=>{const g=(e=>{switch(e.type){case"signal.opened":case"activate_scheduled.commit":case"signal_sync.open":return"#4CAF50";case"signal.closed":case"signal_sync.close":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":case"cancel_scheduled.commit":default:return"#9E9E9E";case"partial_profit.available":case"partial_profit.commit":return"#8BC34A";case"partial_loss.available":case"partial_loss.commit":return"#FF5722";case"breakeven.available":case"breakeven.commit":return"#00BCD4";case"trailing_stop.commit":case"trailing_take.commit":return"#673AB7";case"close_pending.commit":return"#607D8B";case"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";case"signal.info":return"#9C27B0"}})(e),h=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:u,style:b,ref:y,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":w.layoutService.pickRisk(e.id);break;case"signal.opened":w.layoutService.pickSignalOpened(e.id);break;case"signal.closed":w.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":w.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":w.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":w.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":w.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":w.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":w.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":w.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":w.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":w.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":w.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":w.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":w.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":w.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":w.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":w.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":w.layoutService.pickClosePending(e.id);break;case"signal.info":w.layoutService.pickSignalNotify(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...v},children:a(r,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[a(n,{direction:"row",spacing:2,sx:{p:2},children:[a(t,{sx:{width:56,height:56,background:g},children:B(e)}),a(n,{flex:1,spacing:1,children:[a(n,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(o,{variant:"h6",sx:{fontWeight:600},children:R(e)}),a(o,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:s(h).format("HH:mm DD/MM/YYYY")})]}),a(n,{mt:-1,direction:"row",flexWrap:"wrap",children:[a(c,{size:"small",label:I(e),sx:{background:g,mt:1,mr:1,color:"white",fontWeight:500}}),N(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.symbol,variant:"outlined"}),U(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),M(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`PnL: ${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`,color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),H(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Level")}: ${e.level}%`,variant:"outlined"}),K(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Close")}: ${e.percentToClose}%`,variant:"outlined"}),V(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Duration")}: ${e.duration} ${l("min")}`,variant:"outlined"}),q(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.closeReason,variant:"outlined",color:"info"}),G(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:e.cancelReason,variant:"outlined",color:"info"}),J(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ee(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Active")}: ${e.activePositionCount}`,variant:"outlined"}),ie(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Entries")}: ${e.totalEntries}`,variant:"outlined"}),ne(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Partials")}: ${e.totalPartials}`,variant:"outlined"}),te(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Cost")}: ${e.cost.toFixed(2)}$`,variant:"outlined"}),ae(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Avg entry")}: ${e.effectivePriceOpen}`,variant:"outlined",color:"warning"}),re(e)&&a(c,{size:"small",sx:{mt:1,mr:1},label:`${l("Orig entry")}: ${e.originalPriceOpen}`,variant:"outlined"})]}),W(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[Y(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Current"),":"," "]}),e.currentPrice]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Take Profit"),":"," "]}),e.priceTakeProfit]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Stop Loss"),":"," "]}),e.priceStopLoss]})]})]}),oe(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL Entry"),":"," "]}),e.pnlPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL Exit"),":"," "]}),e.pnlPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL"),":"," "]}),a(o,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:[e.pnlCost>=0?"+":"",e.pnlCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.pnlEntries.toFixed(2),"$"]})]})]}),se(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak Entry"),":"," "]}),e.peakProfitPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak Exit"),":"," "]}),e.peakProfitPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak"),":"," "]}),a(o,{component:"span",color:e.peakProfitCost>=0?"success.main":"error.main",children:[e.peakProfitCost>=0?"+":"",e.peakProfitCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.peakProfitEntries.toFixed(2),"$"]})]})]}),ce(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown Entry"),":"," "]}),e.maxDrawdownPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown Exit"),":"," "]}),e.maxDrawdownPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown"),":"," "]}),a(o,{component:"span",color:e.maxDrawdownCost>=0?"success.main":"error.main",children:[e.maxDrawdownCost>=0?"+":"",e.maxDrawdownCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.maxDrawdownEntries.toFixed(2),"$"]})]})]})]})]}),Q(e)&&a(r,{onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(r,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordWrap:"break-word"},children:a(m,{content:e.note})})]}),X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"error",children:e.rejectionNote})]}),Z(e)&&!Q(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"text.secondary",children:e.message})]}),a(r,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:g}})]})})})}),de=[{action:"update-now",label:"Refresh manually",icon:()=>a(O,{icon:j,color:"#4caf50"})}],pe=[{type:F.Link,action:"back-action",label:a(T,{sx:{display:"block"}})},{type:F.Link,action:"back-action",label:"Main"},{type:F.Link,action:"back-action",label:"Notifications"}],me=new _,ue=()=>{const{data:e,hasMore:i,loading:r,onSkip:n}=C({handler:async(e,a)=>{const i=await w.notificationViewService.getList(),r=E(e,a);for(const n of i)if(r([n]).done)break;return r().rows},onLoadStart:()=>w.layoutService.setAppbarLoader(!0),onLoadEnd:()=>w.layoutService.setAppbarLoader(!1),reloadSubject:me});return a(D,{children:[a(L,{items:pe,actions:de,onAction:async e=>{"back-action"===e&&w.routerService.push("/"),"update-now"===e&&await me.next()}}),a(z,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:r,onDataRequest:n,bufferSize:A,hasMore:i,children:e.map(e=>a(le,{item:e,sx:{mb:1}},e.id))})]})};export{ue as NotificationPage,ue as default};
@@ -1 +1 @@
1
- import{g as e,a as t,b as a,f as o,r as n,u as r,_ as i,d as s,I as l,C as c,e as d,j as p,k as h,s as m,P as v,l as u,n as g,T as f,o as y,B as w,M as z,t as b,p as x,D as S,F as C,q as M,v as k,w as V,J as H,i as L,x as $,y as N,z as T,A,E as R,G as F,H as P,K as B,L as I,N as D,O,Q as E,R as j,V as W,W as J}from"./index-is6UARFt.js";import{r as _}from"./emitters-1aP5uqiT.js";import{C as G,R as U}from"./Refresh-6IBmzTpL.js";function K(t){return e("MuiAlert",t)}const Z=t("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),q=a(o("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Q=a(o("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),X=a(o("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Y=a(o("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),ee=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],te=m(v,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[a.variant],t[`${a.variant}${p(a.color||a.severity)}`]]}})(({theme:e,ownerState:t})=>{const a="light"===e.palette.mode?u:g,o="light"===e.palette.mode?g:u,n=t.color||t.severity;return s({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},n&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${n}Color`]:a(e.palette[n].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${n}StandardBg`]:o(e.palette[n].light,.9),[`& .${Z.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}},n&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${n}Color`]:a(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${Z.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}},n&&"filled"===t.variant&&s({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${n}FilledColor`],backgroundColor:e.vars.palette.Alert[`${n}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[n].dark:e.palette[n].main,color:e.palette.getContrastText(e.palette[n].main)}))}),ae=m("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),oe=m("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),ne=m("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),re={success:o(q,{fontSize:"inherit"}),warning:o(Q,{fontSize:"inherit"}),error:o(X,{fontSize:"inherit"}),info:o(Y,{fontSize:"inherit"})},ie=n.forwardRef(function(e,t){var a,n,m,v,u,g;const f=r({props:e,name:"MuiAlert"}),{action:y,children:w,className:z,closeText:b="Close",color:x,components:S={},componentsProps:C={},icon:M,iconMapping:k=re,onClose:V,role:H="alert",severity:L="success",slotProps:$={},slots:N={},variant:T="standard"}=f,A=i(f,ee),R=s({},f,{color:x,severity:L,variant:T}),F=(e=>{const{variant:t,color:a,severity:o,classes:n}=e,r={root:["root",`${t}${p(a||o)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return h(r,K,n)})(R),P=null!=(a=null!=(n=N.closeButton)?n:S.CloseButton)?a:l,B=null!=(m=null!=(v=N.closeIcon)?v:S.CloseIcon)?m:c,I=null!=(u=$.closeButton)?u:C.closeButton,D=null!=(g=$.closeIcon)?g:C.closeIcon;return o(te,s({role:H,elevation:0,ownerState:R,className:d(F.root,z),ref:t},A,{children:[!1!==M?o(ae,{ownerState:R,className:F.icon,children:M||k[L]||re[L]}):null,o(oe,{ownerState:R,className:F.message,children:w}),null!=y?o(ne,{ownerState:R,className:F.action,children:y}):null,null==y&&V?o(ne,{ownerState:R,className:F.action,children:o(P,s({size:"small","aria-label":b,title:b,color:"inherit",onClick:V},I,{children:o(B,s({fontSize:"small"},D))}))}):null]}))}),se=a([o("path",{d:"M13 17c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h6V5H5v14h14v-2h-6z",opacity:".3"}),o("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.38-1-1.72zM20 9v6h-7V9h7zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2H5z"}),o("circle",{cx:"16",cy:"12",r:"1.5"})],"AccountBalanceWalletTwoTone"),le=a([o("path",{d:"M8 6h8v6H8zm11 8H5c-.55 0-1 .45-1 1v3h16v-3c0-.55-.45-1-1-1zm-1 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z",opacity:".3"}),o("path",{d:"M19 12h-1V4H6v8H5c-1.66 0-3 1.34-3 3v5h20v-5c0-1.66-1.34-3-3-3zM8 6h8v6H8V6zm12 12H4v-3c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v3z"}),o("circle",{cx:"18",cy:"16",r:"1"})],"AdfScannerTwoTone"),ce=a([o("path",{d:"M9 4H7v2H5v12h2v2h2v-2h2V6H9V4zm0 12H7V8h2v8z"}),o("path",{d:"M7 8h2v8H7zm8 2h2v3h-2z",opacity:".3"}),o("path",{d:"M19 8h-2V4h-2v4h-2v7h2v5h2v-5h2V8zm-2 5h-2v-3h2v3z"})],"CandlestickChartTwoTone"),de=a([o("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8zm0 14.5c-.83 0-1.5-.67-1.5-1.5h3c0 .83-.67 1.5-1.5 1.5zm5-2.5H7v-2h1v-2.61C8 9.27 9.03 7.47 11 7v-.5c0-.57.43-1 1-1s1 .43 1 1V7c1.97.47 3 2.28 3 4.39V14h1v2z",opacity:".3"}),o("path",{d:"M12 18.5c.83 0 1.5-.67 1.5-1.5h-3c0 .83.67 1.5 1.5 1.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4-8.61c0-2.11-1.03-3.92-3-4.39v-.5c0-.57-.43-1-1-1s-1 .43-1 1V7c-1.97.47-3 2.27-3 4.39V14H7v2h10v-2h-1v-2.61zM14 14h-4v-3c0-1.1.9-2 2-2s2 .9 2 2v3z"})],"CircleNotificationsTwoTone"),pe=a(o("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),he=a(o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),me=a([o("path",{d:"M14 4H6v16h12V8h-4V4zm2 7v4c0 2.21-1.79 4-4 4s-4-1.79-4-4V9.5C8 8.12 9.12 7 10.5 7S13 8.12 13 9.5V15h-2V9.5c0-.28-.22-.5-.5-.5s-.5.22-.5.5V15c0 1.1.9 2 2 2s2-.9 2-2v-4h2z",opacity:".3"}),o("path",{d:"M14 15c0 1.1-.9 2-2 2s-2-.9-2-2V9.5c0-.28.22-.5.5-.5s.5.22.5.5V15h2V9.5C13 8.12 11.88 7 10.5 7S8 8.12 8 9.5V15c0 2.21 1.79 4 4 4s4-1.79 4-4v-4h-2v4z"}),o("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h8v4h4v12z"})],"FilePresentTwoTone"),ve=a([o("path",{d:"M19 5H5v14h14V5zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z",opacity:".3"}),o("path",{d:"M3 5v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2zm2 0h14v14H5V5zm2 5h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"})],"InsertChartTwoTone"),ue=a([o("path",{d:"M10 5h4v14h-4V5zm-6 6h4v8H4v-8zm16 8h-4v-6h4v6z",opacity:".3"}),o("path",{d:"M16 11V3H8v6H2v12h20V11h-6zm-6-6h4v14h-4V5zm-6 6h4v8H4v-8zm16 8h-4v-6h4v6z"})],"LeaderboardTwoTone"),ge=a(o(n.Fragment,{children:[o("path",{d:"M12 20c4.41 0 8-3.59 8-8s-3.59-8-8-8-8 3.59-8 8 3.59 8 8 8zM10 7.5l6 4.5-6 4.5v-9z",opacity:".3"}),o("path",{d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10zm0-18c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8zm-2 3.5v9l6-4.5z"})]}),"PlayCircleFilledWhiteTwoTone"),fe=a([o("path",{d:"M4 18h16V8H4v10zm8-3h6v2h-6v-2zm-5.91-4.59L7.5 9l4 4-4 4-1.41-1.41L8.67 13l-2.58-2.59z",opacity:".3"}),o("path",{d:"M12 15h6v2h-6z"}),o("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm0 14H4V8h16v10z"}),o("path",{d:"m7.5 17 4-4-4-4-1.41 1.41L8.67 13l-2.58 2.59z"})],"TerminalTwoTone"),ye=x()(e=>({root:{marginTop:e.spacing(1),marginBottom:e.spacing(2),marginLeft:e.spacing(2),marginRight:e.spacing(3),background:"white",transition:"opacity 500ms","&:hover":{opacity:1},opacity:.35,cursor:"pointer"},open:{opacity:1},expandButton:{cursor:"pointer !important",marginLeft:e.spacing(1)},downloadButton:{cursor:"pointer !important"}})),we=(e,t="%")=>null===e?"—":`${e.toFixed(2)}${t}`,ze=e=>window.Translate?window.Translate.translateText(e):e,be=({data:e})=>{const{classes:t,cx:a}=ye(),[r,i]=n.useState(!1),s=(e=>{const{context:t,portfolioTotalPnl:a,portfolioSharpeRatio:o,portfolioTotalTrades:n,symbols:r,backtest:i}=e,s=ze(i?"Backtest":"Live"),l=t.frameName?` / ${t.frameName}`:"",c=[`## ${s}: ${t.strategyName} / ${t.exchangeName}${l}`,"",`**${ze("Total PNL")}:** ${we(a)} `,`**Sharpe Ratio:** ${we(o,"")} `,`**${ze("Total trades")}:** ${n}`,""];for(const d of r)c.push(`### ${d.symbol}`,"",`**PNL:** ${we(d.totalPnl)} `,`**Win Rate:** ${we(d.winRate)} `,`**Profit Factor:** ${we(d.profitFactor,"")} `,`**Max Drawdown:** ${we(d.maxDrawdown)} `,`**Expectancy:** ${we(d.expectancy)} `,`**Sortino Ratio:** ${we(d.sortinoRatio,"")} `,`**Calmar Ratio:** ${we(d.calmarRatio,"")} `,`**Recovery Factor:** ${we(d.recoveryFactor,"")} `,`**${ze("Trades")}:** ${d.totalTrades}`,"");return c.join("\n")})(e),c=()=>{i(!r)},d=async e=>{e.stopPropagation(),await M(s)};return o(ie,{className:a(t.root,{[t.open]:r}),action:o(C,{children:[o(l,{className:t.downloadButton,onClick:d,size:"small",children:o(S,{})}),o(l,{className:t.expandButton,onClick:c,size:"small",children:o(r?pe:he,{})})]}),onClick:c,variant:"outlined",severity:"info",children:o(f,{minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",width:"100%",children:[o(f,{variant:"body2",sx:{opacity:r?.5:1,transition:"opacity 500ms"},minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",children:[e.backtest?"Backtest":"Live",": ",e.context.strategyName]}),o(y,{in:r,timeout:"auto",unmountOnExit:!0,children:[o(w,{paddingBottom:"16px"}),o(z,{content:s}),o(w,{paddingBottom:"32px"})]}),!r&&o(f,{variant:"caption",sx:{opacity:.7,mt:1},children:[b(s).slice(0,150),"..."]})]})})},xe="backtest-kit__groupHeader",Se="backtest-kit__groupRoot",Ce="backtest-kit__symbolImage",Me=x()({root:{[`& .${Se}:hover .${xe}`]:{opacity:"1 !important"}}});function ke(e){return W(e,"#000000")>W(e,"#FFFFFF")}const Ve=[{type:V.Link,action:"back-action",label:"Main"},{type:V.Link,action:"back-action",label:"Navigation"}],He=[{action:"download-json",label:"Download Heatmap JSON",icon:()=>o(T,{icon:N,color:"#4caf50"})},{action:"download-markdown",label:"Download Heatmap Markdown",icon:()=>o(T,{icon:A,color:"#4caf50"})},{action:"download-pdf",label:"Download Heatmap PDF",icon:()=>o(T,{icon:R,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(T,{icon:U,color:"#4caf50"})}],Le=(e,t)=>({type:P.Group,className:Se,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:P.Component,className:xe,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(D,{direction:"row",children:[o(B,{variant:"outlined",size:"medium",color:"info",label:`${I.bullet} ${e}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),o(w,{flex:1})]})},{type:P.Group,fields:t.map(({label:e,description:t,to:a,color:n,icon:r})=>((e,t,a,n,r)=>({type:P.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(j,{description:a,children:o(O,{component:E,onClick:()=>{L.routerService.push(e)},sx:{width:"100%",background:n,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${Ce}`]:{transition:"filter 500ms"},"&:hover":{background:()=>ke(n)?u(n,.33):g(n,.33),[`& .${Ce}`]:{transition:"filter 500ms",filter:ke(n)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(r,{className:Ce}),children:t})})}))(a,e,t,n,r))}]}),$e=[{label:"Portfolio Overview",description:J.newline("Closed trading signals grouped by symbol for Backtest and Live modes","Each card shows position type, entry price, TP/SL levels, PNL amount and percent","Displays DCA entry count and partial close count where applicable","Supports JSON export and manual refresh of the signal list"),to:"/overview",color:"#0033AD",icon:se},{label:"PNL Performance",description:J.newline("KPI dashboard with aggregated trading performance metrics per symbol","Shows daily trade counts, success rates, resolved/rejected breakdowns","Revenue analytics across today, yesterday, 7-day and 31-day windows","Toggle between Backtest and Live modes; supports JSON export"),to:"/dashboard",color:"#E6007A",icon:ve},{label:"System Logs",description:J.newline("Virtualized feed of runtime log entries with type badges: Debug, Info, Warn, Log","Each entry shows topic, timestamp and raw JSON arguments in monospace","Filter by keyword or regex via search prompt","Supports full log export as JSON file"),to:"/logs",color:"#58BF00",icon:fe}],Ne=[{label:"Notifications",description:J.newline("Event feed for all trading signals: opens, closes, schedules, errors","Color-coded cards with symbol, position, PNL, entry/exit/TP/SL prices","Infinite-scroll pagination; click any card to open a detailed modal","Supports manual refresh to pull the latest activity"),to:"/notifications",color:"#F7931A",icon:de},{label:"Pending Status",description:J.newline("Live view of active trading signals grouped by strategy","Grid of strategy buttons; click to inspect individual signal state","Detail view shows entry, exit, effective price, DCA and partial counts","Supports per-signal JSON export and manual refresh"),to:"/status",color:"#6F42C1",icon:ge},{label:"Dump Explorer",description:J.newline("Tree-structured file browser for backtest output and artifact files","Icons indicate file type: image, JSON, plain text or generic","Click any file to open a full-screen preview modal","Supports keyword search and manual refresh of the file tree"),to:"/dump",color:"#0090FF",icon:me}],Te=[{label:"Markdown Reports",description:J.newline("Strategy performance reports rendered from markdown for Backtest and Live runs","Grid of strategy buttons grouped by type and sorted by signal volume","Download reports as markdown, PDF or raw JSON","Supports manual refresh to regenerate report content"),to:"/report",color:"#009688",icon:le},{label:"Price Charts",description:J.newline("Interactive candlestick charts powered by TradingView Lightweight Charts","Navigate by symbol then interval (1m, 15m, 1h) to view price history","Overlays active signal lines: entry, take profit (green) and stop loss (red)","Supports chart image export and signal detail inspection"),to:"/price_chart",color:"#1565C0",icon:ce},{label:"Heatmap",description:J.newline("Color-coded performance heatmap across all tracked symbols","Cells show win rate, profit factor, Sharpe ratio and other key metrics","Download heatmap as JSON, markdown report or PDF","Supports manual refresh to recalculate aggregated statistics"),to:"/heat",color:"#8D6E63",icon:ue}],Ae=[Le("Application",$e),Le("Live",Ne),Le("Other",Te)],Re=()=>o(F,{sx:{width:"100%",height:"75px"}}),Fe=()=>{const{classes:e}=Me();return o(G,{children:[o(k,{items:Ve,actions:He,onAction:async e=>{"update-now"===e&&await(async()=>{L.statusViewService.getStatusInfo.clear(),_.next()})(),"download-markdown"===e&&await(async()=>{const e=await L.heatViewService.getStrategyHeatReport(),t=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(t);L.layoutService.downloadFile(a,`heat_${Date.now()}.md`)})(),"download-pdf"===e&&await(async()=>{const e=await L.heatViewService.getStrategyHeatReport();await M(e)})(),"download-json"===e&&await(async()=>{const e=await L.heatViewService.getStrategyHeatData(),t=JSON.stringify(e,null,2),a=new Blob([t],{type:"text/plain"}),o=URL.createObjectURL(a);L.layoutService.downloadFile(o,`heat_${Date.now()}.md`)})()}}),o(H,{Loader:Re,reloadSubject:_,children:async()=>{const e=await L.statusViewService.getStatusInfo();return e?o(be,{data:e}):null}}),o($,{className:e.root,fields:Ae,payload:()=>({history:history})}),o(w,{paddingBottom:"24px"})]})};export{Fe as MainPage,Fe as default};
1
+ import{g as e,a as t,b as a,f as o,r as n,u as r,_ as i,d as s,I as l,C as c,e as d,j as p,k as h,s as m,P as v,l as u,n as g,T as f,o as y,B as w,M as z,t as b,p as x,D as S,F as C,q as M,v as k,w as V,J as H,i as L,x as $,y as N,z as T,A,E as R,G as F,H as P,K as B,L as I,N as D,O,Q as E,R as j,V as W,W as J}from"./index-C9KwLGA7.js";import{r as _}from"./emitters-B7Jkz1Yr.js";import{C as G,R as U}from"./Refresh-kZF-8lkD.js";function K(t){return e("MuiAlert",t)}const Z=t("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),q=a(o("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Q=a(o("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),X=a(o("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Y=a(o("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),ee=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],te=m(v,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[a.variant],t[`${a.variant}${p(a.color||a.severity)}`]]}})(({theme:e,ownerState:t})=>{const a="light"===e.palette.mode?u:g,o="light"===e.palette.mode?g:u,n=t.color||t.severity;return s({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},n&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${n}Color`]:a(e.palette[n].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${n}StandardBg`]:o(e.palette[n].light,.9),[`& .${Z.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}},n&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${n}Color`]:a(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${Z.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}},n&&"filled"===t.variant&&s({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${n}FilledColor`],backgroundColor:e.vars.palette.Alert[`${n}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[n].dark:e.palette[n].main,color:e.palette.getContrastText(e.palette[n].main)}))}),ae=m("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),oe=m("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),ne=m("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),re={success:o(q,{fontSize:"inherit"}),warning:o(Q,{fontSize:"inherit"}),error:o(X,{fontSize:"inherit"}),info:o(Y,{fontSize:"inherit"})},ie=n.forwardRef(function(e,t){var a,n,m,v,u,g;const f=r({props:e,name:"MuiAlert"}),{action:y,children:w,className:z,closeText:b="Close",color:x,components:S={},componentsProps:C={},icon:M,iconMapping:k=re,onClose:V,role:H="alert",severity:L="success",slotProps:$={},slots:N={},variant:T="standard"}=f,A=i(f,ee),R=s({},f,{color:x,severity:L,variant:T}),F=(e=>{const{variant:t,color:a,severity:o,classes:n}=e,r={root:["root",`${t}${p(a||o)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return h(r,K,n)})(R),P=null!=(a=null!=(n=N.closeButton)?n:S.CloseButton)?a:l,B=null!=(m=null!=(v=N.closeIcon)?v:S.CloseIcon)?m:c,I=null!=(u=$.closeButton)?u:C.closeButton,D=null!=(g=$.closeIcon)?g:C.closeIcon;return o(te,s({role:H,elevation:0,ownerState:R,className:d(F.root,z),ref:t},A,{children:[!1!==M?o(ae,{ownerState:R,className:F.icon,children:M||k[L]||re[L]}):null,o(oe,{ownerState:R,className:F.message,children:w}),null!=y?o(ne,{ownerState:R,className:F.action,children:y}):null,null==y&&V?o(ne,{ownerState:R,className:F.action,children:o(P,s({size:"small","aria-label":b,title:b,color:"inherit",onClick:V},I,{children:o(B,s({fontSize:"small"},D))}))}):null]}))}),se=a([o("path",{d:"M13 17c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h6V5H5v14h14v-2h-6z",opacity:".3"}),o("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.38-1-1.72zM20 9v6h-7V9h7zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2H5z"}),o("circle",{cx:"16",cy:"12",r:"1.5"})],"AccountBalanceWalletTwoTone"),le=a([o("path",{d:"M8 6h8v6H8zm11 8H5c-.55 0-1 .45-1 1v3h16v-3c0-.55-.45-1-1-1zm-1 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z",opacity:".3"}),o("path",{d:"M19 12h-1V4H6v8H5c-1.66 0-3 1.34-3 3v5h20v-5c0-1.66-1.34-3-3-3zM8 6h8v6H8V6zm12 12H4v-3c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v3z"}),o("circle",{cx:"18",cy:"16",r:"1"})],"AdfScannerTwoTone"),ce=a([o("path",{d:"M9 4H7v2H5v12h2v2h2v-2h2V6H9V4zm0 12H7V8h2v8z"}),o("path",{d:"M7 8h2v8H7zm8 2h2v3h-2z",opacity:".3"}),o("path",{d:"M19 8h-2V4h-2v4h-2v7h2v5h2v-5h2V8zm-2 5h-2v-3h2v3z"})],"CandlestickChartTwoTone"),de=a([o("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8zm0 14.5c-.83 0-1.5-.67-1.5-1.5h3c0 .83-.67 1.5-1.5 1.5zm5-2.5H7v-2h1v-2.61C8 9.27 9.03 7.47 11 7v-.5c0-.57.43-1 1-1s1 .43 1 1V7c1.97.47 3 2.28 3 4.39V14h1v2z",opacity:".3"}),o("path",{d:"M12 18.5c.83 0 1.5-.67 1.5-1.5h-3c0 .83.67 1.5 1.5 1.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4-8.61c0-2.11-1.03-3.92-3-4.39v-.5c0-.57-.43-1-1-1s-1 .43-1 1V7c-1.97.47-3 2.27-3 4.39V14H7v2h10v-2h-1v-2.61zM14 14h-4v-3c0-1.1.9-2 2-2s2 .9 2 2v3z"})],"CircleNotificationsTwoTone"),pe=a(o("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),he=a(o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),me=a([o("path",{d:"M14 4H6v16h12V8h-4V4zm2 7v4c0 2.21-1.79 4-4 4s-4-1.79-4-4V9.5C8 8.12 9.12 7 10.5 7S13 8.12 13 9.5V15h-2V9.5c0-.28-.22-.5-.5-.5s-.5.22-.5.5V15c0 1.1.9 2 2 2s2-.9 2-2v-4h2z",opacity:".3"}),o("path",{d:"M14 15c0 1.1-.9 2-2 2s-2-.9-2-2V9.5c0-.28.22-.5.5-.5s.5.22.5.5V15h2V9.5C13 8.12 11.88 7 10.5 7S8 8.12 8 9.5V15c0 2.21 1.79 4 4 4s4-1.79 4-4v-4h-2v4z"}),o("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h8v4h4v12z"})],"FilePresentTwoTone"),ve=a([o("path",{d:"M19 5H5v14h14V5zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z",opacity:".3"}),o("path",{d:"M3 5v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2zm2 0h14v14H5V5zm2 5h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"})],"InsertChartTwoTone"),ue=a([o("path",{d:"M10 5h4v14h-4V5zm-6 6h4v8H4v-8zm16 8h-4v-6h4v6z",opacity:".3"}),o("path",{d:"M16 11V3H8v6H2v12h20V11h-6zm-6-6h4v14h-4V5zm-6 6h4v8H4v-8zm16 8h-4v-6h4v6z"})],"LeaderboardTwoTone"),ge=a(o(n.Fragment,{children:[o("path",{d:"M12 20c4.41 0 8-3.59 8-8s-3.59-8-8-8-8 3.59-8 8 3.59 8 8 8zM10 7.5l6 4.5-6 4.5v-9z",opacity:".3"}),o("path",{d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10zm0-18c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8zm-2 3.5v9l6-4.5z"})]}),"PlayCircleFilledWhiteTwoTone"),fe=a([o("path",{d:"M4 18h16V8H4v10zm8-3h6v2h-6v-2zm-5.91-4.59L7.5 9l4 4-4 4-1.41-1.41L8.67 13l-2.58-2.59z",opacity:".3"}),o("path",{d:"M12 15h6v2h-6z"}),o("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm0 14H4V8h16v10z"}),o("path",{d:"m7.5 17 4-4-4-4-1.41 1.41L8.67 13l-2.58 2.59z"})],"TerminalTwoTone"),ye=x()(e=>({root:{marginTop:e.spacing(1),marginBottom:e.spacing(2),marginLeft:e.spacing(2),marginRight:e.spacing(3),background:"white",transition:"opacity 500ms","&:hover":{opacity:1},opacity:.35,cursor:"pointer"},open:{opacity:1},expandButton:{cursor:"pointer !important",marginLeft:e.spacing(1)},downloadButton:{cursor:"pointer !important"}})),we=(e,t="%")=>null===e?"—":`${e.toFixed(2)}${t}`,ze=e=>window.Translate?window.Translate.translateText(e):e,be=({data:e})=>{const{classes:t,cx:a}=ye(),[r,i]=n.useState(!1),s=(e=>{const{context:t,portfolioTotalPnl:a,portfolioSharpeRatio:o,portfolioTotalTrades:n,symbols:r,backtest:i}=e,s=ze(i?"Backtest":"Live"),l=t.frameName?` / ${t.frameName}`:"",c=[`## ${s}: ${t.strategyName} / ${t.exchangeName}${l}`,"",`**${ze("Total PNL")}:** ${we(a)} `,`**Sharpe Ratio:** ${we(o,"")} `,`**${ze("Total trades")}:** ${n}`,""];for(const d of r)c.push(`### ${d.symbol}`,"",`**PNL:** ${we(d.totalPnl)} `,`**Win Rate:** ${we(d.winRate)} `,`**Profit Factor:** ${we(d.profitFactor,"")} `,`**Max Drawdown:** ${we(d.maxDrawdown)} `,`**Expectancy:** ${we(d.expectancy)} `,`**Sortino Ratio:** ${we(d.sortinoRatio,"")} `,`**Calmar Ratio:** ${we(d.calmarRatio,"")} `,`**Recovery Factor:** ${we(d.recoveryFactor,"")} `,`**${ze("Trades")}:** ${d.totalTrades}`,"");return c.join("\n")})(e),c=()=>{i(!r)},d=async e=>{e.stopPropagation(),await M(s)};return o(ie,{className:a(t.root,{[t.open]:r}),action:o(C,{children:[o(l,{className:t.downloadButton,onClick:d,size:"small",children:o(S,{})}),o(l,{className:t.expandButton,onClick:c,size:"small",children:o(r?pe:he,{})})]}),onClick:c,variant:"outlined",severity:"info",children:o(f,{minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",width:"100%",children:[o(f,{variant:"body2",sx:{opacity:r?.5:1,transition:"opacity 500ms"},minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",children:[e.backtest?"Backtest":"Live",": ",e.context.strategyName]}),o(y,{in:r,timeout:"auto",unmountOnExit:!0,children:[o(w,{paddingBottom:"16px"}),o(z,{content:s}),o(w,{paddingBottom:"32px"})]}),!r&&o(f,{variant:"caption",sx:{opacity:.7,mt:1},children:[b(s).slice(0,150),"..."]})]})})},xe="backtest-kit__groupHeader",Se="backtest-kit__groupRoot",Ce="backtest-kit__symbolImage",Me=x()({root:{[`& .${Se}:hover .${xe}`]:{opacity:"1 !important"}}});function ke(e){return W(e,"#000000")>W(e,"#FFFFFF")}const Ve=[{type:V.Link,action:"back-action",label:"Main"},{type:V.Link,action:"back-action",label:"Navigation"}],He=[{action:"download-json",label:"Download Heatmap JSON",icon:()=>o(T,{icon:N,color:"#4caf50"})},{action:"download-markdown",label:"Download Heatmap Markdown",icon:()=>o(T,{icon:A,color:"#4caf50"})},{action:"download-pdf",label:"Download Heatmap PDF",icon:()=>o(T,{icon:R,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(T,{icon:U,color:"#4caf50"})}],Le=(e,t)=>({type:P.Group,className:Se,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:P.Component,className:xe,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(D,{direction:"row",children:[o(B,{variant:"outlined",size:"medium",color:"info",label:`${I.bullet} ${e}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),o(w,{flex:1})]})},{type:P.Group,fields:t.map(({label:e,description:t,to:a,color:n,icon:r})=>((e,t,a,n,r)=>({type:P.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(j,{description:a,children:o(O,{component:E,onClick:()=>{L.routerService.push(e)},sx:{width:"100%",background:n,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${Ce}`]:{transition:"filter 500ms"},"&:hover":{background:()=>ke(n)?u(n,.33):g(n,.33),[`& .${Ce}`]:{transition:"filter 500ms",filter:ke(n)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(r,{className:Ce}),children:t})})}))(a,e,t,n,r))}]}),$e=[{label:"Portfolio Overview",description:J.newline("Closed trading signals grouped by symbol for Backtest and Live modes","Each card shows position type, entry price, TP/SL levels, PNL amount and percent","Displays DCA entry count and partial close count where applicable","Supports JSON export and manual refresh of the signal list"),to:"/overview",color:"#0033AD",icon:se},{label:"PNL Performance",description:J.newline("KPI dashboard with aggregated trading performance metrics per symbol","Shows daily trade counts, success rates, resolved/rejected breakdowns","Revenue analytics across today, yesterday, 7-day and 31-day windows","Toggle between Backtest and Live modes; supports JSON export"),to:"/dashboard",color:"#E6007A",icon:ve},{label:"System Logs",description:J.newline("Virtualized feed of runtime log entries with type badges: Debug, Info, Warn, Log","Each entry shows topic, timestamp and raw JSON arguments in monospace","Filter by keyword or regex via search prompt","Supports full log export as JSON file"),to:"/logs",color:"#58BF00",icon:fe}],Ne=[{label:"Notifications",description:J.newline("Event feed for all trading signals: opens, closes, schedules, errors","Color-coded cards with symbol, position, PNL, entry/exit/TP/SL prices","Infinite-scroll pagination; click any card to open a detailed modal","Supports manual refresh to pull the latest activity"),to:"/notifications",color:"#F7931A",icon:de},{label:"Pending Status",description:J.newline("Live view of active trading signals grouped by strategy","Grid of strategy buttons; click to inspect individual signal state","Detail view shows entry, exit, effective price, DCA and partial counts","Supports per-signal JSON export and manual refresh"),to:"/status",color:"#6F42C1",icon:ge},{label:"Dump Explorer",description:J.newline("Tree-structured file browser for backtest output and artifact files","Icons indicate file type: image, JSON, plain text or generic","Click any file to open a full-screen preview modal","Supports keyword search and manual refresh of the file tree"),to:"/dump",color:"#0090FF",icon:me}],Te=[{label:"Markdown Reports",description:J.newline("Strategy performance reports rendered from markdown for Backtest and Live runs","Grid of strategy buttons grouped by type and sorted by signal volume","Download reports as markdown, PDF or raw JSON","Supports manual refresh to regenerate report content"),to:"/report",color:"#009688",icon:le},{label:"Price Charts",description:J.newline("Interactive candlestick charts powered by TradingView Lightweight Charts","Navigate by symbol then interval (1m, 15m, 1h) to view price history","Overlays active signal lines: entry, take profit (green) and stop loss (red)","Supports chart image export and signal detail inspection"),to:"/price_chart",color:"#1565C0",icon:ce},{label:"Heatmap",description:J.newline("Color-coded performance heatmap across all tracked symbols","Cells show win rate, profit factor, Sharpe ratio and other key metrics","Download heatmap as JSON, markdown report or PDF","Supports manual refresh to recalculate aggregated statistics"),to:"/heat",color:"#8D6E63",icon:ue}],Ae=[Le("Application",$e),Le("Live",Ne),Le("Other",Te)],Re=()=>o(F,{sx:{width:"100%",height:"75px"}}),Fe=()=>{const{classes:e}=Me();return o(G,{children:[o(k,{items:Ve,actions:He,onAction:async e=>{"update-now"===e&&await(async()=>{L.statusViewService.getStatusInfo.clear(),_.next()})(),"download-markdown"===e&&await(async()=>{const e=await L.heatViewService.getStrategyHeatReport(),t=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(t);L.layoutService.downloadFile(a,`heat_${Date.now()}.md`)})(),"download-pdf"===e&&await(async()=>{const e=await L.heatViewService.getStrategyHeatReport();await M(e)})(),"download-json"===e&&await(async()=>{const e=await L.heatViewService.getStrategyHeatData(),t=JSON.stringify(e,null,2),a=new Blob([t],{type:"text/plain"}),o=URL.createObjectURL(a);L.layoutService.downloadFile(o,`heat_${Date.now()}.md`)})()}}),o(H,{Loader:Re,reloadSubject:_,children:async()=>{const e=await L.statusViewService.getStatusInfo();return e?o(be,{data:e}):null}}),o($,{className:e.root,fields:Ae,payload:()=>({history:history})}),o(w,{paddingBottom:"24px"})]})};export{Fe as MainPage,Fe as default};