scope360-core 0.0.454 → 0.0.455

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.
@@ -40,7 +40,7 @@
40
40
  `):t}function z$(t,e){const{element:n,datasetIndex:a,index:o}=e,i=t.getDatasetMeta(a).controller,{label:s,value:l}=i.getLabelAndValue(o);return{chart:t,label:s,parsed:i.getParsed(o),raw:t.data.datasets[a].data[o],formattedValue:l,dataset:i.getDataset(),dataIndex:o,datasetIndex:a,element:n}}function d6(t,e){const n=t.chart.ctx,{body:a,footer:o,title:i}=t,{boxWidth:s,boxHeight:l}=e,d=Dt(e.bodyFont),c=Dt(e.titleFont),u=Dt(e.footerFont),h=i.length,p=o.length,f=a.length,_=It(e.padding);let m=_.height,g=0,b=a.reduce((k,v)=>k+v.before.length+v.lines.length+v.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,h&&(m+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),b){const k=e.displayColors?Math.max(l,d.lineHeight):d.lineHeight;m+=f*k+(b-f)*d.lineHeight+(b-1)*e.bodySpacing}p&&(m+=e.footerMarginTop+p*u.lineHeight+(p-1)*e.footerSpacing);let w=0;const y=function(k){g=Math.max(g,n.measureText(k).width+w)};return n.save(),n.font=c.string,Ie(t.title,y),n.font=d.string,Ie(t.beforeBody.concat(t.afterBody),y),w=e.displayColors?s+2+e.boxPadding:0,Ie(a,k=>{Ie(k.before,y),Ie(k.lines,y),Ie(k.after,y)}),w=0,n.font=u.string,Ie(t.footer,y),n.restore(),g+=_.width,{width:g,height:m}}function R$(t,e){const{y:n,height:a}=e;return n<a/2?"top":n>t.height-a/2?"bottom":"center"}function H$(t,e,n,a){const{x:o,width:i}=a,s=n.caretSize+n.caretPadding;if(t==="left"&&o+i+s>e.width||t==="right"&&o-i-s<0)return!0}function I$(t,e,n,a){const{x:o,width:i}=n,{width:s,chartArea:{left:l,right:d}}=t;let c="center";return a==="center"?c=o<=(l+d)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),H$(c,t,e,n)&&(c="center"),c}function c6(t,e,n){const a=n.yAlign||e.yAlign||R$(t,n);return{xAlign:n.xAlign||e.xAlign||I$(t,e,n,a),yAlign:a}}function j$(t,e){let{x:n,width:a}=t;return e==="right"?n-=a:e==="center"&&(n-=a/2),n}function Z$(t,e,n){let{y:a,height:o}=t;return e==="top"?a+=n:e==="bottom"?a-=o+n:a-=o/2,a}function u6(t,e,n,a){const{caretSize:o,caretPadding:i,cornerRadius:s}=t,{xAlign:l,yAlign:d}=n,c=o+i,{topLeft:u,topRight:h,bottomLeft:p,bottomRight:f}=Ko(s);let _=j$(e,l);const m=Z$(e,d,c);return d==="center"?l==="left"?_+=c:l==="right"&&(_-=c):l==="left"?_-=Math.max(u,p)+o:l==="right"&&(_+=Math.max(h,f)+o),{x:Rt(_,0,a.width-e.width),y:Rt(m,0,a.height-e.height)}}function Xl(t,e,n){const a=It(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-a.right:t.x+a.left}function h6(t){return ha([],Ta(t))}function Y$(t,e,n){return po(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function p6(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const f6={beforeTitle:La,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,a=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(a>0&&e.dataIndex<a)return n[e.dataIndex]}return""},afterTitle:La,beforeBody:La,beforeLabel:La,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return He(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:La,afterBody:La,beforeFooter:La,footer:La,afterFooter:La};function sn(t,e,n,a){const o=t[e].call(n,a);return typeof o>"u"?f6[e].call(n,a):o}class m6 extends Ea{static positioners=us;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,a=this.options.setContext(this.getContext()),o=a.enabled&&n.options.animation&&a.animations,i=new r3(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Y$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:a}=n,o=sn(a,"beforeTitle",this,e),i=sn(a,"title",this,e),s=sn(a,"afterTitle",this,e);let l=[];return l=ha(l,Ta(o)),l=ha(l,Ta(i)),l=ha(l,Ta(s)),l}getBeforeBody(e,n){return h6(sn(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:a}=n,o=[];return Ie(e,i=>{const s={before:[],lines:[],after:[]},l=p6(a,i);ha(s.before,Ta(sn(l,"beforeLabel",this,i))),ha(s.lines,sn(l,"label",this,i)),ha(s.after,Ta(sn(l,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(e,n){return h6(sn(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:a}=n,o=sn(a,"beforeFooter",this,e),i=sn(a,"footer",this,e),s=sn(a,"afterFooter",this,e);let l=[];return l=ha(l,Ta(o)),l=ha(l,Ta(i)),l=ha(l,Ta(s)),l}_createItems(e){const n=this._active,a=this.chart.data,o=[],i=[],s=[];let l=[],d,c;for(d=0,c=n.length;d<c;++d)l.push(z$(this.chart,n[d]));return e.filter&&(l=l.filter((u,h,p)=>e.filter(u,h,p,a))),e.itemSort&&(l=l.sort((u,h)=>e.itemSort(u,h,a))),Ie(l,u=>{const h=p6(e.callbacks,u);o.push(sn(h,"labelColor",this,u)),i.push(sn(h,"labelPointStyle",this,u)),s.push(sn(h,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=l,l}update(e,n){const a=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const l=us[a.position].call(this,o,this._eventPosition);s=this._createItems(a),this.title=this.getTitle(s,a),this.beforeBody=this.getBeforeBody(s,a),this.body=this.getBody(s,a),this.afterBody=this.getAfterBody(s,a),this.footer=this.getFooter(s,a);const d=this._size=d6(this,a),c=Object.assign({},l,d),u=c6(this.chart,a,c),h=u6(a,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:h.x,y:h.y,width:d.width,height:d.height,caretX:l.x,caretY:l.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,a,o){const i=this.getCaretPosition(e,a,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,a){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:l}=a,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:h}=Ko(l),{x:p,y:f}=e,{width:_,height:m}=n;let g,b,w,y,k,v;return i==="center"?(k=f+m/2,o==="left"?(g=p,b=g-s,y=k+s,v=k-s):(g=p+_,b=g+s,y=k-s,v=k+s),w=g):(o==="left"?b=p+Math.max(d,u)+s:o==="right"?b=p+_-Math.max(c,h)-s:b=this.caretX,i==="top"?(y=f,k=y-s,g=b-s,w=b+s):(y=f+m,k=y+s,g=b+s,w=b-s),v=y),{x1:g,x2:b,x3:w,y1:y,y2:k,y3:v}}drawTitle(e,n,a){const o=this.title,i=o.length;let s,l,d;if(i){const c=jr(a.rtl,this.x,this.width);for(e.x=Xl(this,a.titleAlign,a),n.textAlign=c.textAlign(a.titleAlign),n.textBaseline="middle",s=Dt(a.titleFont),l=a.titleSpacing,n.fillStyle=a.titleColor,n.font=s.string,d=0;d<i;++d)n.fillText(o[d],c.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+l,d+1===i&&(e.y+=a.titleMarginBottom-l)}}_drawColorBox(e,n,a,o,i){const s=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:d,boxWidth:c}=i,u=Dt(i.bodyFont),h=Xl(this,"left",i),p=o.x(h),f=d<u.lineHeight?(u.lineHeight-d)/2:0,_=n.y+f;if(i.usePointStyle){const m={radius:Math.min(c,d)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},g=o.leftForLtr(p,c)+c/2,b=_+d/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,tu(e,m,g,b),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,tu(e,m,g,b)}else{e.lineWidth=Ve(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const m=o.leftForLtr(p,c),g=o.leftForLtr(o.xPlus(p,1),c-2),b=Ko(s.borderRadius);Object.values(b).some(w=>w!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,ts(e,{x:m,y:_,w:c,h:d,radius:b}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),ts(e,{x:g,y:_+1,w:c-2,h:d-2,radius:b}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(m,_,c,d),e.strokeRect(m,_,c,d),e.fillStyle=s.backgroundColor,e.fillRect(g,_+1,c-2,d-2))}e.fillStyle=this.labelTextColors[a]}drawBody(e,n,a){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:l,boxHeight:d,boxWidth:c,boxPadding:u}=a,h=Dt(a.bodyFont);let p=h.lineHeight,f=0;const _=jr(a.rtl,this.x,this.width),m=function($){n.fillText($,_.x(e.x+f),e.y+p/2),e.y+=p+i},g=_.textAlign(s);let b,w,y,k,v,M,C;for(n.textAlign=s,n.textBaseline="middle",n.font=h.string,e.x=Xl(this,g,a),n.fillStyle=a.bodyColor,Ie(this.beforeBody,m),f=l&&g!=="right"?s==="center"?c/2+u:c+2+u:0,k=0,M=o.length;k<M;++k){for(b=o[k],w=this.labelTextColors[k],n.fillStyle=w,Ie(b.before,m),y=b.lines,l&&y.length&&(this._drawColorBox(n,e,k,_,a),p=Math.max(h.lineHeight,d)),v=0,C=y.length;v<C;++v)m(y[v]),p=h.lineHeight;Ie(b.after,m)}f=0,p=h.lineHeight,Ie(this.afterBody,m),e.y-=i}drawFooter(e,n,a){const o=this.footer,i=o.length;let s,l;if(i){const d=jr(a.rtl,this.x,this.width);for(e.x=Xl(this,a.footerAlign,a),e.y+=a.footerMarginTop,n.textAlign=d.textAlign(a.footerAlign),n.textBaseline="middle",s=Dt(a.footerFont),n.fillStyle=a.footerColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],d.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+a.footerSpacing}}drawBackground(e,n,a,o){const{xAlign:i,yAlign:s}=this,{x:l,y:d}=e,{width:c,height:u}=a,{topLeft:h,topRight:p,bottomLeft:f,bottomRight:_}=Ko(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(l+h,d),s==="top"&&this.drawCaret(e,n,a,o),n.lineTo(l+c-p,d),n.quadraticCurveTo(l+c,d,l+c,d+p),s==="center"&&i==="right"&&this.drawCaret(e,n,a,o),n.lineTo(l+c,d+u-_),n.quadraticCurveTo(l+c,d+u,l+c-_,d+u),s==="bottom"&&this.drawCaret(e,n,a,o),n.lineTo(l+f,d+u),n.quadraticCurveTo(l,d+u,l,d+u-f),s==="center"&&i==="left"&&this.drawCaret(e,n,a,o),n.lineTo(l,d+h),n.quadraticCurveTo(l,d,l+h,d),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,a=this.$animations,o=a&&a.x,i=a&&a.y;if(o||i){const s=us[e.position].call(this,this._active,this._eventPosition);if(!s)return;const l=this._size=d6(this,e),d=Object.assign({},s,this._size),c=c6(n,e,d),u=u6(e,d,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=l.width,this.height=l.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const s=It(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=a,this.drawBackground(i,e,o,n),X2(e,n.textDirection),i.y+=s.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),K2(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const a=this._active,o=e.map(({datasetIndex:l,index:d})=>{const c=this.chart.getDatasetMeta(l);if(!c)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:c.data[d],index:d}}),i=!Sl(a,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,a=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(e,i,n,a),l=this._positionChanged(s,e),d=n||!Sl(s,i)||l;return d&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),d}_getActiveElements(e,n,a,o){const i=this.options;if(e.type==="mouseout")return[];if(!o)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,i.mode,i,a);return i.reverse&&s.reverse(),s}_positionChanged(e,n){const{caretX:a,caretY:o,options:i}=this,s=us[i.position].call(this,e,n);return s!==!1&&(a!==s.x||o!==s.y)}}var ku={id:"tooltip",_element:m6,positioners:us,afterInit(t,e,n){n&&(t.tooltip=new m6({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:f6},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const W$=(t,e,n,a)=>(typeof e=="string"?(n=t.push(e)-1,a.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function U$(t,e,n,a){const o=t.indexOf(e);if(o===-1)return W$(t,e,n,a);const i=t.lastIndexOf(e);return o!==i?n:o}const q$=(t,e)=>t===null?null:Rt(Math.round(t),0,e);function _6(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Cu extends nr{static id="category";static defaults={ticks:{callback:_6}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const a=this.getLabels();for(const{index:o,label:i}of n)a[o]===i&&a.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(He(e))return null;const a=this.getLabels();return n=isFinite(n)&&a[n]===e?n:U$(a,e,Se(n,e),this._addedLabels),q$(n,a.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:a,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(a=0),n||(o=this.getLabels().length-1)),this.min=a,this.max=o}buildTicks(){const e=this.min,n=this.max,a=this.options.offset,o=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let s=e;s<=n;s++)o.push({value:s});return o}getLabelForValue(e){return _6.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function G$(t,e){const n=[],{bounds:o,step:i,min:s,max:l,precision:d,count:c,maxTicks:u,maxDigits:h,includeBounds:p}=t,f=i||1,_=u-1,{min:m,max:g}=e,b=!He(s),w=!He(l),y=!He(c),k=(g-m)/(h+1);let v=C2((g-m)/_/f)*f,M,C,$,S;if(v<1e-14&&!b&&!w)return[{value:m},{value:g}];S=Math.ceil(g/v)-Math.floor(m/v),S>_&&(v=C2(S*v/_/f)*f),He(d)||(M=Math.pow(10,d),v=Math.ceil(v*M)/M),o==="ticks"?(C=Math.floor(m/v)*v,$=Math.ceil(g/v)*v):(C=m,$=g),b&&w&&i&&JC((l-s)/i,v/1e3)?(S=Math.round(Math.min((l-s)/v,u)),v=(l-s)/S,C=s,$=l):y?(C=b?s:C,$=w?l:$,S=c-1,v=($-C)/S):(S=($-C)/v,Xi(S,Math.round(S),v/1e3)?S=Math.round(S):S=Math.ceil(S));const E=Math.max(S2(v),S2(C));M=Math.pow(10,He(d)?E:d),C=Math.round(C*M)/M,$=Math.round($*M)/M;let R=0;for(b&&(p&&C!==s?(n.push({value:s}),C<s&&R++,Xi(Math.round((C+R*v)*M)/M,s,g6(s,k,t))&&R++):C<s&&R++);R<S;++R){const U=Math.round((C+R*v)*M)/M;if(w&&U>l)break;n.push({value:U})}return w&&p&&$!==l?n.length&&Xi(n[n.length-1].value,l,g6(l,k,t))?n[n.length-1].value=l:n.push({value:l}):(!w||$===l)&&n.push({value:$}),n}function g6(t,e,{horizontal:n,minRotation:a}){const o=ca(a),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*e*(""+t).length;return Math.min(e/i,s)}class Kl extends nr{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return He(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:a}=this.getUserBounds();let{min:o,max:i}=this;const s=d=>o=n?o:d,l=d=>i=a?i:d;if(e){const d=da(o),c=da(i);d<0&&c<0?l(0):d>0&&c>0&&s(0)}if(o===i){let d=i===0?1:Math.abs(i*.05);l(i+d),e||s(o-d)}this.min=o,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:a}=e,o;return a?(o=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let a=this.getTickLimit();a=Math.max(2,a);const o={maxTicks:a,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=G$(o,i);return e.bounds==="ticks"&&M2(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let n=this.min,a=this.max;if(super.configure(),this.options.offset&&e.length){const o=(a-n)/Math.max(e.length-1,1)/2;n-=o,a+=o}this._startValue=n,this._endValue=a,this._valueRange=a-n}getLabelForValue(e){return Vl(e,this.chart.options.locale,this.options.ticks.format)}}class Mu extends Kl{static id="linear";static defaults={ticks:{callback:El.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ht(e)?e:0,this.max=ht(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,a=ca(this.options.ticks.minRotation),o=(e?Math.sin(a):Math.cos(a))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const hs=t=>Math.floor(ho(t)),or=(t,e)=>Math.pow(10,hs(t)+e);function b6(t){return t/Math.pow(10,hs(t))===1}function y6(t,e,n){const a=Math.pow(10,n),o=Math.floor(t/a);return Math.ceil(e/a)-o}function X$(t,e){const n=e-t;let a=hs(n);for(;y6(t,e,a)>10;)a++;for(;y6(t,e,a)<10;)a--;return Math.min(a,hs(t))}function K$(t,{min:e,max:n}){e=yn(t.min,e);const a=[],o=hs(e);let i=X$(e,n),s=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),d=o>i?Math.pow(10,o):0,c=Math.round((e-d)*s)/s,u=Math.floor((e-d)/l/10)*l*10;let h=Math.floor((c-u)/Math.pow(10,i)),p=yn(t.min,Math.round((d+u+h*Math.pow(10,i))*s)/s);for(;p<n;)a.push({value:p,major:b6(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,s=i>=0?1:s),p=Math.round((d+u+h*Math.pow(10,i))*s)/s;const f=yn(t.max,p);return a.push({value:f,major:b6(f),significand:h}),a}class qX extends nr{static id="logarithmic";static defaults={ticks:{callback:El.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const a=Kl.prototype.parse.apply(this,[e,n]);if(a===0){this._zero=!0;return}return ht(a)&&a>0?a:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ht(e)?Math.max(0,e):null,this.max=ht(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=e===or(this.min,0)?or(this.min,-1):or(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let a=this.min,o=this.max;const i=l=>a=e?a:l,s=l=>o=n?o:l;a===o&&(a<=0?(i(1),s(10)):(i(or(a,-1)),s(or(o,1)))),a<=0&&i(or(o,-1)),o<=0&&s(or(a,1)),this.min=a,this.max=o}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},a=K$(n,this);return e.bounds==="ticks"&&M2(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}getLabelForValue(e){return e===void 0?"0":Vl(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=ho(e),this._valueRange=ho(this.max)-ho(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(ho(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}function Su(t){const e=t.ticks;if(e.display&&t.display){const n=It(e.backdropPadding);return Se(e.font&&e.font.size,pt.font.size)+n.height}return 0}function Q$(t,e,n){return n=nt(n)?n:[n],{w:bM(t,e.string,n),h:n.length*e.lineHeight}}function w6(t,e,n,a,o){return t===a||t===o?{start:e-n/2,end:e+n/2}:t<a||t>o?{start:e-n,end:e}:{start:e,end:e+n}}function J$(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),a=[],o=[],i=t._pointLabels.length,s=t.options.pointLabels,l=s.centerPointLabels?at/i:0;for(let d=0;d<i;d++){const c=s.setContext(t.getPointLabelContext(d));o[d]=c.padding;const u=t.getPointPosition(d,t.drawingArea+o[d],l),h=Dt(c.font),p=Q$(t.ctx,h,t._pointLabels[d]);a[d]=p;const f=wn(t.getIndexAngle(d)+l),_=Math.round(U1(f)),m=w6(_,u.x,p.w,0,180),g=w6(_,u.y,p.h,90,270);eD(n,e,f,m,g)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=aD(t,a,o)}function eD(t,e,n,a,o){const i=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let l=0,d=0;a.start<e.l?(l=(e.l-a.start)/i,t.l=Math.min(t.l,e.l-l)):a.end>e.r&&(l=(a.end-e.r)/i,t.r=Math.max(t.r,e.r+l)),o.start<e.t?(d=(e.t-o.start)/s,t.t=Math.min(t.t,e.t-d)):o.end>e.b&&(d=(o.end-e.b)/s,t.b=Math.max(t.b,e.b+d))}function tD(t,e,n){const a=t.drawingArea,{extra:o,additionalAngle:i,padding:s,size:l}=n,d=t.getPointPosition(e,a+o+s,i),c=Math.round(U1(wn(d.angle+xt))),u=iD(d.y,l.h,c),h=oD(c),p=rD(d.x,l.w,h);return{visible:!0,x:d.x,y:u,textAlign:h,left:p,top:u,right:p+l.w,bottom:u+l.h}}function nD(t,e){if(!e)return!0;const{left:n,top:a,right:o,bottom:i}=t;return!(Da({x:n,y:a},e)||Da({x:n,y:i},e)||Da({x:o,y:a},e)||Da({x:o,y:i},e))}function aD(t,e,n){const a=[],o=t._pointLabels.length,i=t.options,{centerPointLabels:s,display:l}=i.pointLabels,d={extra:Su(i)/2,additionalAngle:s?at/o:0};let c;for(let u=0;u<o;u++){d.padding=n[u],d.size=e[u];const h=tD(t,u,d);a.push(h),l==="auto"&&(h.visible=nD(h,c),h.visible&&(c=h))}return a}function oD(t){return t===0||t===180?"center":t<180?"left":"right"}function rD(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function iD(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function sD(t,e,n){const{left:a,top:o,right:i,bottom:s}=n,{backdropColor:l}=e;if(!He(l)){const d=Ko(e.borderRadius),c=It(e.backdropPadding);t.fillStyle=l;const u=a-c.left,h=o-c.top,p=i-a+c.width,f=s-o+c.height;Object.values(d).some(_=>_!==0)?(t.beginPath(),ts(t,{x:u,y:h,w:p,h:f,radius:d}),t.fill()):t.fillRect(u,h,p,f)}}function lD(t,e){const{ctx:n,options:{pointLabels:a}}=t;for(let o=e-1;o>=0;o--){const i=t._pointLabelItems[o];if(!i.visible)continue;const s=a.setContext(t.getPointLabelContext(o));sD(n,s,i);const l=Dt(s.font),{x:d,y:c,textAlign:u}=i;Xo(n,t._pointLabels[o],d,c+l.lineHeight/2,l,{color:s.color,textAlign:u,textBaseline:"middle"})}}function v6(t,e,n,a){const{ctx:o}=t;if(n)o.arc(t.xCenter,t.yCenter,e,0,Xe);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let s=1;s<a;s++)i=t.getPointPosition(s,e),o.lineTo(i.x,i.y)}}function dD(t,e,n,a,o){const i=t.ctx,s=e.circular,{color:l,lineWidth:d}=e;!s&&!a||!l||!d||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=d,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),v6(t,n,s,a),i.closePath(),i.stroke(),i.restore())}function cD(t,e,n){return po(t,{label:n,index:e,type:"pointLabel"})}class GX extends Kl{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:El.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=It(Su(this.options)/2),n=this.width=this.maxWidth-e.width,a=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+a/2+e.top),this.drawingArea=Math.floor(Math.min(n,a)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=ht(e)&&!isNaN(e)?e:0,this.max=ht(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Su(this.options))}generateTickLabels(e){Kl.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,a)=>{const o=Ue(this.options.pointLabels.callback,[n,a],this);return o||o===0?o:""}).filter((n,a)=>this.chart.getDataVisibility(a))}fit(){const e=this.options;e.display&&e.pointLabels.display?J$(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,a,o){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((a-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,a,o))}getIndexAngle(e){const n=Xe/(this._pointLabels.length||1),a=this.options.startAngle||0;return wn(e*n+ca(a))}getDistanceFromCenterForValue(e){if(He(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(He(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const a=n[e];return cD(this.getContext(),e,a)}}getPointPosition(e,n,a=0){const o=this.getIndexAngle(e)-xt+a;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:a,right:o,bottom:i}=this._pointLabelItems[e];return{left:n,top:a,right:o,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const a=this.ctx;a.save(),a.beginPath(),v6(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),a.closePath(),a.fillStyle=e,a.fill(),a.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:a,grid:o,border:i}=n,s=this._pointLabels.length;let l,d,c;if(n.pointLabels.display&&lD(this,s),o.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){d=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(h),f=o.setContext(p),_=i.setContext(p);dD(this,f,d,s,_)}}),a.display){for(e.save(),l=s-1;l>=0;l--){const u=a.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:p}=u;!p||!h||(e.lineWidth=p,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,d=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(l,d),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,a=n.ticks;if(!a.display)return;const o=this.getIndexAngle(0);let i,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,d)=>{if(d===0&&this.min>=0&&!n.reverse)return;const c=a.setContext(this.getContext(d)),u=Dt(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[d].value),c.showLabelBackdrop){e.font=u.string,s=e.measureText(l.label).width,e.fillStyle=c.backdropColor;const h=It(c.backdropPadding);e.fillRect(-s/2-h.left,-i-u.size/2-h.top,s+h.width,u.size+h.height)}Xo(e,l.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}const Ql={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ln=Object.keys(Ql);function x6(t,e){return t-e}function k6(t,e){if(He(e))return null;const n=t._adapter,{parser:a,round:o,isoWeekday:i}=t._parseOpts;let s=e;return typeof a=="function"&&(s=a(s)),ht(s)||(s=typeof a=="string"?n.parse(s,a):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Ki(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function C6(t,e,n,a){const o=ln.length;for(let i=ln.indexOf(t);i<o-1;++i){const s=Ql[ln[i]],l=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-e)/(l*s.size))<=a)return ln[i]}return ln[o-1]}function uD(t,e,n,a,o){for(let i=ln.length-1;i>=ln.indexOf(n);i--){const s=ln[i];if(Ql[s].common&&t._adapter.diff(o,a,s)>=e-1)return s}return ln[n?ln.indexOf(n):0]}function hD(t){for(let e=ln.indexOf(t)+1,n=ln.length;e<n;++e)if(Ql[ln[e]].common)return ln[e]}function M6(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:a,hi:o}=G1(n,e),i=n[a]>=e?n[a]:n[o];t[i]=!0}}function pD(t,e,n,a){const o=t._adapter,i=+o.startOf(e[0].value,a),s=e[e.length-1].value;let l,d;for(l=i;l<=s;l=+o.add(l,1,a))d=n[l],d>=0&&(e[d].major=!0);return e}function S6(t,e,n){const a=[],o={},i=e.length;let s,l;for(s=0;s<i;++s)l=e[s],o[l]=s,a.push({value:l,major:!1});return i===0||!n?a:pD(t,a,o,n)}class L6 extends nr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const a=e.time||(e.time={}),o=this._adapter=new NS._date(e.adapters.date);o.init(n),qi(a.displayFormats,o.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:k6(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,a=e.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:l}=this.getUserBounds();function d(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!l&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!l)&&(d(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&d(this.getMinMax(!1))),o=ht(o)&&!isNaN(o)?o:+n.startOf(Date.now(),a),i=ht(i)&&!isNaN(i)?i:+n.endOf(Date.now(),a)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],a=e[e.length-1]),{min:n,max:a}}buildTicks(){const e=this.options,n=e.time,a=e.ticks,o=a.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,s=this.max,l=aM(o,i,s);return this._unit=n.unit||(a.autoSkip?C6(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):uD(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:hD(this._unit),this.initOffsets(o),e.reverse&&l.reverse(),S6(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,a=0,o,i;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?n=1-o:n=(this.getDecimalForValue(e[1])-o)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?a=i:a=(i-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;n=Rt(n,0,s),a=Rt(a,0,s),this._offsets={start:n,end:a,factor:1/(n+1+a)}}_generate(){const e=this._adapter,n=this.min,a=this.max,o=this.options,i=o.time,s=i.unit||C6(i.minUnit,n,a,this._getLabelCapacity(n)),l=Se(o.ticks.stepSize,1),d=s==="week"?i.isoWeekday:!1,c=Ki(d)||d===!0,u={};let h=n,p,f;if(c&&(h=+e.startOf(h,"isoWeek",d)),h=+e.startOf(h,c?"day":s),e.diff(a,n,s)>1e5*l)throw new Error(n+" and "+a+" are too far apart with stepSize of "+l+" "+s);const _=o.ticks.source==="data"&&this.getDataTimestamps();for(p=h,f=0;p<a;p=+e.add(p,l,s),f++)M6(u,p,_);return(p===a||o.bounds==="ticks"||f===1)&&M6(u,p,_),Object.keys(u).sort(x6).map(m=>+m)}getLabelForValue(e){const n=this._adapter,a=this.options.time;return a.tooltipFormat?n.format(e,a.tooltipFormat):n.format(e,a.displayFormats.datetime)}format(e,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(e,s)}_tickFormatFunction(e,n,a,o){const i=this.options,s=i.ticks.callback;if(s)return Ue(s,[e,n,a],this);const l=i.time.displayFormats,d=this._unit,c=this._majorUnit,u=d&&l[d],h=c&&l[c],p=a[n],f=c&&h&&p&&p.major;return this._adapter.format(e,o||(f?h:u))}generateTickLabels(e){let n,a,o;for(n=0,a=e.length;n<a;++n)o=e[n],o.label=this._tickFormatFunction(o.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,a=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+a)*n.factor)}getValueForPixel(e){const n=this._offsets,a=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+a*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,a=this.ctx.measureText(e).width,o=ca(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:a*i+l*s,h:a*s+l*i}}_getLabelCapacity(e){const n=this.options.time,a=n.displayFormats,o=a[n.unit]||a.millisecond,i=this._tickFormatFunction(e,0,S6(this,[e],this._majorUnit),o),s=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,a;if(e.length)return e;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,a=o.length;n<a;++n)e=e.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,a;if(e.length)return e;const o=this.getLabels();for(n=0,a=o.length;n<a;++n)e.push(k6(this,o[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return V2(e.sort(x6))}}function Jl(t,e,n){let a=0,o=t.length-1,i,s,l,d;n?(e>=t[a].pos&&e<=t[o].pos&&({lo:a,hi:o}=Uo(t,"pos",e)),{pos:i,time:l}=t[a],{pos:s,time:d}=t[o]):(e>=t[a].time&&e<=t[o].time&&({lo:a,hi:o}=Uo(t,"time",e)),{time:i,pos:l}=t[a],{time:s,pos:d}=t[o]);const c=s-i;return c?l+(d-l)*(e-i)/c:l}class XX extends L6{static id="timeseries";static defaults=L6.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Jl(n,this.min),this._tableRange=Jl(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:a}=this,o=[],i=[];let s,l,d,c,u;for(s=0,l=e.length;s<l;++s)c=e[s],c>=n&&c<=a&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:a,pos:1}];for(s=0,l=o.length;s<l;++s)u=o[s+1],d=o[s-1],c=o[s],Math.round((u+d)/2)!==c&&i.push({time:c,pos:s/(l-1)});return i}_generate(){const e=this.min,n=this.max;let a=super.getDataTimestamps();return(!a.includes(e)||!a.length)&&a.splice(0,0,e),(!a.includes(n)||a.length===1)&&a.push(n),a.sort((o,i)=>o-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),a=this.getLabelTimestamps();return n.length&&a.length?e=this.normalize(n.concat(a)):e=n.length?n:a,e=this._cache.all=e,e}getDecimalForValue(e){return(Jl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,a=this.getDecimalForPixel(e)/n.factor-n.end;return Jl(this._table,a*this._tableRange+this._minPos,!0)}}const $6={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},fD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$6,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},mD=r.version[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function Yr(t){return r.isProxy(t)?r.toRaw(t):t}function _D(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return r.isProxy(e)?new Proxy(t,{}):t}function gD(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function D6(t,e){t.labels=e}function V6(t,e,n){const a=[];t.datasets=e.map(o=>{const i=t.datasets.find(s=>s[n]===o[n]);return!i||!o.data||a.includes(i)?{...o}:(a.push(i),Object.assign(i,o),i)})}function bD(t,e){const n={labels:[],datasets:[]};return D6(n,t.labels),V6(n,t.datasets,e),n}const yD=r.defineComponent({props:fD,setup(t,e){let{expose:n,slots:a}=e;const o=r.ref(null),i=r.shallowRef(null);n({chart:i});const s=()=>{if(!o.value)return;const{type:c,data:u,options:h,plugins:p,datasetIdKey:f}=t,_=bD(u,f),m=_D(_,u);i.value=new ar(o.value,{type:c,data:m,options:{...h},plugins:p})},l=()=>{const c=r.toRaw(i.value);c&&(t.destroyDelay>0?setTimeout(()=>{c.destroy(),i.value=null},t.destroyDelay):(c.destroy(),i.value=null))},d=c=>{c.update(t.updateMode)};return r.onMounted(s),r.onUnmounted(l),r.watch([()=>t.options,()=>t.data],(c,u)=>{let[h,p]=c,[f,_]=u;const m=r.toRaw(i.value);if(!m)return;let g=!1;if(h){const b=Yr(h),w=Yr(f);b&&b!==w&&(gD(m,b),g=!0)}if(p){const b=Yr(p.labels),w=Yr(_.labels),y=Yr(p.datasets),k=Yr(_.datasets);b!==w&&(D6(m.config.data,b),g=!0),y&&y!==k&&(V6(m.config.data,y,t.datasetIdKey),g=!0)}g&&r.nextTick(()=>{d(m)})},{deep:!0}),()=>r.h("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:o},[r.h("p",{},[a.default?a.default():""])])}});function Lu(t,e){return ar.register(e),r.defineComponent({props:$6,setup(n,a){let{expose:o}=a;const i=r.shallowRef(null),s=l=>{i.value=l?.chart};return o({chart:i}),()=>r.h(yD,mD({ref:s},{type:t,...n}))}})}const wD=Lu("bar",TS),vD=Lu("doughnut",BS),E6=Lu("line",PS),xD={class:"chart-container"},$u={__name:"LineChart",props:{data:{type:Array,required:!0},dataType:{type:String,required:!0},isMask:{type:Boolean,default:!1},ticksCallback:{type:Function,default:t=>t},borderColor:{type:String,default:"#007AFF"},gradient:{type:Object,default:{height:450,startColor:"rgba(0, 122, 255, 0.1)",endColor:"rgba(0, 122, 255, 0)"}}},setup(t){ar.register(Cu,Mu,q3,cs,ku,a6);const e=t,n=r.ref(0),a=r.inject("darkMode");let o=r.reactive({isEmpty:!0});const i=p=>{const f=new Set,_=[];let m=[];switch(e.dataType){case"balanceChartData":p.length===0?m=[0,0]:m=p.map(b=>(f.add(b.date),lt(b.balance*o0(),2)));break;case"performanceChartData":p.length===0?m=[0,0]:m=p.reduce((b,w,y)=>{f.add(w.date);const k=y?b[y-1]:0,v=lt(k+w.pnl_to_deposit,2);return b.push(v),b},[]);break}_.push({data:m});const g=Array.from(f);return g.length===1?(g.push(...g),_.forEach(b=>{b.data.push(...b.data)}),o.isEmpty=!1):g.length===0?(o.isEmpty=!0,g.push(0,0)):o.isEmpty=!1,{labels:g,datasets:_}},s=r.computed(()=>i(e.data)),l=p=>{const _=p.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return _.addColorStop(0,e.gradient.startColor),_.addColorStop(1,e.gradient.endColor),_},d=(p,f)=>{let _=document.querySelector(`#${p}-${e.dataType}`);return _||(_=document.createElement("div"),_.classList.add(p),_.setAttribute("id",`${p}-${e.dataType}`),f.canvas.parentNode.appendChild(_)),_},c=p=>{if(!o.isEmpty){const{chart:f,tooltip:_}=p,m=d("chart-tooltip",f);if(_.opacity===0){m.style.opacity="0";return}if(_.body){const M=_.title||[],C=_.body.map(S=>S.lines),$=document.createElement("div");for($.classList.add("chart-tooltip-middle"),$.innerHTML=`<div class="chart-tooltip-content">
41
41
  ${e.dataType==="balanceChartData"?`${xs()}${_e(e.isMask,vd(C[0]),{repeat:6})}`:`${_e(e.isMask,vd(C[0]),{repeat:3})}%`}
42
42
  <span> | ${a0(M[0],"EEE, dd LLL, yyyy")}</span></div>`;m.firstChild;)m.firstChild.remove();m.appendChild($)}const{offsetLeft:g,offsetTop:b,clientWidth:w}=f.canvas;let y=g+_.caretX;const k=b+_.caretY,v=m.clientWidth;y+v>w&&(y-=v),m.style.opacity="1",m.style.left=y+"px",m.style.top=k+"px"}},u=p=>{const{chart:f}=p,_=d("chart-line",f),m=f.chartArea;f.canvas.addEventListener("mousemove",function(g){const b=f.canvas.getBoundingClientRect(),w=g.clientX-b.left,y=g.clientY-b.top;w>=m.left&&w<=m.right&&y>=m.top&&y<=m.bottom?(_.style.left=w+"px",_.style.top=m.top+"px",_.style.height=m.bottom-m.top+"px",_.style.display="flex"):_.style.display="none"}),f.canvas.addEventListener("mouseout",function(){_.style.display="none"})},h=r.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!o.isEmpty,callback:function(p){return h_(this.getLabelForValue(p)).slice(0,3)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15,align:"center"},grid:{display:!1},border:{color:a.value?"#2D2D2D":"#EDEDED"}},y:{ticks:{display:!o.isEmpty,callback:function(p){return e.ticksCallback(p,e.isMask)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15},grid:{color:a.value?"#2D2D2D":"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}},plugins:{tooltip:{enabled:!1,position:"nearest",external:c},legend:!1},elements:{line:{backgroundColor:p=>l(p),tension:.3,borderWidth:2,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:"circle",pointRadius:1,pointHoverRadius:8,pointBackgroundColor:e.borderColor,pointBorderWidth:0,pointHoverBorderWidth:3,pointBorderColor:"#fff",pointHoverBorderColor:"#fff",pointHitRadius:50}},onHover:u}));return r.watch(()=>e.isMask,()=>{n.value+=1},{immediate:!0}),(p,f)=>(r.openBlock(),r.createElementBlock("div",xD,[(r.openBlock(),r.createBlock(r.unref(E6),{key:n.value,data:s.value,options:h.value},null,8,["data","options"]))]))}},Du={__name:"SimpleLineChart",props:{data:{type:Array,required:!0},borderColor:{type:String,default:"#56B683"},gradient:{type:Object,default:{height:200,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}}},setup(t){ar.register(Cu,Mu,q3,cs,a6);const e=t,n=s=>{const l=new Set,d=[],c=s.map(h=>(l.add(h.date),h.balance));return d.push({data:c}),{labels:Array.from(l),datasets:d}},a=r.computed(()=>n(e.data)),o=s=>{const d=s.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return d.addColorStop(0,e.gradient.startColor),d.addColorStop(1,e.gradient.endColor),d},i=r.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},scales:{x:{display:!1},y:{display:!1}},plugins:{tooltip:!1,legend:!1},elements:{line:{backgroundColor:s=>o(s),tension:.05,borderWidth:3,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}}});return(s,l)=>(r.openBlock(),r.createBlock(r.unref(E6),{data:a.value,options:i.value},null,8,["data","options"]))}},kD=t=>(r.pushScopeId("data-v-a1d419ad"),t=t(),r.popScopeId(),t),CD={class:"import-data"},MD={class:"import-data__content"},SD=kD(()=>r.createElementVNode("div",{class:"import-data__text"},[r.createTextVNode(" Importing data from the exchange. "),r.createElementVNode("br"),r.createTextVNode(" The widget will be displayed after the page reloads ")],-1)),dn=ve({__name:"ImportData",emits:["refresh"],setup(t,{emit:e}){const n=e;return(a,o)=>(r.openBlock(),r.createElementBlock("div",CD,[r.createElementVNode("div",MD,[r.createElementVNode("div",{onClick:o[0]||(o[0]=i=>n("refresh")),class:"import-data__refresh-btn"},[r.createVNode(r.unref(Le),{icon:"arrow-rotating"})]),SD])]))}},[["__scopeId","data-v-a1d419ad"]]),LD=t=>(r.pushScopeId("data-v-969073e2"),t=t(),r.popScopeId(),t),$D={class:"account-balance-widget"},DD={class:"account-balance-widget__top"},VD={class:"account-balance-widget__title-wrapper"},ED=LD(()=>r.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),TD=ve({__name:"AccountBalanceWidget",props:{tooltip:{type:String,default:"This graphic widget displays changes to your deposit over a specific time period."},balanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e;return(a,o)=>(r.openBlock(),r.createElementBlock("div",$D,[r.createElementVNode("div",DD,[r.createElementVNode("div",VD,[ED,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.tooltip),1)]),_:1})])]),r.createVNode(r.unref($u),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":r.unref(ri),isMask:t.isMask},null,8,["data","ticks-callback","isMask"]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:o[0]||(o[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-969073e2"]]),T6=t=>(r.pushScopeId("data-v-ccf45b88"),t=t(),r.popScopeId(),t),OD={class:"balance-widget"},BD={class:"balance-part"},PD={class:"balance-part__top"},ND={class:"balance-part__title-wrapper"},AD=T6(()=>r.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),FD={class:"balance-part__content"},zD={class:"balance-part__content__wrapper"},RD={key:0,class:"balance-part__content__bitcoin"},HD={key:0,class:"divider"},ID={key:1,class:"personal-target-part"},jD={class:"personal-target-part__top"},ZD={class:"personal-target-part__title-wrapper"},YD=T6(()=>r.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),WD={class:"personal-target-part__content"},UD={class:"personal-target-part__content__current"},qD={class:"personal-target-part__content__from"},GD=ve({__name:"BalanceWidget",props:{tooltip:{type:String,default:`Displays the balance of your deposit in USD and BTC equivalent,
43
- additionally showing the growth/fall of your balance.`},showBTC:{type:Boolean,default:!0},BTC:{type:Number,default:0},USDT:{type:Number,default:0},delta:{type:Number,default:0},balanceChartData:{type:Array,default:[]},currentProfit:{type:Number,default:0},profit:{type:Number,default:0},drawdown:{type:Number,default:0},isPercentage:Boolean,isShare:{type:Boolean,default:!1},isHidden:{type:Boolean,default:!1},isMaskBalance:{type:Boolean,default:!1},isMaskPersonalTarget:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["switchModal","switchVisibility","refresh"],setup(t,{emit:e}){const n=e,a=t,o=r.reactive({USDT:0,BTC:0,delta:0}),i=r.reactive({currentProfit:0}),s=r.ref(0),l=()=>{n("switchVisibility")},d=r.computed(()=>({currentProfit:a.currentProfit,profit:a.profit,drawdown:a.drawdown})),c=r.computed(()=>`${44+(String(lt(a.USDT,2)).length-1)*16}px`);return r.watch(()=>a.USDT,u=>{so.to(o,{duration:1.5,USDT:Number(u)||0,BTC:a.BTC,delta:a.delta})},{immediate:!0}),r.watch(()=>d,u=>{s.value=so.to(i,{duration:1.5,currentProfit:a.currentProfit})},{immediate:!0,deep:!0}),(u,h)=>(r.openBlock(),r.createElementBlock("div",OD,[r.createElementVNode("div",BD,[r.createElementVNode("div",PD,[r.createElementVNode("div",ND,[AD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.tooltip),1)]),_:1})]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:l},[r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye"},null,512),[[r.vShow,t.isHidden]]),r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye-slash"},null,512),[[r.vShow,!t.isHidden]])]))]),r.createElementVNode("div",FD,[r.createElementVNode("div",zD,[r.createElementVNode("div",{class:"balance-part__content__count",style:r.normalizeStyle({minWidth:c.value})},r.toDisplayString(r.unref(_e)(t.isMaskBalance,r.unref(ze)(o.USDT),{prefix:"$"})),5),t.delta?(r.openBlock(),r.createBlock(r.unref(Zd),{key:0,class:"balance-part__content__chips","is-hidden":t.isMaskBalance,percentage:"",delta:o.delta},null,8,["is-hidden","delta"])):r.createCommentVNode("",!0)]),t.showBTC?(r.openBlock(),r.createElementBlock("div",RD," = "+r.toDisplayString(r.unref(_e)(t.isMaskBalance,o.BTC))+" BTC ",1)):r.createCommentVNode("",!0)]),t.isShare?(r.openBlock(),r.createBlock(r.unref(Du),{key:0,class:"balance-part__chart balance-part__chart--share",data:t.balanceChartData,gradient:{height:500,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}},null,8,["data"])):(r.openBlock(),r.createBlock(r.unref(Du),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",HD)),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ID,[r.createElementVNode("div",jD,[r.createElementVNode("div",ZD,[YD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(" In this widget, set your desired balance growth target in $ or % for a specific period. It will display your PNL relative to the goal, helping you know when to stop or pay closer attention. ")]),_:1})]),r.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:h[0]||(h[0]=p=>n("switchModal"))},[r.createVNode(r.unref(Le),{icon:"settings"})])]),r.createElementVNode("div",WD,[r.createElementVNode("div",UD,r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(ze)(i.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),r.createElementVNode("div",qD," / "+r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(ze)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),(r.openBlock(),r.createBlock(r.unref(C5),{key:s.value,"current-profit":t.currentProfit,"is-hidden":t.isMaskPersonalTarget,drawdown:t.drawdown,profit:t.profit,"is-percentage":t.isPercentage},null,8,["current-profit","is-hidden","drawdown","profit","is-percentage"]))])),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:h[1]||(h[1]=p=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-ccf45b88"]]),ed=t=>(r.pushScopeId("data-v-9786b83c"),t=t(),r.popScopeId(),t),XD={class:"calendar-widget"},KD={class:"calendar-widget__calendar"},QD={class:"calendar-widget__top"},JD={class:"calendar-widget__title-wrapper"},eV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),tV={class:"stat-calendar"},nV={class:"stat-calendar__week-days"},aV={key:0,class:"stat-calendar__row-wrapper"},oV={class:"stat-calendar__row"},rV=["onClick"],iV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),sV={key:0,class:"calendar-widget__day"},lV={class:"calendar-widget__day__title-wrapper"},dV={class:"calendar-widget__day__title"},cV={class:"calendar-widget__day__content"},uV={class:"calendar-widget__point"},hV={class:"calendar-widget__point__title"},pV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),fV={class:"calendar-widget__day__trades"},mV={class:"calendar-widget__point"},_V={class:"calendar-widget__point__title"},gV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),bV={__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,minDate:Date,currentDate:{type:Date,default:new Date},maxDate:{type:Date,default:Date()},isCurrentDate:Function,isCurrentDay:Function,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["setNewDate","chooseMonth","refresh","getDetails"],setup(t,{emit:e}){const n=["Mo","Tu","We","Th","Fr","Sa","Su"],a=r.ref(null),o=r.ref(null),i=e,s=t,l=u=>{a.value=u.year,o.value=u.month,i("chooseMonth",u)};r.nextTick(()=>{const u=new Date;a.value=u.getFullYear(),o.value=u.getMonth()});const d=r.computed(()=>[{title:"Total trades",value:s.dailyStatData&&s.dailyStatData.trades_total_count||0},{title:"Winrate",value:ze(s.dailyStatData&&s.dailyStatData.win_rate||0,{isPercentage:!0,isFixed:!0}),class:s.dailyStatData&&s.dailyStatData.win_rate>=50?"-win":"-loss"},{title:"Return",value:ze(s.dailyStatData&&s.dailyStatData.return_total||0),class:s.dailyStatData&&s.dailyStatData.return_total>=0?"-win":"-loss"},{title:"Return on winners",value:ze(s.dailyStatData&&s.dailyStatData.return_win||0)},{title:"Return on losers",value:ze(s.dailyStatData&&s.dailyStatData.return_lose||0)},{title:"Commission",value:ze(s.dailyStatData&&s.dailyStatData.commission||0)}]),c=r.computed(()=>[{title:"Win trades",value:s.dailyStatData&&s.dailyStatData.trades_win_count||0,isPositive:!0},{title:"Loss trades",value:-(s.dailyStatData&&s.dailyStatData.trades_lose_count)||0,isNegative:!1}]);return(u,h)=>(r.openBlock(),r.createElementBlock("div",XD,[r.createElementVNode("div",KD,[r.createElementVNode("div",QD,[r.createElementVNode("div",JD,[eV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("A widget that displays the performance of your trades in a calendar format. Here you can see profitable and unprofitable days with detailed statistics for each day. ")]),_:1})]),t.currentDate&&t.minDate?(r.openBlock(),r.createBlock(r.unref(x5),{key:0,"current-date":t.currentDate||new Date,"min-date":t.minDate,"max-date":t.maxDate,onOnChange:l,year:a.value,"onUpdate:year":h[0]||(h[0]=p=>a.value=p),month:o.value,"onUpdate:month":h[1]||(h[1]=p=>o.value=p)},null,8,["current-date","min-date","max-date","year","month"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",tV,[r.createElementVNode("div",nV,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(n,(p,f)=>r.createElementVNode("div",{class:r.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},r.toDisplayString(p),3)),64))]),t.rows?(r.openBlock(),r.createElementBlock("div",aV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.rows,p=>(r.openBlock(),r.createElementBlock("div",oV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,f=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["stat-calendar__day",{"-unavailable":f.unavailable,"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:_=>i("setNewDate",f.date)},r.toDisplayString(f.date?f.date:""),11,rV))),256))]))),256))])):r.createCommentVNode("",!0)])]),iV,t.dailyStatData&&!t.dailyStatData.isNull?(r.openBlock(),r.createElementBlock("div",sV,[r.createElementVNode("div",lV,[r.createElementVNode("div",dV,r.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),r.createVNode(Le,{icon:"preview",onClick:h[2]||(h[2]=p=>i("getDetails"))})]),r.createElementVNode("div",cV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,p=>(r.openBlock(),r.createElementBlock("div",uV,[r.createElementVNode("div",hV,r.toDisplayString(p.title),1),pV,r.createElementVNode("div",{class:r.normalizeClass(["calendar-widget__point__value",p.class?p.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,p.value,{repeat:5})),3)]))),256)),r.createVNode(r.unref(u2),{isHidden:t.isMask,long:t.dailyStatData?.long_count,short:t.dailyStatData?.short_count},null,8,["isHidden","long","short"]),r.createElementVNode("div",fV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,p=>(r.openBlock(),r.createElementBlock("div",mV,[r.createElementVNode("div",_V,r.toDisplayString(p.title),1),gV,r.createVNode(r.unref(Zd),{isHidden:t.isMask,"is-positive":p.isPositive,"is-negative":p.isNegative,delta:p.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(r.openBlock(),r.createBlock(r.unref(va),{key:1,class:"-empty"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:h[3]||(h[3]=p=>i("refresh"))})):r.createCommentVNode("",!0)]))}},yV=ve(bV,[["__scopeId","data-v-9786b83c"]]),Vu=t=>(r.pushScopeId("data-v-f0601396"),t=t(),r.popScopeId(),t),wV={class:"commission-widget"},vV={class:"commission-widget__content"},xV={class:"commission-widget__top"},kV={class:"commission-widget__title-wrapper"},CV=Vu(()=>r.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),MV={class:"commission-widget__info"},SV={class:"commission-widget__total-wrapper"},LV=Vu(()=>r.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),$V={class:"commission-widget__total-wrapper__total"},DV={class:"commission-widget__total-wrapper__value"},VV={class:"commission-widget__points"},EV={class:"commission-widget__point"},TV={class:"commission-widget__point__title"},OV=Vu(()=>r.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),BV=ve({__name:"CommissionsFeesWidget",props:{commissionData:Object,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,a=t,o=r.reactive({commission:0}),i=r.computed(()=>a.commissionData&&a.commissionData.commission||0),s=r.computed(()=>a.commissionData&&a.commissionData.pnl||0),l=r.computed(()=>[{title:"AVG fees per trade",value:`${ze(a.commissionData&&a.commissionData.fees_per_trade||0)}`},{title:"PNL / Commission",value:s.value&&i.value?`${ze(s.value)}/${ze(i.value)}`:`${ze(0)}`},{title:"AVG fees per day",value:`${ze(a.commissionData&&a.commissionData.fees_per_day||0)}`},{title:"Funding",value:`${ze(a.commissionData&&a.commissionData.funding||0)}`}]);return r.watch(i,d=>{so.to(o,{duration:1.5,commission:d})},{immediate:!0}),(d,c)=>(r.openBlock(),r.createElementBlock("div",wV,[r.createElementVNode("div",vV,[r.createElementVNode("div",xV,[r.createElementVNode("div",kV,[CV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget helps traders finally understand how much money they spent on commissions and funding. ")]),_:1})])]),r.createElementVNode("div",MV,[r.createElementVNode("div",SV,[LV,r.createElementVNode("div",$V,[r.createElementVNode("div",DV,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(o.commission),{repeat:5})),1)])]),r.createElementVNode("div",VV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(u,h)=>(r.openBlock(),r.createElementBlock("div",EV,[r.createElementVNode("div",TV,r.toDisplayString(u.title),1),OV,r.createElementVNode("div",{class:r.normalizeClass(["commission-widget__point__value",u.class?u.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,u.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:c[0]||(c[0]=u=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-f0601396"]]),PV={class:"chart-wrapper"},NV=["id","onMouseover","onMouseleave"],td={__name:"BarChart",props:{data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"#56B683"},ticksCallback:{type:Function,default:t=>t},yTicksCallback:{type:Function,default:t=>t},altLabels:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){ar.register(Cu,Mu,h$,F$,ku,s6);const e=r.inject("darkMode"),n=r.ref(0);r.ref(!1);const a=r.ref(null),o=t,i=r.ref(null),s=r.ref([]),l=f=>{a.value=f},d=f=>{a.value=null},c=r.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},elements:{line:{tension:.05,borderWidth:3,borderColor:o.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}},plugins:{tooltip:{enabled:!1,position:"nearest",external:p},legend:!1},scales:{x:{grid:{display:!1},ticks:{callback:function(f){return o.ticksCallback(f,o.data.labels)}}},y:{ticks:{callback:function(f){return o.yTicksCallback(f,o.isMask)}},grid:{color:e?.value?"#2D2D2D":"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}}}),u=f=>{const _=f.scales.x;o.data.labels.forEach((m,g)=>{const b=_.getPixelForTick(g)-20;s.value[g]=b})};function h(f,_){let m=document.querySelector(`#${f}-${o.dataType}`);return m||(m=document.createElement("div"),m.classList.add(f),m.setAttribute("id",`${f}-${o.dataType}`),_.canvas.parentNode.appendChild(m)),m}function p(f){const{chart:_,tooltip:m}=f,g=h("chart-tooltip",_);if(m.opacity===0){g.style.opacity="0";return}if(m.body){m.title;const C=m.body.map(S=>S.lines),$=document.createElement("div");for($.classList.add("chart-tooltip-middle"),$.innerHTML=`${_e(o.isMask,vd(ze(C[0])),{repeat:3})}`;g.firstChild;)g.firstChild.remove();g.appendChild($)}const{offsetLeft:b,offsetTop:w,clientWidth:y}=_.canvas;let k=b+m.caretX;const v=w+m.caretY,M=g.clientWidth;k+M>y&&(k-=M),g.style.opacity="1",g.style.left=k+"px",g.style.top=v+"px"}return r.watch(()=>o.isMask,()=>{n.value+=1},{immediate:!0}),r.onMounted(()=>{o.altLabels&&r.nextTick(()=>{u(i.value.chart),window.addEventListener("resize",f=>u(i.value.chart))})}),(f,_)=>(r.openBlock(),r.createElementBlock("div",PV,[(r.openBlock(),r.createBlock(r.unref(wD),{ref_key:"barChart",ref:i,class:"chart-container",key:n.value,data:t.data,options:c.value},null,8,["data","options"])),t.altLabels?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data.labels,(m,g)=>(r.openBlock(),r.createElementBlock("div",{class:"chart-wrapper__labels",id:`label-${g}`,style:r.normalizeStyle({left:`${s.value[g]}px`}),onMouseover:b=>l(g),onMouseleave:b=>d()},[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(m,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(m,1)}`)},null,2)],44,NV))),256)):r.createCommentVNode("",!0),a.value!==null?(r.openBlock(),r.createElementBlock("div",{key:1,class:"chart-wrapper__label-tooltip",style:r.normalizeStyle({left:`${s.value[a.value]-25}px`})},r.toDisplayString(r.unref(dr)(o.data.labels[a.value])),5)):r.createCommentVNode("",!0)]))}},AV=t=>(r.pushScopeId("data-v-d430cc1b"),t=t(),r.popScopeId(),t),FV={class:"instrument-widget"},zV={class:"instrument-widget__top"},RV={class:"instrument-widget__title-wrapper"},HV=AV(()=>r.createElementVNode("div",{class:"instrument-widget__title"},"Results by Instrument",-1)),IV={key:0,class:""},jV={key:1,class:"instrument-widget__grid"},ZV={class:"instrument-widget__card"},YV={class:"instrument-widget__card__top"},WV={class:"instrument-widget__card__pair-icons"},UV={class:"instrument-widget__card__title"},qV={class:"instrument-widget__card__bottom"},GV={class:"instrument-widget__card__trades"},XV=ve({__name:"InstrumentWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Overall"},{id:1,name:"Long"},{id:2,name:"Short"}],a=t,o=e,i=r.ref(!1),s=r.ref({id:0,name:"Overall"}),l=r.computed(()=>a.results[s.value.name.toLowerCase()]),d=r.computed(()=>{const h=Object.values(l.value).map(f=>f.net_pnl_total),p=Object.values(l.value).map(f=>f.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value),datasets:[{data:h,backgroundColor:p,borderRadius:4}]}}),c=(h,p)=>"",u=()=>{i.value=!i.value};return(h,p)=>(r.openBlock(),r.createElementBlock("div",FV,[r.createElementVNode("div",zV,[r.createElementVNode("div",RV,[HV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Check your performance across different trading instruments. Use the Overall, Long, or Short filters to view detailed results. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"instrument-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:u})]),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Bc),{class:"instrument-widget__switcher",modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=f=>s.value=f),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",IV,[r.createVNode(td,{class:"instrument-widget__bar",data:d.value,ticksCallback:c,"y-ticks-callback":r.unref(ri),"is-mask":t.isMask,"data-type":"instrument","alt-labels":""},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",jV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(f,_,m)=>(r.openBlock(),r.createElementBlock("div",ZV,[r.createElementVNode("div",YV,[r.createElementVNode("div",WV,[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(_,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(_,1)}`)},null,2)]),r.createElementVNode("div",UV,r.toDisplayString(r.unref(dr)(_)),1)]),r.createElementVNode("div",qV,[r.createElementVNode("div",GV,r.toDisplayString(r.unref(_e)(t.isMask,f.trades_count,{repeat:3}))+" trades ",1),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__card__net-pnl",{"-positive":f.net_pnl_total>0,"-negative":f.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(f.net_pnl_total,{isFixed:!0,isPlus:!0}),{repeat:3})),3)])]))),256))]))],64)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:p[1]||(p[1]=f=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-d430cc1b"]]),KV=t=>(r.pushScopeId("data-v-9276a75c"),t=t(),r.popScopeId(),t),QV={class:"size-widget"},JV={class:"size-widget__top"},eE={class:"size-widget__title-wrapper"},tE=KV(()=>r.createElementVNode("div",{class:"size-widget__title"},"Result by position size",-1)),nE={key:0},aE={key:1,class:"size-widget__grid"},oE={class:"size-widget__card"},rE={class:"size-widget__card__top"},iE={class:"size-widget__card__title"},sE={class:"size-widget__card__trades"},lE={class:"size-widget__card__bottom"},dE=ve({__name:"SizeWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,a=e,o=r.ref(!1),i=r.computed(()=>{const d=n.results.map(h=>h.net_pnl),c=n.results.map(h=>h.net_pnl>0?"#56B683":"#F18169");return{labels:n.results.map(h=>h.amount),datasets:[{data:d,backgroundColor:c,borderRadius:4}]}}),s=(d,c)=>c[d],l=()=>{o.value=!o.value};return(d,c)=>(r.openBlock(),r.createElementBlock("div",QV,[r.createElementVNode("div",JV,[r.createElementVNode("div",eE,[tE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Compare your profits or losses based on the size of your positions. Understand how position size influences your trading outcomes. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"size-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l})]),t.results&&t.results.length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["size-widget__content",{"-chart-active":o.value}])},[o.value?(r.openBlock(),r.createElementBlock("div",nE,[r.createVNode(td,{class:"size-widget__bar",data:i.value,"ticks-callback":s,"y-ticks-callback":r.unref(ri),"is-mask":t.isMask,"data-type":"size"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",aE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,u=>(r.openBlock(),r.createElementBlock("div",oE,[r.createElementVNode("div",rE,[r.createElementVNode("div",iE,r.toDisplayString(u.amount)+" lots",1),r.createElementVNode("div",sE,r.toDisplayString(r.unref(_e)(t.isMask,u.total_count,{repeat:3}))+" trades ",1)]),r.createElementVNode("div",lE,[r.createElementVNode("div",{class:r.normalizeClass(["size-widget__card__net-pnl",{"-positive":u.net_pnl>0,"-negative":u.net_pnl<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(u.net_pnl,{isPlus:!0,isFixed:!0}),{repeat:3})),3)])]))),256))]))],2)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:c[0]||(c[0]=u=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-9276a75c"]]),cE=t=>(r.pushScopeId("data-v-98670dfc"),t=t(),r.popScopeId(),t),uE={class:"performance-widget"},hE={class:"performance-widget__top"},pE={class:"performance-widget__title-wrapper"},fE=cE(()=>r.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),mE=ve({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){r.ref("week");const n=t,a=e,o=i=>_e(n.isMask,lt(i,2)+"%",{repeat:3});return(i,s)=>(r.openBlock(),r.createElementBlock("div",uE,[r.createElementVNode("div",hE,[r.createElementVNode("div",pE,[fE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("The linear graphics widget displays the profit as a percentage of the deposit. ")]),_:1})])]),r.createVNode(r.unref($u),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":o,isMask:t.isMask},null,8,["data","isMask"]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-98670dfc"]]),Eu=t=>(r.pushScopeId("data-v-e936f12b"),t=t(),r.popScopeId(),t),_E={class:"return-widget"},gE={class:"return-widget__content"},bE={class:"return-widget__top"},yE={class:"return-widget__title-wrapper"},wE=Eu(()=>r.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),vE={class:"return-widget__info"},xE={class:"return-widget__total-wrapper"},kE=Eu(()=>r.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),CE={class:"return-widget__total-wrapper__total"},ME={class:"return-widget__points"},SE={class:"return-widget__point"},LE={class:"return-widget__point__title"},$E=Eu(()=>r.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),DE=["innerHTML"],VE=ve({__name:"ReturnWidget",props:{totalReturn:{type:Number,default:0},win:{type:Number,default:0},lose:{type:Number,default:0},returnPeriod:{type:Number,default:0},profitFactor:{type:Number,default:0},daily:{type:Number,default:0},changeRate:{type:Number,default:0},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,a=t,o=r.computed(()=>`${44+(String(lt(a.returnPeriod,2)).length-1)*16}px`),i=r.reactive({returnPeriod:0,changeRate:0}),s=r.computed(()=>[{title:"Average return per trade",value:a.totalReturn,options:{isPlus:!0,isFixed:!0},class:a.totalReturn===0?"":a.totalReturn>0?"-win":"-loss"},{title:"Daily return",value:a.daily,options:{isPlus:!0,isFixed:!0},class:a.daily===0?"":a.daily>0?"-win":"-loss"},{title:"Return on winners",value:a.win,class:"-win"},{title:"Return on losers",value:a.lose,class:"-loss"}]),l=r.computed(()=>a.returnPeriod>0),d=r.computed(()=>a.returnPeriod<0),c=r.computed(()=>a.profitFactor>1?"-positive":"-negative"),u=r.computed(()=>a.profitFactor>0?`Your profit factor is ${_e(a.isMask,lt(a.profitFactor),{repeat:5})}. <br /> You earn ${_e(a.isMask,ze(a.profitFactor),{repeat:5,prefix:"$"})} on every ${_e(a.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${_e(a.isMask,lt(a.profitFactor),{repeat:5})}. <br/> You loss ${_e(a.isMask,ze(Math.abs(a.profitFactor)),{repeat:5,prefix:"$"})} on every ${_e(a.isMask,"$1",{repeat:5,prefix:"$"})} earn. `);return r.watch(()=>a.returnPeriod,h=>{so.to(i,{duration:1.5,returnPeriod:h,changeRate:a.changeRate})},{immediate:!0}),(h,p)=>(r.openBlock(),r.createElementBlock("div",_E,[r.createElementVNode("div",gE,[r.createElementVNode("div",bE,[r.createElementVNode("div",yE,[wE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget displays an increase in NET profit in dollars and percentage relative to the deposit for the specified period you have chosen. ")]),_:1})])]),r.createElementVNode("div",vE,[r.createElementVNode("div",xE,[kE,r.createElementVNode("div",CE,[r.createElementVNode("div",{class:r.normalizeClass(["return-widget__total-wrapper__value",{"-positive":l.value,"-negative":d.value}]),style:r.normalizeStyle({minWidth:o.value})},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(i.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),7),a.changeRate?(r.openBlock(),r.createBlock(r.unref(Zd),{key:0,percentage:"",class:"return-widget__total-wrapper__chips",isHidden:t.isMask,delta:i.changeRate},null,8,["isHidden","delta"])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",ME,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("div",SE,[r.createElementVNode("div",LE,r.toDisplayString(f.title),1),$E,r.createElementVNode("div",{class:r.normalizeClass(["return-widget__point__value",f.class?f.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(f.value,f.options),{repeat:5,prefix:"$"})),3)]))),256))])])]),t.profitFactor?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["return-widget__profit",c.value])},[r.createVNode(r.unref(Le),{icon:"tip",class:"return-widget__profit__icon"}),r.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:u.value},null,8,DE)],2)):r.createCommentVNode("",!0),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:1,onRefresh:p[0]||(p[0]=f=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-e936f12b"]]),O6=t=>(r.pushScopeId("data-v-1522f636"),t=t(),r.popScopeId(),t),EE={class:"top-positions-widget"},TE={class:"top-positions-widget__top"},OE={class:"top-positions-widget__title-wrapper"},BE=O6(()=>r.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),PE={key:0,class:"top-positions-widget__returns"},NE={class:"top-positions-widget__return"},AE={class:"top-positions-widget__return__left"},FE=O6(()=>r.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),zE=["onClick"],RE={class:"top-positions-widget__return__right"},HE={class:"top-positions-widget__return__pnl"},IE=ve({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh","onPairClick"],setup(t,{emit:e}){r.ref("week");const n=e;return(a,o)=>(r.openBlock(),r.createElementBlock("div",EE,[r.createElementVNode("div",TE,[r.createElementVNode("div",OE,[BE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Helps you find the top profitable positions. We calculate only net PNL, taking into account commission and funding. ")]),_:1})])]),t.topPositions&&t.topPositions.length?(r.openBlock(),r.createElementBlock("div",PE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.topPositions,i=>(r.openBlock(),r.createElementBlock("div",NE,[r.createElementVNode("div",AE,[FE,r.createElementVNode("div",{class:"top-positions-widget__return__pair",onClick:s=>n("onPairClick",i)},[r.createTextVNode(r.toDisplayString(r.unref(dr)(i.pair))+" ",1),r.createVNode(r.unref(Le),{icon:"chevron-right-small"})],8,zE)]),r.createElementVNode("div",RE,[r.createElementVNode("div",HE,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(i.pnl,{isFixed:!0,isPlus:!0},{repeat:5}))),1),r.createElementVNode("div",{class:r.normalizeClass(["top-positions-widget__return__roi",i.roi<0?"-negative":"-positive"])},[r.createVNode(r.unref(Le),{icon:"bxs_up-arrow"}),r.createElementVNode("span",null,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(i.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])]))),256))])):(r.openBlock(),r.createBlock(r.unref(va),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:o[0]||(o[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-1522f636"]]),Tu=t=>(r.pushScopeId("data-v-a3559196"),t=t(),r.popScopeId(),t),jE={class:"trade-widget"},ZE={class:"trade-widget__content"},YE={class:"trade-widget__top"},WE={class:"trade-widget__title-wrapper"},UE=Tu(()=>r.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),qE={class:"trade-widget__info"},GE={class:"trade-widget__total-wrapper"},XE=Tu(()=>r.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),KE={class:"trade-widget__total-wrapper__total"},QE={class:"trade-widget__total-wrapper__value"},JE={class:"trade-widget__points"},eT={class:"trade-widget__point"},tT={class:"trade-widget__point__title"},nT=Tu(()=>r.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),aT=ve({__name:"TradePerformanceWidget",props:{totalTrades:Number,minDate:Date,tradePoints:Array,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=r.reactive({totalTrades:0}),a=e,o=t;return r.watch(()=>o.totalTrades,i=>{so.to(n,{duration:1.5,totalTrades:i})},{immediate:!0}),(i,s)=>(r.openBlock(),r.createElementBlock("div",jE,[r.createElementVNode("div",ZE,[r.createElementVNode("div",YE,[r.createElementVNode("div",WE,[UE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("It displays the number of profitable and unprofitable positions. This widget is very useful for understanding your trading opportunities. ")]),_:1})])]),r.createElementVNode("div",qE,[r.createElementVNode("div",GE,[XE,r.createElementVNode("div",KE,[r.createElementVNode("div",QE,r.toDisplayString(r.unref(_e)(t.isMask,Math.floor(n.totalTrades),{repeat:5})),1)])]),r.createElementVNode("div",JE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tradePoints,l=>(r.openBlock(),r.createElementBlock("div",eT,[r.createElementVNode("div",tT,r.toDisplayString(l.title),1),nT,r.createElementVNode("div",{class:r.normalizeClass(["trade-widget__point__value",l.class?l.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,l.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a3559196"]]),Ou=t=>(r.pushScopeId("data-v-6e6e0081"),t=t(),r.popScopeId(),t),oT={class:"winrate-widget"},rT={class:"winrate-widget__winrate"},iT={class:"winrate-widget__title-wrapper"},sT=Ou(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),lT={class:"winrate-widget__chart"},dT={class:"winrate-widget__data"},cT={class:"winrate-widget__data_value"},uT=Ou(()=>r.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),hT={class:"winrate-widget__average-rr"},pT={class:"winrate-widget__title-wrapper"},fT=Ou(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),mT=ve({__name:"WinrateWidget",props:{winrate:{type:Number,default:0},minRR:{type:Number,default:0},averageRR:{type:Number,default:0},maxRR:{type:Number,default:0},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e;return(a,o)=>(r.openBlock(),r.createElementBlock("div",oT,[r.createElementVNode("div",rT,[r.createElementVNode("div",iT,[sT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),r.createElementVNode("div",lT,[r.renderSlot(a.$slots,"roundSlider",{},void 0,!0),r.createElementVNode("div",dT,[r.createElementVNode("div",cT,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(lt)(t.winrate,2)))+"% ",1),uT])])]),r.createElementVNode("div",hT,[r.createElementVNode("div",pT,[fT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),r.createVNode(r.unref(g_),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:o[0]||(o[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-6e6e0081"]]),B6=t=>(r.pushScopeId("data-v-47d081bb"),t=t(),r.popScopeId(),t),_T={class:"oh-widget"},gT={class:"oh-widget__top"},bT={class:"oh-widget__title-wrapper"},yT=B6(()=>r.createElementVNode("div",{class:"oh-widget__title"},"Result by Open Hour",-1)),wT={key:0},vT={key:1,class:"oh-widget__table-wrapper"},xT={class:"oh-widget__list"},kT=B6(()=>r.createElementVNode("thead",{class:"oh-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),CT={class:"oh-widget__list__body"},MT={class:"oh-widget__list__point"},ST={class:"oh-widget__list__subpoint"},LT={class:"oh-widget__list__subpoint"},$T=ve({__name:"OpenHourWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Asia",key:"asia_session"},{id:1,name:"London",key:"london_session"},{id:2,name:"NY",key:"new_york_session"}],a=t,o=e,i=r.ref(!1),s=r.ref({id:0,name:"Asia",key:"asia_session"}),l=r.computed(()=>a.results?a.results[s.value.key]:{}),d=r.computed(()=>{const h=Object.values(l.value).map(f=>f.net_pnl_total),p=Object.values(l.value).map(f=>f.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value),datasets:[{data:h,backgroundColor:p,borderRadius:4}]}}),c=()=>{i.value=!i.value},u=(h,p)=>p[h];return(h,p)=>(r.openBlock(),r.createElementBlock("div",_T,[r.createElementVNode("div",gT,[r.createElementVNode("div",bT,[yT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Analyze your trading performance based on the hour of the day and trading session. Switch between different time zones to track results by market. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"oh-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:c})]),r.createElementVNode("div",{class:r.normalizeClass(["oh-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Bc),{class:"oh-widget__switcher",modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=f=>s.value=f),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",wT,[r.createVNode(td,{class:"oh-widget__bar",data:d.value,"ticks-callback":u,"y-ticks-callback":r.unref(ri),"is-mask":t.isMask,"data-type":"oh"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",vT,[r.createElementVNode("table",xT,[kT,r.createElementVNode("tbody",CT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(f,_,m)=>(r.openBlock(),r.createElementBlock("tr",MT,[r.createElementVNode("td",ST,r.toDisplayString(_),1),r.createElementVNode("td",LT,r.toDisplayString(r.unref(_e)(t.isMask,f.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["oh-widget__list__subpoint",{"-positive":f.net_pnl_total>0,"-negative":f.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(f.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])])]))],64)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:p[1]||(p[1]=f=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-47d081bb"]]),P6=t=>(r.pushScopeId("data-v-f722929f"),t=t(),r.popScopeId(),t),DT={class:"duration-widget"},VT={class:"duration-widget__top"},ET={class:"duration-widget__title-wrapper"},TT=P6(()=>r.createElementVNode("div",{class:"duration-widget__title"},"Result by time duration",-1)),OT={key:0},BT={key:1,class:"duration-widget__list"},PT=P6(()=>r.createElementVNode("thead",{class:"duration-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),NT={class:"duration-widget__list__body"},AT={class:"duration-widget__list__point"},FT={class:"duration-widget__list__subpoint"},zT={class:"duration-widget__list__subpoint"},RT=ve({__name:"DurationWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,a=e,o=r.ref(!1),i=r.computed(()=>{const c=Object.values(n.results).map(h=>h.net_pnl_total),u=Object.values(n.results).map(h=>h.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(n.results),datasets:[{data:c,backgroundColor:u,borderRadius:4}]}});function s(c){const u=Math.floor(c/1440),h=Math.floor(c%(60*24)/60),p=Math.floor(c%60),f=[];return u>0&&f.push(`${u}d`),h>0&&f.push(`${h}h`),p>0&&f.push(`${p}m`),f.length===0?"0m":f.join(" ")}const l=()=>{o.value=!o.value},d=(c,u)=>u[c];return(c,u)=>(r.openBlock(),r.createElementBlock("div",DT,[r.createElementVNode("div",VT,[r.createElementVNode("div",ET,[TT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("See how your trades perform based on their duration. Filter by time intervals to identify patterns in short or long-term trades. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"duration-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l})]),t.results&&Object.values(t.results).length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["duration-widget__content",{"-chart-active":o.value}])},[o.value?(r.openBlock(),r.createElementBlock("div",OT,[r.createVNode(td,{class:"duration-widget__bar",data:i.value,"ticks-callback":d,"y-ticks-callback":r.unref(ri),"data-type":"duration","is-mask":t.isMask},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("table",BT,[PT,r.createElementVNode("tbody",NT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,(h,p,f)=>(r.openBlock(),r.createElementBlock("tr",AT,[r.createElementVNode("td",FT,r.toDisplayString(s(Number(p))),1),r.createElementVNode("td",zT,r.toDisplayString(r.unref(_e)(t.isMask,h.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["duration-widget__list__subpoint",{"-positive":h.net_pnl_total>0,"-negative":h.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(h.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])]))],2)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:u[0]||(u[0]=h=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-f722929f"]]);class rr extends Error{}class HT extends rr{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class IT extends rr{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class jT extends rr{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Wr extends rr{}class N6 extends rr{constructor(e){super(`Invalid unit ${e}`)}}class jt extends rr{}class mo extends rr{constructor(){super("Zone is an abstract class")}}const le="numeric",Yn="short",vn="long",nd={year:le,month:le,day:le},A6={year:le,month:Yn,day:le},ZT={year:le,month:Yn,day:le,weekday:Yn},F6={year:le,month:vn,day:le},z6={year:le,month:vn,day:le,weekday:vn},R6={hour:le,minute:le},H6={hour:le,minute:le,second:le},I6={hour:le,minute:le,second:le,timeZoneName:Yn},j6={hour:le,minute:le,second:le,timeZoneName:vn},Z6={hour:le,minute:le,hourCycle:"h23"},Y6={hour:le,minute:le,second:le,hourCycle:"h23"},W6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:Yn},U6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:vn},q6={year:le,month:le,day:le,hour:le,minute:le},G6={year:le,month:le,day:le,hour:le,minute:le,second:le},X6={year:le,month:Yn,day:le,hour:le,minute:le},K6={year:le,month:Yn,day:le,hour:le,minute:le,second:le},YT={year:le,month:Yn,day:le,weekday:Yn,hour:le,minute:le},Q6={year:le,month:vn,day:le,hour:le,minute:le,timeZoneName:Yn},J6={year:le,month:vn,day:le,hour:le,minute:le,second:le,timeZoneName:Yn},em={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,timeZoneName:vn},tm={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,second:le,timeZoneName:vn};class ps{get type(){throw new mo}get name(){throw new mo}get ianaName(){return this.name}get isUniversal(){throw new mo}offsetName(e,n){throw new mo}formatOffset(e,n){throw new mo}offset(e){throw new mo}equals(e){throw new mo}get isValid(){throw new mo}}let Bu=null;class ad extends ps{static get instance(){return Bu===null&&(Bu=new ad),Bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:a}){return Sm(e,n,a)}formatOffset(e,n){return gs(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let od={};function WT(t){return od[t]||(od[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),od[t]}const UT={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function qT(t,e){const n=t.format(e).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,s,l,d,c,u]=a;return[s,o,i,l,d,c,u]}function GT(t,e){const n=t.formatToParts(e),a=[];for(let o=0;o<n.length;o++){const{type:i,value:s}=n[o],l=UT[i];i==="era"?a[l]=s:we(l)||(a[l]=parseInt(s,10))}return a}let rd={};class Oa extends ps{static create(e){return rd[e]||(rd[e]=new Oa(e)),rd[e]}static resetCache(){rd={},od={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Oa.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:a}){return Sm(e,n,a,this.name)}formatOffset(e,n){return gs(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const a=WT(this.name);let[o,i,s,l,d,c,u]=a.formatToParts?GT(a,n):qT(a,n);l==="BC"&&(o=-Math.abs(o)+1);const p=cd({year:o,month:i,day:s,hour:d===24?0:d,minute:c,second:u,millisecond:0});let f=+n;const _=f%1e3;return f-=_>=0?_:1e3+_,(p-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let nm={};function XT(t,e={}){const n=JSON.stringify([t,e]);let a=nm[n];return a||(a=new Intl.ListFormat(t,e),nm[n]=a),a}let Pu={};function Nu(t,e={}){const n=JSON.stringify([t,e]);let a=Pu[n];return a||(a=new Intl.DateTimeFormat(t,e),Pu[n]=a),a}let Au={};function KT(t,e={}){const n=JSON.stringify([t,e]);let a=Au[n];return a||(a=new Intl.NumberFormat(t,e),Au[n]=a),a}let Fu={};function QT(t,e={}){const{base:n,...a}=e,o=JSON.stringify([t,a]);let i=Fu[o];return i||(i=new Intl.RelativeTimeFormat(t,e),Fu[o]=i),i}let fs=null;function JT(){return fs||(fs=new Intl.DateTimeFormat().resolvedOptions().locale,fs)}let am={};function eO(t){let e=am[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,am[t]=e}return e}function tO(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let a,o;try{a=Nu(t).resolvedOptions(),o=t}catch{const d=t.substring(0,n);a=Nu(d).resolvedOptions(),o=d}const{numberingSystem:i,calendar:s}=a;return[o,i,s]}}function nO(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function aO(t){const e=[];for(let n=1;n<=12;n++){const a=be.utc(2009,n,1);e.push(t(a))}return e}function oO(t){const e=[];for(let n=1;n<=7;n++){const a=be.utc(2016,11,13+n);e.push(t(a))}return e}function id(t,e,n,a){const o=t.listingMode();return o==="error"?null:o==="en"?n(e):a(e)}function rO(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class iO{constructor(e,n,a){this.padTo=a.padTo||0,this.floor=a.floor||!1;const{padTo:o,floor:i,...s}=a;if(!n||Object.keys(s).length>0){const l={useGrouping:!1,...a};a.padTo>0&&(l.minimumIntegerDigits=a.padTo),this.inf=KT(e,l)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Wu(e,3);return St(n,this.padTo)}}}class sO{constructor(e,n,a){this.opts=a,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const s=-1*(e.offset/60),l=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&Oa.create(l).valid?(o=l,this.dt=e):(o="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,o=e.zone.name):(o="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=Nu(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const a=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:a}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class lO{constructor(e,n,a){this.opts={style:"long",...a},!n&&xm()&&(this.rtf=QT(e,a))}format(e,n){return this.rtf?this.rtf.format(e,n):EO(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const dO={firstDay:1,minimalDays:4,weekend:[6,7]};let Ke=class Is{static fromOpts(e){return Is.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,a,o,i=!1){const s=e||ft.defaultLocale,l=s||(i?"en-US":JT()),d=n||ft.defaultNumberingSystem,c=a||ft.defaultOutputCalendar,u=Zu(o)||ft.defaultWeekSettings;return new Is(l,d,c,u,s)}static resetCache(){fs=null,Pu={},Au={},Fu={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:a,weekSettings:o}={}){return Is.create(e,n,a,o)}constructor(e,n,a,o,i){const[s,l,d]=tO(e);this.locale=s,this.numberingSystem=n||l||null,this.outputCalendar=a||d||null,this.weekSettings=o,this.intl=nO(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=rO(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Is.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Zu(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return id(this,e,Dm,()=>{const a=n?{month:e,day:"numeric"}:{month:e},o=n?"format":"standalone";return this.monthsCache[o][e]||(this.monthsCache[o][e]=aO(i=>this.extract(i,a,"month"))),this.monthsCache[o][e]})}weekdays(e,n=!1){return id(this,e,Tm,()=>{const a=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},o=n?"format":"standalone";return this.weekdaysCache[o][e]||(this.weekdaysCache[o][e]=oO(i=>this.extract(i,a,"weekday"))),this.weekdaysCache[o][e]})}meridiems(){return id(this,void 0,()=>Om,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[be.utc(2016,11,13,9),be.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return id(this,e,Bm,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[be.utc(-40,1,1),be.utc(2017,1,1)].map(a=>this.extract(a,n,"era"))),this.eraCache[e]})}extract(e,n,a){const o=this.dtFormatter(e,n),i=o.formatToParts(),s=i.find(l=>l.type.toLowerCase()===a);return s?s.value:null}numberFormatter(e={}){return new iO(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new sO(e,this.intl,n)}relFormatter(e={}){return new lO(this.intl,this.isEnglish(),e)}listFormatter(e={}){return XT(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:km()?eO(this.locale):dO}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},zu=null;class Kt extends ps{static get utcInstance(){return zu===null&&(zu=new Kt(0)),zu}static instance(e){return e===0?Kt.utcInstance:new Kt(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Kt(ud(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${gs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${gs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return gs(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class cO extends ps{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function _o(t,e){if(we(t)||t===null)return e;if(t instanceof ps)return t;if(_O(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?ad.instance:n==="utc"||n==="gmt"?Kt.utcInstance:Kt.parseSpecifier(n)||Oa.create(t)}else return go(t)?Kt.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new cO(t)}const Ru={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},om={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},uO=Ru.hanidec.replace(/[\[|\]]/g,"").split("");function hO(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);if(t[n].search(Ru.hanidec)!==-1)e+=uO.indexOf(t[n]);else for(const o in om){const[i,s]=om[o];a>=i&&a<=s&&(e+=a-i)}}return parseInt(e,10)}else return e}let Ur={};function pO(){Ur={}}function Wn({numberingSystem:t},e=""){const n=t||"latn";return Ur[n]||(Ur[n]={}),Ur[n][e]||(Ur[n][e]=new RegExp(`${Ru[n]}${e}`)),Ur[n][e]}let rm=()=>Date.now(),im="system",sm=null,lm=null,dm=null,cm=60,um,hm=null;class ft{static get now(){return rm}static set now(e){rm=e}static set defaultZone(e){im=e}static get defaultZone(){return _o(im,ad.instance)}static get defaultLocale(){return sm}static set defaultLocale(e){sm=e}static get defaultNumberingSystem(){return lm}static set defaultNumberingSystem(e){lm=e}static get defaultOutputCalendar(){return dm}static set defaultOutputCalendar(e){dm=e}static get defaultWeekSettings(){return hm}static set defaultWeekSettings(e){hm=Zu(e)}static get twoDigitCutoffYear(){return cm}static set twoDigitCutoffYear(e){cm=e%100}static get throwOnInvalid(){return um}static set throwOnInvalid(e){um=e}static resetCaches(){Ke.resetCache(),Oa.resetCache(),be.resetCache(),pO()}}class Un{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const pm=[0,31,59,90,120,151,181,212,243,273,304,334],fm=[0,31,60,91,121,152,182,213,244,274,305,335];function Vn(t,e){return new Un("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Hu(t,e,n){const a=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&a.setUTCFullYear(a.getUTCFullYear()-1900);const o=a.getUTCDay();return o===0?7:o}function mm(t,e,n){return n+(ms(t)?fm:pm)[e-1]}function _m(t,e){const n=ms(t)?fm:pm,a=n.findIndex(i=>i<e),o=e-n[a];return{month:a+1,day:o}}function Iu(t,e){return(t-e+7)%7+1}function sd(t,e=4,n=1){const{year:a,month:o,day:i}=t,s=mm(a,o,i),l=Iu(Hu(a,o,i),n);let d=Math.floor((s-l+14-e)/7),c;return d<1?(c=a-1,d=_s(c,e,n)):d>_s(a,e,n)?(c=a+1,d=1):c=a,{weekYear:c,weekNumber:d,weekday:l,...pd(t)}}function gm(t,e=4,n=1){const{weekYear:a,weekNumber:o,weekday:i}=t,s=Iu(Hu(a,1,e),n),l=Gr(a);let d=o*7+i-s-7+e,c;d<1?(c=a-1,d+=Gr(c)):d>l?(c=a+1,d-=Gr(a)):c=a;const{month:u,day:h}=_m(c,d);return{year:c,month:u,day:h,...pd(t)}}function ju(t){const{year:e,month:n,day:a}=t,o=mm(e,n,a);return{year:e,ordinal:o,...pd(t)}}function bm(t){const{year:e,ordinal:n}=t,{month:a,day:o}=_m(e,n);return{year:e,month:a,day:o,...pd(t)}}function ym(t,e){if(!we(t.localWeekday)||!we(t.localWeekNumber)||!we(t.localWeekYear)){if(!we(t.weekday)||!we(t.weekNumber)||!we(t.weekYear))throw new Wr("Cannot mix locale-based week fields with ISO-based week fields");return we(t.localWeekday)||(t.weekday=t.localWeekday),we(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),we(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function fO(t,e=4,n=1){const a=ld(t.weekYear),o=En(t.weekNumber,1,_s(t.weekYear,e,n)),i=En(t.weekday,1,7);return a?o?i?!1:Vn("weekday",t.weekday):Vn("week",t.weekNumber):Vn("weekYear",t.weekYear)}function mO(t){const e=ld(t.year),n=En(t.ordinal,1,Gr(t.year));return e?n?!1:Vn("ordinal",t.ordinal):Vn("year",t.year)}function wm(t){const e=ld(t.year),n=En(t.month,1,12),a=En(t.day,1,dd(t.year,t.month));return e?n?a?!1:Vn("day",t.day):Vn("month",t.month):Vn("year",t.year)}function vm(t){const{hour:e,minute:n,second:a,millisecond:o}=t,i=En(e,0,23)||e===24&&n===0&&a===0&&o===0,s=En(n,0,59),l=En(a,0,59),d=En(o,0,999);return i?s?l?d?!1:Vn("millisecond",o):Vn("second",a):Vn("minute",n):Vn("hour",e)}function we(t){return typeof t>"u"}function go(t){return typeof t=="number"}function ld(t){return typeof t=="number"&&t%1===0}function _O(t){return typeof t=="string"}function gO(t){return Object.prototype.toString.call(t)==="[object Date]"}function xm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function km(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function bO(t){return Array.isArray(t)?t:[t]}function Cm(t,e,n){if(t.length!==0)return t.reduce((a,o)=>{const i=[e(o),o];return a&&n(a[0],i[0])===a[0]?a:i},null)[1]}function yO(t,e){return e.reduce((n,a)=>(n[a]=t[a],n),{})}function qr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Zu(t){if(t==null)return null;if(typeof t!="object")throw new jt("Week settings must be an object");if(!En(t.firstDay,1,7)||!En(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!En(e,1,7)))throw new jt("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function En(t,e,n){return ld(t)&&t>=e&&t<=n}function wO(t,e){return t-e*Math.floor(t/e)}function St(t,e=2){const n=t<0;let a;return n?a="-"+(""+-t).padStart(e,"0"):a=(""+t).padStart(e,"0"),a}function bo(t){if(!(we(t)||t===null||t===""))return parseInt(t,10)}function ir(t){if(!(we(t)||t===null||t===""))return parseFloat(t)}function Yu(t){if(!(we(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Wu(t,e,n=!1){const a=10**e;return(n?Math.trunc:Math.round)(t*a)/a}function ms(t){return t%4===0&&(t%100!==0||t%400===0)}function Gr(t){return ms(t)?366:365}function dd(t,e){const n=wO(e-1,12)+1,a=t+(e-n)/12;return n===2?ms(a)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function cd(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Mm(t,e,n){return-Iu(Hu(t,1,e),n)+e-1}function _s(t,e=4,n=1){const a=Mm(t,e,n),o=Mm(t+1,e,n);return(Gr(t)-a+o)/7}function Uu(t){return t>99?t:t>ft.twoDigitCutoffYear?1900+t:2e3+t}function Sm(t,e,n,a=null){const o=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};a&&(i.timeZone=a);const s={timeZoneName:e,...i},l=new Intl.DateTimeFormat(n,s).formatToParts(o).find(d=>d.type.toLowerCase()==="timezonename");return l?l.value:null}function ud(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const a=parseInt(e,10)||0,o=n<0||Object.is(n,-0)?-a:a;return n*60+o}function Lm(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new jt(`Invalid unit value ${t}`);return e}function hd(t,e){const n={};for(const a in t)if(qr(t,a)){const o=t[a];if(o==null)continue;n[e(a)]=Lm(o)}return n}function gs(t,e){const n=Math.trunc(Math.abs(t/60)),a=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${St(n,2)}:${St(a,2)}`;case"narrow":return`${o}${n}${a>0?`:${a}`:""}`;case"techie":return`${o}${St(n,2)}${St(a,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function pd(t){return yO(t,["hour","minute","second","millisecond"])}const vO=["January","February","March","April","May","June","July","August","September","October","November","December"],$m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xO=["J","F","M","A","M","J","J","A","S","O","N","D"];function Dm(t){switch(t){case"narrow":return[...xO];case"short":return[...$m];case"long":return[...vO];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Vm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Em=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],kO=["M","T","W","T","F","S","S"];function Tm(t){switch(t){case"narrow":return[...kO];case"short":return[...Em];case"long":return[...Vm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Om=["AM","PM"],CO=["Before Christ","Anno Domini"],MO=["BC","AD"],SO=["B","A"];function Bm(t){switch(t){case"narrow":return[...SO];case"short":return[...MO];case"long":return[...CO];default:return null}}function LO(t){return Om[t.hour<12?0:1]}function $O(t,e){return Tm(e)[t.weekday-1]}function DO(t,e){return Dm(e)[t.month-1]}function VO(t,e){return Bm(e)[t.year<0?0:1]}function EO(t,e,n="always",a=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){const h=t==="days";switch(e){case 1:return h?"tomorrow":`next ${o[t][0]}`;case-1:return h?"yesterday":`last ${o[t][0]}`;case 0:return h?"today":`this ${o[t][0]}`}}const s=Object.is(e,-0)||e<0,l=Math.abs(e),d=l===1,c=o[t],u=a?d?c[1]:c[2]||c[1]:d?o[t][0]:t;return s?`${l} ${u} ago`:`in ${l} ${u}`}function Pm(t,e){let n="";for(const a of t)a.literal?n+=a.val:n+=e(a.val);return n}const TO={D:nd,DD:A6,DDD:F6,DDDD:z6,t:R6,tt:H6,ttt:I6,tttt:j6,T:Z6,TT:Y6,TTT:W6,TTTT:U6,f:q6,ff:X6,fff:Q6,ffff:em,F:G6,FF:K6,FFF:J6,FFFF:tm};class Zt{static create(e,n={}){return new Zt(e,n)}static parseFormat(e){let n=null,a="",o=!1;const i=[];for(let s=0;s<e.length;s++){const l=e.charAt(s);l==="'"?(a.length>0&&i.push({literal:o||/^\s+$/.test(a),val:a}),n=null,a="",o=!o):o||l===n?a+=l:(a.length>0&&i.push({literal:/^\s+$/.test(a),val:a}),a=l,n=l)}return a.length>0&&i.push({literal:o||/^\s+$/.test(a),val:a}),i}static macroTokenToFormatOpts(e){return TO[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return St(e,n);const a={...this.opts};return n>0&&(a.padTo=n),this.loc.numberFormatter(a).format(e)}formatDateTimeFromString(e,n){const a=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,_)=>this.loc.extract(e,f,_),s=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",l=()=>a?LO(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(f,_)=>a?DO(e,f):i(_?{month:f}:{month:f,day:"numeric"},"month"),c=(f,_)=>a?$O(e,f):i(_?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),u=f=>{const _=Zt.macroTokenToFormatOpts(f);return _?this.formatWithSystemDefault(e,_):f},h=f=>a?VO(e,f):i({era:f},"era"),p=f=>{switch(f){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return o?i({day:"numeric"},"day"):this.num(e.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(e.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(e.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(f)}};return Pm(Zt.parseFormat(n),p)}formatDurationFromString(e,n){const a=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=d=>c=>{const u=a(c);return u?this.num(d.get(u),c.length):c},i=Zt.parseFormat(n),s=i.reduce((d,{literal:c,val:u})=>c?d:d.concat(u),[]),l=e.shiftTo(...s.map(a).filter(d=>d));return Pm(i,o(l))}}const Nm=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Xr(...t){const e=t.reduce((n,a)=>n+a.source,"");return RegExp(`^${e}$`)}function Kr(...t){return e=>t.reduce(([n,a,o],i)=>{const[s,l,d]=i(e,o);return[{...n,...s},l||a,d]},[{},null,1]).slice(0,2)}function Qr(t,...e){if(t==null)return[null,null];for(const[n,a]of e){const o=n.exec(t);if(o)return a(o)}return[null,null]}function Am(...t){return(e,n)=>{const a={};let o;for(o=0;o<t.length;o++)a[t[o]]=bo(e[n+o]);return[a,null,n+o]}}const Fm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,OO=`(?:${Fm.source}?(?:\\[(${Nm.source})\\])?)?`,qu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,zm=RegExp(`${qu.source}${OO}`),Gu=RegExp(`(?:T${zm.source})?`),BO=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,PO=/(\d{4})-?W(\d\d)(?:-?(\d))?/,NO=/(\d{4})-?(\d{3})/,AO=Am("weekYear","weekNumber","weekDay"),FO=Am("year","ordinal"),zO=/(\d{4})-(\d\d)-(\d\d)/,Rm=RegExp(`${qu.source} ?(?:${Fm.source}|(${Nm.source}))?`),RO=RegExp(`(?: ${Rm.source})?`);function Jr(t,e,n){const a=t[e];return we(a)?n:bo(a)}function HO(t,e){return[{year:Jr(t,e),month:Jr(t,e+1,1),day:Jr(t,e+2,1)},null,e+3]}function ei(t,e){return[{hours:Jr(t,e,0),minutes:Jr(t,e+1,0),seconds:Jr(t,e+2,0),milliseconds:Yu(t[e+3])},null,e+4]}function bs(t,e){const n=!t[e]&&!t[e+1],a=ud(t[e+1],t[e+2]),o=n?null:Kt.instance(a);return[{},o,e+3]}function ys(t,e){const n=t[e]?Oa.create(t[e]):null;return[{},n,e+1]}const IO=RegExp(`^T?${qu.source}$`),jO=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function ZO(t){const[e,n,a,o,i,s,l,d,c]=t,u=e[0]==="-",h=d&&d[0]==="-",p=(f,_=!1)=>f!==void 0&&(_||f&&u)?-f:f;return[{years:p(ir(n)),months:p(ir(a)),weeks:p(ir(o)),days:p(ir(i)),hours:p(ir(s)),minutes:p(ir(l)),seconds:p(ir(d),d==="-0"),milliseconds:p(Yu(c),h)}]}const YO={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Xu(t,e,n,a,o,i,s){const l={year:e.length===2?Uu(bo(e)):bo(e),month:$m.indexOf(n)+1,day:bo(a),hour:bo(o),minute:bo(i)};return s&&(l.second=bo(s)),t&&(l.weekday=t.length>3?Vm.indexOf(t)+1:Em.indexOf(t)+1),l}const WO=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function UO(t){const[,e,n,a,o,i,s,l,d,c,u,h]=t,p=Xu(e,o,a,n,i,s,l);let f;return d?f=YO[d]:c?f=0:f=ud(u,h),[p,new Kt(f)]}function qO(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const GO=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,XO=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,KO=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Hm(t){const[,e,n,a,o,i,s,l]=t;return[Xu(e,o,a,n,i,s,l),Kt.utcInstance]}function QO(t){const[,e,n,a,o,i,s,l]=t;return[Xu(e,l,n,a,o,i,s),Kt.utcInstance]}const JO=Xr(BO,Gu),eB=Xr(PO,Gu),tB=Xr(NO,Gu),nB=Xr(zm),Im=Kr(HO,ei,bs,ys),aB=Kr(AO,ei,bs,ys),oB=Kr(FO,ei,bs,ys),rB=Kr(ei,bs,ys);function iB(t){return Qr(t,[JO,Im],[eB,aB],[tB,oB],[nB,rB])}function sB(t){return Qr(qO(t),[WO,UO])}function lB(t){return Qr(t,[GO,Hm],[XO,Hm],[KO,QO])}function dB(t){return Qr(t,[jO,ZO])}const cB=Kr(ei);function uB(t){return Qr(t,[IO,cB])}const hB=Xr(zO,RO),pB=Xr(Rm),fB=Kr(ei,bs,ys);function mB(t){return Qr(t,[hB,Im],[pB,fB])}const jm="Invalid Duration",Zm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},_B={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Zm},Tn=146097/400,ti=146097/4800,gB={years:{quarters:4,months:12,weeks:Tn/7,days:Tn,hours:Tn*24,minutes:Tn*24*60,seconds:Tn*24*60*60,milliseconds:Tn*24*60*60*1e3},quarters:{months:3,weeks:Tn/28,days:Tn/4,hours:Tn*24/4,minutes:Tn*24*60/4,seconds:Tn*24*60*60/4,milliseconds:Tn*24*60*60*1e3/4},months:{weeks:ti/7,days:ti,hours:ti*24,minutes:ti*24*60,seconds:ti*24*60*60,milliseconds:ti*24*60*60*1e3},...Zm},sr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bB=sr.slice(0).reverse();function yo(t,e,n=!1){const a={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Yt(a)}function Ym(t,e){let n=e.milliseconds??0;for(const a of bB.slice(1))e[a]&&(n+=e[a]*t[a].milliseconds);return n}function Wm(t,e){const n=Ym(t,e)<0?-1:1;sr.reduceRight((a,o)=>{if(we(e[o]))return a;if(a){const i=e[a]*n,s=t[o][a],l=Math.floor(i/s);e[o]+=l*n,e[a]-=l*s*n}return o},null),sr.reduce((a,o)=>{if(we(e[o]))return a;if(a){const i=e[a]%1;e[a]-=i,e[o]+=i*t[a][o]}return o},null)}function yB(t){const e={};for(const[n,a]of Object.entries(t))a!==0&&(e[n]=a);return e}let Yt=class Bt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let a=n?gB:_B;e.matrix&&(a=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=a,this.isLuxonDuration=!0}static fromMillis(e,n){return Bt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new jt(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Bt({values:hd(e,Bt.normalizeUnit),loc:Ke.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(go(e))return Bt.fromMillis(e);if(Bt.isDuration(e))return e;if(typeof e=="object")return Bt.fromObject(e);throw new jt(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[a]=dB(e);return a?Bt.fromObject(a,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[a]=uB(e);return a?Bt.fromObject(a,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Duration is invalid");const a=e instanceof Un?e:new Un(e,n);if(ft.throwOnInvalid)throw new jT(a);return new Bt({invalid:a})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new N6(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const a={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Zt.create(this.loc,a).formatDurationFromString(this,e):jm}toHuman(e={}){if(!this.isValid)return jm;const n=sr.map(a=>{const o=this.values[a];return we(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:a.slice(0,-1)}).format(o)}).filter(a=>a);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Wu(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},be.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Ym(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e),a={};for(const o of sr)(qr(n.values,o)||qr(this.values,o))&&(a[o]=n.get(o)+this.get(o));return yo(this,{values:a},!0)}minus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const a of Object.keys(this.values))n[a]=Lm(e(this.values[a],a));return yo(this,{values:n},!0)}get(e){return this[Bt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...hd(e,Bt.normalizeUnit)};return yo(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:a,matrix:o}={}){const s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:o,conversionAccuracy:a};return yo(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Wm(this.matrix,e),yo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=yB(this.normalize().shiftToAll().toObject());return yo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>Bt.normalizeUnit(s));const n={},a={},o=this.toObject();let i;for(const s of sr)if(e.indexOf(s)>=0){i=s;let l=0;for(const c in a)l+=this.matrix[c][s]*a[c],a[c]=0;go(o[s])&&(l+=o[s]);const d=Math.trunc(l);n[s]=d,a[s]=(l*1e3-d*1e3)/1e3}else go(o[s])&&(a[s]=o[s]);for(const s in a)a[s]!==0&&(n[i]+=s===i?a[s]:a[s]/this.matrix[i][s]);return Wm(this.matrix,n),yo(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return yo(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(a,o){return a===void 0||a===0?o===void 0||o===0:a===o}for(const a of sr)if(!n(this.values[a],e.values[a]))return!1;return!0}};const ni="Invalid Interval";function wB(t,e){return!t||!t.isValid?mt.invalid("missing or invalid start"):!e||!e.isValid?mt.invalid("missing or invalid end"):e<t?mt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class mt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Interval is invalid");const a=e instanceof Un?e:new Un(e,n);if(ft.throwOnInvalid)throw new IT(a);return new mt({invalid:a})}static fromDateTimes(e,n){const a=vs(e),o=vs(n),i=wB(a,o);return i??new mt({start:a,end:o})}static after(e,n){const a=Yt.fromDurationLike(n),o=vs(e);return mt.fromDateTimes(o,o.plus(a))}static before(e,n){const a=Yt.fromDurationLike(n),o=vs(e);return mt.fromDateTimes(o.minus(a),o)}static fromISO(e,n){const[a,o]=(e||"").split("/",2);if(a&&o){let i,s;try{i=be.fromISO(a,n),s=i.isValid}catch{s=!1}let l,d;try{l=be.fromISO(o,n),d=l.isValid}catch{d=!1}if(s&&d)return mt.fromDateTimes(i,l);if(s){const c=Yt.fromISO(o,n);if(c.isValid)return mt.after(i,c)}else if(d){const c=Yt.fromISO(a,n);if(c.isValid)return mt.before(l,c)}}return mt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const a=this.start.startOf(e,n);let o;return n?.useLocaleWeeks?o=this.end.reconfigure({locale:a.locale}):o=this.end,o=o.startOf(e,n),Math.floor(o.diff(a,e).get(e))+(o.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?mt.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(vs).filter(s=>this.contains(s)).sort((s,l)=>s.toMillis()-l.toMillis()),a=[];let{s:o}=this,i=0;for(;o<this.e;){const s=n[i]||this.e,l=+s>+this.e?this.e:s;a.push(mt.fromDateTimes(o,l)),o=l,i+=1}return a}splitBy(e){const n=Yt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:a}=this,o=1,i;const s=[];for(;a<this.e;){const l=this.start.plus(n.mapUnits(d=>d*o));i=+l>+this.e?this.e:l,s.push(mt.fromDateTimes(a,i)),a=i,o+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,a=this.e<e.e?this.e:e.e;return n>=a?null:mt.fromDateTimes(n,a)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,a=this.e>e.e?this.e:e.e;return mt.fromDateTimes(n,a)}static merge(e){const[n,a]=e.sort((o,i)=>o.s-i.s).reduce(([o,i],s)=>i?i.overlaps(s)||i.abutsStart(s)?[o,i.union(s)]:[o.concat([i]),s]:[o,s],[[],null]);return a&&n.push(a),n}static xor(e){let n=null,a=0;const o=[],i=e.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...i),l=s.sort((d,c)=>d.time-c.time);for(const d of l)a+=d.type==="s"?1:-1,a===1?n=d.time:(n&&+n!=+d.time&&o.push(mt.fromDateTimes(n,d.time)),n=null);return mt.merge(o)}difference(...e){return mt.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ni}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.s.loc.clone(n),e).formatInterval(this):ni}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ni}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ni}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ni}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:ni}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Yt.invalid(this.invalidReason)}mapEndpoints(e){return mt.fromDateTimes(e(this.s),e(this.e))}}class fd{static hasDST(e=ft.defaultZone){const n=be.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return Oa.isValidZone(e)}static normalizeZone(e){return _o(e,ft.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Ke.create(n,a,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Ke.create(n,a,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null}={}){return(o||Ke.create(n,a,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null}={}){return(o||Ke.create(n,a,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Ke.create(n,null,"gregory").eras(e)}static features(){return{relative:xm(),localeWeek:km()}}}function Um(t,e){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),a=n(e)-n(t);return Math.floor(Yt.fromMillis(a).as("days"))}function vB(t,e,n){const a=[["years",(d,c)=>c.year-d.year],["quarters",(d,c)=>c.quarter-d.quarter+(c.year-d.year)*4],["months",(d,c)=>c.month-d.month+(c.year-d.year)*12],["weeks",(d,c)=>{const u=Um(d,c);return(u-u%7)/7}],["days",Um]],o={},i=t;let s,l;for(const[d,c]of a)n.indexOf(d)>=0&&(s=d,o[d]=c(t,e),l=i.plus(o),l>e?(o[d]--,t=i.plus(o),t>e&&(l=t,o[d]--,t=i.plus(o))):t=l);return[t,o,l,s]}function xB(t,e,n,a){let[o,i,s,l]=vB(t,e,n);const d=e-o,c=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);c.length===0&&(s<e&&(s=o.plus({[l]:1})),s!==o&&(i[l]=(i[l]||0)+d/(s-o)));const u=Yt.fromObject(i,a);return c.length>0?Yt.fromMillis(d,a).shiftTo(...c).plus(u):u}const kB="missing Intl.DateTimeFormat.formatToParts support";function Fe(t,e=n=>n){return{regex:t,deser:([n])=>e(hO(n))}}const qm="[  ]",Gm=new RegExp(qm,"g");function CB(t){return t.replace(/\./g,"\\.?").replace(Gm,qm)}function Xm(t){return t.replace(/\./g,"").replace(Gm," ").toLowerCase()}function qn(t,e){return t===null?null:{regex:RegExp(t.map(CB).join("|")),deser:([n])=>t.findIndex(a=>Xm(n)===Xm(a))+e}}function Km(t,e){return{regex:t,deser:([,n,a])=>ud(n,a),groups:e}}function md(t){return{regex:t,deser:([e])=>e}}function MB(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function SB(t,e){const n=Wn(e),a=Wn(e,"{2}"),o=Wn(e,"{3}"),i=Wn(e,"{4}"),s=Wn(e,"{6}"),l=Wn(e,"{1,2}"),d=Wn(e,"{1,3}"),c=Wn(e,"{1,6}"),u=Wn(e,"{1,9}"),h=Wn(e,"{2,4}"),p=Wn(e,"{4,6}"),f=g=>({regex:RegExp(MB(g.val)),deser:([b])=>b,literal:!0}),m=(g=>{if(t.literal)return f(g);switch(g.val){case"G":return qn(e.eras("short"),0);case"GG":return qn(e.eras("long"),0);case"y":return Fe(c);case"yy":return Fe(h,Uu);case"yyyy":return Fe(i);case"yyyyy":return Fe(p);case"yyyyyy":return Fe(s);case"M":return Fe(l);case"MM":return Fe(a);case"MMM":return qn(e.months("short",!0),1);case"MMMM":return qn(e.months("long",!0),1);case"L":return Fe(l);case"LL":return Fe(a);case"LLL":return qn(e.months("short",!1),1);case"LLLL":return qn(e.months("long",!1),1);case"d":return Fe(l);case"dd":return Fe(a);case"o":return Fe(d);case"ooo":return Fe(o);case"HH":return Fe(a);case"H":return Fe(l);case"hh":return Fe(a);case"h":return Fe(l);case"mm":return Fe(a);case"m":return Fe(l);case"q":return Fe(l);case"qq":return Fe(a);case"s":return Fe(l);case"ss":return Fe(a);case"S":return Fe(d);case"SSS":return Fe(o);case"u":return md(u);case"uu":return md(l);case"uuu":return Fe(n);case"a":return qn(e.meridiems(),0);case"kkkk":return Fe(i);case"kk":return Fe(h,Uu);case"W":return Fe(l);case"WW":return Fe(a);case"E":case"c":return Fe(n);case"EEE":return qn(e.weekdays("short",!1),1);case"EEEE":return qn(e.weekdays("long",!1),1);case"ccc":return qn(e.weekdays("short",!0),1);case"cccc":return qn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Km(new RegExp(`([+-]${l.source})(?::(${a.source}))?`),2);case"ZZZ":return Km(new RegExp(`([+-]${l.source})(${a.source})?`),2);case"z":return md(/[a-z_+-/]{1,256}?/i);case" ":return md(/[^\S\n\r]/);default:return f(g)}})(t)||{invalidReason:kB};return m.token=t,m}const LB={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function $B(t,e,n){const{type:a,value:o}=t;if(a==="literal"){const d=/^\s+$/.test(o);return{literal:!d,val:d?" ":o}}const i=e[a];let s=a;a==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let l=LB[s];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function DB(t){return[`^${t.map(n=>n.regex).reduce((n,a)=>`${n}(${a.source})`,"")}$`,t]}function VB(t,e,n){const a=t.match(e);if(a){const o={};let i=1;for(const s in n)if(qr(n,s)){const l=n[s],d=l.groups?l.groups+1:1;!l.literal&&l.token&&(o[l.token.val[0]]=l.deser(a.slice(i,i+d))),i+=d}return[a,o]}else return[a,{}]}function EB(t){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,a;return we(t.z)||(n=Oa.create(t.z)),we(t.Z)||(n||(n=new Kt(t.Z)),a=t.Z),we(t.q)||(t.M=(t.q-1)*3+1),we(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),we(t.u)||(t.S=Yu(t.u)),[Object.keys(t).reduce((i,s)=>{const l=e(s);return l&&(i[l]=t[s]),i},{}),n,a]}let Ku=null;function TB(){return Ku||(Ku=be.fromMillis(1555555555555)),Ku}function OB(t,e){if(t.literal)return t;const n=Zt.macroTokenToFormatOpts(t.val),a=t_(n,e);return a==null||a.includes(void 0)?t:a}function Qm(t,e){return Array.prototype.concat(...t.map(n=>OB(n,e)))}class Jm{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Qm(Zt.parseFormat(n),e),this.units=this.tokens.map(a=>SB(a,e)),this.disqualifyingUnit=this.units.find(a=>a.invalidReason),!this.disqualifyingUnit){const[a,o]=DB(this.units);this.regex=RegExp(a,"i"),this.handlers=o}}explainFromTokens(e){if(this.isValid){const[n,a]=VB(e,this.regex,this.handlers),[o,i,s]=a?EB(a):[null,null,void 0];if(qr(a,"a")&&qr(a,"H"))throw new Wr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:a,result:o,zone:i,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function e_(t,e,n){return new Jm(t,n).explainFromTokens(e)}function BB(t,e,n){const{result:a,zone:o,specificOffset:i,invalidReason:s}=e_(t,e,n);return[a,o,i,s]}function t_(t,e){if(!t)return null;const a=Zt.create(e,t).dtFormatter(TB()),o=a.formatToParts(),i=a.resolvedOptions();return o.map(s=>$B(s,t,i))}const Qu="Invalid DateTime",n_=864e13;function ws(t){return new Un("unsupported zone",`the zone "${t.name}" is not supported`)}function Ju(t){return t.weekData===null&&(t.weekData=sd(t.c)),t.weekData}function e0(t){return t.localWeekData===null&&(t.localWeekData=sd(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function lr(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new be({...n,...e,old:n})}function a_(t,e,n){let a=t-e*60*1e3;const o=n.offset(a);if(e===o)return[a,e];a-=(o-e)*60*1e3;const i=n.offset(a);return o===i?[a,o]:[t-Math.min(o,i)*60*1e3,Math.max(o,i)]}function _d(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function gd(t,e,n){return a_(cd(t),e,n)}function o_(t,e){const n=t.o,a=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:a,month:o,day:Math.min(t.c.day,dd(a,o))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Yt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=cd(i);let[d,c]=a_(l,n,t.zone);return s!==0&&(d+=s,c=t.zone.offset(d)),{ts:d,o:c}}function ai(t,e,n,a,o,i){const{setZone:s,zone:l}=n;if(t&&Object.keys(t).length!==0||e){const d=e||l,c=be.fromObject(t,{...n,zone:d,specificOffset:i});return s?c:c.setZone(l)}else return be.invalid(new Un("unparsable",`the input "${o}" can't be parsed as ${a}`))}function bd(t,e,n=!0){return t.isValid?Zt.create(Ke.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function t0(t,e){const n=t.c.year>9999||t.c.year<0;let a="";return n&&t.c.year>=0&&(a+="+"),a+=St(t.c.year,n?6:4),e?(a+="-",a+=St(t.c.month),a+="-",a+=St(t.c.day)):(a+=St(t.c.month),a+=St(t.c.day)),a}function r_(t,e,n,a,o,i){let s=St(t.c.hour);return e?(s+=":",s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=":")):s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=St(t.c.second),(t.c.millisecond!==0||!a)&&(s+=".",s+=St(t.c.millisecond,3))),o&&(t.isOffsetFixed&&t.offset===0&&!i?s+="Z":t.o<0?(s+="-",s+=St(Math.trunc(-t.o/60)),s+=":",s+=St(Math.trunc(-t.o%60))):(s+="+",s+=St(Math.trunc(t.o/60)),s+=":",s+=St(Math.trunc(t.o%60)))),i&&(s+="["+t.zone.ianaName+"]"),s}const i_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},PB={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},NB={ordinal:1,hour:0,minute:0,second:0,millisecond:0},s_=["year","month","day","hour","minute","second","millisecond"],AB=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],FB=["year","ordinal","hour","minute","second","millisecond"];function zB(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new N6(t);return e}function l_(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return zB(t)}}function RB(t){return wd[t]||(yd===void 0&&(yd=ft.now()),wd[t]=t.offset(yd)),wd[t]}function d_(t,e){const n=_o(e.zone,ft.defaultZone);if(!n.isValid)return be.invalid(ws(n));const a=Ke.fromObject(e);let o,i;if(we(t.year))o=ft.now();else{for(const d of s_)we(t[d])&&(t[d]=i_[d]);const s=wm(t)||vm(t);if(s)return be.invalid(s);const l=RB(n);[o,i]=gd(t,l,n)}return new be({ts:o,zone:n,loc:a,o:i})}function c_(t,e,n){const a=we(n.round)?!0:n.round,o=(s,l)=>(s=Wu(s,a||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(s,l)),i=s=>n.calendary?e.hasSame(t,s)?0:e.startOf(s).diff(t.startOf(s),s).get(s):e.diff(t,s).get(s);if(n.unit)return o(i(n.unit),n.unit);for(const s of n.units){const l=i(s);if(Math.abs(l)>=1)return o(l,s)}return o(t>e?-0:0,n.units[n.units.length-1])}function u_(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let yd,wd={};class be{constructor(e){const n=e.zone||ft.defaultZone;let a=e.invalid||(Number.isNaN(e.ts)?new Un("invalid input"):null)||(n.isValid?null:ws(n));this.ts=we(e.ts)?ft.now():e.ts;let o=null,i=null;if(!a)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[o,i]=[e.old.c,e.old.o];else{const l=go(e.o)&&!e.old?e.o:n.offset(this.ts);o=_d(this.ts,l),a=Number.isNaN(o.year)?new Un("invalid input"):null,o=a?null:o,i=a?null:l}this._zone=n,this.loc=e.loc||Ke.create(),this.invalid=a,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new be({})}static local(){const[e,n]=u_(arguments),[a,o,i,s,l,d,c]=n;return d_({year:a,month:o,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static utc(){const[e,n]=u_(arguments),[a,o,i,s,l,d,c]=n;return e.zone=Kt.utcInstance,d_({year:a,month:o,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static fromJSDate(e,n={}){const a=gO(e)?e.valueOf():NaN;if(Number.isNaN(a))return be.invalid("invalid input");const o=_o(n.zone,ft.defaultZone);return o.isValid?new be({ts:a,zone:o,loc:Ke.fromObject(n)}):be.invalid(ws(o))}static fromMillis(e,n={}){if(go(e))return e<-n_||e>n_?be.invalid("Timestamp out of range"):new be({ts:e,zone:_o(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(go(e))return new be({ts:e*1e3,zone:_o(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const a=_o(n.zone,ft.defaultZone);if(!a.isValid)return be.invalid(ws(a));const o=Ke.fromObject(n),i=hd(e,l_),{minDaysInFirstWeek:s,startOfWeek:l}=ym(i,o),d=ft.now(),c=we(n.specificOffset)?a.offset(d):n.specificOffset,u=!we(i.ordinal),h=!we(i.year),p=!we(i.month)||!we(i.day),f=h||p,_=i.weekYear||i.weekNumber;if((f||u)&&_)throw new Wr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new Wr("Can't mix ordinal dates with month/day");const m=_||i.weekday&&!f;let g,b,w=_d(d,c);m?(g=AB,b=PB,w=sd(w,s,l)):u?(g=FB,b=NB,w=ju(w)):(g=s_,b=i_);let y=!1;for(const E of g){const R=i[E];we(R)?y?i[E]=b[E]:i[E]=w[E]:y=!0}const k=m?fO(i,s,l):u?mO(i):wm(i),v=k||vm(i);if(v)return be.invalid(v);const M=m?gm(i,s,l):u?bm(i):i,[C,$]=gd(M,c,a),S=new be({ts:C,zone:a,o:$,loc:o});return i.weekday&&f&&e.weekday!==S.weekday?be.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${S.toISO()}`):S.isValid?S:be.invalid(S.invalid)}static fromISO(e,n={}){const[a,o]=iB(e);return ai(a,o,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[a,o]=sB(e);return ai(a,o,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[a,o]=lB(e);return ai(a,o,n,"HTTP",n)}static fromFormat(e,n,a={}){if(we(e)||we(n))throw new jt("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=a,s=Ke.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[l,d,c,u]=BB(s,e,n);return u?be.invalid(u):ai(l,d,a,`format ${n}`,e,c)}static fromString(e,n,a={}){return be.fromFormat(e,n,a)}static fromSQL(e,n={}){const[a,o]=mB(e);return ai(a,o,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the DateTime is invalid");const a=e instanceof Un?e:new Un(e,n);if(ft.throwOnInvalid)throw new HT(a);return new be({invalid:a})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const a=t_(e,Ke.fromObject(n));return a?a.map(o=>o?o.val:null).join(""):null}static expandFormat(e,n={}){return Qm(Zt.parseFormat(e),Ke.fromObject(n)).map(o=>o.val).join("")}static resetCache(){yd=void 0,wd={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ju(this).weekYear:NaN}get weekNumber(){return this.isValid?Ju(this).weekNumber:NaN}get weekday(){return this.isValid?Ju(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?e0(this).weekday:NaN}get localWeekNumber(){return this.isValid?e0(this).weekNumber:NaN}get localWeekYear(){return this.isValid?e0(this).weekYear:NaN}get ordinal(){return this.isValid?ju(this.c).ordinal:NaN}get monthShort(){return this.isValid?fd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,a=cd(this.c),o=this.zone.offset(a-e),i=this.zone.offset(a+e),s=this.zone.offset(a-o*n),l=this.zone.offset(a-i*n);if(s===l)return[this];const d=a-s*n,c=a-l*n,u=_d(d,s),h=_d(c,l);return u.hour===h.hour&&u.minute===h.minute&&u.second===h.second&&u.millisecond===h.millisecond?[lr(this,{ts:d}),lr(this,{ts:c})]:[this]}get isInLeapYear(){return ms(this.year)}get daysInMonth(){return dd(this.year,this.month)}get daysInYear(){return this.isValid?Gr(this.year):NaN}get weeksInWeekYear(){return this.isValid?_s(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?_s(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:a,calendar:o}=Zt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:a,outputCalendar:o}}toUTC(e=0,n={}){return this.setZone(Kt.instance(e),n)}toLocal(){return this.setZone(ft.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:a=!1}={}){if(e=_o(e,ft.defaultZone),e.equals(this.zone))return this;if(e.isValid){let o=this.ts;if(n||a){const i=e.offset(this.ts),s=this.toObject();[o]=gd(s,i,e)}return lr(this,{ts:o,zone:e})}else return be.invalid(ws(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:a}={}){const o=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:a});return lr(this,{loc:o})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=hd(e,l_),{minDaysInFirstWeek:a,startOfWeek:o}=ym(n,this.loc),i=!we(n.weekYear)||!we(n.weekNumber)||!we(n.weekday),s=!we(n.ordinal),l=!we(n.year),d=!we(n.month)||!we(n.day),c=l||d,u=n.weekYear||n.weekNumber;if((c||s)&&u)throw new Wr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&s)throw new Wr("Can't mix ordinal dates with month/day");let h;i?h=gm({...sd(this.c,a,o),...n},a,o):we(n.ordinal)?(h={...this.toObject(),...n},we(n.day)&&(h.day=Math.min(dd(h.year,h.month),h.day))):h=bm({...ju(this.c),...n});const[p,f]=gd(h,this.o,this.zone);return lr(this,{ts:p,o:f})}plus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e);return lr(this,o_(this,n))}minus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e).negate();return lr(this,o_(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const a={},o=Yt.normalizeUnit(e);switch(o){case"years":a.month=1;case"quarters":case"months":a.day=1;case"weeks":case"days":a.hour=0;case"hours":a.minute=0;case"minutes":a.second=0;case"seconds":a.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:s}=this;s<i&&(a.weekNumber=this.weekNumber-1),a.weekday=i}else a.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);a.month=(i-1)*3+1}return this.set(a)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?Zt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Qu}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.loc.clone(n),e).formatDateTime(this):Qu}toLocaleParts(e={}){return this.isValid?Zt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:a=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const s=e==="extended";let l=t0(this,s);return l+="T",l+=r_(this,s,n,a,o,i),l}toISODate({format:e="extended"}={}){return this.isValid?t0(this,e==="extended"):null}toISOWeekDate(){return bd(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:a=!0,includePrefix:o=!1,extendedZone:i=!1,format:s="extended"}={}){return this.isValid?(o?"T":"")+r_(this,s==="extended",n,e,a,i):null}toRFC2822(){return bd(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bd(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?t0(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:a=!0}={}){let o="HH:mm:ss.SSS";return(n||e)&&(a&&(o+=" "),n?o+="z":e&&(o+="ZZ")),bd(this,o,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Qu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",a={}){if(!this.isValid||!e.isValid)return Yt.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...a},i=bO(n).map(Yt.normalizeUnit),s=e.valueOf()>this.valueOf(),l=s?this:e,d=s?e:this,c=xB(l,d,i,o);return s?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(be.now(),e,n)}until(e){return this.isValid?mt.fromDateTimes(this,e):this}hasSame(e,n,a){if(!this.isValid)return!1;const o=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,a)<=o&&o<=i.endOf(n,a)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||be.fromObject({},{zone:this.zone}),a=e.padding?this<n?-e.padding:e.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(o=e.unit,i=void 0),c_(n,this.plus(a),{...e,numeric:"always",units:o,unit:i})}toRelativeCalendar(e={}){return this.isValid?c_(e.base||be.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(be.isDateTime))throw new jt("min requires all arguments be DateTimes");return Cm(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(be.isDateTime))throw new jt("max requires all arguments be DateTimes");return Cm(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,a={}){const{locale:o=null,numberingSystem:i=null}=a,s=Ke.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return e_(s,e,n)}static fromStringExplain(e,n,a={}){return be.fromFormatExplain(e,n,a)}static buildFormatParser(e,n={}){const{locale:a=null,numberingSystem:o=null}=n,i=Ke.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return new Jm(i,e)}static fromFormatParser(e,n,a={}){if(we(e)||we(n))throw new jt("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=a,s=Ke.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!s.equals(n.locale))throw new jt(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${n.locale}`);const{result:l,zone:d,specificOffset:c,invalidReason:u}=n.explainFromTokens(e);return u?be.invalid(u):ai(l,d,a,`format ${n.format}`,e,c)}static get DATE_SHORT(){return nd}static get DATE_MED(){return A6}static get DATE_MED_WITH_WEEKDAY(){return ZT}static get DATE_FULL(){return F6}static get DATE_HUGE(){return z6}static get TIME_SIMPLE(){return R6}static get TIME_WITH_SECONDS(){return H6}static get TIME_WITH_SHORT_OFFSET(){return I6}static get TIME_WITH_LONG_OFFSET(){return j6}static get TIME_24_SIMPLE(){return Z6}static get TIME_24_WITH_SECONDS(){return Y6}static get TIME_24_WITH_SHORT_OFFSET(){return W6}static get TIME_24_WITH_LONG_OFFSET(){return U6}static get DATETIME_SHORT(){return q6}static get DATETIME_SHORT_WITH_SECONDS(){return G6}static get DATETIME_MED(){return X6}static get DATETIME_MED_WITH_SECONDS(){return K6}static get DATETIME_MED_WITH_WEEKDAY(){return YT}static get DATETIME_FULL(){return Q6}static get DATETIME_FULL_WITH_SECONDS(){return J6}static get DATETIME_HUGE(){return em}static get DATETIME_HUGE_WITH_SECONDS(){return tm}}function vs(t){if(be.isDateTime(t))return t;if(t&&t.valueOf&&go(t.valueOf()))return be.fromJSDate(t);if(t&&typeof t=="object")return be.fromObject(t);throw new jt(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const HB=[{name:"Sydney",open:"21:00",close:"6:00"},{name:"Tokyo",open:"0:00",close:"9:00"},{name:"London",open:"7:00",close:"16:00"},{name:"New-York",open:"13:00",close:"22:00"}];function lt(t,e=2){return isNaN(+t)?0:Math.round(+t*10**e)/10**e}function n0(t){if(t){const e=t.toString();if(/\B(?=(\d{3})+(?!\d))/g.test(e))if(e.includes(".")){let a=e.split(".");return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),a.join(".")}else return e.replace(/\B(?=(\d{3})+(?!\d))/g," ");else return e}else return t}function IB(t,e){const n=parseFloat(t.entry_price),a=t.amount,o=t.multiplier,i=t.side;let s=0,l=0;return i==="SHORT"?(s=(n-e)*Math.abs(a),l=(n-e)*a*o/(n*Math.abs(a))*100):i==="LONG"&&(s=(e-n)*Math.abs(a),l=(e-n)*a*o/(n*Math.abs(a))*100),{pnl:s,pnlToBalanceRatio:l}}function jB(t){if(isNaN(+t))return 0;const e=parseFloat(String(t));if(Number.isInteger(e))return e;const n=e.toString(),a=n.indexOf(".");if(a===-1)return e;const i=n.slice(a+1).search(/[^0]/);if(i===-1)return e;const l=10**(i+4);return Math.round(e*l)/l}function vd(t){let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}function _e(t,e,n={}){const{repeat:a=4,mask:o="*",prefix:i="",suffix:s=""}=n;let l,d;return t?(l=i==="$"?xs():i,d=s==="$"?xs():s,l+o.repeat(a)+d):e}function ZB(t){return t.reduce((e,n,a)=>a===0?`key=${encodeURIComponent(n.id)}`:e+`&key=${encodeURIComponent(n.id)}`,"")}function oi(){function t(o){return Number(o)===o&&o%1!==0}function e(o){let i=String(o);return i.includes(".75")?i.replace(".75",":45"):i.includes(".25")?i.replace(".25",":15"):i.replace(".5",":30")}const n=Number(aa.getItem("scope360::timezone"))||0,a=t(n)?e(n):n;return`UTC${n>=0?"+":""}${a}`}function YB(t){return new Date(t).getFullYear()}function WB(t){const e=oi();return be.fromISO(t,{setZone:!0}).setZone(e).toFormat("dd LLLL, y, TT")}function a0(t,e="dd/LL/y",n=!0){const a=n?oi():"UTC+0";return be.fromISO(t,{setZone:!0}).setZone(a).toFormat(e)}function UB(t){return t.toISOString().split("T")[0]}function qB(t){return["January","February","March","April","May","June","July","August","September","October","November","December"][new Date(t).getMonth()]}function GB(t){return new Date(t).getDate()}function h_(t){return be.fromISO(t,{setZone:!0}).toFormat("cccc")}function XB(t){const e=new Date(t),a=new Date-e;return Math.floor(a/(1e3*3600*24))}function xs(){const t={USD:"$",EUR:"€",JPY:"¥",GBP:"£",CHF:"Fr.",CAD:"$",AUD:"$",NOK:"kr",SEK:"kr",DKK:"kr"},e=aa.getItem("scope360::currency");return e&&t[e?.split("::")[0]]?t[e?.split("::")[0]]:t.USD}function o0(){const t=aa.getItem("scope360::currency");return t&&t?.split("::")[1]?+t?.split("::")[1]:1}const ze=(t,e={isPercentage:!1,isFixed:!0,isPlus:!1})=>{let n;t>=0?n=e.isPlus&&t!==0?"+":"":n="-";let a=Math.abs(t);return e.isFixed&&(a=lt(a)),e.isPercentage?n0(`${n}${a}%`):n0(`${n}${xs()}${lt(a*o0())}`)};function KB(t,e){const n=+new Date(e)-+new Date(t);return m_(n)}function p_(){function t(s){const[l,d]=s.split(":").map(Number);return l+d/60}function e(s){const l=Math.floor(s),d=s%1*60;return`${String(l).padStart(2,"0")}:${String(d).padStart(2,"0")}`}function n(s){const l=s.match(/([+-]?)(\d+):?(\d+)?/);if(!l)return 0;const d=l[1]==="-"?-1:1,c=parseInt(l[2],10),u=l[3]?parseInt(l[3],10):0;return d*(c+u/60)}const a=oi(),o=n(a);return HB.map(s=>{const l=t(s.open),d=t(s.close),c=(l+o+24)%24,u=(d+o+24)%24;return{name:s.name,open:e(c),close:e(u)}})}function f_(){const t=[{name:"Sydney",open:"21:00",close:"6:00"},{name:"Tokyo",open:"0:00",close:"9:00"},{name:"London",open:"7:00",close:"16:00"},{name:"New-York",open:"13:00",close:"22:00"}],e=new Date,n=e.getUTCHours(),a=e.getUTCMinutes(),o=n*60+a,i=t.filter(({open:s,close:l})=>{const[d,c]=s.split(":").map(Number),[u,h]=l.split(":").map(Number),p=d*60+c,f=u*60+h;return p<f?o>=p&&o<f:o>=p||o<f});if(i.length>1){const l=Math.min(...i.map(({close:d})=>{const[c,u]=d.split(":").map(Number);return c*60+u}))-o;return{activeMarkets:i.map(({name:d})=>d),overlapTime:l>0?l:0}}else{if(i.length===1)return{activeMarkets:i.map(({name:s})=>s),overlapTime:0};{const l=t.map(({name:d,open:c})=>{const[u,h]=c.split(":").map(Number),p=u*60+h,f=p>=o?p-o:1440-o+p;return{name:d,timeUntilOpen:f}}).reduce((d,c)=>d.timeUntilOpen<c.timeUntilOpen?d:c);return{activeMarkets:[],nextMarket:l.name,timeUntilNextOpen:l.timeUntilOpen}}}}function ri(t,e){return t>=1e3||t<=-1e3?_e(e,lt(t/1e3,2)+"k",{repeat:3}):_e(e,lt(t,2),{repeat:3})}function m_(t){const e=Math.floor(t/864e5),n=Math.floor(t%(1e3*60*60*24)/(1e3*60*60)),a=Math.floor(t%(1e3*60*60)/(1e3*60)),o=Math.floor(t%(1e3*60)/1e3),i=[];return e>0&&i.push(`${e}D`),n>0&&i.push(`${n}H`),a>0&&i.push(`${a}M`),o>0&&i.push(`${o}S`),i.join(" ")}function dr(t){const e=/^(.*?)(BTC|ETH|USDT|USD|EUR|GBP|JPY|CAD|CHF|USDC|CNH)$/,n=t.match(e);if(n){const a=n[1],o=n[2];return a===""||o===""?t:`${a}/${o}`}else return t}function ks(t,e){const a=dr(t).split("/")[e];if(a)return a.toLowerCase()}function QB(t,e){let n=[],a=new Date(e,t,1),o=new Date(e,t+1,0),i=o.getDate(),s=1,l;for(a.getDay()===1?l=7:a.getDay()===0?(s=new Date(e,t,0).getDate()-6+1,l=1):(s=new Date(e,t,0).getDate()+1-a.getDay()+1,l=7-a.getDay()+1,n.push({start:s,end:l}),s=l+1,l=l+7);s<=i;)if(n.push({start:s,end:l}),s=l+1,l=l+7,l=s===1&&l===8?1:l,l>i&&s<=i){l=l-i,n.push({start:s,end:l});break}return n.map(({start:d,end:c},u)=>{const h=+(d>c&&u===0);return Array.from({length:7},(p,f)=>{const _=new Date(e,t-h,d+f);return{date:_.getDate(),month:_.getMonth(),day:_.toLocaleString("en",{weekday:"long"})}})})}function JB(t,e,n){let a=new Date(t),o=new Date(e);a>o&&([a,o]=[o,a]);let i=[],s=new Date(a.getFullYear(),a.getMonth(),1),l=0;for(;s<=o;){let d=s.toLocaleString("en",{month:"long",year:"numeric"});n?i.push({month:s.getMonth(),year:s.getFullYear(),name:d,id:l}):i.push(d),l=l+1,s.setMonth(s.getMonth()+1)}return i}function eP(t,e,n){let a=new Date(t),o=new Date(e);a>o&&([a,o]=[o,a]);let i=[],s=a.getFullYear(),l=o.getFullYear(),d=0;for(let c=s;c<=l;c++)n?i.push({value:c,name:c.toString(),id:d}):i.push(c.toString()),d=d+1;return i}function tP(t,e){let o=new Date(t).getTime()-e*24*60*60*1e3;return new Date(o).toISOString().split(".")[0]+"Z"}function nP(t){function e(a,o){let i=[],s=new Date(o,a,1),l=new Date(o,a+1,0),d=l.getDate(),c=1,u;for(s.getDay()===1?u=7:s.getDay()===0?(c=new Date(o,a,0).getDate()-6+1,u=1):(c=new Date(o,a,0).getDate()+1-s.getDay()+1,u=7-s.getDay()+1,i.push({start:c,end:u}),c=u+1,u=u+7);c<=d;)if(i.push({start:c,end:u}),c=u+1,u=u+7,u=c===1&&u===8?1:u,u>d&&c<=d){u=u-d,i.push({start:c,end:u});break}return i.map(({start:h,end:p},f)=>{const _=+(h>p&&f===0);return Array.from({length:7},(m,g)=>{const b=new Date(o,a-_,h+g);return{date:b.getMonth()===a?b.getDate():0,day:b.toLocaleString("en",{weekday:"long"})}})})}let n=[];for(let a=0;a<12;a++)n.push(e(a,t));return n}function aP(t){const e=t.map(a=>new Date(a));return new Date(Math.min(...e.map(a=>a.getTime())))}const oP={class:"doughnut-wrapper"},rP={class:"doughnut-wrapper__total"},iP={class:"doughnut-wrapper__total__value"},sP=r.createElementVNode("div",{class:"doughnut-wrapper__total__label"},"Total positions",-1),lP={__name:"DoughnutChart",props:{total:{type:Number,required:!0},data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"transparent"},isMask:{type:Boolean,default:!1}},setup(t){ar.register(KL,ku,s6);const e=r.ref(0),n=t,a=r.ref({cutout:75,spacing:2,responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},plugins:{tooltip:{enabled:!1,position:"nearest",external:i},legend:!1}});function o(s,l){let d=document.querySelector(`#${s}-${n.dataType}`);return d||(d=document.createElement("div"),d.classList.add(s),d.setAttribute("id",`${s}-${n.dataType}`),l.canvas.parentNode.appendChild(d)),d}function i(s){const{chart:l,tooltip:d}=s,c=o("chart-tooltip",l);if(d.opacity===0){c.style.opacity="0";return}if(d.body){const g=d.title||[],b=d.body.map($=>$.lines),w=g[0],y=b[0],k=n.data.labels.findIndex($=>$===w),v=n.data.datasets[0].backgroundColor[k],M=n.data.totals[k],C=document.createElement("div");for(C.classList.add("chart-tooltip-info"),C.innerHTML=`<div class="chart-tooltip-info__top">
43
+ additionally showing the growth/fall of your balance.`},showBTC:{type:Boolean,default:!0},BTC:{type:Number,default:0},USDT:{type:Number,default:0},delta:{type:Number,default:0},balanceChartData:{type:Array,default:[]},currentProfit:{type:Number,default:0},profit:{type:Number,default:0},drawdown:{type:Number,default:0},isPercentage:Boolean,isShare:{type:Boolean,default:!1},isHidden:{type:Boolean,default:!1},isMaskBalance:{type:Boolean,default:!1},isMaskPersonalTarget:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["switchModal","switchVisibility","refresh"],setup(t,{emit:e}){const n=e,a=t,o=r.reactive({USDT:0,BTC:0,delta:0}),i=r.reactive({currentProfit:0}),s=r.ref(0),l=()=>{n("switchVisibility")},d=r.computed(()=>({currentProfit:a.currentProfit,profit:a.profit,drawdown:a.drawdown})),c=r.computed(()=>`${44+(String(lt(a.USDT,2)).length-1)*16}px`);return r.watch(()=>a.USDT,u=>{so.to(o,{duration:1.5,USDT:Number(u)||0,BTC:a.BTC,delta:a.delta})},{immediate:!0}),r.watch(()=>d,u=>{s.value=so.to(i,{duration:1.5,currentProfit:a.currentProfit})},{immediate:!0,deep:!0}),(u,h)=>(r.openBlock(),r.createElementBlock("div",OD,[r.createElementVNode("div",BD,[r.createElementVNode("div",PD,[r.createElementVNode("div",ND,[AD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.tooltip),1)]),_:1})]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:l},[r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye"},null,512),[[r.vShow,t.isHidden]]),r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye-slash"},null,512),[[r.vShow,!t.isHidden]])]))]),r.createElementVNode("div",FD,[r.createElementVNode("div",zD,[r.createElementVNode("div",{class:"balance-part__content__count",style:r.normalizeStyle({minWidth:c.value})},r.toDisplayString(r.unref(_e)(t.isMaskBalance,r.unref(ze)(o.USDT),{prefix:"$"})),5),t.delta?(r.openBlock(),r.createBlock(r.unref(Zd),{key:0,class:"balance-part__content__chips","is-hidden":t.isMaskBalance,percentage:"",delta:o.delta},null,8,["is-hidden","delta"])):r.createCommentVNode("",!0)]),t.showBTC?(r.openBlock(),r.createElementBlock("div",RD," = "+r.toDisplayString(r.unref(_e)(t.isMaskBalance,o.BTC))+" BTC ",1)):r.createCommentVNode("",!0)]),t.isShare?(r.openBlock(),r.createBlock(r.unref(Du),{key:0,class:"balance-part__chart balance-part__chart--share",data:t.balanceChartData,gradient:{height:500,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}},null,8,["data"])):(r.openBlock(),r.createBlock(r.unref(Du),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",HD)),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ID,[r.createElementVNode("div",jD,[r.createElementVNode("div",ZD,[YD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(" In this widget, set your desired balance growth target in $ or % for a specific period. It will display your PNL relative to the goal, helping you know when to stop or pay closer attention. ")]),_:1})]),r.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:h[0]||(h[0]=p=>n("switchModal"))},[r.createVNode(r.unref(Le),{icon:"settings"})])]),r.createElementVNode("div",WD,[r.createElementVNode("div",UD,r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(ze)(i.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),r.createElementVNode("div",qD," / "+r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(ze)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),(r.openBlock(),r.createBlock(r.unref(C5),{key:s.value,"current-profit":t.currentProfit,"is-hidden":t.isMaskPersonalTarget,drawdown:t.drawdown,profit:t.profit,"is-percentage":t.isPercentage},null,8,["current-profit","is-hidden","drawdown","profit","is-percentage"]))])),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:h[1]||(h[1]=p=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-ccf45b88"]]),ed=t=>(r.pushScopeId("data-v-9786b83c"),t=t(),r.popScopeId(),t),XD={class:"calendar-widget"},KD={class:"calendar-widget__calendar"},QD={class:"calendar-widget__top"},JD={class:"calendar-widget__title-wrapper"},eV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),tV={class:"stat-calendar"},nV={class:"stat-calendar__week-days"},aV={key:0,class:"stat-calendar__row-wrapper"},oV={class:"stat-calendar__row"},rV=["onClick"],iV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),sV={key:0,class:"calendar-widget__day"},lV={class:"calendar-widget__day__title-wrapper"},dV={class:"calendar-widget__day__title"},cV={class:"calendar-widget__day__content"},uV={class:"calendar-widget__point"},hV={class:"calendar-widget__point__title"},pV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),fV={class:"calendar-widget__day__trades"},mV={class:"calendar-widget__point"},_V={class:"calendar-widget__point__title"},gV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),bV={__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,minDate:Date,currentDate:{type:Date,default:new Date},maxDate:{type:Date,default:Date()},isCurrentDate:Function,isCurrentDay:Function,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["setNewDate","chooseMonth","refresh","getDetails"],setup(t,{emit:e}){const n=["Mo","Tu","We","Th","Fr","Sa","Su"],a=r.ref(null),o=r.ref(null),i=e,s=t,l=u=>{a.value=u.year,o.value=u.month,i("chooseMonth",u)};r.nextTick(()=>{const u=new Date;a.value=u.getFullYear(),o.value=u.getMonth()});const d=r.computed(()=>[{title:"Total trades",value:s.dailyStatData&&s.dailyStatData.trades_total_count||0},{title:"Winrate",value:ze(s.dailyStatData&&s.dailyStatData.win_rate||0,{isPercentage:!0,isFixed:!0}),class:s.dailyStatData&&s.dailyStatData.win_rate>=50?"-win":"-loss"},{title:"Return",value:ze(s.dailyStatData&&s.dailyStatData.return_total||0),class:s.dailyStatData&&s.dailyStatData.return_total>=0?"-win":"-loss"},{title:"Return on winners",value:ze(s.dailyStatData&&s.dailyStatData.return_win||0)},{title:"Return on losers",value:ze(s.dailyStatData&&s.dailyStatData.return_lose||0)},{title:"Commission",value:ze(s.dailyStatData&&s.dailyStatData.commission||0)}]),c=r.computed(()=>[{title:"Win trades",value:s.dailyStatData&&s.dailyStatData.trades_win_count||0,isPositive:!0},{title:"Loss trades",value:-(s.dailyStatData&&s.dailyStatData.trades_lose_count)||0,isNegative:!1}]);return(u,h)=>(r.openBlock(),r.createElementBlock("div",XD,[r.createElementVNode("div",KD,[r.createElementVNode("div",QD,[r.createElementVNode("div",JD,[eV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("A widget that displays the performance of your trades in a calendar format. Here you can see profitable and unprofitable days with detailed statistics for each day. ")]),_:1})]),t.currentDate&&t.minDate?(r.openBlock(),r.createBlock(r.unref(x5),{key:0,"current-date":t.currentDate||new Date,"min-date":t.minDate,"max-date":t.maxDate,onOnChange:l,year:a.value,"onUpdate:year":h[0]||(h[0]=p=>a.value=p),month:o.value,"onUpdate:month":h[1]||(h[1]=p=>o.value=p)},null,8,["current-date","min-date","max-date","year","month"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",tV,[r.createElementVNode("div",nV,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(n,(p,f)=>r.createElementVNode("div",{class:r.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},r.toDisplayString(p),3)),64))]),t.rows?(r.openBlock(),r.createElementBlock("div",aV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.rows,p=>(r.openBlock(),r.createElementBlock("div",oV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,f=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["stat-calendar__day",{"-unavailable":f.unavailable,"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:_=>i("setNewDate",f.date)},r.toDisplayString(f.date?f.date:""),11,rV))),256))]))),256))])):r.createCommentVNode("",!0)])]),iV,t.dailyStatData&&!t.dailyStatData.isNull?(r.openBlock(),r.createElementBlock("div",sV,[r.createElementVNode("div",lV,[r.createElementVNode("div",dV,r.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),r.createVNode(Le,{icon:"preview",onClick:h[2]||(h[2]=p=>i("getDetails"))})]),r.createElementVNode("div",cV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,p=>(r.openBlock(),r.createElementBlock("div",uV,[r.createElementVNode("div",hV,r.toDisplayString(p.title),1),pV,r.createElementVNode("div",{class:r.normalizeClass(["calendar-widget__point__value",p.class?p.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,p.value,{repeat:5})),3)]))),256)),r.createVNode(r.unref(u2),{isHidden:t.isMask,long:t.dailyStatData?.long_count,short:t.dailyStatData?.short_count},null,8,["isHidden","long","short"]),r.createElementVNode("div",fV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,p=>(r.openBlock(),r.createElementBlock("div",mV,[r.createElementVNode("div",_V,r.toDisplayString(p.title),1),gV,r.createVNode(r.unref(Zd),{isHidden:t.isMask,"is-positive":p.isPositive,"is-negative":p.isNegative,delta:p.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(r.openBlock(),r.createBlock(r.unref(va),{key:1,class:"-empty"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:h[3]||(h[3]=p=>i("refresh"))})):r.createCommentVNode("",!0)]))}},yV=ve(bV,[["__scopeId","data-v-9786b83c"]]),Vu=t=>(r.pushScopeId("data-v-f0601396"),t=t(),r.popScopeId(),t),wV={class:"commission-widget"},vV={class:"commission-widget__content"},xV={class:"commission-widget__top"},kV={class:"commission-widget__title-wrapper"},CV=Vu(()=>r.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),MV={class:"commission-widget__info"},SV={class:"commission-widget__total-wrapper"},LV=Vu(()=>r.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),$V={class:"commission-widget__total-wrapper__total"},DV={class:"commission-widget__total-wrapper__value"},VV={class:"commission-widget__points"},EV={class:"commission-widget__point"},TV={class:"commission-widget__point__title"},OV=Vu(()=>r.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),BV=ve({__name:"CommissionsFeesWidget",props:{commissionData:Object,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,a=t,o=r.reactive({commission:0}),i=r.computed(()=>a.commissionData&&a.commissionData.commission||0),s=r.computed(()=>a.commissionData&&a.commissionData.pnl||0),l=r.computed(()=>[{title:"AVG fees per trade",value:`${ze(a.commissionData&&a.commissionData.fees_per_trade||0)}`},{title:"PNL / Commission",value:s.value&&i.value?`${ze(s.value)}/${ze(i.value)}`:`${ze(0)}`},{title:"AVG fees per day",value:`${ze(a.commissionData&&a.commissionData.fees_per_day||0)}`},{title:"Funding",value:`${ze(a.commissionData&&a.commissionData.funding||0)}`}]);return r.watch(i,d=>{so.to(o,{duration:1.5,commission:d})},{immediate:!0}),(d,c)=>(r.openBlock(),r.createElementBlock("div",wV,[r.createElementVNode("div",vV,[r.createElementVNode("div",xV,[r.createElementVNode("div",kV,[CV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget helps traders finally understand how much money they spent on commissions and funding. ")]),_:1})])]),r.createElementVNode("div",MV,[r.createElementVNode("div",SV,[LV,r.createElementVNode("div",$V,[r.createElementVNode("div",DV,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(o.commission),{repeat:5})),1)])]),r.createElementVNode("div",VV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(u,h)=>(r.openBlock(),r.createElementBlock("div",EV,[r.createElementVNode("div",TV,r.toDisplayString(u.title),1),OV,r.createElementVNode("div",{class:r.normalizeClass(["commission-widget__point__value",u.class?u.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,u.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:c[0]||(c[0]=u=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-f0601396"]]),PV={class:"chart-wrapper"},NV=["id","onMouseover","onMouseleave"],td={__name:"BarChart",props:{data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"#56B683"},ticksCallback:{type:Function,default:t=>t},yTicksCallback:{type:Function,default:t=>t},altLabels:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){ar.register(Cu,Mu,h$,F$,ku,s6);const e=r.inject("darkMode"),n=r.ref(0);r.ref(!1);const a=r.ref(null),o=t,i=r.ref(null),s=r.ref([]),l=f=>{a.value=f},d=f=>{a.value=null},c=r.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},elements:{line:{tension:.05,borderWidth:3,borderColor:o.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}},plugins:{tooltip:{enabled:!1,position:"nearest",external:p},legend:!1},scales:{x:{grid:{display:!1},ticks:{callback:function(f){return o.ticksCallback(f,o.data.labels)}}},y:{ticks:{callback:function(f){return o.yTicksCallback(f,o.isMask)}},grid:{color:e?.value?"#2D2D2D":"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}}}),u=f=>{const _=f.scales.x;o.data.labels.forEach((m,g)=>{const b=_.getPixelForTick(g)-20;s.value[g]=b})};function h(f,_){let m=document.querySelector(`#${f}-${o.dataType}`);return m||(m=document.createElement("div"),m.classList.add(f),m.setAttribute("id",`${f}-${o.dataType}`),_.canvas.parentNode.appendChild(m)),m}function p(f){const{chart:_,tooltip:m}=f,g=h("chart-tooltip",_);if(m.opacity===0){g.style.opacity="0";return}if(m.body){m.title;const C=m.body.map(S=>S.lines),$=document.createElement("div");for($.classList.add("chart-tooltip-middle"),$.innerHTML=`${_e(o.isMask,vd(ze(C[0])),{repeat:3})}`;g.firstChild;)g.firstChild.remove();g.appendChild($)}const{offsetLeft:b,offsetTop:w,clientWidth:y}=_.canvas;let k=b+m.caretX;const v=w+m.caretY,M=g.clientWidth;k+M>y&&(k-=M),g.style.opacity="1",g.style.left=k+"px",g.style.top=v+"px"}return r.watch(()=>o.isMask,()=>{n.value+=1},{immediate:!0}),r.onMounted(()=>{o.altLabels&&r.nextTick(()=>{u(i.value.chart),window.addEventListener("resize",f=>u(i.value.chart))})}),(f,_)=>(r.openBlock(),r.createElementBlock("div",PV,[(r.openBlock(),r.createBlock(r.unref(wD),{ref_key:"barChart",ref:i,class:"chart-container",key:n.value,data:t.data,options:c.value},null,8,["data","options"])),t.altLabels?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data.labels,(m,g)=>(r.openBlock(),r.createElementBlock("div",{class:"chart-wrapper__labels",id:`label-${g}`,style:r.normalizeStyle({left:`${s.value[g]}px`}),onMouseover:b=>l(g),onMouseleave:b=>d()},[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(m,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(m,1)}`)},null,2)],44,NV))),256)):r.createCommentVNode("",!0),a.value!==null?(r.openBlock(),r.createElementBlock("div",{key:1,class:"chart-wrapper__label-tooltip",style:r.normalizeStyle({left:`${s.value[a.value]-25}px`})},r.toDisplayString(r.unref(dr)(o.data.labels[a.value])),5)):r.createCommentVNode("",!0)]))}},AV=t=>(r.pushScopeId("data-v-d430cc1b"),t=t(),r.popScopeId(),t),FV={class:"instrument-widget"},zV={class:"instrument-widget__top"},RV={class:"instrument-widget__title-wrapper"},HV=AV(()=>r.createElementVNode("div",{class:"instrument-widget__title"},"Results by Instrument",-1)),IV={key:0,class:""},jV={key:1,class:"instrument-widget__grid"},ZV={class:"instrument-widget__card"},YV={class:"instrument-widget__card__top"},WV={class:"instrument-widget__card__pair-icons"},UV={class:"instrument-widget__card__title"},qV={class:"instrument-widget__card__bottom"},GV={class:"instrument-widget__card__trades"},XV=ve({__name:"InstrumentWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Overall"},{id:1,name:"Long"},{id:2,name:"Short"}],a=t,o=e,i=r.ref(!1),s=r.ref({id:0,name:"Overall"}),l=r.computed(()=>a.results[s.value.name.toLowerCase()]),d=r.computed(()=>{const h=Object.values(l.value).map(f=>f.net_pnl_total),p=Object.values(l.value).map(f=>f.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value),datasets:[{data:h,backgroundColor:p,borderRadius:4}]}}),c=(h,p)=>"",u=()=>{i.value=!i.value};return(h,p)=>(r.openBlock(),r.createElementBlock("div",FV,[r.createElementVNode("div",zV,[r.createElementVNode("div",RV,[HV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Check your performance across different trading instruments. Use the Overall, Long, or Short filters to view detailed results. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"instrument-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:u})]),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Bc),{class:"instrument-widget__switcher",modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=f=>s.value=f),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",IV,[r.createVNode(td,{class:"instrument-widget__bar",data:d.value,ticksCallback:c,"y-ticks-callback":r.unref(ri),"is-mask":t.isMask,"data-type":"instrument","alt-labels":""},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",jV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(f,_,m)=>(r.openBlock(),r.createElementBlock("div",ZV,[r.createElementVNode("div",YV,[r.createElementVNode("div",WV,[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(_,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(ks)(_,1)}`)},null,2)]),r.createElementVNode("div",UV,r.toDisplayString(r.unref(dr)(_)),1)]),r.createElementVNode("div",qV,[r.createElementVNode("div",GV,r.toDisplayString(r.unref(_e)(t.isMask,f.trades_count,{repeat:3}))+" trades ",1),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__card__net-pnl",{"-positive":f.net_pnl_total>0,"-negative":f.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(f.net_pnl_total,{isFixed:!0,isPlus:!0}),{repeat:3})),3)])]))),256))]))],64)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:p[1]||(p[1]=f=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-d430cc1b"]]),KV=t=>(r.pushScopeId("data-v-9276a75c"),t=t(),r.popScopeId(),t),QV={class:"size-widget"},JV={class:"size-widget__top"},eE={class:"size-widget__title-wrapper"},tE=KV(()=>r.createElementVNode("div",{class:"size-widget__title"},"Result by position size",-1)),nE={key:0},aE={key:1,class:"size-widget__grid"},oE={class:"size-widget__card"},rE={class:"size-widget__card__top"},iE={class:"size-widget__card__title"},sE={class:"size-widget__card__trades"},lE={class:"size-widget__card__bottom"},dE=ve({__name:"SizeWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,a=e,o=r.ref(!1),i=r.computed(()=>{const d=n.results.map(h=>h.net_pnl),c=n.results.map(h=>h.net_pnl>0?"#56B683":"#F18169");return{labels:n.results.map(h=>h.amount),datasets:[{data:d,backgroundColor:c,borderRadius:4}]}}),s=(d,c)=>c[d],l=()=>{o.value=!o.value};return(d,c)=>(r.openBlock(),r.createElementBlock("div",QV,[r.createElementVNode("div",JV,[r.createElementVNode("div",eE,[tE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Compare your profits or losses based on the size of your positions. Understand how position size influences your trading outcomes. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"size-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l})]),t.results&&t.results.length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["size-widget__content",{"-chart-active":o.value}])},[o.value?(r.openBlock(),r.createElementBlock("div",nE,[r.createVNode(td,{class:"size-widget__bar",data:i.value,"ticks-callback":s,"y-ticks-callback":r.unref(ri),"is-mask":t.isMask,"data-type":"size"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",aE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,u=>(r.openBlock(),r.createElementBlock("div",oE,[r.createElementVNode("div",rE,[r.createElementVNode("div",iE,r.toDisplayString(u.amount)+" lots",1),r.createElementVNode("div",sE,r.toDisplayString(r.unref(_e)(t.isMask,u.total_count,{repeat:3}))+" trades ",1)]),r.createElementVNode("div",lE,[r.createElementVNode("div",{class:r.normalizeClass(["size-widget__card__net-pnl",{"-positive":u.net_pnl>0,"-negative":u.net_pnl<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(u.net_pnl,{isPlus:!0,isFixed:!0}),{repeat:3})),3)])]))),256))]))],2)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:c[0]||(c[0]=u=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-9276a75c"]]),cE=t=>(r.pushScopeId("data-v-98670dfc"),t=t(),r.popScopeId(),t),uE={class:"performance-widget"},hE={class:"performance-widget__top"},pE={class:"performance-widget__title-wrapper"},fE=cE(()=>r.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),mE=ve({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){r.ref("week");const n=t,a=e,o=i=>_e(n.isMask,lt(i,2)+"%",{repeat:3});return(i,s)=>(r.openBlock(),r.createElementBlock("div",uE,[r.createElementVNode("div",hE,[r.createElementVNode("div",pE,[fE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("The linear graphics widget displays the profit as a percentage of the deposit. ")]),_:1})])]),r.createVNode(r.unref($u),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":o,isMask:t.isMask},null,8,["data","isMask"]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-98670dfc"]]),Eu=t=>(r.pushScopeId("data-v-e936f12b"),t=t(),r.popScopeId(),t),_E={class:"return-widget"},gE={class:"return-widget__content"},bE={class:"return-widget__top"},yE={class:"return-widget__title-wrapper"},wE=Eu(()=>r.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),vE={class:"return-widget__info"},xE={class:"return-widget__total-wrapper"},kE=Eu(()=>r.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),CE={class:"return-widget__total-wrapper__total"},ME={class:"return-widget__points"},SE={class:"return-widget__point"},LE={class:"return-widget__point__title"},$E=Eu(()=>r.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),DE=["innerHTML"],VE=ve({__name:"ReturnWidget",props:{totalReturn:{type:Number,default:0},win:{type:Number,default:0},lose:{type:Number,default:0},returnPeriod:{type:Number,default:0},profitFactor:{type:Number,default:0},daily:{type:Number,default:0},changeRate:{type:Number,default:0},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,a=t,o=r.computed(()=>`${44+(String(lt(a.returnPeriod,2)).length-1)*16}px`),i=r.reactive({returnPeriod:0,changeRate:0}),s=r.computed(()=>[{title:"Average return per trade",value:a.totalReturn,options:{isPlus:!0,isFixed:!0},class:a.totalReturn===0?"":a.totalReturn>0?"-win":"-loss"},{title:"Daily return",value:a.daily,options:{isPlus:!0,isFixed:!0},class:a.daily===0?"":a.daily>0?"-win":"-loss"},{title:"Return on winners",value:a.win,class:"-win"},{title:"Return on losers",value:a.lose,class:"-loss"}]),l=r.computed(()=>a.returnPeriod>0),d=r.computed(()=>a.returnPeriod<0),c=r.computed(()=>a.profitFactor>1?"-positive":"-negative"),u=r.computed(()=>a.profitFactor>0?`Your profit factor is ${_e(a.isMask,lt(a.profitFactor),{repeat:5})}. <br /> You earn ${_e(a.isMask,ze(a.profitFactor),{repeat:5,prefix:"$"})} on every ${_e(a.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${_e(a.isMask,lt(a.profitFactor),{repeat:5})}. <br/> You loss ${_e(a.isMask,ze(Math.abs(a.profitFactor)),{repeat:5,prefix:"$"})} on every ${_e(a.isMask,"$1",{repeat:5,prefix:"$"})} earn. `);return r.watch(()=>a.returnPeriod,h=>{so.to(i,{duration:1.5,returnPeriod:h,changeRate:a.changeRate})},{immediate:!0}),(h,p)=>(r.openBlock(),r.createElementBlock("div",_E,[r.createElementVNode("div",gE,[r.createElementVNode("div",bE,[r.createElementVNode("div",yE,[wE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget displays an increase in NET profit in dollars and percentage relative to the deposit for the specified period you have chosen. ")]),_:1})])]),r.createElementVNode("div",vE,[r.createElementVNode("div",xE,[kE,r.createElementVNode("div",CE,[r.createElementVNode("div",{class:r.normalizeClass(["return-widget__total-wrapper__value",{"-positive":l.value,"-negative":d.value}]),style:r.normalizeStyle({minWidth:o.value})},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(i.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),7),a.changeRate?(r.openBlock(),r.createBlock(r.unref(Zd),{key:0,percentage:"",class:"return-widget__total-wrapper__chips",isHidden:t.isMask,delta:i.changeRate},null,8,["isHidden","delta"])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",ME,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("div",SE,[r.createElementVNode("div",LE,r.toDisplayString(f.title),1),$E,r.createElementVNode("div",{class:r.normalizeClass(["return-widget__point__value",f.class?f.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(f.value,f.options),{repeat:5,prefix:"$"})),3)]))),256))])])]),t.profitFactor?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["return-widget__profit",c.value])},[r.createVNode(r.unref(Le),{icon:"tip",class:"return-widget__profit__icon"}),r.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:u.value},null,8,DE)],2)):r.createCommentVNode("",!0),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:1,onRefresh:p[0]||(p[0]=f=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-e936f12b"]]),O6=t=>(r.pushScopeId("data-v-1522f636"),t=t(),r.popScopeId(),t),EE={class:"top-positions-widget"},TE={class:"top-positions-widget__top"},OE={class:"top-positions-widget__title-wrapper"},BE=O6(()=>r.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),PE={key:0,class:"top-positions-widget__returns"},NE={class:"top-positions-widget__return"},AE={class:"top-positions-widget__return__left"},FE=O6(()=>r.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),zE=["onClick"],RE={class:"top-positions-widget__return__right"},HE={class:"top-positions-widget__return__pnl"},IE=ve({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh","onPairClick"],setup(t,{emit:e}){r.ref("week");const n=e;return(a,o)=>(r.openBlock(),r.createElementBlock("div",EE,[r.createElementVNode("div",TE,[r.createElementVNode("div",OE,[BE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Helps you find the top profitable positions. We calculate only net PNL, taking into account commission and funding. ")]),_:1})])]),t.topPositions&&t.topPositions.length?(r.openBlock(),r.createElementBlock("div",PE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.topPositions,i=>(r.openBlock(),r.createElementBlock("div",NE,[r.createElementVNode("div",AE,[FE,r.createElementVNode("div",{class:"top-positions-widget__return__pair",onClick:s=>n("onPairClick",i)},[r.createTextVNode(r.toDisplayString(r.unref(dr)(i.pair))+" ",1),r.createVNode(r.unref(Le),{icon:"chevron-right-small"})],8,zE)]),r.createElementVNode("div",RE,[r.createElementVNode("div",HE,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(i.pnl,{isFixed:!0,isPlus:!0},{repeat:5}))),1),r.createElementVNode("div",{class:r.normalizeClass(["top-positions-widget__return__roi",i.roi<0?"-negative":"-positive"])},[r.createVNode(r.unref(Le),{icon:"bxs_up-arrow"}),r.createElementVNode("span",null,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(i.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])]))),256))])):(r.openBlock(),r.createBlock(r.unref(va),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:o[0]||(o[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-1522f636"]]),Tu=t=>(r.pushScopeId("data-v-a3559196"),t=t(),r.popScopeId(),t),jE={class:"trade-widget"},ZE={class:"trade-widget__content"},YE={class:"trade-widget__top"},WE={class:"trade-widget__title-wrapper"},UE=Tu(()=>r.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),qE={class:"trade-widget__info"},GE={class:"trade-widget__total-wrapper"},XE=Tu(()=>r.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),KE={class:"trade-widget__total-wrapper__total"},QE={class:"trade-widget__total-wrapper__value"},JE={class:"trade-widget__points"},eT={class:"trade-widget__point"},tT={class:"trade-widget__point__title"},nT=Tu(()=>r.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),aT=ve({__name:"TradePerformanceWidget",props:{totalTrades:Number,minDate:Date,tradePoints:Array,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=r.reactive({totalTrades:0}),a=e,o=t;return r.watch(()=>o.totalTrades,i=>{so.to(n,{duration:1.5,totalTrades:i})},{immediate:!0}),(i,s)=>(r.openBlock(),r.createElementBlock("div",jE,[r.createElementVNode("div",ZE,[r.createElementVNode("div",YE,[r.createElementVNode("div",WE,[UE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("It displays the number of profitable and unprofitable positions. This widget is very useful for understanding your trading opportunities. ")]),_:1})])]),r.createElementVNode("div",qE,[r.createElementVNode("div",GE,[XE,r.createElementVNode("div",KE,[r.createElementVNode("div",QE,r.toDisplayString(r.unref(_e)(t.isMask,Math.floor(n.totalTrades),{repeat:5})),1)])]),r.createElementVNode("div",JE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tradePoints,l=>(r.openBlock(),r.createElementBlock("div",eT,[r.createElementVNode("div",tT,r.toDisplayString(l.title),1),nT,r.createElementVNode("div",{class:r.normalizeClass(["trade-widget__point__value",l.class?l.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,l.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a3559196"]]),Ou=t=>(r.pushScopeId("data-v-6e6e0081"),t=t(),r.popScopeId(),t),oT={class:"winrate-widget"},rT={class:"winrate-widget__winrate"},iT={class:"winrate-widget__title-wrapper"},sT=Ou(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),lT={class:"winrate-widget__chart"},dT={class:"winrate-widget__data"},cT={class:"winrate-widget__data_value"},uT=Ou(()=>r.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),hT={class:"winrate-widget__average-rr"},pT={class:"winrate-widget__title-wrapper"},fT=Ou(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),mT=ve({__name:"WinrateWidget",props:{winrate:{type:Number,default:0},minRR:{type:Number,default:0},averageRR:{type:Number,default:0},maxRR:{type:Number,default:0},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e;return(a,o)=>(r.openBlock(),r.createElementBlock("div",oT,[r.createElementVNode("div",rT,[r.createElementVNode("div",iT,[sT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),r.createElementVNode("div",lT,[r.renderSlot(a.$slots,"roundSlider",{},void 0,!0),r.createElementVNode("div",dT,[r.createElementVNode("div",cT,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(lt)(t.winrate,2)))+"% ",1),uT])])]),r.createElementVNode("div",hT,[r.createElementVNode("div",pT,[fT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),r.createVNode(r.unref(g_),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:o[0]||(o[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-6e6e0081"]]),B6=t=>(r.pushScopeId("data-v-47d081bb"),t=t(),r.popScopeId(),t),_T={class:"oh-widget"},gT={class:"oh-widget__top"},bT={class:"oh-widget__title-wrapper"},yT=B6(()=>r.createElementVNode("div",{class:"oh-widget__title"},"Result by Open Hour",-1)),wT={key:0},vT={key:1,class:"oh-widget__table-wrapper"},xT={class:"oh-widget__list"},kT=B6(()=>r.createElementVNode("thead",{class:"oh-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),CT={class:"oh-widget__list__body"},MT={class:"oh-widget__list__point"},ST={class:"oh-widget__list__subpoint"},LT={class:"oh-widget__list__subpoint"},$T=ve({__name:"OpenHourWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Asia",key:"asia_session"},{id:1,name:"London",key:"london_session"},{id:2,name:"NY",key:"new_york_session"}],a=t,o=e,i=r.ref(!1),s=r.ref({id:0,name:"Asia",key:"asia_session"}),l=r.computed(()=>a.results?a.results[s.value.key]:{}),d=r.computed(()=>{const h=Object.values(l.value).map(f=>f.net_pnl_total),p=Object.values(l.value).map(f=>f.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value),datasets:[{data:h,backgroundColor:p,borderRadius:4}]}}),c=()=>{i.value=!i.value},u=(h,p)=>p[h];return(h,p)=>(r.openBlock(),r.createElementBlock("div",_T,[r.createElementVNode("div",gT,[r.createElementVNode("div",bT,[yT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Analyze your trading performance based on the hour of the day and trading session. Switch between different time zones to track results by market. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"oh-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:c})]),r.createElementVNode("div",{class:r.normalizeClass(["oh-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Bc),{class:"oh-widget__switcher",modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=f=>s.value=f),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",wT,[r.createVNode(td,{class:"oh-widget__bar",data:d.value,"ticks-callback":u,"y-ticks-callback":r.unref(ri),"is-mask":t.isMask,"data-type":"oh"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",vT,[r.createElementVNode("table",xT,[kT,r.createElementVNode("tbody",CT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(f,_,m)=>(r.openBlock(),r.createElementBlock("tr",MT,[r.createElementVNode("td",ST,r.toDisplayString(_),1),r.createElementVNode("td",LT,r.toDisplayString(r.unref(_e)(t.isMask,f.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["oh-widget__list__subpoint",{"-positive":f.net_pnl_total>0,"-negative":f.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(f.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])])]))],64)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:p[1]||(p[1]=f=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-47d081bb"]]),P6=t=>(r.pushScopeId("data-v-f722929f"),t=t(),r.popScopeId(),t),DT={class:"duration-widget"},VT={class:"duration-widget__top"},ET={class:"duration-widget__title-wrapper"},TT=P6(()=>r.createElementVNode("div",{class:"duration-widget__title"},"Result by time duration",-1)),OT={key:0},BT={key:1,class:"duration-widget__list"},PT=P6(()=>r.createElementVNode("thead",{class:"duration-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),NT={class:"duration-widget__list__body"},AT={class:"duration-widget__list__point"},FT={class:"duration-widget__list__subpoint"},zT={class:"duration-widget__list__subpoint"},RT=ve({__name:"DurationWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,a=e,o=r.ref(!1),i=r.computed(()=>{const c=Object.values(n.results).map(h=>h.net_pnl_total),u=Object.values(n.results).map(h=>h.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(n.results),datasets:[{data:c,backgroundColor:u,borderRadius:4}]}});function s(c){const u=Math.floor(c/1440),h=Math.floor(c%(60*24)/60),p=Math.floor(c%60),f=[];return u>0&&f.push(`${u}d`),h>0&&f.push(`${h}h`),p>0&&f.push(`${p}m`),f.length===0?"0m":f.join(" ")}const l=()=>{o.value=!o.value},d=(c,u)=>u[c];return(c,u)=>(r.openBlock(),r.createElementBlock("div",DT,[r.createElementVNode("div",VT,[r.createElementVNode("div",ET,[TT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("See how your trades perform based on their duration. Filter by time intervals to identify patterns in short or long-term trades. ")]),_:1})]),r.createVNode(r.unref(ja),{class:"duration-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l})]),t.results&&Object.values(t.results).length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["duration-widget__content",{"-chart-active":o.value}])},[o.value?(r.openBlock(),r.createElementBlock("div",OT,[r.createVNode(td,{class:"duration-widget__bar",data:i.value,"ticks-callback":d,"y-ticks-callback":r.unref(ri),"data-type":"duration","is-mask":t.isMask},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("table",BT,[PT,r.createElementVNode("tbody",NT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,(h,p,f)=>(r.openBlock(),r.createElementBlock("tr",AT,[r.createElementVNode("td",FT,r.toDisplayString(s(Number(p))),1),r.createElementVNode("td",zT,r.toDisplayString(r.unref(_e)(t.isMask,h.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["duration-widget__list__subpoint",{"-positive":h.net_pnl_total>0,"-negative":h.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(ze)(h.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])]))],2)):(r.openBlock(),r.createBlock(va,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:u[0]||(u[0]=h=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-f722929f"]]);class rr extends Error{}class HT extends rr{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class IT extends rr{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class jT extends rr{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Wr extends rr{}class N6 extends rr{constructor(e){super(`Invalid unit ${e}`)}}class jt extends rr{}class mo extends rr{constructor(){super("Zone is an abstract class")}}const le="numeric",Yn="short",vn="long",nd={year:le,month:le,day:le},A6={year:le,month:Yn,day:le},ZT={year:le,month:Yn,day:le,weekday:Yn},F6={year:le,month:vn,day:le},z6={year:le,month:vn,day:le,weekday:vn},R6={hour:le,minute:le},H6={hour:le,minute:le,second:le},I6={hour:le,minute:le,second:le,timeZoneName:Yn},j6={hour:le,minute:le,second:le,timeZoneName:vn},Z6={hour:le,minute:le,hourCycle:"h23"},Y6={hour:le,minute:le,second:le,hourCycle:"h23"},W6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:Yn},U6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:vn},q6={year:le,month:le,day:le,hour:le,minute:le},G6={year:le,month:le,day:le,hour:le,minute:le,second:le},X6={year:le,month:Yn,day:le,hour:le,minute:le},K6={year:le,month:Yn,day:le,hour:le,minute:le,second:le},YT={year:le,month:Yn,day:le,weekday:Yn,hour:le,minute:le},Q6={year:le,month:vn,day:le,hour:le,minute:le,timeZoneName:Yn},J6={year:le,month:vn,day:le,hour:le,minute:le,second:le,timeZoneName:Yn},em={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,timeZoneName:vn},tm={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,second:le,timeZoneName:vn};class ps{get type(){throw new mo}get name(){throw new mo}get ianaName(){return this.name}get isUniversal(){throw new mo}offsetName(e,n){throw new mo}formatOffset(e,n){throw new mo}offset(e){throw new mo}equals(e){throw new mo}get isValid(){throw new mo}}let Bu=null;class ad extends ps{static get instance(){return Bu===null&&(Bu=new ad),Bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:a}){return Sm(e,n,a)}formatOffset(e,n){return gs(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let od={};function WT(t){return od[t]||(od[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),od[t]}const UT={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function qT(t,e){const n=t.format(e).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,s,l,d,c,u]=a;return[s,o,i,l,d,c,u]}function GT(t,e){const n=t.formatToParts(e),a=[];for(let o=0;o<n.length;o++){const{type:i,value:s}=n[o],l=UT[i];i==="era"?a[l]=s:we(l)||(a[l]=parseInt(s,10))}return a}let rd={};class Oa extends ps{static create(e){return rd[e]||(rd[e]=new Oa(e)),rd[e]}static resetCache(){rd={},od={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Oa.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:a}){return Sm(e,n,a,this.name)}formatOffset(e,n){return gs(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const a=WT(this.name);let[o,i,s,l,d,c,u]=a.formatToParts?GT(a,n):qT(a,n);l==="BC"&&(o=-Math.abs(o)+1);const p=cd({year:o,month:i,day:s,hour:d===24?0:d,minute:c,second:u,millisecond:0});let f=+n;const _=f%1e3;return f-=_>=0?_:1e3+_,(p-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let nm={};function XT(t,e={}){const n=JSON.stringify([t,e]);let a=nm[n];return a||(a=new Intl.ListFormat(t,e),nm[n]=a),a}let Pu={};function Nu(t,e={}){const n=JSON.stringify([t,e]);let a=Pu[n];return a||(a=new Intl.DateTimeFormat(t,e),Pu[n]=a),a}let Au={};function KT(t,e={}){const n=JSON.stringify([t,e]);let a=Au[n];return a||(a=new Intl.NumberFormat(t,e),Au[n]=a),a}let Fu={};function QT(t,e={}){const{base:n,...a}=e,o=JSON.stringify([t,a]);let i=Fu[o];return i||(i=new Intl.RelativeTimeFormat(t,e),Fu[o]=i),i}let fs=null;function JT(){return fs||(fs=new Intl.DateTimeFormat().resolvedOptions().locale,fs)}let am={};function eO(t){let e=am[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,am[t]=e}return e}function tO(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let a,o;try{a=Nu(t).resolvedOptions(),o=t}catch{const d=t.substring(0,n);a=Nu(d).resolvedOptions(),o=d}const{numberingSystem:i,calendar:s}=a;return[o,i,s]}}function nO(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function aO(t){const e=[];for(let n=1;n<=12;n++){const a=be.utc(2009,n,1);e.push(t(a))}return e}function oO(t){const e=[];for(let n=1;n<=7;n++){const a=be.utc(2016,11,13+n);e.push(t(a))}return e}function id(t,e,n,a){const o=t.listingMode();return o==="error"?null:o==="en"?n(e):a(e)}function rO(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class iO{constructor(e,n,a){this.padTo=a.padTo||0,this.floor=a.floor||!1;const{padTo:o,floor:i,...s}=a;if(!n||Object.keys(s).length>0){const l={useGrouping:!1,...a};a.padTo>0&&(l.minimumIntegerDigits=a.padTo),this.inf=KT(e,l)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Wu(e,3);return St(n,this.padTo)}}}class sO{constructor(e,n,a){this.opts=a,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const s=-1*(e.offset/60),l=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&Oa.create(l).valid?(o=l,this.dt=e):(o="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,o=e.zone.name):(o="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=Nu(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const a=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:a}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class lO{constructor(e,n,a){this.opts={style:"long",...a},!n&&xm()&&(this.rtf=QT(e,a))}format(e,n){return this.rtf?this.rtf.format(e,n):EO(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const dO={firstDay:1,minimalDays:4,weekend:[6,7]};let Ke=class Is{static fromOpts(e){return Is.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,a,o,i=!1){const s=e||ft.defaultLocale,l=s||(i?"en-US":JT()),d=n||ft.defaultNumberingSystem,c=a||ft.defaultOutputCalendar,u=Zu(o)||ft.defaultWeekSettings;return new Is(l,d,c,u,s)}static resetCache(){fs=null,Pu={},Au={},Fu={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:a,weekSettings:o}={}){return Is.create(e,n,a,o)}constructor(e,n,a,o,i){const[s,l,d]=tO(e);this.locale=s,this.numberingSystem=n||l||null,this.outputCalendar=a||d||null,this.weekSettings=o,this.intl=nO(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=rO(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Is.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Zu(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return id(this,e,Dm,()=>{const a=n?{month:e,day:"numeric"}:{month:e},o=n?"format":"standalone";return this.monthsCache[o][e]||(this.monthsCache[o][e]=aO(i=>this.extract(i,a,"month"))),this.monthsCache[o][e]})}weekdays(e,n=!1){return id(this,e,Tm,()=>{const a=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},o=n?"format":"standalone";return this.weekdaysCache[o][e]||(this.weekdaysCache[o][e]=oO(i=>this.extract(i,a,"weekday"))),this.weekdaysCache[o][e]})}meridiems(){return id(this,void 0,()=>Om,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[be.utc(2016,11,13,9),be.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return id(this,e,Bm,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[be.utc(-40,1,1),be.utc(2017,1,1)].map(a=>this.extract(a,n,"era"))),this.eraCache[e]})}extract(e,n,a){const o=this.dtFormatter(e,n),i=o.formatToParts(),s=i.find(l=>l.type.toLowerCase()===a);return s?s.value:null}numberFormatter(e={}){return new iO(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new sO(e,this.intl,n)}relFormatter(e={}){return new lO(this.intl,this.isEnglish(),e)}listFormatter(e={}){return XT(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:km()?eO(this.locale):dO}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},zu=null;class Kt extends ps{static get utcInstance(){return zu===null&&(zu=new Kt(0)),zu}static instance(e){return e===0?Kt.utcInstance:new Kt(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Kt(ud(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${gs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${gs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return gs(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class cO extends ps{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function _o(t,e){if(we(t)||t===null)return e;if(t instanceof ps)return t;if(_O(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?ad.instance:n==="utc"||n==="gmt"?Kt.utcInstance:Kt.parseSpecifier(n)||Oa.create(t)}else return go(t)?Kt.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new cO(t)}const Ru={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},om={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},uO=Ru.hanidec.replace(/[\[|\]]/g,"").split("");function hO(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);if(t[n].search(Ru.hanidec)!==-1)e+=uO.indexOf(t[n]);else for(const o in om){const[i,s]=om[o];a>=i&&a<=s&&(e+=a-i)}}return parseInt(e,10)}else return e}let Ur={};function pO(){Ur={}}function Wn({numberingSystem:t},e=""){const n=t||"latn";return Ur[n]||(Ur[n]={}),Ur[n][e]||(Ur[n][e]=new RegExp(`${Ru[n]}${e}`)),Ur[n][e]}let rm=()=>Date.now(),im="system",sm=null,lm=null,dm=null,cm=60,um,hm=null;class ft{static get now(){return rm}static set now(e){rm=e}static set defaultZone(e){im=e}static get defaultZone(){return _o(im,ad.instance)}static get defaultLocale(){return sm}static set defaultLocale(e){sm=e}static get defaultNumberingSystem(){return lm}static set defaultNumberingSystem(e){lm=e}static get defaultOutputCalendar(){return dm}static set defaultOutputCalendar(e){dm=e}static get defaultWeekSettings(){return hm}static set defaultWeekSettings(e){hm=Zu(e)}static get twoDigitCutoffYear(){return cm}static set twoDigitCutoffYear(e){cm=e%100}static get throwOnInvalid(){return um}static set throwOnInvalid(e){um=e}static resetCaches(){Ke.resetCache(),Oa.resetCache(),be.resetCache(),pO()}}class Un{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const pm=[0,31,59,90,120,151,181,212,243,273,304,334],fm=[0,31,60,91,121,152,182,213,244,274,305,335];function Vn(t,e){return new Un("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Hu(t,e,n){const a=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&a.setUTCFullYear(a.getUTCFullYear()-1900);const o=a.getUTCDay();return o===0?7:o}function mm(t,e,n){return n+(ms(t)?fm:pm)[e-1]}function _m(t,e){const n=ms(t)?fm:pm,a=n.findIndex(i=>i<e),o=e-n[a];return{month:a+1,day:o}}function Iu(t,e){return(t-e+7)%7+1}function sd(t,e=4,n=1){const{year:a,month:o,day:i}=t,s=mm(a,o,i),l=Iu(Hu(a,o,i),n);let d=Math.floor((s-l+14-e)/7),c;return d<1?(c=a-1,d=_s(c,e,n)):d>_s(a,e,n)?(c=a+1,d=1):c=a,{weekYear:c,weekNumber:d,weekday:l,...pd(t)}}function gm(t,e=4,n=1){const{weekYear:a,weekNumber:o,weekday:i}=t,s=Iu(Hu(a,1,e),n),l=Gr(a);let d=o*7+i-s-7+e,c;d<1?(c=a-1,d+=Gr(c)):d>l?(c=a+1,d-=Gr(a)):c=a;const{month:u,day:h}=_m(c,d);return{year:c,month:u,day:h,...pd(t)}}function ju(t){const{year:e,month:n,day:a}=t,o=mm(e,n,a);return{year:e,ordinal:o,...pd(t)}}function bm(t){const{year:e,ordinal:n}=t,{month:a,day:o}=_m(e,n);return{year:e,month:a,day:o,...pd(t)}}function ym(t,e){if(!we(t.localWeekday)||!we(t.localWeekNumber)||!we(t.localWeekYear)){if(!we(t.weekday)||!we(t.weekNumber)||!we(t.weekYear))throw new Wr("Cannot mix locale-based week fields with ISO-based week fields");return we(t.localWeekday)||(t.weekday=t.localWeekday),we(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),we(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function fO(t,e=4,n=1){const a=ld(t.weekYear),o=En(t.weekNumber,1,_s(t.weekYear,e,n)),i=En(t.weekday,1,7);return a?o?i?!1:Vn("weekday",t.weekday):Vn("week",t.weekNumber):Vn("weekYear",t.weekYear)}function mO(t){const e=ld(t.year),n=En(t.ordinal,1,Gr(t.year));return e?n?!1:Vn("ordinal",t.ordinal):Vn("year",t.year)}function wm(t){const e=ld(t.year),n=En(t.month,1,12),a=En(t.day,1,dd(t.year,t.month));return e?n?a?!1:Vn("day",t.day):Vn("month",t.month):Vn("year",t.year)}function vm(t){const{hour:e,minute:n,second:a,millisecond:o}=t,i=En(e,0,23)||e===24&&n===0&&a===0&&o===0,s=En(n,0,59),l=En(a,0,59),d=En(o,0,999);return i?s?l?d?!1:Vn("millisecond",o):Vn("second",a):Vn("minute",n):Vn("hour",e)}function we(t){return typeof t>"u"}function go(t){return typeof t=="number"}function ld(t){return typeof t=="number"&&t%1===0}function _O(t){return typeof t=="string"}function gO(t){return Object.prototype.toString.call(t)==="[object Date]"}function xm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function km(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function bO(t){return Array.isArray(t)?t:[t]}function Cm(t,e,n){if(t.length!==0)return t.reduce((a,o)=>{const i=[e(o),o];return a&&n(a[0],i[0])===a[0]?a:i},null)[1]}function yO(t,e){return e.reduce((n,a)=>(n[a]=t[a],n),{})}function qr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Zu(t){if(t==null)return null;if(typeof t!="object")throw new jt("Week settings must be an object");if(!En(t.firstDay,1,7)||!En(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!En(e,1,7)))throw new jt("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function En(t,e,n){return ld(t)&&t>=e&&t<=n}function wO(t,e){return t-e*Math.floor(t/e)}function St(t,e=2){const n=t<0;let a;return n?a="-"+(""+-t).padStart(e,"0"):a=(""+t).padStart(e,"0"),a}function bo(t){if(!(we(t)||t===null||t===""))return parseInt(t,10)}function ir(t){if(!(we(t)||t===null||t===""))return parseFloat(t)}function Yu(t){if(!(we(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Wu(t,e,n=!1){const a=10**e;return(n?Math.trunc:Math.round)(t*a)/a}function ms(t){return t%4===0&&(t%100!==0||t%400===0)}function Gr(t){return ms(t)?366:365}function dd(t,e){const n=wO(e-1,12)+1,a=t+(e-n)/12;return n===2?ms(a)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function cd(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Mm(t,e,n){return-Iu(Hu(t,1,e),n)+e-1}function _s(t,e=4,n=1){const a=Mm(t,e,n),o=Mm(t+1,e,n);return(Gr(t)-a+o)/7}function Uu(t){return t>99?t:t>ft.twoDigitCutoffYear?1900+t:2e3+t}function Sm(t,e,n,a=null){const o=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};a&&(i.timeZone=a);const s={timeZoneName:e,...i},l=new Intl.DateTimeFormat(n,s).formatToParts(o).find(d=>d.type.toLowerCase()==="timezonename");return l?l.value:null}function ud(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const a=parseInt(e,10)||0,o=n<0||Object.is(n,-0)?-a:a;return n*60+o}function Lm(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new jt(`Invalid unit value ${t}`);return e}function hd(t,e){const n={};for(const a in t)if(qr(t,a)){const o=t[a];if(o==null)continue;n[e(a)]=Lm(o)}return n}function gs(t,e){const n=Math.trunc(Math.abs(t/60)),a=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${St(n,2)}:${St(a,2)}`;case"narrow":return`${o}${n}${a>0?`:${a}`:""}`;case"techie":return`${o}${St(n,2)}${St(a,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function pd(t){return yO(t,["hour","minute","second","millisecond"])}const vO=["January","February","March","April","May","June","July","August","September","October","November","December"],$m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xO=["J","F","M","A","M","J","J","A","S","O","N","D"];function Dm(t){switch(t){case"narrow":return[...xO];case"short":return[...$m];case"long":return[...vO];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Vm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Em=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],kO=["M","T","W","T","F","S","S"];function Tm(t){switch(t){case"narrow":return[...kO];case"short":return[...Em];case"long":return[...Vm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Om=["AM","PM"],CO=["Before Christ","Anno Domini"],MO=["BC","AD"],SO=["B","A"];function Bm(t){switch(t){case"narrow":return[...SO];case"short":return[...MO];case"long":return[...CO];default:return null}}function LO(t){return Om[t.hour<12?0:1]}function $O(t,e){return Tm(e)[t.weekday-1]}function DO(t,e){return Dm(e)[t.month-1]}function VO(t,e){return Bm(e)[t.year<0?0:1]}function EO(t,e,n="always",a=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){const h=t==="days";switch(e){case 1:return h?"tomorrow":`next ${o[t][0]}`;case-1:return h?"yesterday":`last ${o[t][0]}`;case 0:return h?"today":`this ${o[t][0]}`}}const s=Object.is(e,-0)||e<0,l=Math.abs(e),d=l===1,c=o[t],u=a?d?c[1]:c[2]||c[1]:d?o[t][0]:t;return s?`${l} ${u} ago`:`in ${l} ${u}`}function Pm(t,e){let n="";for(const a of t)a.literal?n+=a.val:n+=e(a.val);return n}const TO={D:nd,DD:A6,DDD:F6,DDDD:z6,t:R6,tt:H6,ttt:I6,tttt:j6,T:Z6,TT:Y6,TTT:W6,TTTT:U6,f:q6,ff:X6,fff:Q6,ffff:em,F:G6,FF:K6,FFF:J6,FFFF:tm};class Zt{static create(e,n={}){return new Zt(e,n)}static parseFormat(e){let n=null,a="",o=!1;const i=[];for(let s=0;s<e.length;s++){const l=e.charAt(s);l==="'"?(a.length>0&&i.push({literal:o||/^\s+$/.test(a),val:a}),n=null,a="",o=!o):o||l===n?a+=l:(a.length>0&&i.push({literal:/^\s+$/.test(a),val:a}),a=l,n=l)}return a.length>0&&i.push({literal:o||/^\s+$/.test(a),val:a}),i}static macroTokenToFormatOpts(e){return TO[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return St(e,n);const a={...this.opts};return n>0&&(a.padTo=n),this.loc.numberFormatter(a).format(e)}formatDateTimeFromString(e,n){const a=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,_)=>this.loc.extract(e,f,_),s=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",l=()=>a?LO(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(f,_)=>a?DO(e,f):i(_?{month:f}:{month:f,day:"numeric"},"month"),c=(f,_)=>a?$O(e,f):i(_?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),u=f=>{const _=Zt.macroTokenToFormatOpts(f);return _?this.formatWithSystemDefault(e,_):f},h=f=>a?VO(e,f):i({era:f},"era"),p=f=>{switch(f){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return o?i({day:"numeric"},"day"):this.num(e.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(e.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(e.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(f)}};return Pm(Zt.parseFormat(n),p)}formatDurationFromString(e,n){const a=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=d=>c=>{const u=a(c);return u?this.num(d.get(u),c.length):c},i=Zt.parseFormat(n),s=i.reduce((d,{literal:c,val:u})=>c?d:d.concat(u),[]),l=e.shiftTo(...s.map(a).filter(d=>d));return Pm(i,o(l))}}const Nm=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Xr(...t){const e=t.reduce((n,a)=>n+a.source,"");return RegExp(`^${e}$`)}function Kr(...t){return e=>t.reduce(([n,a,o],i)=>{const[s,l,d]=i(e,o);return[{...n,...s},l||a,d]},[{},null,1]).slice(0,2)}function Qr(t,...e){if(t==null)return[null,null];for(const[n,a]of e){const o=n.exec(t);if(o)return a(o)}return[null,null]}function Am(...t){return(e,n)=>{const a={};let o;for(o=0;o<t.length;o++)a[t[o]]=bo(e[n+o]);return[a,null,n+o]}}const Fm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,OO=`(?:${Fm.source}?(?:\\[(${Nm.source})\\])?)?`,qu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,zm=RegExp(`${qu.source}${OO}`),Gu=RegExp(`(?:T${zm.source})?`),BO=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,PO=/(\d{4})-?W(\d\d)(?:-?(\d))?/,NO=/(\d{4})-?(\d{3})/,AO=Am("weekYear","weekNumber","weekDay"),FO=Am("year","ordinal"),zO=/(\d{4})-(\d\d)-(\d\d)/,Rm=RegExp(`${qu.source} ?(?:${Fm.source}|(${Nm.source}))?`),RO=RegExp(`(?: ${Rm.source})?`);function Jr(t,e,n){const a=t[e];return we(a)?n:bo(a)}function HO(t,e){return[{year:Jr(t,e),month:Jr(t,e+1,1),day:Jr(t,e+2,1)},null,e+3]}function ei(t,e){return[{hours:Jr(t,e,0),minutes:Jr(t,e+1,0),seconds:Jr(t,e+2,0),milliseconds:Yu(t[e+3])},null,e+4]}function bs(t,e){const n=!t[e]&&!t[e+1],a=ud(t[e+1],t[e+2]),o=n?null:Kt.instance(a);return[{},o,e+3]}function ys(t,e){const n=t[e]?Oa.create(t[e]):null;return[{},n,e+1]}const IO=RegExp(`^T?${qu.source}$`),jO=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function ZO(t){const[e,n,a,o,i,s,l,d,c]=t,u=e[0]==="-",h=d&&d[0]==="-",p=(f,_=!1)=>f!==void 0&&(_||f&&u)?-f:f;return[{years:p(ir(n)),months:p(ir(a)),weeks:p(ir(o)),days:p(ir(i)),hours:p(ir(s)),minutes:p(ir(l)),seconds:p(ir(d),d==="-0"),milliseconds:p(Yu(c),h)}]}const YO={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Xu(t,e,n,a,o,i,s){const l={year:e.length===2?Uu(bo(e)):bo(e),month:$m.indexOf(n)+1,day:bo(a),hour:bo(o),minute:bo(i)};return s&&(l.second=bo(s)),t&&(l.weekday=t.length>3?Vm.indexOf(t)+1:Em.indexOf(t)+1),l}const WO=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function UO(t){const[,e,n,a,o,i,s,l,d,c,u,h]=t,p=Xu(e,o,a,n,i,s,l);let f;return d?f=YO[d]:c?f=0:f=ud(u,h),[p,new Kt(f)]}function qO(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const GO=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,XO=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,KO=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Hm(t){const[,e,n,a,o,i,s,l]=t;return[Xu(e,o,a,n,i,s,l),Kt.utcInstance]}function QO(t){const[,e,n,a,o,i,s,l]=t;return[Xu(e,l,n,a,o,i,s),Kt.utcInstance]}const JO=Xr(BO,Gu),eB=Xr(PO,Gu),tB=Xr(NO,Gu),nB=Xr(zm),Im=Kr(HO,ei,bs,ys),aB=Kr(AO,ei,bs,ys),oB=Kr(FO,ei,bs,ys),rB=Kr(ei,bs,ys);function iB(t){return Qr(t,[JO,Im],[eB,aB],[tB,oB],[nB,rB])}function sB(t){return Qr(qO(t),[WO,UO])}function lB(t){return Qr(t,[GO,Hm],[XO,Hm],[KO,QO])}function dB(t){return Qr(t,[jO,ZO])}const cB=Kr(ei);function uB(t){return Qr(t,[IO,cB])}const hB=Xr(zO,RO),pB=Xr(Rm),fB=Kr(ei,bs,ys);function mB(t){return Qr(t,[hB,Im],[pB,fB])}const jm="Invalid Duration",Zm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},_B={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Zm},Tn=146097/400,ti=146097/4800,gB={years:{quarters:4,months:12,weeks:Tn/7,days:Tn,hours:Tn*24,minutes:Tn*24*60,seconds:Tn*24*60*60,milliseconds:Tn*24*60*60*1e3},quarters:{months:3,weeks:Tn/28,days:Tn/4,hours:Tn*24/4,minutes:Tn*24*60/4,seconds:Tn*24*60*60/4,milliseconds:Tn*24*60*60*1e3/4},months:{weeks:ti/7,days:ti,hours:ti*24,minutes:ti*24*60,seconds:ti*24*60*60,milliseconds:ti*24*60*60*1e3},...Zm},sr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bB=sr.slice(0).reverse();function yo(t,e,n=!1){const a={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Yt(a)}function Ym(t,e){let n=e.milliseconds??0;for(const a of bB.slice(1))e[a]&&(n+=e[a]*t[a].milliseconds);return n}function Wm(t,e){const n=Ym(t,e)<0?-1:1;sr.reduceRight((a,o)=>{if(we(e[o]))return a;if(a){const i=e[a]*n,s=t[o][a],l=Math.floor(i/s);e[o]+=l*n,e[a]-=l*s*n}return o},null),sr.reduce((a,o)=>{if(we(e[o]))return a;if(a){const i=e[a]%1;e[a]-=i,e[o]+=i*t[a][o]}return o},null)}function yB(t){const e={};for(const[n,a]of Object.entries(t))a!==0&&(e[n]=a);return e}let Yt=class Bt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let a=n?gB:_B;e.matrix&&(a=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=a,this.isLuxonDuration=!0}static fromMillis(e,n){return Bt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new jt(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Bt({values:hd(e,Bt.normalizeUnit),loc:Ke.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(go(e))return Bt.fromMillis(e);if(Bt.isDuration(e))return e;if(typeof e=="object")return Bt.fromObject(e);throw new jt(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[a]=dB(e);return a?Bt.fromObject(a,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[a]=uB(e);return a?Bt.fromObject(a,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Duration is invalid");const a=e instanceof Un?e:new Un(e,n);if(ft.throwOnInvalid)throw new jT(a);return new Bt({invalid:a})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new N6(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const a={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Zt.create(this.loc,a).formatDurationFromString(this,e):jm}toHuman(e={}){if(!this.isValid)return jm;const n=sr.map(a=>{const o=this.values[a];return we(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:a.slice(0,-1)}).format(o)}).filter(a=>a);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Wu(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},be.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Ym(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e),a={};for(const o of sr)(qr(n.values,o)||qr(this.values,o))&&(a[o]=n.get(o)+this.get(o));return yo(this,{values:a},!0)}minus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const a of Object.keys(this.values))n[a]=Lm(e(this.values[a],a));return yo(this,{values:n},!0)}get(e){return this[Bt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...hd(e,Bt.normalizeUnit)};return yo(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:a,matrix:o}={}){const s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:o,conversionAccuracy:a};return yo(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Wm(this.matrix,e),yo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=yB(this.normalize().shiftToAll().toObject());return yo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>Bt.normalizeUnit(s));const n={},a={},o=this.toObject();let i;for(const s of sr)if(e.indexOf(s)>=0){i=s;let l=0;for(const c in a)l+=this.matrix[c][s]*a[c],a[c]=0;go(o[s])&&(l+=o[s]);const d=Math.trunc(l);n[s]=d,a[s]=(l*1e3-d*1e3)/1e3}else go(o[s])&&(a[s]=o[s]);for(const s in a)a[s]!==0&&(n[i]+=s===i?a[s]:a[s]/this.matrix[i][s]);return Wm(this.matrix,n),yo(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return yo(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(a,o){return a===void 0||a===0?o===void 0||o===0:a===o}for(const a of sr)if(!n(this.values[a],e.values[a]))return!1;return!0}};const ni="Invalid Interval";function wB(t,e){return!t||!t.isValid?mt.invalid("missing or invalid start"):!e||!e.isValid?mt.invalid("missing or invalid end"):e<t?mt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class mt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Interval is invalid");const a=e instanceof Un?e:new Un(e,n);if(ft.throwOnInvalid)throw new IT(a);return new mt({invalid:a})}static fromDateTimes(e,n){const a=vs(e),o=vs(n),i=wB(a,o);return i??new mt({start:a,end:o})}static after(e,n){const a=Yt.fromDurationLike(n),o=vs(e);return mt.fromDateTimes(o,o.plus(a))}static before(e,n){const a=Yt.fromDurationLike(n),o=vs(e);return mt.fromDateTimes(o.minus(a),o)}static fromISO(e,n){const[a,o]=(e||"").split("/",2);if(a&&o){let i,s;try{i=be.fromISO(a,n),s=i.isValid}catch{s=!1}let l,d;try{l=be.fromISO(o,n),d=l.isValid}catch{d=!1}if(s&&d)return mt.fromDateTimes(i,l);if(s){const c=Yt.fromISO(o,n);if(c.isValid)return mt.after(i,c)}else if(d){const c=Yt.fromISO(a,n);if(c.isValid)return mt.before(l,c)}}return mt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const a=this.start.startOf(e,n);let o;return n?.useLocaleWeeks?o=this.end.reconfigure({locale:a.locale}):o=this.end,o=o.startOf(e,n),Math.floor(o.diff(a,e).get(e))+(o.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?mt.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(vs).filter(s=>this.contains(s)).sort((s,l)=>s.toMillis()-l.toMillis()),a=[];let{s:o}=this,i=0;for(;o<this.e;){const s=n[i]||this.e,l=+s>+this.e?this.e:s;a.push(mt.fromDateTimes(o,l)),o=l,i+=1}return a}splitBy(e){const n=Yt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:a}=this,o=1,i;const s=[];for(;a<this.e;){const l=this.start.plus(n.mapUnits(d=>d*o));i=+l>+this.e?this.e:l,s.push(mt.fromDateTimes(a,i)),a=i,o+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,a=this.e<e.e?this.e:e.e;return n>=a?null:mt.fromDateTimes(n,a)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,a=this.e>e.e?this.e:e.e;return mt.fromDateTimes(n,a)}static merge(e){const[n,a]=e.sort((o,i)=>o.s-i.s).reduce(([o,i],s)=>i?i.overlaps(s)||i.abutsStart(s)?[o,i.union(s)]:[o.concat([i]),s]:[o,s],[[],null]);return a&&n.push(a),n}static xor(e){let n=null,a=0;const o=[],i=e.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...i),l=s.sort((d,c)=>d.time-c.time);for(const d of l)a+=d.type==="s"?1:-1,a===1?n=d.time:(n&&+n!=+d.time&&o.push(mt.fromDateTimes(n,d.time)),n=null);return mt.merge(o)}difference(...e){return mt.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ni}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.s.loc.clone(n),e).formatInterval(this):ni}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ni}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ni}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ni}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:ni}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Yt.invalid(this.invalidReason)}mapEndpoints(e){return mt.fromDateTimes(e(this.s),e(this.e))}}class fd{static hasDST(e=ft.defaultZone){const n=be.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return Oa.isValidZone(e)}static normalizeZone(e){return _o(e,ft.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Ke.create(n,a,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Ke.create(n,a,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null}={}){return(o||Ke.create(n,a,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:a=null,locObj:o=null}={}){return(o||Ke.create(n,a,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Ke.create(n,null,"gregory").eras(e)}static features(){return{relative:xm(),localeWeek:km()}}}function Um(t,e){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),a=n(e)-n(t);return Math.floor(Yt.fromMillis(a).as("days"))}function vB(t,e,n){const a=[["years",(d,c)=>c.year-d.year],["quarters",(d,c)=>c.quarter-d.quarter+(c.year-d.year)*4],["months",(d,c)=>c.month-d.month+(c.year-d.year)*12],["weeks",(d,c)=>{const u=Um(d,c);return(u-u%7)/7}],["days",Um]],o={},i=t;let s,l;for(const[d,c]of a)n.indexOf(d)>=0&&(s=d,o[d]=c(t,e),l=i.plus(o),l>e?(o[d]--,t=i.plus(o),t>e&&(l=t,o[d]--,t=i.plus(o))):t=l);return[t,o,l,s]}function xB(t,e,n,a){let[o,i,s,l]=vB(t,e,n);const d=e-o,c=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);c.length===0&&(s<e&&(s=o.plus({[l]:1})),s!==o&&(i[l]=(i[l]||0)+d/(s-o)));const u=Yt.fromObject(i,a);return c.length>0?Yt.fromMillis(d,a).shiftTo(...c).plus(u):u}const kB="missing Intl.DateTimeFormat.formatToParts support";function Fe(t,e=n=>n){return{regex:t,deser:([n])=>e(hO(n))}}const qm="[  ]",Gm=new RegExp(qm,"g");function CB(t){return t.replace(/\./g,"\\.?").replace(Gm,qm)}function Xm(t){return t.replace(/\./g,"").replace(Gm," ").toLowerCase()}function qn(t,e){return t===null?null:{regex:RegExp(t.map(CB).join("|")),deser:([n])=>t.findIndex(a=>Xm(n)===Xm(a))+e}}function Km(t,e){return{regex:t,deser:([,n,a])=>ud(n,a),groups:e}}function md(t){return{regex:t,deser:([e])=>e}}function MB(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function SB(t,e){const n=Wn(e),a=Wn(e,"{2}"),o=Wn(e,"{3}"),i=Wn(e,"{4}"),s=Wn(e,"{6}"),l=Wn(e,"{1,2}"),d=Wn(e,"{1,3}"),c=Wn(e,"{1,6}"),u=Wn(e,"{1,9}"),h=Wn(e,"{2,4}"),p=Wn(e,"{4,6}"),f=g=>({regex:RegExp(MB(g.val)),deser:([b])=>b,literal:!0}),m=(g=>{if(t.literal)return f(g);switch(g.val){case"G":return qn(e.eras("short"),0);case"GG":return qn(e.eras("long"),0);case"y":return Fe(c);case"yy":return Fe(h,Uu);case"yyyy":return Fe(i);case"yyyyy":return Fe(p);case"yyyyyy":return Fe(s);case"M":return Fe(l);case"MM":return Fe(a);case"MMM":return qn(e.months("short",!0),1);case"MMMM":return qn(e.months("long",!0),1);case"L":return Fe(l);case"LL":return Fe(a);case"LLL":return qn(e.months("short",!1),1);case"LLLL":return qn(e.months("long",!1),1);case"d":return Fe(l);case"dd":return Fe(a);case"o":return Fe(d);case"ooo":return Fe(o);case"HH":return Fe(a);case"H":return Fe(l);case"hh":return Fe(a);case"h":return Fe(l);case"mm":return Fe(a);case"m":return Fe(l);case"q":return Fe(l);case"qq":return Fe(a);case"s":return Fe(l);case"ss":return Fe(a);case"S":return Fe(d);case"SSS":return Fe(o);case"u":return md(u);case"uu":return md(l);case"uuu":return Fe(n);case"a":return qn(e.meridiems(),0);case"kkkk":return Fe(i);case"kk":return Fe(h,Uu);case"W":return Fe(l);case"WW":return Fe(a);case"E":case"c":return Fe(n);case"EEE":return qn(e.weekdays("short",!1),1);case"EEEE":return qn(e.weekdays("long",!1),1);case"ccc":return qn(e.weekdays("short",!0),1);case"cccc":return qn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Km(new RegExp(`([+-]${l.source})(?::(${a.source}))?`),2);case"ZZZ":return Km(new RegExp(`([+-]${l.source})(${a.source})?`),2);case"z":return md(/[a-z_+-/]{1,256}?/i);case" ":return md(/[^\S\n\r]/);default:return f(g)}})(t)||{invalidReason:kB};return m.token=t,m}const LB={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function $B(t,e,n){const{type:a,value:o}=t;if(a==="literal"){const d=/^\s+$/.test(o);return{literal:!d,val:d?" ":o}}const i=e[a];let s=a;a==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let l=LB[s];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function DB(t){return[`^${t.map(n=>n.regex).reduce((n,a)=>`${n}(${a.source})`,"")}$`,t]}function VB(t,e,n){const a=t.match(e);if(a){const o={};let i=1;for(const s in n)if(qr(n,s)){const l=n[s],d=l.groups?l.groups+1:1;!l.literal&&l.token&&(o[l.token.val[0]]=l.deser(a.slice(i,i+d))),i+=d}return[a,o]}else return[a,{}]}function EB(t){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,a;return we(t.z)||(n=Oa.create(t.z)),we(t.Z)||(n||(n=new Kt(t.Z)),a=t.Z),we(t.q)||(t.M=(t.q-1)*3+1),we(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),we(t.u)||(t.S=Yu(t.u)),[Object.keys(t).reduce((i,s)=>{const l=e(s);return l&&(i[l]=t[s]),i},{}),n,a]}let Ku=null;function TB(){return Ku||(Ku=be.fromMillis(1555555555555)),Ku}function OB(t,e){if(t.literal)return t;const n=Zt.macroTokenToFormatOpts(t.val),a=t_(n,e);return a==null||a.includes(void 0)?t:a}function Qm(t,e){return Array.prototype.concat(...t.map(n=>OB(n,e)))}class Jm{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Qm(Zt.parseFormat(n),e),this.units=this.tokens.map(a=>SB(a,e)),this.disqualifyingUnit=this.units.find(a=>a.invalidReason),!this.disqualifyingUnit){const[a,o]=DB(this.units);this.regex=RegExp(a,"i"),this.handlers=o}}explainFromTokens(e){if(this.isValid){const[n,a]=VB(e,this.regex,this.handlers),[o,i,s]=a?EB(a):[null,null,void 0];if(qr(a,"a")&&qr(a,"H"))throw new Wr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:a,result:o,zone:i,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function e_(t,e,n){return new Jm(t,n).explainFromTokens(e)}function BB(t,e,n){const{result:a,zone:o,specificOffset:i,invalidReason:s}=e_(t,e,n);return[a,o,i,s]}function t_(t,e){if(!t)return null;const a=Zt.create(e,t).dtFormatter(TB()),o=a.formatToParts(),i=a.resolvedOptions();return o.map(s=>$B(s,t,i))}const Qu="Invalid DateTime",n_=864e13;function ws(t){return new Un("unsupported zone",`the zone "${t.name}" is not supported`)}function Ju(t){return t.weekData===null&&(t.weekData=sd(t.c)),t.weekData}function e0(t){return t.localWeekData===null&&(t.localWeekData=sd(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function lr(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new be({...n,...e,old:n})}function a_(t,e,n){let a=t-e*60*1e3;const o=n.offset(a);if(e===o)return[a,e];a-=(o-e)*60*1e3;const i=n.offset(a);return o===i?[a,o]:[t-Math.min(o,i)*60*1e3,Math.max(o,i)]}function _d(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function gd(t,e,n){return a_(cd(t),e,n)}function o_(t,e){const n=t.o,a=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:a,month:o,day:Math.min(t.c.day,dd(a,o))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Yt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=cd(i);let[d,c]=a_(l,n,t.zone);return s!==0&&(d+=s,c=t.zone.offset(d)),{ts:d,o:c}}function ai(t,e,n,a,o,i){const{setZone:s,zone:l}=n;if(t&&Object.keys(t).length!==0||e){const d=e||l,c=be.fromObject(t,{...n,zone:d,specificOffset:i});return s?c:c.setZone(l)}else return be.invalid(new Un("unparsable",`the input "${o}" can't be parsed as ${a}`))}function bd(t,e,n=!0){return t.isValid?Zt.create(Ke.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function t0(t,e){const n=t.c.year>9999||t.c.year<0;let a="";return n&&t.c.year>=0&&(a+="+"),a+=St(t.c.year,n?6:4),e?(a+="-",a+=St(t.c.month),a+="-",a+=St(t.c.day)):(a+=St(t.c.month),a+=St(t.c.day)),a}function r_(t,e,n,a,o,i){let s=St(t.c.hour);return e?(s+=":",s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=":")):s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=St(t.c.second),(t.c.millisecond!==0||!a)&&(s+=".",s+=St(t.c.millisecond,3))),o&&(t.isOffsetFixed&&t.offset===0&&!i?s+="Z":t.o<0?(s+="-",s+=St(Math.trunc(-t.o/60)),s+=":",s+=St(Math.trunc(-t.o%60))):(s+="+",s+=St(Math.trunc(t.o/60)),s+=":",s+=St(Math.trunc(t.o%60)))),i&&(s+="["+t.zone.ianaName+"]"),s}const i_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},PB={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},NB={ordinal:1,hour:0,minute:0,second:0,millisecond:0},s_=["year","month","day","hour","minute","second","millisecond"],AB=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],FB=["year","ordinal","hour","minute","second","millisecond"];function zB(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new N6(t);return e}function l_(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return zB(t)}}function RB(t){return wd[t]||(yd===void 0&&(yd=ft.now()),wd[t]=t.offset(yd)),wd[t]}function d_(t,e){const n=_o(e.zone,ft.defaultZone);if(!n.isValid)return be.invalid(ws(n));const a=Ke.fromObject(e);let o,i;if(we(t.year))o=ft.now();else{for(const d of s_)we(t[d])&&(t[d]=i_[d]);const s=wm(t)||vm(t);if(s)return be.invalid(s);const l=RB(n);[o,i]=gd(t,l,n)}return new be({ts:o,zone:n,loc:a,o:i})}function c_(t,e,n){const a=we(n.round)?!0:n.round,o=(s,l)=>(s=Wu(s,a||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(s,l)),i=s=>n.calendary?e.hasSame(t,s)?0:e.startOf(s).diff(t.startOf(s),s).get(s):e.diff(t,s).get(s);if(n.unit)return o(i(n.unit),n.unit);for(const s of n.units){const l=i(s);if(Math.abs(l)>=1)return o(l,s)}return o(t>e?-0:0,n.units[n.units.length-1])}function u_(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let yd,wd={};class be{constructor(e){const n=e.zone||ft.defaultZone;let a=e.invalid||(Number.isNaN(e.ts)?new Un("invalid input"):null)||(n.isValid?null:ws(n));this.ts=we(e.ts)?ft.now():e.ts;let o=null,i=null;if(!a)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[o,i]=[e.old.c,e.old.o];else{const l=go(e.o)&&!e.old?e.o:n.offset(this.ts);o=_d(this.ts,l),a=Number.isNaN(o.year)?new Un("invalid input"):null,o=a?null:o,i=a?null:l}this._zone=n,this.loc=e.loc||Ke.create(),this.invalid=a,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new be({})}static local(){const[e,n]=u_(arguments),[a,o,i,s,l,d,c]=n;return d_({year:a,month:o,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static utc(){const[e,n]=u_(arguments),[a,o,i,s,l,d,c]=n;return e.zone=Kt.utcInstance,d_({year:a,month:o,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static fromJSDate(e,n={}){const a=gO(e)?e.valueOf():NaN;if(Number.isNaN(a))return be.invalid("invalid input");const o=_o(n.zone,ft.defaultZone);return o.isValid?new be({ts:a,zone:o,loc:Ke.fromObject(n)}):be.invalid(ws(o))}static fromMillis(e,n={}){if(go(e))return e<-n_||e>n_?be.invalid("Timestamp out of range"):new be({ts:e,zone:_o(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(go(e))return new be({ts:e*1e3,zone:_o(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const a=_o(n.zone,ft.defaultZone);if(!a.isValid)return be.invalid(ws(a));const o=Ke.fromObject(n),i=hd(e,l_),{minDaysInFirstWeek:s,startOfWeek:l}=ym(i,o),d=ft.now(),c=we(n.specificOffset)?a.offset(d):n.specificOffset,u=!we(i.ordinal),h=!we(i.year),p=!we(i.month)||!we(i.day),f=h||p,_=i.weekYear||i.weekNumber;if((f||u)&&_)throw new Wr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new Wr("Can't mix ordinal dates with month/day");const m=_||i.weekday&&!f;let g,b,w=_d(d,c);m?(g=AB,b=PB,w=sd(w,s,l)):u?(g=FB,b=NB,w=ju(w)):(g=s_,b=i_);let y=!1;for(const E of g){const R=i[E];we(R)?y?i[E]=b[E]:i[E]=w[E]:y=!0}const k=m?fO(i,s,l):u?mO(i):wm(i),v=k||vm(i);if(v)return be.invalid(v);const M=m?gm(i,s,l):u?bm(i):i,[C,$]=gd(M,c,a),S=new be({ts:C,zone:a,o:$,loc:o});return i.weekday&&f&&e.weekday!==S.weekday?be.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${S.toISO()}`):S.isValid?S:be.invalid(S.invalid)}static fromISO(e,n={}){const[a,o]=iB(e);return ai(a,o,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[a,o]=sB(e);return ai(a,o,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[a,o]=lB(e);return ai(a,o,n,"HTTP",n)}static fromFormat(e,n,a={}){if(we(e)||we(n))throw new jt("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=a,s=Ke.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[l,d,c,u]=BB(s,e,n);return u?be.invalid(u):ai(l,d,a,`format ${n}`,e,c)}static fromString(e,n,a={}){return be.fromFormat(e,n,a)}static fromSQL(e,n={}){const[a,o]=mB(e);return ai(a,o,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the DateTime is invalid");const a=e instanceof Un?e:new Un(e,n);if(ft.throwOnInvalid)throw new HT(a);return new be({invalid:a})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const a=t_(e,Ke.fromObject(n));return a?a.map(o=>o?o.val:null).join(""):null}static expandFormat(e,n={}){return Qm(Zt.parseFormat(e),Ke.fromObject(n)).map(o=>o.val).join("")}static resetCache(){yd=void 0,wd={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ju(this).weekYear:NaN}get weekNumber(){return this.isValid?Ju(this).weekNumber:NaN}get weekday(){return this.isValid?Ju(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?e0(this).weekday:NaN}get localWeekNumber(){return this.isValid?e0(this).weekNumber:NaN}get localWeekYear(){return this.isValid?e0(this).weekYear:NaN}get ordinal(){return this.isValid?ju(this.c).ordinal:NaN}get monthShort(){return this.isValid?fd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,a=cd(this.c),o=this.zone.offset(a-e),i=this.zone.offset(a+e),s=this.zone.offset(a-o*n),l=this.zone.offset(a-i*n);if(s===l)return[this];const d=a-s*n,c=a-l*n,u=_d(d,s),h=_d(c,l);return u.hour===h.hour&&u.minute===h.minute&&u.second===h.second&&u.millisecond===h.millisecond?[lr(this,{ts:d}),lr(this,{ts:c})]:[this]}get isInLeapYear(){return ms(this.year)}get daysInMonth(){return dd(this.year,this.month)}get daysInYear(){return this.isValid?Gr(this.year):NaN}get weeksInWeekYear(){return this.isValid?_s(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?_s(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:a,calendar:o}=Zt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:a,outputCalendar:o}}toUTC(e=0,n={}){return this.setZone(Kt.instance(e),n)}toLocal(){return this.setZone(ft.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:a=!1}={}){if(e=_o(e,ft.defaultZone),e.equals(this.zone))return this;if(e.isValid){let o=this.ts;if(n||a){const i=e.offset(this.ts),s=this.toObject();[o]=gd(s,i,e)}return lr(this,{ts:o,zone:e})}else return be.invalid(ws(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:a}={}){const o=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:a});return lr(this,{loc:o})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=hd(e,l_),{minDaysInFirstWeek:a,startOfWeek:o}=ym(n,this.loc),i=!we(n.weekYear)||!we(n.weekNumber)||!we(n.weekday),s=!we(n.ordinal),l=!we(n.year),d=!we(n.month)||!we(n.day),c=l||d,u=n.weekYear||n.weekNumber;if((c||s)&&u)throw new Wr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&s)throw new Wr("Can't mix ordinal dates with month/day");let h;i?h=gm({...sd(this.c,a,o),...n},a,o):we(n.ordinal)?(h={...this.toObject(),...n},we(n.day)&&(h.day=Math.min(dd(h.year,h.month),h.day))):h=bm({...ju(this.c),...n});const[p,f]=gd(h,this.o,this.zone);return lr(this,{ts:p,o:f})}plus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e);return lr(this,o_(this,n))}minus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e).negate();return lr(this,o_(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const a={},o=Yt.normalizeUnit(e);switch(o){case"years":a.month=1;case"quarters":case"months":a.day=1;case"weeks":case"days":a.hour=0;case"hours":a.minute=0;case"minutes":a.second=0;case"seconds":a.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:s}=this;s<i&&(a.weekNumber=this.weekNumber-1),a.weekday=i}else a.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);a.month=(i-1)*3+1}return this.set(a)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?Zt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Qu}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.loc.clone(n),e).formatDateTime(this):Qu}toLocaleParts(e={}){return this.isValid?Zt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:a=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const s=e==="extended";let l=t0(this,s);return l+="T",l+=r_(this,s,n,a,o,i),l}toISODate({format:e="extended"}={}){return this.isValid?t0(this,e==="extended"):null}toISOWeekDate(){return bd(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:a=!0,includePrefix:o=!1,extendedZone:i=!1,format:s="extended"}={}){return this.isValid?(o?"T":"")+r_(this,s==="extended",n,e,a,i):null}toRFC2822(){return bd(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bd(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?t0(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:a=!0}={}){let o="HH:mm:ss.SSS";return(n||e)&&(a&&(o+=" "),n?o+="z":e&&(o+="ZZ")),bd(this,o,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Qu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",a={}){if(!this.isValid||!e.isValid)return Yt.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...a},i=bO(n).map(Yt.normalizeUnit),s=e.valueOf()>this.valueOf(),l=s?this:e,d=s?e:this,c=xB(l,d,i,o);return s?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(be.now(),e,n)}until(e){return this.isValid?mt.fromDateTimes(this,e):this}hasSame(e,n,a){if(!this.isValid)return!1;const o=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,a)<=o&&o<=i.endOf(n,a)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||be.fromObject({},{zone:this.zone}),a=e.padding?this<n?-e.padding:e.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(o=e.unit,i=void 0),c_(n,this.plus(a),{...e,numeric:"always",units:o,unit:i})}toRelativeCalendar(e={}){return this.isValid?c_(e.base||be.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(be.isDateTime))throw new jt("min requires all arguments be DateTimes");return Cm(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(be.isDateTime))throw new jt("max requires all arguments be DateTimes");return Cm(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,a={}){const{locale:o=null,numberingSystem:i=null}=a,s=Ke.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return e_(s,e,n)}static fromStringExplain(e,n,a={}){return be.fromFormatExplain(e,n,a)}static buildFormatParser(e,n={}){const{locale:a=null,numberingSystem:o=null}=n,i=Ke.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return new Jm(i,e)}static fromFormatParser(e,n,a={}){if(we(e)||we(n))throw new jt("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=a,s=Ke.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!s.equals(n.locale))throw new jt(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${n.locale}`);const{result:l,zone:d,specificOffset:c,invalidReason:u}=n.explainFromTokens(e);return u?be.invalid(u):ai(l,d,a,`format ${n.format}`,e,c)}static get DATE_SHORT(){return nd}static get DATE_MED(){return A6}static get DATE_MED_WITH_WEEKDAY(){return ZT}static get DATE_FULL(){return F6}static get DATE_HUGE(){return z6}static get TIME_SIMPLE(){return R6}static get TIME_WITH_SECONDS(){return H6}static get TIME_WITH_SHORT_OFFSET(){return I6}static get TIME_WITH_LONG_OFFSET(){return j6}static get TIME_24_SIMPLE(){return Z6}static get TIME_24_WITH_SECONDS(){return Y6}static get TIME_24_WITH_SHORT_OFFSET(){return W6}static get TIME_24_WITH_LONG_OFFSET(){return U6}static get DATETIME_SHORT(){return q6}static get DATETIME_SHORT_WITH_SECONDS(){return G6}static get DATETIME_MED(){return X6}static get DATETIME_MED_WITH_SECONDS(){return K6}static get DATETIME_MED_WITH_WEEKDAY(){return YT}static get DATETIME_FULL(){return Q6}static get DATETIME_FULL_WITH_SECONDS(){return J6}static get DATETIME_HUGE(){return em}static get DATETIME_HUGE_WITH_SECONDS(){return tm}}function vs(t){if(be.isDateTime(t))return t;if(t&&t.valueOf&&go(t.valueOf()))return be.fromJSDate(t);if(t&&typeof t=="object")return be.fromObject(t);throw new jt(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const HB=[{name:"Sydney",open:"21:00",close:"6:00"},{name:"Tokyo",open:"0:00",close:"9:00"},{name:"London",open:"7:00",close:"16:00"},{name:"New-York",open:"13:00",close:"22:00"}];function lt(t,e=2){return isNaN(+t)?0:Math.round(+t*10**e)/10**e}function n0(t){if(t){const e=t.toString();if(/\B(?=(\d{3})+(?!\d))/g.test(e))if(e.includes(".")){let a=e.split(".");return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),a.join(".")}else return e.replace(/\B(?=(\d{3})+(?!\d))/g," ");else return e}else return t}function IB(t,e){const n=parseFloat(t.entry_price),a=t.amount,o=t.multiplier,i=t.side;let s=0,l=0;return i==="SHORT"?(s=(n-e)*Math.abs(a),l=(n-e)*a*o/(n*Math.abs(a))*100):i==="LONG"&&(s=(e-n)*Math.abs(a),l=(e-n)*a*o/(n*Math.abs(a))*100),{pnl:s,pnlToBalanceRatio:l}}function jB(t){if(isNaN(+t))return 0;const e=parseFloat(String(t));if(Number.isInteger(e))return e;const n=e.toString(),a=n.indexOf(".");if(a===-1)return e;const i=n.slice(a+1).search(/[^0]/);if(i===-1)return e;const l=10**(i+4);return Math.round(e*l)/l}function vd(t){let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}function _e(t,e,n={}){const{repeat:a=4,mask:o="*",prefix:i="",suffix:s=""}=n;let l,d;return t?(l=i==="$"?xs():i,d=s==="$"?xs():s,l+o.repeat(a)+d):e}function ZB(t){return t.reduce((e,n,a)=>a===0?`key=${encodeURIComponent(n.id)}`:e+`&key=${encodeURIComponent(n.id)}`,"")}function oi(){function t(o){return Number(o)===o&&o%1!==0}function e(o){let i=String(o);return i.includes(".75")?i.replace(".75",":45"):i.includes(".25")?i.replace(".25",":15"):i.replace(".5",":30")}const n=Number(aa.getItem("scope360::timezone"))||0,a=t(n)?e(n):n;return`UTC${n>=0?"+":""}${a}`}function YB(t){return new Date(t).getFullYear()}function WB(t){const e=oi();return be.fromISO(t,{setZone:!0}).setZone(e).toFormat("dd LLLL, y, TT")}function a0(t,e="dd/LL/y",n=!0){const a=n?oi():"UTC+0";return be.fromISO(t,{setZone:!0}).setZone(a).toFormat(e)}function UB(t){return t.toISOString().split("T")[0]}function qB(t){return["January","February","March","April","May","June","July","August","September","October","November","December"][new Date(t).getMonth()]}function GB(t){return new Date(t).getDate()}function h_(t){return be.fromISO(t,{setZone:!0}).toFormat("cccc")}function XB(t){const e=new Date(t),a=new Date-e;return Math.floor(a/(1e3*3600*24))}function xs(){const t={USD:"$",EUR:"€",JPY:"¥",GBP:"£",CHF:"Fr.",CAD:"$",AUD:"$",NOK:"kr",SEK:"kr",DKK:"kr"},e=aa.getItem("scope360::currency");return e&&t[e?.split("::")[0]]?t[e?.split("::")[0]]:t.USD}function o0(){const t=aa.getItem("scope360::currency");return t&&t?.split("::")[1]?+t?.split("::")[1]:1}const ze=(t,e={isPercentage:!1,isFixed:!0,isPlus:!1})=>{let n;t>=0?n=e.isPlus&&t!==0?"+":"":n="-";let a=Math.abs(t);return e.isFixed&&(a=lt(a)),e.isPercentage?n0(`${n}${a}%`):n0(`${n}${xs()}${lt(a*o0())}`)};function KB(t,e){const n=+new Date(e)-+new Date(t);return m_(n)}function p_(){function t(s){const[l,d]=s.split(":").map(Number);return l+d/60}function e(s){const l=Math.floor(s),d=s%1*60;return`${String(l).padStart(2,"0")}:${String(d).padStart(2,"0")}`}function n(s){const l=s.match(/([+-]?)(\d+):?(\d+)?/);if(!l)return 0;const d=l[1]==="-"?-1:1,c=parseInt(l[2],10),u=l[3]?parseInt(l[3],10):0;return d*(c+u/60)}const a=oi(),o=n(a);return HB.map(s=>{const l=t(s.open),d=t(s.close),c=(l+o+24)%24,u=(d+o+24)%24;return{name:s.name,open:e(c),close:e(u)}})}function f_(){const t=[{name:"Sydney",open:"21:00",close:"6:00"},{name:"Tokyo",open:"0:00",close:"9:00"},{name:"London",open:"7:00",close:"16:00"},{name:"New-York",open:"13:00",close:"22:00"}],e=new Date,n=e.getUTCHours(),a=e.getUTCMinutes(),o=e.getUTCSeconds(),i=n*3600+a*60+o,s=t.filter(({open:l,close:d})=>{const[c,u]=l.split(":").map(Number),[h,p]=d.split(":").map(Number),f=c*3600+u*60,_=h*3600+p*60;return f<_?i>=f&&i<_:i>=f||i<_});if(s.length>1){const d=Math.min(...s.map(({close:c})=>{const[u,h]=c.split(":").map(Number);return u*3600+h*60}))-i;return{activeMarkets:s.map(({name:c})=>c),overlapTime:d>0?Math.floor(d/60):0}}else{if(s.length===1)return{activeMarkets:s.map(({name:l})=>l),overlapTime:0};{const d=t.map(({name:c,open:u})=>{const[h,p]=u.split(":").map(Number),f=h*3600+p*60,_=f>=i?f-i:86400-i+f;return{name:c,timeUntilOpenInSeconds:_}}).reduce((c,u)=>c.timeUntilOpenInSeconds<u.timeUntilOpenInSeconds?c:u);return{activeMarkets:[],nextMarket:d.name,timeUntilNextOpen:Math.floor(d.timeUntilOpenInSeconds/60),timeUntilNextOpenInSeconds:d.timeUntilOpenInSeconds}}}}function ri(t,e){return t>=1e3||t<=-1e3?_e(e,lt(t/1e3,2)+"k",{repeat:3}):_e(e,lt(t,2),{repeat:3})}function m_(t){const e=Math.floor(t/864e5),n=Math.floor(t%(1e3*60*60*24)/(1e3*60*60)),a=Math.floor(t%(1e3*60*60)/(1e3*60)),o=Math.floor(t%(1e3*60)/1e3),i=[];return e>0&&i.push(`${e}D`),n>0&&i.push(`${n}H`),a>0&&i.push(`${a}M`),o>0&&i.push(`${o}S`),i.join(" ")}function dr(t){const e=/^(.*?)(BTC|ETH|USDT|USD|EUR|GBP|JPY|CAD|CHF|USDC|CNH)$/,n=t.match(e);if(n){const a=n[1],o=n[2];return a===""||o===""?t:`${a}/${o}`}else return t}function ks(t,e){const a=dr(t).split("/")[e];if(a)return a.toLowerCase()}function QB(t,e){let n=[],a=new Date(e,t,1),o=new Date(e,t+1,0),i=o.getDate(),s=1,l;for(a.getDay()===1?l=7:a.getDay()===0?(s=new Date(e,t,0).getDate()-6+1,l=1):(s=new Date(e,t,0).getDate()+1-a.getDay()+1,l=7-a.getDay()+1,n.push({start:s,end:l}),s=l+1,l=l+7);s<=i;)if(n.push({start:s,end:l}),s=l+1,l=l+7,l=s===1&&l===8?1:l,l>i&&s<=i){l=l-i,n.push({start:s,end:l});break}return n.map(({start:d,end:c},u)=>{const h=+(d>c&&u===0);return Array.from({length:7},(p,f)=>{const _=new Date(e,t-h,d+f);return{date:_.getDate(),month:_.getMonth(),day:_.toLocaleString("en",{weekday:"long"})}})})}function JB(t,e,n){let a=new Date(t),o=new Date(e);a>o&&([a,o]=[o,a]);let i=[],s=new Date(a.getFullYear(),a.getMonth(),1),l=0;for(;s<=o;){let d=s.toLocaleString("en",{month:"long",year:"numeric"});n?i.push({month:s.getMonth(),year:s.getFullYear(),name:d,id:l}):i.push(d),l=l+1,s.setMonth(s.getMonth()+1)}return i}function eP(t,e,n){let a=new Date(t),o=new Date(e);a>o&&([a,o]=[o,a]);let i=[],s=a.getFullYear(),l=o.getFullYear(),d=0;for(let c=s;c<=l;c++)n?i.push({value:c,name:c.toString(),id:d}):i.push(c.toString()),d=d+1;return i}function tP(t,e){let o=new Date(t).getTime()-e*24*60*60*1e3;return new Date(o).toISOString().split(".")[0]+"Z"}function nP(t){function e(a,o){let i=[],s=new Date(o,a,1),l=new Date(o,a+1,0),d=l.getDate(),c=1,u;for(s.getDay()===1?u=7:s.getDay()===0?(c=new Date(o,a,0).getDate()-6+1,u=1):(c=new Date(o,a,0).getDate()+1-s.getDay()+1,u=7-s.getDay()+1,i.push({start:c,end:u}),c=u+1,u=u+7);c<=d;)if(i.push({start:c,end:u}),c=u+1,u=u+7,u=c===1&&u===8?1:u,u>d&&c<=d){u=u-d,i.push({start:c,end:u});break}return i.map(({start:h,end:p},f)=>{const _=+(h>p&&f===0);return Array.from({length:7},(m,g)=>{const b=new Date(o,a-_,h+g);return{date:b.getMonth()===a?b.getDate():0,day:b.toLocaleString("en",{weekday:"long"})}})})}let n=[];for(let a=0;a<12;a++)n.push(e(a,t));return n}function aP(t){const e=t.map(a=>new Date(a));return new Date(Math.min(...e.map(a=>a.getTime())))}const oP={class:"doughnut-wrapper"},rP={class:"doughnut-wrapper__total"},iP={class:"doughnut-wrapper__total__value"},sP=r.createElementVNode("div",{class:"doughnut-wrapper__total__label"},"Total positions",-1),lP={__name:"DoughnutChart",props:{total:{type:Number,required:!0},data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"transparent"},isMask:{type:Boolean,default:!1}},setup(t){ar.register(KL,ku,s6);const e=r.ref(0),n=t,a=r.ref({cutout:75,spacing:2,responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},plugins:{tooltip:{enabled:!1,position:"nearest",external:i},legend:!1}});function o(s,l){let d=document.querySelector(`#${s}-${n.dataType}`);return d||(d=document.createElement("div"),d.classList.add(s),d.setAttribute("id",`${s}-${n.dataType}`),l.canvas.parentNode.appendChild(d)),d}function i(s){const{chart:l,tooltip:d}=s,c=o("chart-tooltip",l);if(d.opacity===0){c.style.opacity="0";return}if(d.body){const g=d.title||[],b=d.body.map($=>$.lines),w=g[0],y=b[0],k=n.data.labels.findIndex($=>$===w),v=n.data.datasets[0].backgroundColor[k],M=n.data.totals[k],C=document.createElement("div");for(C.classList.add("chart-tooltip-info"),C.innerHTML=`<div class="chart-tooltip-info__top">
44
44
  <div class="chart-tooltip-info__dot" style="background-color: ${v}"></div>
45
45
  <div class="chart-tooltip-info__pair">${w}</div>
46
46
  </div>