diff --git a/README.md b/README.md
index 1af1092cf..6515ad52d 100644
--- a/README.md
+++ b/README.md
@@ -70,21 +70,13 @@ In contrast, existing alternatives tend to be either [very costly](https://studi
- [`brk_store`](https://crates.io/crates/brk_store): A thin wrapper around [`fjall`](https://crates.io/crates/fjall)
- [`brk_vec`](https://crates.io/crates/brk_vec): A push-only, truncable, compressable, saveable Vec
-## Acknowledgments
-
-Deepest gratitude to the [Open Sats](https://opensats.org/) public charity. Their grant — from December 2024 to the present — has been critical in sustaining this project.
-
-Heartfelt thanks go out to every donor on [Nostr](https://primal.net/p/npub1jagmm3x39lmwfnrtvxcs9ac7g300y3dusv9lgzhk2e4x5frpxlrqa73v44) and [Geyser.fund](https://geyser.fund/project/brk) whose support has ensured the availability of the [kibo.money](https://kibo.money) public instance.
-
## Hosting as a service
-*Soon™*
-
If you'd like to have your own instance hosted for you please contact [hosting@bitcoinresearchkit.org](mailto:hosting@bitcoinresearchkit.org).
- 2 separate dedicated servers (1 GB/s each) with different ISPs and Cloudflare integration for enhanced performance and optimal availability
- 99.99% SLA
-- Configurated for speed (`raw + eager`)
+- Configurated for speed
- Updates delivered at your convenience
- Direct communication for feature requests and support
- Bitcoin Core or Knots with desired version
@@ -93,6 +85,12 @@ If you'd like to have your own instance hosted for you please contact [hosting@b
Pricing: `0.01 BTC / month` *or* `0.1 BTC / year`
+## Acknowledgments
+
+Deepest gratitude to the [Open Sats](https://opensats.org/) public charity. Their grant — from December 2024 to the present — has been critical in sustaining this project.
+
+Heartfelt thanks go out to every donor on [Nostr](https://primal.net/p/npub1jagmm3x39lmwfnrtvxcs9ac7g300y3dusv9lgzhk2e4x5frpxlrqa73v44) and [Geyser.fund](https://geyser.fund/project/brk) whose support has ensured the availability of the [kibo.money](https://kibo.money) public instance.
+
## Donate
[`bc1q09 8zsm89 m7kgyz e338vf ejhpdt 92ua9p 3peuve`](bitcoin:bc1q098zsm89m7kgyze338vfejhpdt92ua9p3peuve)
diff --git a/websites/default/index.html b/websites/default/index.html
index f99617143..5c7f2cd0a 100644
--- a/websites/default/index.html
+++ b/websites/default/index.html
@@ -1,4 +1,4 @@
-
+
@@ -649,17 +649,9 @@
height: 100%;
display: flex;
flex-direction: column;
- gap: 2rem;
padding-bottom: var(--bottom-area);
}
- nav {
- header {
- display: flex;
- justify-content: center;
- }
- }
-
sup {
opacity: 0.5;
margin-left: 0.25rem;
@@ -728,6 +720,7 @@
*/
.tree {
+ margin-top: -0.125rem;
user-select: none;
-webkit-user-select: none;
@@ -800,14 +793,6 @@
}
}
- search {
- ul {
- display: flex;
- flex-direction: column;
- gap: 1rem;
- }
- }
-
#share-div {
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
@@ -848,16 +833,12 @@
}
search {
- > #search-no-input-text {
- color: var(--off-color);
+ gap: 1rem;
- &:has(+ ul li) {
- display: none;
- }
-
- > button {
- color: var(--color);
- }
+ ul {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
}
}
@@ -1133,7 +1114,7 @@
// @ts-check
const preferredColorSchemeMatchMedia = window.matchMedia(
- "(prefers-color-scheme: dark)",
+ "(prefers-color-scheme: dark)"
);
const themeColor = window.document.createElement("meta");
@@ -1143,7 +1124,7 @@
/** @param {boolean} dark */
function updateThemeColor(dark) {
const backgroundColor = getComputedStyle(
- window.document.documentElement,
+ window.document.documentElement
).getPropertyValue(dark ? "--black" : "--white");
themeColor.content = backgroundColor;
}
@@ -1153,7 +1134,7 @@
"change",
({ matches }) => {
updateThemeColor(matches);
- },
+ }
);
if ("standalone" in window.navigator && !!window.navigator.standalone) {
diff --git a/websites/default/jsconfig.json b/websites/default/jsconfig.json
index 354a94ecf..0866cbfda 100644
--- a/websites/default/jsconfig.json
+++ b/websites/default/jsconfig.json
@@ -3,7 +3,8 @@
"checkJs": true,
"strict": true,
"target": "ESNext",
- "module": "ESNext"
+ "module": "ESNext",
+ "skipLibCheck": true
},
"exclude": ["assets", "packages", "ignore"]
}
diff --git a/websites/default/packages/lean-qr/v2.3.4/script.js b/websites/default/packages/lean-qr/v2.3.4/script.js
deleted file mode 100644
index 898deb8cd..000000000
--- a/websites/default/packages/lean-qr/v2.3.4/script.js
+++ /dev/null
@@ -1,2 +0,0 @@
-// @ts-nocheck
-const t=[.2,3/8,5/9,2/3],o=(o,e)=>r=>{const n=4*o+r-4,s="*-04-39?2$%%$%%'$%''%'''%')(%'))%(++'(++'(+.'+-.',/3',33)-/5)-43).36)058*18<+37<+4:<,4:E,5C/8@F/:EH/8?s:1,c=e/f|0,i=e%f,l=f-i,a=n>8?c*t[r]+(o>5)&-2:s,u=c-a;return{t:8*(l*u+i*(u+1)),o:i?[[l,u],[i,u+1]]:[[l,u]],i:a}},e={min:0,L:0,M:1,Q:2,H:3,max:3},r=t=>new Uint8Array(t),n=t=>{const o=new Error(`lean-qr error ${t}`);throw o.code=t,o},s=t=>"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".indexOf(t),f=t=>t.charCodeAt(0),c=(...t)=>(o,e)=>t.forEach((t=>t(o,e))),i=t=>o=>{o.eci!==t&&(o.push(7,4),o.push(t,8),o.eci=t)},l=t=>(o,e)=>{o.push(4,4),o.push(t.length,8+8*(e>9)),t.forEach((t=>o.push(t,8)))},a=(t,o,e,r,n=((t,o)=>e(t.length,o)),s=(r?o=>c(i(r),t(o)):t))=>(s.test=o,s.l=e,s.est=n,s.eci=r&&[r],s),u=a((t=>(o,e)=>{o.push(1,4),o.push(t.length,10+2*(e>26)+2*(e>9));let r=0;for(;r14+2*(o>26)+2*(o>9)+10*t/3)),_=a((t=>(o,e)=>{o.push(2,4),o.push(t.length,9+2*(e>26)+2*(e>9));let r=0;for(;rs(t)>=0),((t,o)=>13+2*(o>26)+2*(o>9)+5.5*t)),d=a((t=>l([...t].map(f))),(t=>f(t)<128),((t,o)=>12+8*(o>9)+8*t));d.u=!0;const m=a(d,(t=>f(t)<256),d.l,3);m.u=!0;const p=new TextEncoder,h=a((t=>l(p.encode(t))),(()=>1),0,26,((t,o)=>12+8*(o>9)+8*p.encode(t).length));h.u=!0;let w=()=>{const t=new Map,o=new TextDecoder("sjis"),e=r(2);for(let r=0;r<7973;++r)e[0]=r/192+129+64*(r>5951),e[1]=r%192+64,t.set(o.decode(e),r);return t.delete("\ufffd"),w=()=>t,t};const g=a((t=>(o,e)=>{o.push(8,4),o.push(t.length,8+2*(e>26)+2*(e>9));for(const e of t)o.push(w().get(e),13)}),(t=>w().has(t)),((t,o)=>12+2*(o>26)+2*(o>9)+13*t));g.u=!0;const y=[u,_,d,m,g,h],x={auto:(t,{modes:o=y}={})=>(e,r)=>{let s=1;for(const e of o){const o=new Map;e._=s<<=1,e.m=e.est("",r),e.h=e.l?(t,n)=>{const s=n-t,f=o.get(s)??e.l(s,r);return o.set(s,f),f}:(n,s)=>{const f=t.slice(n,s),c=o.get(f)??e.est(f,r);return o.set(f,c),c}}let f=[{S:0}],c=0,i=0,l=-1;for(const e of[...t,""]){let t=0;if(e)for(const r of o)r.test(e)&&(t|=r._);if(!e||t!==l){if(-1!==l){const t=new Set(f.map((t=>t.v))),e=[];for(const r of o.filter((t=>l&t._))){const o=r.h(c,i);for(const n of r.eci??t){if(r===d&&n)continue;let t;for(const e of f)if(e.v===n||r.eci){const s=e.C===r&&e.v===n,f=s?e.D:e,l=s?e.V:c;let a;a=r.u&&s?e.S+o-r.m:f.S+12*(f.v!==n)+(l===c?o:r.h(l,i)),(!t||ao.St(e,r)))},multi:c,eci:i,numeric:u,alphaNumeric:_,bytes:l,ascii:d,iso8859_1:m,shift_jis:g,utf8:h},z=()=>({A:r(2956),F:0,push(t,o){for(let e=o,r=8-(7&this.F);e>0;e-=r,r=8)this.A[this.F>>3]|=t<>e,this.F+=e({size:t,I:e,get:(o,r)=>o>=0&&o!(1&(t^o)),(t,o)=>!(1&o),t=>!(t%3),(t,o)=>!((t+o)%3),(t,o)=>!(1&(t/3^o>>1)),(t,o)=>!((t&o&1)+t*o%3),(t,o)=>!((t&o&1)+t*o%3&1),(t,o)=>!((1&(t^o))+t*o%3&1)],S=r(512);S[0]=1;for(let t=0,o=1;t<255;S[++t]=o)S[o+256]=t,o*=2,256&o&&(o^=285);const v=t=>S[t%255],C=t=>S[t+256],D=(t,o)=>{const e=r(t.length+o.length-1);for(let r=0;r{const e=r(t.length+o.length-1);e.set(t,0);for(let r=0;r{const e=[[],[]];let n=0,s=0;for(const[r,f]of o.o)for(let c=0;c{let r=t<>=1)r&t&&(r^=o*(t>>e-1));return r},A=({size:t,I:o,K:e},r)=>{const n=(e,r,n,s,f)=>{for(;s-- >0;){const c=(r+s)*t+e;o.fill(f,c,c+n)}},s=(t,o)=>{n(t-3,o-3,7,7,3),n(t-2,o-2,5,5,2),n(t-1,o-1,3,3,3)},f=(t,o)=>{n(t-2,o-2,5,5,3),n(t-1,o-1,3,3,2),e(t,o,3)};n(7,0,2,9,2),n(t-8,0,8,9,2);for(let o=0;o1){const o=1+(r/7|0),e=2*((t-13)/o/2+.75|0);for(let r=0;r6)for(let o=r<<12|b(r,7973,13),n=0;n<6;++n)for(let r=12;r-- >9;o>>=1)e(t-r,n,2|1&o);for(let e=0;e{const e=[];for(let r=t-2,n=t,s=-1;r>=0;r-=2){for(5===r&&(r=4);n+=s,-1!==n&&n!==t;){const s=n*t+r;o[s+1]<2&&e.push(s+1),o[s]<2&&e.push(s)}s*=-1}return e},H=({I:t},o,e)=>o.forEach(((o,r)=>t[o]=e[r>>3]>>7-(7&r)&1)),I=({size:t,I:o,K:e},r,n,s)=>{for(let e=0;e>1^1)}const f=(1^s)<<3|n;let c=21522^(f<<10|b(f,1335,11));for(let o=8;o-- >0;c>>=1)e(8,(o>1?7:8)-o,c),e(t-8+o,8,c);for(let o=7;o-- >0;c>>=1)e(o>5?7:o,8,c),e(8,t-o-1,c)},K=({size:t,I:o},e=0,r=0)=>{for(let n=0;n>1|2098176)&(3047517^a-1),2049&i&&(e+=40),a!==f?(l=1,f=a):++l>4&&(e+=l<6?3:1)}if(n)for(let r=1,s=1&o[n-1],f=(1&o[n])===s;r{s>3);if(c(r).t=r;--t){const o=c(t);if(o.t{const n=E(e.size,e.I);return I(n,o,i??r,t),n.s=K(n),n})).reduce(((t,o)=>o.s(o,e)=>P(o,{modes:[...y,...t],...e});export{e as correction,P as generate,x as mode};
\ No newline at end of file
diff --git a/websites/default/packages/lean-qr/v2.3.4/types.d.ts b/websites/default/packages/lean-qr/v2.3.4/types.d.ts
deleted file mode 100644
index 7368f9168..000000000
--- a/websites/default/packages/lean-qr/v2.3.4/types.d.ts
+++ /dev/null
@@ -1,241 +0,0 @@
-declare module "lean-qr" {
- interface ImageDataLike {
- readonly data: Uint8ClampedArray;
- }
-
- interface Context2DLike {
- createImageData(width: number, height: number): DataT;
- putImageData(data: DataT, x: number, y: number): void;
- }
-
- interface CanvasLike {
- width: number;
- height: number;
- getContext(type: "2d"): Context2DLike | null;
- }
-
- export type RGBA = readonly [number, number, number, number?];
-
- export interface Bitmap1D {
- push(value: number, bits: number): void;
- }
-
- export interface StringOptions {
- on?: string;
- off?: string;
- lf?: string;
- padX?: number;
- padY?: number;
- }
-
- export interface ImageDataOptions {
- on?: RGBA;
- off?: RGBA;
- padX?: number;
- padY?: number;
- }
-
- export interface Bitmap2D {
- readonly size: number;
-
- get(x: number, y: number): boolean;
-
- toString(options?: Readonly): string;
-
- toImageData(
- context: Context2DLike,
- options?: Readonly,
- ): DataT;
-
- toDataURL(
- options?: Readonly<
- ImageDataOptions & {
- type?: `image/${string}`;
- scale?: number;
- }
- >,
- ): string;
-
- toCanvas(
- canvas: CanvasLike,
- options?: Readonly,
- ): void;
- }
-
- export type Mask = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
- export type Mode = (data: Bitmap1D, version: number) => void;
- export interface ModeFactory {
- (value: string): Mode;
- test(string: string): boolean;
- est(value: string, version: number): number;
- eci?: number;
- }
-
- interface ModeAutoOptions {
- modes?: ReadonlyArray;
- }
-
- export const mode: Readonly<{
- auto(value: string, options?: Readonly): Mode;
- multi(...modes: ReadonlyArray): Mode;
- eci(id: number): Mode;
- numeric: ModeFactory;
- alphaNumeric: ModeFactory;
- bytes(data: Uint8Array | ReadonlyArray): Mode;
- ascii: ModeFactory;
- iso8859_1: ModeFactory;
- shift_jis: ModeFactory;
- utf8: ModeFactory;
- }>;
-
- type Correction = number & { readonly _: unique symbol };
- export const correction: Readonly<{
- min: Correction;
- L: Correction;
- M: Correction;
- Q: Correction;
- H: Correction;
- max: Correction;
- }>;
-
- export interface GenerateOptions extends ModeAutoOptions {
- minCorrectionLevel?: Correction;
- maxCorrectionLevel?: Correction;
- minVersion?: number;
- maxVersion?: number;
- mask?: null | Mask;
- trailer?: number;
- }
-
- export type GenerateFn = (
- data: Mode | string,
- options?: Readonly,
- ) => Bitmap2D;
- interface Generate extends GenerateFn {
- with(...modes: ReadonlyArray): GenerateFn;
- }
- export const generate: Generate;
-}
-
-declare module "lean-qr/extras/svg" {
- import type { Bitmap2D } from "lean-qr";
-
- export interface SVGOptions {
- on?: string;
- off?: string;
- padX?: number;
- padY?: number;
- width?: number | null;
- height?: number | null;
- scale?: number;
- }
-
- export const toSvgPath: (code: Bitmap2D) => string;
-
- export const toSvg: (
- code: Bitmap2D,
- target: Document | SVGElement,
- options?: Readonly,
- ) => SVGElement;
-
- export const toSvgSource: (
- code: Bitmap2D,
- options?: Readonly,
- ) => string;
-
- export type toSvgDataURLFn = (
- code: Bitmap2D,
- options?: Readonly,
- ) => string;
- export const toSvgDataURL: toSvgDataURLFn;
-}
-
-declare module "lean-qr/extras/node_export" {
- import type { RGBA, Bitmap2D } from "lean-qr";
-
- export interface PNGOptions {
- on?: RGBA;
- off?: RGBA;
- padX?: number;
- padY?: number;
- scale?: number;
- }
-
- export const toPngBuffer: (
- code: Bitmap2D,
- options?: Readonly,
- ) => Uint8Array;
-
- export const toPngDataURL: (
- code: Bitmap2D,
- options?: Readonly,
- ) => string;
-}
-
-declare module "lean-qr/extras/react" {
- import type { ImageDataOptions, GenerateOptions, GenerateFn } from "lean-qr";
- import type { SVGOptions, toSvgDataURLFn } from "lean-qr/extras/svg";
-
- export interface AsyncFramework {
- createElement: (
- type: "canvas",
- props: {
- ref: any;
- style: { imageRendering: "pixelated" };
- className: string;
- },
- ) => T;
- useRef(initialValue: T | null): { readonly current: T | null };
- useEffect(fn: () => void | (() => void), deps: unknown[]): void;
- }
-
- interface QRComponentProps {
- content: string;
- className?: string;
- }
-
- export interface AsyncQRComponentProps
- extends ImageDataOptions,
- GenerateOptions,
- QRComponentProps {}
-
- export type AsyncQRComponent = (
- props: Readonly,
- ) => T;
-
- export const makeAsyncComponent: (
- framework: Readonly>,
- generate: GenerateFn,
- defaultProps?: Readonly>,
- ) => AsyncQRComponent;
-
- export interface SyncFramework {
- createElement: (
- type: "img",
- props: {
- src: string;
- style: { imageRendering: "pixelated" };
- className: string;
- },
- ) => T;
- useMemo(fn: () => T, deps: unknown[]): T;
- }
-
- export interface SyncQRComponentProps
- extends SVGOptions,
- GenerateOptions,
- QRComponentProps {}
-
- export type SyncQRComponent = (props: Readonly) => T;
-
- export const makeSyncComponent: (
- framework: Readonly>,
- generate: GenerateFn,
- toSvgDataURL: toSvgDataURLFn,
- defaultProps?: Readonly>,
- ) => SyncQRComponent;
-}
-
-declare module "lean-qr/extras/errors" {
- export const readError: (error: unknown) => string;
-}
diff --git a/websites/default/packages/lean-qr/v2.5.0/script.js b/websites/default/packages/lean-qr/v2.5.0/script.js
new file mode 100644
index 000000000..973746454
--- /dev/null
+++ b/websites/default/packages/lean-qr/v2.5.0/script.js
@@ -0,0 +1,3 @@
+// @ts-nocheck
+
+const t=[.2,3/8,5/9,2/3],o=(o,e)=>r=>{const n=4*o+r-4,s="*-04-39?2$%%$%%'$%''%'''%')(%'))%(++'(++'(+.'+-.',/3',33)-/5)-43).36)058*18<+37<+4:<,4:E,5C/8@F/:EH/8?s:1,c=e/f|0,i=e%f,l=f-i,a=n>8?c*t[r]+(o>5)&-2:s,_=c-a;return{t:l*_+i*_+i,o:[[l,_],[i,_+1]],i:a}},e={min:0,L:0,M:1,Q:2,H:3,max:3},r=t=>new Uint8Array(t),n=t=>{const o=new Error(`lean-qr error ${t}`);throw o.code=t,o},s=t=>"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".indexOf(t),f=t=>t.charCodeAt(0),c=(...t)=>(o,e)=>t.forEach((t=>t(o,e))),i=t=>o=>{o.eci!==t&&(o.push(7,4),o.push(t,8),o.eci=t)},l=t=>(o,e)=>{o.push(4,4),o.push(t.length,8+8*(e>9)),t.forEach((t=>o.push(t,8)))},a=(t,o,e,r,n=(t,o)=>e(t.length,o),s=(r?o=>c(i(r),t(o)):t))=>(s.test=o,s.l=e,s.est=n,s.eci=r&&[r],s),_=a((t=>(o,e)=>{o.push(1,4),o.push(t.length,10+2*(e>26)+2*(e>9));let r=0;for(;r/[0-9]/.test(t)),((t,o)=>14+2*(o>26)+2*(o>9)+10*t/3)),u=a((t=>(o,e)=>{o.push(2,4),o.push(t.length,9+2*(e>26)+2*(e>9));let r=0;for(;rs(t)>=0),((t,o)=>13+2*(o>26)+2*(o>9)+5.5*t)),d=a((t=>l([...t].map(f))),(t=>f(t)<128),((t,o)=>12+8*(o>9)+8*t));d._=!0,d.u=!0;const p=a(d,(t=>f(t)<256),d.l,3);p._=!0;const m=new TextEncoder,h=a((t=>l(m.encode(t))),(()=>1),0,26,((t,o)=>12+8*(o>9)+8*m.encode(t).length));h._=!0;let w=()=>{const t=new Map,o=new TextDecoder("sjis"),e=r(2);for(let r=0;r<7973;++r)e[0]=r/192+129+64*(r>5951),e[1]=r%192+64,t.set(o.decode(e),r);return t.delete("\ufffd"),w=()=>t,t};const y=a((t=>(o,e)=>{o.push(8,4),o.push(t.length,8+2*(e>26)+2*(e>9));for(const e of t)o.push(w().get(e),13)}),(t=>w().has(t)),((t,o)=>12+2*(o>26)+2*(o>9)+13*t));y._=!0;const g=[_,u,d,p,y,h],b={auto:(t,{modes:o=g}={})=>(e,r)=>{const s=o.map(((o,e)=>{const n=new Map,s=(t,o)=>(n.has(t)||n.set(t,o(t,r)),n.get(t));return{m:o,h:1<s(e-t,o.l):(e,r)=>s(t.slice(e,r),o.est)}}));let f=[{v:0}],c=0,i=0,l=-1;for(const o of[...t,""]){let t=0;if(o)for(const e of s)e.m.test(o)&&(t|=e.h);if(!o||t!==l){if(-1!==l){const t=new Set(f.map((t=>t.D))),o=[];for(const{m:e,C:r,S:n,h:a}of s)if(l&a){const s=n(c,i);for(const l of e.eci??t)if(!e.u||!l){let t;for(const o of f)if(o.D===l||e.eci){const f=o.m===e&&o.D===l,a=f?o.V:o,_=e._&&f?o.v+s-r:a.v+12*(a.D!==l)+(f?n(f?o.$:c,i):s);(!t||_o.vt(e,r)))},multi:c,eci:i,bytes:l,numeric:_,alphaNumeric:u,ascii:d,iso8859_1:p,shift_jis:y,utf8:h},C=()=>({F:r(2956),I:0,push(t,o){for(let e=o,r=8-(7&this.I);e>0;e-=r,r=8)this.F[this.I>>3]|=t<>e,this.I+=e({size:t,K:e,get:(o,r)=>o>=0&&o!(1&(t^o)),(t,o)=>!(1&o),t=>!(t%3),(t,o)=>!((t+o)%3),(t,o)=>!(1&(t/3^o>>1)),(t,o)=>!((t&o&1)+t*o%3),(t,o)=>!((t&o&1)+t*o%3&1),(t,o)=>!((1&(t^o))+t*o%3&1)],E=r(511);for(let t=0,o=1;t<255;o=2*o^285*(o>127))E[E[o+255]=t++]=o;const M=t=>E[t%255],S=t=>E[t+255],v=(t,o)=>{const e=r(t.length+o.length-1);for(let r=0;r{const e=r(t.length+o.length-1);e.set(t,0);for(let r=0;r{const e=[[],[]];let n=0,s=0;for(const[r,f]of o.o)for(let c=0;c{let r=t<<=e;for(let t=134217728;t>>=1;)r&t&&(r^=o*(t>>e));return r|t},A=({size:t,K:o},e)=>{const r=(e,r,n,s)=>{for(;n-- >0;e+=t)o.fill(s,e,e+r)},n=(o,e,n)=>{for(let s=0;s++<3;n-=2)r(e*t+o-(n>>1)*(t+1),n,n,2|s)},s=2*((t-13)/(1+(e/7|0))/2+.75|0);if(e>1)for(let o=t-7;o>8;o-=s){for(let t=o;t>8;t-=s)n(o,t,5);o6)for(let r=$(e,7973,12),n=1;n<7;++n)for(let e=12;e-- >9;r>>=1)o[n*t-e]=2|1&r;r(7,2,9,2),r(t-8,8,9,2);for(let e=0;e{const e=[];for(let r=t-2,n=t,s=-1;r>=0;r-=2){for(5===r&&(r=4);n+=s,-1!==n&&n!==t;){const s=n*t+r;o[s+1]||e.push(s+1),o[s]||e.push(s)}s*=-1}return e},H=({K:t},o,e)=>o.forEach(((o,r)=>t[o]=e[r>>3]>>(7&~r)&1)),I=({size:t,K:o},e,r,n)=>{for(let r=0;r>1^1)}let s=21522^$((1^n)<<3|r,1335,10);for(let e=0;e++<8;s>>=1)o[(e-(e<7))*t+8]=1&s,o[9*t-e]=1&s;for(let e=8;--e,s;s>>=1)o[8*t+e-(e<7)]=1&s,o[(t-e)*t+8]=1&s},K=({size:t,K:o},e=0,r=0)=>{for(let n=0;n>1|2098176)&(3047517^a-1),2049&i&&(e+=40),a!==f&&(l=0),f=a,e+=5===++l?3:l>5}if(n)for(let r=t+n,s=5*o[n-1]^o[n];r{r>3);if(8*f(e).t=e;--t){const o=f(t);if(8*o.t{const n=x(e.size,e.K);return I(n,o,c??r,t),n.s=K(n),n})).reduce(((t,o)=>o.s(o,e)=>P(o,{modes:[...g,...t],...e});export{e as correction,P as generate,b as mode};
\ No newline at end of file
diff --git a/websites/default/packages/lean-qr/v2.5.0/types.d.ts b/websites/default/packages/lean-qr/v2.5.0/types.d.ts
new file mode 100644
index 000000000..d7b750972
--- /dev/null
+++ b/websites/default/packages/lean-qr/v2.5.0/types.d.ts
@@ -0,0 +1,491 @@
+declare module "lean-qr" {
+ interface ImageDataLike {
+ readonly data: Uint8ClampedArray;
+ }
+
+ interface Context2DLike {
+ createImageData(width: number, height: number): DataT;
+ putImageData(data: DataT, x: number, y: number): void;
+ }
+
+ interface CanvasLike {
+ width: number;
+ height: number;
+ getContext(type: "2d"): Context2DLike | null;
+ }
+
+ /**
+ * A colour in `[red, green, blue, alpha]` format (all values from 0 to 255).
+ * If alpha is omitted, it is assumed to be 255 (opaque).
+ */
+ export type RGBA = readonly [number, number, number, number?];
+
+ export interface Bitmap1D {
+ /**
+ * Appends a sequence of bits.
+ *
+ * @param value an integer containing the bits to append (big endian).
+ * @param bits the number of bits to read from `value`. Must be between 1 and 24.
+ */
+ push(value: number, bits: number): void;
+ }
+
+ export interface StringOptions {
+ /** the text to use for modules which are 'on' (typically black) */
+ on?: string;
+
+ /** the text to use for modules which are 'off' (typically white) */
+ off?: string;
+
+ /** the text to use for linefeeds between rows */
+ lf?: string;
+
+ /** the padding to apply on the left and right of the output (populated with 'off' modules) */
+ padX?: number;
+
+ /** the padding to apply on the top and bottom of the output (populated with 'off' modules) */
+ padY?: number;
+ }
+
+ export interface ImageDataOptions {
+ /** the colour to use for modules which are 'on' (typically black) */
+ on?: RGBA;
+
+ /** the colour to use for modules which are 'off' (typically white) */
+ off?: RGBA;
+
+ /** the padding to apply on the left and right of the output (filled with 'off') */
+ padX?: number;
+
+ /** the padding to apply on the top and bottom of the output (filled with 'off') */
+ padY?: number;
+ }
+
+ export interface Bitmap2D {
+ /** the width / height of the QR code in modules (excluding any padding) */
+ readonly size: number;
+
+ /**
+ * Read the state of a module from the QR code.
+ *
+ * @param x the x coordinate to read. Can be negative / out of bounds.
+ * @param y the y coordinate to read. Can be negative / out of bounds.
+ * @returns true if the requested module is set (i.e. typically black)
+ */
+ get(x: number, y: number): boolean;
+
+ /**
+ * Generate a string containing the QR code, suitable for displaying in a
+ * terminal environment. Generally, you should customise on and off to use
+ * the ANSI escapes of your target terminal for better rendering.
+ *
+ * @param options optional configuration for the display.
+ */
+ toString(options?: Readonly): string;
+
+ /**
+ * Generate image data containing the QR code, at a scale of 1 pixel per
+ * module. Use this if you need more control than toCanvas allows.
+ *
+ * @param context a context to use for creating the image data.
+ * @param options optional configuration for the display.
+ */
+ toImageData(
+ context: Context2DLike,
+ options?: Readonly
+ ): DataT;
+
+ /**
+ * Generate a `data:image/*` URL for the QR code.
+ *
+ * @param options optional configuration for the output.
+ * @returns a string suitable for use as the `src` of an `img` tag.
+ */
+ toDataURL(
+ options?: Readonly<
+ ImageDataOptions & {
+ type?: `image/${string}`;
+ scale?: number;
+ }
+ >
+ ): string;
+
+ /**
+ * Populate a given canvas with the QR code, at a scale of 1 pixel per
+ * module. Set image-rendering: pixelated and scale the canvas using CSS
+ * for a large image. Automatically resizes the canvas to fit the QR code
+ * if necessary.
+ *
+ * @param canvas the canvas to populate.
+ * @param options optional configuration for the display.
+ */
+ toCanvas(
+ canvas: CanvasLike,
+ options?: Readonly
+ ): void;
+ }
+
+ export type Mask = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
+ export type Mode = (data: Bitmap1D, version: number) => void;
+ export interface ModeFactory {
+ (value: string): Mode;
+ /** a function which returns true when given a character which the current mode can represent */
+ test(string: string): boolean;
+ /** a function which returns an estimate of the number of bits required to encode a given value */
+ est(value: string, version: number): number;
+ /** an optional ECI which must be active for this mode to be interpreted correctly by a reader */
+ eci?: number;
+ }
+
+ interface ModeAutoOptions {
+ /** a list of modes which can be considered when encoding a message */
+ modes?: ReadonlyArray;
+ }
+
+ export const mode: Readonly<{
+ /** automatically picks the most optimal combination of modes for the requested message */
+ auto(value: string, options?: Readonly): Mode;
+ /** concatenates multiple modes together */
+ multi(...modes: ReadonlyArray): Mode;
+ /** sets the Extended Channel Interpretation for the message from this point onwards */
+ eci(id: number): Mode;
+ /** supports `0-9` and stores 3 characters per 10 bits */
+ numeric: ModeFactory;
+ /** supports `0-9A-Z $%*+-./:` and stores 2 characters per 11 bits */
+ alphaNumeric: ModeFactory;
+ /** arbitrary byte data, typically combined with `eci` */
+ bytes(data: Uint8Array | ReadonlyArray): Mode;
+ /** supports 7-bit ASCII and stores 1 character per 8 bits with no ECI */
+ ascii: ModeFactory;
+ /** supports 8-bit ISO-8859-1 and stores 1 character per 8 bits with ECI 3 */
+ iso8859_1: ModeFactory;
+ /** supports double-byte Shift-JIS characters stores 1 character per 13 bits */
+ shift_jis: ModeFactory;
+ /** supports variable length UTF-8 with ECI 26 */
+ utf8: ModeFactory;
+ }>;
+
+ export type Correction = number & { readonly _: unique symbol };
+ export const correction: Readonly<{
+ /** minimum possible correction level (same as L) */
+ min: Correction;
+ /** ~7.5% error tolerance, ~25% data overhead */
+ L: Correction;
+ /** ~15% error tolerance, ~60% data overhead */
+ M: Correction;
+ /** ~22.5% error tolerance, ~120% data overhead */
+ Q: Correction;
+ /** ~30% error tolerance, ~190% data overhead */
+ H: Correction;
+ /** maximum possible correction level (same as H) */
+ max: Correction;
+ }>;
+
+ export interface GenerateOptions extends ModeAutoOptions {
+ /** the minimum correction level to use (higher levels may still be used if the chosen version has space) */
+ minCorrectionLevel?: Correction;
+ /** the maximum correction level to use */
+ maxCorrectionLevel?: Correction;
+ /** the minimum version (size) of code to generate (must be between 1 and 40) */
+ minVersion?: number;
+ /** the maximum version (size) of code to generate (must be between 1 and 40) */
+ maxVersion?: number;
+ /** a mask to use on the QR code (should be left as `null` for ISO compliance but may be changed for artistic effect) */
+ mask?: null | Mask;
+ /** padding bits to use for extra space in the QR code (should be left as the default for ISO compliance but may be changed for artistic effect) */
+ trailer?: number;
+ }
+
+ /**
+ * Generate a QR code.
+ *
+ * @param data either a string, or a pre-encoded mode.
+ * @param options optional configuration for the QR code.
+ * @returns the requested QR code.
+ */
+ export type GenerateFn = (
+ data: Mode | string,
+ options?: Readonly
+ ) => Bitmap2D;
+ interface Generate extends GenerateFn {
+ /**
+ * Creates a scoped `generate` function which considers additional modes
+ * when using auto encoding.
+ *
+ * @param modes the modes to add.
+ * @returns a `generate` function which will additionally consider the
+ * given modes when using auto encoding.
+ */
+ with(...modes: ReadonlyArray): GenerateFn;
+ }
+ export const generate: Generate;
+}
+
+declare module "lean-qr/nano" {
+ import type {
+ Correction,
+ Bitmap2D as FullBitmap2D,
+ GenerateOptions as FullGenerateOptions,
+ } from "lean-qr";
+ import { correction as fullCorrection } from "lean-qr";
+
+ export type { Correction };
+
+ export const correction: Pick;
+
+ export type Bitmap2D = Pick;
+
+ export type GenerateOptions = Pick<
+ FullGenerateOptions,
+ "minCorrectionLevel" | "minVersion"
+ >;
+
+ /**
+ * Generate a QR code.
+ *
+ * @param data either a string, or a pre-encoded mode.
+ * @param options optional configuration for the QR code.
+ * @returns the requested QR code.
+ */
+ export function generate(
+ data: string,
+ options?: Readonly
+ ): Bitmap2D;
+}
+
+declare module "lean-qr/extras/svg" {
+ import type { Bitmap2D as FullBitmap2D } from "lean-qr";
+
+ type Bitmap2D = Pick;
+
+ export interface SVGOptions {
+ /** the colour to use for modules which are 'on' (typically black) */
+ on?: string;
+ /** the colour to use for modules which are 'off' (typically white) */
+ off?: string;
+ /** the padding to apply on the left and right of the output (filled with 'off') */
+ padX?: number;
+ /** the padding to apply on the top and bottom of the output (filled with 'off') */
+ padY?: number;
+ /** a width to apply to the resulting image (overrides `scale`) */
+ width?: number | null;
+ /** a height to apply to the resulting image (overrides `scale`) */
+ height?: number | null;
+ /** a scale to apply to the resulting image (`scale` pixels = 1 module) */
+ scale?: number;
+ }
+
+ /**
+ * Generate the raw outline of the QR code for use in an existing SVG.
+ *
+ * @param code the QR code to convert.
+ * @returns a string suitable for passing to the `d` attribute of a `path`.
+ */
+ export function toSvgPath(code: Bitmap2D): string;
+
+ /**
+ * Generate an SVG element which can be added to the DOM.
+ *
+ * @param code the QR code to convert.
+ * @param options optional configuration for the display.
+ * @returns an SVG element.
+ */
+ export function toSvg(
+ code: Bitmap2D,
+ target: Document | SVGElement,
+ options?: Readonly
+ ): SVGElement;
+
+ /**
+ * Generate an SVG document which can be exported to a file or served from a
+ * web server.
+ *
+ * @param code the QR code to convert.
+ * @param options optional configuration for the display.
+ * @returns an SVG document.
+ */
+ export function toSvgSource(
+ code: Bitmap2D,
+ options?: Readonly<
+ SVGOptions & {
+ /** `true` to include an XML declaration at the start of the source (for standalone documents which will not be embedded inside another document) */
+ xmlDeclaration?: boolean;
+ }
+ >
+ ): string;
+
+ /**
+ * Generate a `data:image/svg+xml` URL.
+ *
+ * @param code the QR code to convert.
+ * @param options optional configuration for the display.
+ * @returns a string suitable for use as the `src` of an `img` tag.
+ */
+ export function toSvgDataURL(
+ code: Bitmap2D,
+ options?: Readonly
+ ): string;
+}
+
+declare module "lean-qr/extras/node_export" {
+ import type { RGBA, Bitmap2D as FullBitmap2D } from "lean-qr";
+
+ type Bitmap2D = Pick;
+
+ export interface PNGOptions {
+ /** the colour to use for modules which are 'on' (typically black) */
+ on?: RGBA;
+ /** the colour to use for modules which are 'off' (typically white) */
+ off?: RGBA;
+ /** the padding to apply on the left and right of the output (filled with 'off') */
+ padX?: number;
+ /** the padding to apply on the top and bottom of the output (filled with 'off') */
+ padY?: number;
+ /** a scale to apply to the resulting image (`scale` pixels = 1 module) */
+ scale?: number;
+ }
+
+ /**
+ * Generate a PNG document which can be exported to a file or served from a
+ * web server.
+ *
+ * @param code the QR code to convert.
+ * @param options optional configuration for the display.
+ * @returns a PNG document.
+ */
+ export function toPngBuffer(
+ code: Bitmap2D,
+ options?: Readonly
+ ): Uint8Array;
+
+ /**
+ * Generate a `data:image/png` URL.
+ *
+ * @param code the QR code to convert.
+ * @param options optional configuration for the display.
+ * @returns a string suitable for use as the `src` of an `img` tag.
+ */
+ export function toPngDataURL(
+ code: Bitmap2D,
+ options?: Readonly
+ ): string;
+}
+
+declare module "lean-qr/extras/react" {
+ import type {
+ Bitmap2D as FullBitmap2D,
+ GenerateOptions,
+ ImageDataOptions,
+ } from "lean-qr";
+ import type {
+ SVGOptions,
+ toSvgDataURL as toSvgDataURLFn,
+ } from "lean-qr/extras/svg";
+
+ export interface AsyncFramework {
+ createElement: (
+ type: "canvas",
+ props: {
+ ref: any;
+ style: { imageRendering: "pixelated" };
+ className: string;
+ }
+ ) => T;
+ useRef(initialValue: T | null): { readonly current: T | null };
+ useEffect(fn: () => void | (() => void), deps: unknown[]): void;
+ }
+
+ interface QRComponentProps {
+ content: string;
+ className?: string;
+ }
+
+ export interface AsyncQRComponentProps
+ extends ImageDataOptions,
+ GenerateOptions,
+ QRComponentProps {}
+
+ export type AsyncQRComponent = (
+ props: Readonly
+ ) => T;
+
+ /**
+ * Generate an asynchronous QR component (rendering to a `canvas`).
+ * You should call this just once, in the global scope.
+ *
+ * This is not suitable for server-side rendering (use `makeSyncComponent`
+ * instead).
+ *
+ * @param framework the framework to use (e.g. `React`).
+ * @param generate the `generate` function to use
+ * (from `lean-qr` or `lean-qr/nano`).
+ * @param defaultProps optional default properties to apply when the
+ * component is used (overridden by properties set on use).
+ * @returns a component which can be rendered elsewhere.
+ */
+ export function makeAsyncComponent(
+ framework: Readonly>,
+ generate: (
+ data: string,
+ options?: Readonly
+ ) => Pick,
+ defaultProps?: Readonly>
+ ): AsyncQRComponent;
+
+ export interface SyncFramework {
+ createElement: (
+ type: "img",
+ props: {
+ src: string;
+ style: { imageRendering: "pixelated" };
+ className: string;
+ }
+ ) => T;
+ useMemo(fn: () => T, deps: unknown[]): T;
+ }
+
+ export interface SyncQRComponentProps
+ extends SVGOptions,
+ GenerateOptions,
+ QRComponentProps {}
+
+ export type SyncQRComponent = (props: Readonly) => T;
+
+ /**
+ * Generate a synchronous QR component (rendering to an SVG).
+ * You should call this just once, in the global scope.
+ *
+ * This is best suited for server-side rendering (prefer
+ * `makeAsyncComponent` if you only need client-side rendering).
+ *
+ * @param framework the framework to use (e.g. `React`).
+ * @param generate the `generate` function to use
+ * (from `lean-qr` or `lean-qr/nano`).
+ * @param toSvgDataURL the `toSvgDataURL` function to use
+ * (from `lean-qr/extras/svg`).
+ * @param defaultProps optional default properties to apply when the
+ * component is used (overridden by properties set on use).
+ * @returns a component which can be rendered elsewhere.
+ */
+ export function makeSyncComponent(
+ framework: Readonly>,
+ generate: (
+ data: string,
+ options?: Readonly
+ ) => Pick,
+ toSvgDataURL: typeof toSvgDataURLFn,
+ defaultProps?: Readonly>
+ ): SyncQRComponent;
+}
+
+declare module "lean-qr/extras/errors" {
+ /**
+ * Convert an error into a human-readable message. This is intended for use
+ * with Lean QR errors, but will return somewhat meaningful messages for
+ * other errors too.
+ *
+ * @param error the error to convert.
+ * @returns a human-readable message explaining the error.
+ */
+ export function readError(error: unknown): string;
+}
diff --git a/websites/default/packages/lightweight-charts/v5.0.6-treeshaked/script.js b/websites/default/packages/lightweight-charts/v5.0.6-treeshaked/script.js
deleted file mode 100644
index 9b6332013..000000000
--- a/websites/default/packages/lightweight-charts/v5.0.6-treeshaked/script.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// @ts-nocheck
-/*!
- * @license
- * TradingView Lightweight Charts™ v5.0.6-dev+202504261524
- * Copyright (c) 2025 TradingView, Inc.
- * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
- */
-const t={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var i,s;function n(t,i){const s={0:[],1:[t.lineWidth,t.lineWidth],2:[2*t.lineWidth,2*t.lineWidth],3:[6*t.lineWidth,6*t.lineWidth],4:[t.lineWidth,4*t.lineWidth]}[i];t.setLineDash(s)}function e(t,i,s,n){t.beginPath();const e=t.lineWidth%2?.5:0;t.moveTo(s,i+e),t.lineTo(n,i+e),t.stroke()}function r(t,i){if(!t)throw new Error("Assertion failed"+(i?": "+i:""))}function h(t){if(void 0===t)throw new Error("Value is undefined");return t}function l(t){if(null===t)throw new Error("Value is null");return t}function a(t){return l(h(t))}!function(t){t[t.Simple=0]="Simple",t[t.WithSteps=1]="WithSteps",t[t.Curved=2]="Curved"}(i||(i={})),function(t){t[t.Solid=0]="Solid",t[t.Dotted=1]="Dotted",t[t.Dashed=2]="Dashed",t[t.LargeDashed=3]="LargeDashed",t[t.SparseDotted=4]="SparseDotted"}(s||(s={}));class o{constructor(){this.t=[]}i(t,i,s){const n={h:t,l:i,o:!0===s};this.t.push(n)}_(t){const i=this.t.findIndex((i=>t===i.h));i>-1&&this.t.splice(i,1)}u(t){this.t=this.t.filter((i=>i.l!==t))}p(t,i,s){const n=[...this.t];this.t=this.t.filter((t=>!t.o)),n.forEach((n=>n.h(t,i,s)))}v(){return this.t.length>0}m(){this.t=[]}}function _(t,...i){for(const s of i)for(const i in s)void 0!==s[i]&&Object.prototype.hasOwnProperty.call(s,i)&&!["__proto__","constructor","prototype"].includes(i)&&("object"!=typeof s[i]||void 0===t[i]||Array.isArray(s[i])?t[i]=s[i]:_(t[i],s[i]));return t}function u(t){return"number"==typeof t&&isFinite(t)}function c(t){return"number"==typeof t&&t%1==0}function d(t){return"string"==typeof t}function f(t){return"boolean"==typeof t}function p(t){const i=t;if(!i||"object"!=typeof i)return i;let s,n,e;for(n in s=Array.isArray(i)?[]:{},i)i.hasOwnProperty(n)&&(e=i[n],s[n]=e&&"object"==typeof e?p(e):e);return s}function v(t){return null!==t}function m(t){return null===t?void 0:t}const w="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function g(t,i,s){return void 0===i&&(i=w),`${s=void 0!==s?`${s} `:""}${t}px ${i}`}class b{constructor(t){this.M={S:1,C:5,P:NaN,T:"",k:"",R:"",D:"",V:0,I:0,B:0,A:0,L:0},this.O=t}N(){const t=this.M,i=this.F(),s=this.W();return t.P===i&&t.k===s||(t.P=i,t.k=s,t.T=g(i,s),t.A=2.5/12*i,t.V=t.A,t.I=i/12*t.C,t.B=i/12*t.C,t.L=0),t.R=this.H(),t.D=this.$(),this.M}H(){return this.O.N().layout.textColor}$(){return this.O.U()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}}function M(t){return t<0?0:t>255?255:Math.round(t)||0}function S(t){return.199*t[0]+.687*t[1]+.114*t[2]}class x{constructor(t,i){this.j=new Map,this.Y=t,i&&(this.j=i)}X(t,i){if("transparent"===t)return t;const s=this.Z(t),n=s[3];return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${i*n})`}q(t){const i=this.Z(t);return{G:`rgb(${i[0]}, ${i[1]}, ${i[2]})`,K:S(i)>160?"black":"white"}}J(t){return S(this.Z(t))}tt(t,i,s){const[n,e,r,h]=this.Z(t),[l,a,o,_]=this.Z(i),u=[M(n+s*(l-n)),M(e+s*(a-e)),M(r+s*(o-r)),(c=h+s*(_-h),c<=0||c>1?Math.min(Math.max(c,0),1):Math.round(1e4*c)/1e4)];var c;return`rgba(${u[0]}, ${u[1]}, ${u[2]}, ${u[3]})`}Z(t){const i=this.j.get(t);if(i)return i;const s=function(t){const i=document.createElement("div");i.style.display="none",document.body.appendChild(i),i.style.color=t;const s=window.getComputedStyle(i).color;return document.body.removeChild(i),s}(t),n=s.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.Y.length)for(const i of this.Y){const s=i(t);if(s)return this.j.set(t,s),s}throw new Error(`Failed to parse color: ${t}`)}const e=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(t,e),e}}class C{constructor(){this.it=[]}st(t){this.it=t}nt(t,i,s){this.it.forEach((n=>{n.nt(t,i,s)}))}}class y{nt(t,i,s){t.useBitmapCoordinateSpace((t=>this.et(t,i,s)))}}class P extends y{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){if(null===this.rt||null===this.rt.lt)return;const n=this.rt.lt,e=this.rt,r=Math.max(1,Math.floor(i))%2/2,h=h=>{t.beginPath();for(let l=n.to-1;l>=n.from;--l){const n=e.ot[l],a=Math.round(n._t*i)+r,o=n.ut*s,_=h*s+r;t.moveTo(a,o),t.arc(a,o,_,0,2*Math.PI)}t.fill()};e.ct>0&&(t.fillStyle=e.dt,h(e.ft+e.ct)),t.fillStyle=e.vt,h(e.ft)}}function T(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const k={from:0,to:1};class R{constructor(t,i,s){this.bt=new C,this.Mt=[],this.St=[],this.xt=!0,this.O=t,this.Ct=i,this.yt=s,this.bt.st(this.Mt)}Pt(t){this.Tt(),this.xt=!0}kt(){return this.xt&&(this.Rt(),this.xt=!1),this.bt}Tt(){const t=this.yt.Dt();t.length!==this.Mt.length&&(this.St=t.map(T),this.Mt=this.St.map((t=>{const i=new P;return i.ht(t),i})),this.bt.st(this.Mt))}Rt(){const t=2===this.Ct.N().mode||!this.Ct.Et(),i=this.yt.Vt(),s=this.Ct.zt(),n=this.O.It();this.Tt(),i.forEach(((i,e)=>{const r=this.St[e],h=i.Bt(s),l=i.At();!t&&null!==h&&i.Et()&&null!==l?(r.vt=h.Lt,r.ft=h.ft,r.ct=h.Ot,r.ot[0].gt=h.gt,r.ot[0].ut=i.Ft().Nt(h.gt,l.Wt),r.dt=h.Ht??this.O.$t(r.ot[0].ut/i.Ft().Ut()),r.ot[0].wt=s,r.ot[0]._t=n.jt(s),r.lt=k):r.lt=null}))}}class D extends y{constructor(t){super(),this.Yt=t}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:r}){if(null===this.Yt)return;const h=this.Yt.Xt.Et,l=this.Yt.Zt.Et;if(!h&&!l)return;const a=Math.round(this.Yt._t*s),o=Math.round(this.Yt.ut*r);t.lineCap="butt",h&&a>=0&&(t.lineWidth=Math.floor(this.Yt.Xt.ct*s),t.strokeStyle=this.Yt.Xt.R,t.fillStyle=this.Yt.Xt.R,n(t,this.Yt.Xt.qt),function(t,i,s,n){t.beginPath();const e=t.lineWidth%2?.5:0;t.moveTo(i+e,s),t.lineTo(i+e,n),t.stroke()}(t,a,0,i.height)),l&&o>=0&&(t.lineWidth=Math.floor(this.Yt.Zt.ct*r),t.strokeStyle=this.Yt.Zt.R,t.fillStyle=this.Yt.Zt.R,n(t,this.Yt.Zt.qt),e(t,o,0,i.width))}}class E{constructor(t,i){this.xt=!0,this.Gt={Xt:{ct:1,qt:0,R:"",Et:!1},Zt:{ct:1,qt:0,R:"",Et:!1},_t:0,ut:0},this.Kt=new D(this.Gt),this.Jt=t,this.yt=i}Pt(){this.xt=!0}kt(t){return this.xt&&(this.Rt(),this.xt=!1),this.Kt}Rt(){const t=this.Jt.Et(),i=this.yt.Qt().N().crosshair,s=this.Gt;if(2===i.mode)return s.Zt.Et=!1,void(s.Xt.Et=!1);s.Zt.Et=t&&this.Jt.ti(this.yt),s.Xt.Et=t&&this.Jt.ii(),s.Zt.ct=i.horzLine.width,s.Zt.qt=i.horzLine.style,s.Zt.R=i.horzLine.color,s.Xt.ct=i.vertLine.width,s.Xt.qt=i.vertLine.style,s.Xt.R=i.vertLine.color,s._t=this.Jt.si(),s.ut=this.Jt.ni()}}function V(t,i,s,n,e,r){t.fillRect(i+r,s,n-2*r,r),t.fillRect(i+r,s+e-r,n-2*r,r),t.fillRect(i,s,r,e),t.fillRect(i+n-r,s,r,e)}function z(t,i,s,n,e,r){t.save(),t.globalCompositeOperation="copy",t.fillStyle=r,t.fillRect(i,s,n,e),t.restore()}function I(t,i,s,n,e,r){t.beginPath(),t.roundRect?t.roundRect(i,s,n,e,r):(t.lineTo(i+n-r[1],s),0!==r[1]&&t.arcTo(i+n,s,i+n,s+r[1],r[1]),t.lineTo(i+n,s+e-r[2]),0!==r[2]&&t.arcTo(i+n,s+e,i+n-r[2],s+e,r[2]),t.lineTo(i+r[3],s+e),0!==r[3]&&t.arcTo(i,s+e,i,s+e-r[3],r[3]),t.lineTo(i,s+r[0]),0!==r[0]&&t.arcTo(i,s,i+r[0],s,r[0]))}function B(t,i,s,n,e,r,h=0,l=[0,0,0,0],a=""){if(t.save(),!h||!a||a===r)return I(t,i,s,n,e,l),t.fillStyle=r,t.fill(),void t.restore();const o=h/2;var _;I(t,i+o,s+o,n-h,e-h,(_=-o,l.map((t=>0===t?t:t+_)))),"transparent"!==r&&(t.fillStyle=r,t.fill()),"transparent"!==a&&(t.lineWidth=h,t.strokeStyle=a,t.closePath(),t.stroke()),t.restore()}function A(t,i,s,n,e,r,h){t.save(),t.globalCompositeOperation="copy";const l=t.createLinearGradient(0,0,0,e);l.addColorStop(0,r),l.addColorStop(1,h),t.fillStyle=l,t.fillRect(i,s,n,e),t.restore()}class L{constructor(t,i){this.ht(t,i)}ht(t,i){this.Yt=t,this.ei=i}Ut(t,i){return this.Yt.Et?t.P+t.A+t.V:0}nt(t,i,s,n){if(!this.Yt.Et||0===this.Yt.ri.length)return;const e=this.Yt.R,r=this.ei.G,h=t.useBitmapCoordinateSpace((t=>{const h=t.context;h.font=i.T;const l=this.hi(t,i,s,n),a=l.li;return l.ai?B(h,a.oi,a._i,a.ui,a.ci,r,a.di,[a.ft,0,0,a.ft],r):B(h,a.fi,a._i,a.ui,a.ci,r,a.di,[0,a.ft,a.ft,0],r),this.Yt.pi&&(h.fillStyle=e,h.fillRect(a.fi,a.mi,a.wi-a.fi,a.gi)),this.Yt.bi&&(h.fillStyle=i.D,h.fillRect(l.ai?a.Mi-a.di:0,a._i,a.di,a.Si-a._i)),l}));t.useMediaCoordinateSpace((({context:t})=>{const s=h.xi;t.font=i.T,t.textAlign=h.ai?"right":"left",t.textBaseline="middle",t.fillStyle=e,t.fillText(this.Yt.ri,s.Ci,(s._i+s.Si)/2+s.yi)}))}hi(t,i,s,n){const{context:e,bitmapSize:r,mediaSize:h,horizontalPixelRatio:l,verticalPixelRatio:a}=t,o=this.Yt.pi||!this.Yt.Pi?i.C:0,_=this.Yt.Ti?i.S:0,u=i.A+this.ei.ki,c=i.V+this.ei.Ri,d=i.I,f=i.B,p=this.Yt.ri,v=i.P,m=s.Di(e,p),w=Math.ceil(s.Ei(e,p)),g=v+u+c,b=i.S+d+f+w+o,M=Math.max(1,Math.floor(a));let S=Math.round(g*a);S%2!=M%2&&(S+=1);const x=_>0?Math.max(1,Math.floor(_*l)):0,C=Math.round(b*l),y=Math.round(o*l),P=this.ei.Vi??this.ei.zi,T=Math.round(P*a)-Math.floor(.5*a),k=Math.floor(T+M/2-S/2),R=k+S,D="right"===n,E=D?h.width-_:_,V=D?r.width-x:x;let z,I,B;return D?(z=V-C,I=V-y,B=E-o-d-_):(z=V+C,I=V+y,B=E+o+d),{ai:D,li:{_i:k,mi:T,Si:R,ui:C,ci:S,ft:2*l,di:x,oi:z,fi:V,wi:I,gi:M,Mi:r.width},xi:{_i:k/a,Si:R/a,Ci:B,yi:m}}}}class O{constructor(t){this.Ii={zi:0,G:"#000",Ri:0,ki:0},this.Bi={ri:"",Et:!1,pi:!0,Pi:!1,Ht:"",R:"#FFF",bi:!1,Ti:!1},this.Ai={ri:"",Et:!1,pi:!1,Pi:!0,Ht:"",R:"#FFF",bi:!0,Ti:!0},this.xt=!0,this.Li=new(t||L)(this.Bi,this.Ii),this.Oi=new(t||L)(this.Ai,this.Ii)}ri(){return this.Ni(),this.Bi.ri}zi(){return this.Ni(),this.Ii.zi}Pt(){this.xt=!0}Ut(t,i=!1){return Math.max(this.Li.Ut(t,i),this.Oi.Ut(t,i))}Fi(){return this.Ii.Vi||0}Wi(t){this.Ii.Vi=t}Hi(){return this.Ni(),this.Bi.Et||this.Ai.Et}$i(){return this.Ni(),this.Bi.Et}kt(t){return this.Ni(),this.Bi.pi=this.Bi.pi&&t.N().ticksVisible,this.Ai.pi=this.Ai.pi&&t.N().ticksVisible,this.Li.ht(this.Bi,this.Ii),this.Oi.ht(this.Ai,this.Ii),this.Li}Ui(){return this.Ni(),this.Li.ht(this.Bi,this.Ii),this.Oi.ht(this.Ai,this.Ii),this.Oi}Ni(){this.xt&&(this.Bi.pi=!0,this.Ai.pi=!1,this.ji(this.Bi,this.Ai,this.Ii))}}class N extends O{constructor(t,i,s){super(),this.Jt=t,this.Yi=i,this.Xi=s}ji(t,i,s){if(t.Et=!1,2===this.Jt.N().mode)return;const n=this.Jt.N().horzLine;if(!n.labelVisible)return;const e=this.Yi.At();if(!this.Jt.Et()||this.Yi.Zi()||null===e)return;const r=this.Yi.qi().q(n.labelBackgroundColor);s.G=r.G,t.R=r.K;const h=2/12*this.Yi.P();s.ki=h,s.Ri=h;const l=this.Xi(this.Yi);s.zi=l.zi,t.ri=this.Yi.Gi(l.gt,e),t.Et=!0}}const F=/[1-9]/g;class W{constructor(){this.Yt=null}ht(t){this.Yt=t}nt(t,i){if(null===this.Yt||!1===this.Yt.Et||0===this.Yt.ri.length)return;const s=t.useMediaCoordinateSpace((({context:t})=>(t.font=i.T,Math.round(i.Ki.Ei(t,l(this.Yt).ri,F)))));if(s<=0)return;const n=i.Ji,e=s+2*n,r=e/2,h=this.Yt.Qi;let a=this.Yt.zi,o=Math.floor(a-r)+.5;o<0?(a+=Math.abs(0-o),o=Math.floor(a-r)+.5):o+e>h&&(a-=Math.abs(h-(o+e)),o=Math.floor(a-r)+.5);const _=o+e,u=Math.ceil(0+i.S+i.C+i.A+i.P+i.V);t.useBitmapCoordinateSpace((({context:t,horizontalPixelRatio:s,verticalPixelRatio:n})=>{const e=l(this.Yt);t.fillStyle=e.G;const r=Math.round(o*s),h=Math.round(0*n),a=Math.round(_*s),c=Math.round(u*n),d=Math.round(2*s);if(t.beginPath(),t.moveTo(r,h),t.lineTo(r,c-d),t.arcTo(r,c,r+d,c,d),t.lineTo(a-d,c),t.arcTo(a,c,a,c-d,d),t.lineTo(a,h),t.fill(),e.pi){const r=Math.round(e.zi*s),l=h,a=Math.round((l+i.C)*n);t.fillStyle=e.R;const o=Math.max(1,Math.floor(s)),_=Math.floor(.5*s);t.fillRect(r-_,l,o,a-l)}})),t.useMediaCoordinateSpace((({context:t})=>{const s=l(this.Yt),e=0+i.S+i.C+i.A+i.P/2;t.font=i.T,t.textAlign="left",t.textBaseline="middle",t.fillStyle=s.R;const r=i.Ki.Di(t,"Apr0");t.translate(o+n,e+r),t.fillText(s.ri,0,0)}))}}class H{constructor(t,i,s){this.xt=!0,this.Kt=new W,this.Gt={Et:!1,G:"#4c525e",R:"white",ri:"",Qi:0,zi:NaN,pi:!0},this.Ct=t,this.ts=i,this.Xi=s}Pt(){this.xt=!0}kt(){return this.xt&&(this.Rt(),this.xt=!1),this.Kt.ht(this.Gt),this.Kt}Rt(){const t=this.Gt;if(t.Et=!1,2===this.Ct.N().mode)return;const i=this.Ct.N().vertLine;if(!i.labelVisible)return;const s=this.ts.It();if(s.Zi())return;t.Qi=s.Qi();const n=this.Xi();if(null===n)return;t.zi=n.zi;const e=s.ss(this.Ct.zt());t.ri=s.ns(l(e)),t.Et=!0;const r=this.ts.qi().q(i.labelBackgroundColor);t.G=r.G,t.R=r.K,t.pi=s.N().ticksVisible}}class ${constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(t){this.rs=t}Ft(){return this.es}os(t){this.es=t}_s(t){return[]}us(){return[]}Et(){return!0}}var U;!function(t){t[t.Normal=0]="Normal",t[t.Magnet=1]="Magnet",t[t.Hidden=2]="Hidden",t[t.MagnetOHLC=3]="MagnetOHLC"}(U||(U={}));class j extends ${constructor(t,i){super(),this.yt=null,this.cs=NaN,this.ds=0,this.fs=!1,this.ps=new Map,this.vs=!1,this.ws=new WeakMap,this.gs=new WeakMap,this.bs=NaN,this.Ms=NaN,this.Ss=NaN,this.xs=NaN,this.ts=t,this.Cs=i;this.ys=((t,i)=>s=>{const n=i(),e=t();if(s===l(this.yt).Ps())return{gt:e,zi:n};{const t=l(s.At());return{gt:s.Ts(n,t),zi:n}}})((()=>this.cs),(()=>this.Ms));const s=((t,i)=>()=>{const s=this.ts.It().ks(t()),n=i();return s&&Number.isFinite(n)?{wt:s,zi:n}:null})((()=>this.ds),(()=>this.si()));this.Rs=new H(this,t,s)}N(){return this.Cs}Ds(t,i){this.Ss=t,this.xs=i}Es(){this.Ss=NaN,this.xs=NaN}Vs(){return this.Ss}zs(){return this.xs}Is(t,i,s){this.vs||(this.vs=!0),this.fs=!0,this.Bs(t,i,s)}zt(){return this.ds}si(){return this.bs}ni(){return this.Ms}Et(){return this.fs}As(){this.fs=!1,this.Ls(),this.cs=NaN,this.bs=NaN,this.Ms=NaN,this.yt=null,this.Es(),this.Os()}Ns(t){let i=this.ws.get(t);i||(i=new E(this,t),this.ws.set(t,i));let s=this.gs.get(t);return s||(s=new R(this.ts,this,t),this.gs.set(t,s)),[i,s]}ti(t){return t===this.yt&&this.Cs.horzLine.visible}ii(){return this.Cs.vertLine.visible}Fs(t,i){this.fs&&this.yt===t||this.ps.clear();const s=[];return this.yt===t&&s.push(this.Ws(this.ps,i,this.ys)),s}us(){return this.fs?[this.Rs]:[]}Hs(){return this.yt}Os(){this.ts.$s().forEach((t=>{this.ws.get(t)?.Pt(),this.gs.get(t)?.Pt()})),this.ps.forEach((t=>t.Pt())),this.Rs.Pt()}Us(t){return t&&!t.Ps().Zi()?t.Ps():null}Bs(t,i,s){this.js(t,i,s)&&this.Os()}js(t,i,s){const n=this.bs,e=this.Ms,r=this.cs,h=this.ds,l=this.yt,a=this.Us(s);this.ds=t,this.bs=isNaN(t)?NaN:this.ts.It().jt(t),this.yt=s;const o=null!==a?a.At():null;return null!==a&&null!==o?(this.cs=i,this.Ms=a.Nt(i,o)):(this.cs=NaN,this.Ms=NaN),n!==this.bs||e!==this.Ms||h!==this.ds||r!==this.cs||l!==this.yt}Ls(){const t=this.ts.Ys().map((t=>t.Zs().Xs())).filter(v),i=0===t.length?null:Math.max(...t);this.ds=null!==i?i:NaN}Ws(t,i,s){let n=t.get(i);return void 0===n&&(n=new N(this,i,s),t.set(i,n)),n}}function Y(t){return"left"===t||"right"===t}class X{constructor(t){this.qs=new Map,this.Gs=[],this.Ks=t}Js(t,i){const s=function(t,i){return void 0===t?i:{Qs:Math.max(t.Qs,i.Qs),tn:t.tn||i.tn}}(this.qs.get(t),i);this.qs.set(t,s)}sn(){return this.Ks}nn(t){const i=this.qs.get(t);return void 0===i?{Qs:this.Ks}:{Qs:Math.max(this.Ks,i.Qs),tn:i.tn}}en(){this.rn(),this.Gs=[{hn:0}]}ln(t){this.rn(),this.Gs=[{hn:1,Wt:t}]}an(t){this._n(),this.Gs.push({hn:5,Wt:t})}rn(){this._n(),this.Gs.push({hn:6})}un(){this.rn(),this.Gs=[{hn:4}]}cn(t){this.rn(),this.Gs.push({hn:2,Wt:t})}dn(t){this.rn(),this.Gs.push({hn:3,Wt:t})}fn(){return this.Gs}pn(t){for(const i of t.Gs)this.vn(i);this.Ks=Math.max(this.Ks,t.Ks),t.qs.forEach(((t,i)=>{this.Js(i,t)}))}static mn(){return new X(2)}static wn(){return new X(3)}vn(t){switch(t.hn){case 0:this.en();break;case 1:this.ln(t.Wt);break;case 2:this.cn(t.Wt);break;case 3:this.dn(t.Wt);break;case 4:this.un();break;case 5:this.an(t.Wt);break;case 6:this._n()}}_n(){const t=this.Gs.findIndex((t=>5===t.hn));-1!==t&&this.Gs.splice(t,1)}}const Z=".";function q(t,i){if(!u(t))return"n/a";if(!c(i))throw new TypeError("invalid length");if(i<0||i>16)throw new TypeError("invalid length");if(0===i)return t.toString();return("0000000000000000"+t.toString()).slice(-i)}class G{constructor(t,i){if(i||(i=1),u(t)&&c(t)||(t=100),t<0)throw new TypeError("invalid base");this.Yi=t,this.gn=i,this.bn()}format(t){const i=t<0?"−":"";return t=Math.abs(t),i+this.Mn(t)}bn(){if(this.Sn=0,this.Yi>0&&this.gn>0){let t=this.Yi;for(;t>1;)t/=10,this.Sn++}}Mn(t){const i=this.Yi/this.gn;let s=Math.floor(t),n="";const e=void 0!==this.Sn?this.Sn:NaN;if(i>1){let r=+(Math.round(t*i)-s*i).toFixed(this.Sn);r>=i&&(r-=i,s+=1),n=Z+q(+r.toFixed(this.Sn)*this.gn,e)}else s=Math.round(s*i)/i,e>0&&(n=Z+q(0,e));return s.toFixed(0)+n}}class K extends G{constructor(t=100){super(t)}format(t){return`${super.format(t)}%`}}class J{constructor(t){this.xn=t}format(t){let i="";return t<0&&(i="-",t=-t),t<995?i+this.Cn(t):t<999995?i+this.Cn(t/1e3)+"K":t<999999995?(t=1e3*Math.round(t/1e3),i+this.Cn(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),i+this.Cn(t/1e9)+"B")}Cn(t){let i;const s=Math.pow(10,this.xn);return i=(t=Math.round(t*s)/s)>=1e-15&&t<1?t.toFixed(this.xn).replace(/\.?0+$/,""):String(t),i.replace(/(\.[1-9]*)0+$/,((t,i)=>i))}}const Q=/[2-9]/g;class tt{constructor(t=50){this.yn=0,this.Pn=1,this.Tn=1,this.kn={},this.Rn=new Map,this.Dn=t}En(){this.yn=0,this.Rn.clear(),this.Pn=1,this.Tn=1,this.kn={}}Ei(t,i,s){return this.Vn(t,i,s).width}Di(t,i,s){const n=this.Vn(t,i,s);return((n.actualBoundingBoxAscent||0)-(n.actualBoundingBoxDescent||0))/2}Vn(t,i,s){const n=s||Q,e=String(i).replace(n,"0");if(this.Rn.has(e))return h(this.Rn.get(e)).zn;if(this.yn===this.Dn){const t=this.kn[this.Tn];delete this.kn[this.Tn],this.Rn.delete(t),this.Tn++,this.yn--}t.save(),t.textBaseline="middle";const r=t.measureText(e);return t.restore(),0===r.width&&i.length||(this.Rn.set(e,{zn:r,In:this.Pn}),this.kn[this.Pn]=e,this.yn++,this.Pn++),r}}class it{constructor(t){this.Bn=null,this.M=null,this.An="right",this.Ln=t}On(t,i,s){this.Bn=t,this.M=i,this.An=s}nt(t){null!==this.M&&null!==this.Bn&&this.Bn.nt(t,this.M,this.Ln,this.An)}}class st{constructor(t,i,s){this.Nn=t,this.Ln=new tt(50),this.Fn=i,this.O=s,this.F=-1,this.Kt=new it(this.Ln)}kt(){const t=this.O.Wn(this.Fn);if(null===t)return null;const i=t.Hn(this.Fn)?t.$n():this.Fn.Ft();if(null===i)return null;const s=t.Un(i);if("overlay"===s)return null;const n=this.O.jn();return n.P!==this.F&&(this.F=n.P,this.Ln.En()),this.Kt.On(this.Nn.Ui(),n,s),this.Kt}}class nt extends y{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}Yn(t,i){if(!this.Yt?.Et)return null;const{ut:s,ct:n,Xn:e}=this.Yt;return i>=s-n-7&&i<=s+n+7?{Zn:this.Yt,Xn:e}:null}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:r}){if(null===this.Yt)return;if(!1===this.Yt.Et)return;const h=Math.round(this.Yt.ut*r);h<0||h>i.height||(t.lineCap="butt",t.strokeStyle=this.Yt.R,t.lineWidth=Math.floor(this.Yt.ct*s),n(t,this.Yt.qt),e(t,h,0,i.width))}}class et{constructor(t){this.qn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,qt:0,Et:!1},this.Gn=new nt,this.xt=!0,this.Kn=t,this.Jn=t.Qt(),this.Gn.ht(this.qn)}Pt(){this.xt=!0}kt(){return this.Kn.Et()?(this.xt&&(this.Qn(),this.xt=!1),this.Gn):null}}class rt extends et{constructor(t){super(t)}Qn(){this.qn.Et=!1;const t=this.Kn.Ft(),i=t.te().te;if(2!==i&&3!==i)return;const s=this.Kn.N();if(!s.baseLineVisible||!this.Kn.Et())return;const n=this.Kn.At();null!==n&&(this.qn.Et=!0,this.qn.ut=t.Nt(n.Wt,n.Wt),this.qn.R=s.baseLineColor,this.qn.ct=s.baseLineWidth,this.qn.qt=s.baseLineStyle)}}class ht extends y{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}ie(){return this.Yt}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){const n=this.Yt;if(null===n)return;const e=Math.max(1,Math.floor(i)),r=e%2/2,h=Math.round(n.se.x*i)+r,l=n.se.y*s;t.fillStyle=n.ne,t.beginPath();const a=Math.max(2,1.5*n.ee)*i;t.arc(h,l,a,0,2*Math.PI,!1),t.fill(),t.fillStyle=n.re,t.beginPath(),t.arc(h,l,n.ft*i,0,2*Math.PI,!1),t.fill(),t.lineWidth=e,t.strokeStyle=n.he,t.beginPath(),t.arc(h,l,n.ft*i+e/2,0,2*Math.PI,!1),t.stroke()}}const lt=[{le:0,ae:.25,oe:4,_e:10,ue:.25,ce:0,de:.4,fe:.8},{le:.25,ae:.525,oe:10,_e:14,ue:0,ce:0,de:.8,fe:0},{le:.525,ae:1,oe:14,_e:14,ue:0,ce:0,de:0,fe:0}];class at{constructor(t){this.Kt=new ht,this.xt=!0,this.pe=!0,this.ve=performance.now(),this.me=this.ve-1,this.we=t}ge(){this.me=this.ve-1,this.Pt()}be(){if(this.Pt(),2===this.we.N().lastPriceAnimation){const t=performance.now(),i=this.me-t;if(i>0)return void(i<650&&(this.me+=2600));this.ve=t,this.me=t+2600}}Pt(){this.xt=!0}Me(){this.pe=!0}Et(){return 0!==this.we.N().lastPriceAnimation}Se(){switch(this.we.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.me}}kt(){return this.xt?(this.Rt(),this.xt=!1,this.pe=!1):this.pe&&(this.xe(),this.pe=!1),this.Kt}Rt(){this.Kt.ht(null);const t=this.we.Qt().It(),i=t.Ce(),s=this.we.At();if(null===i||null===s)return;const n=this.we.ye(!0);if(n.Pe||!i.Te(n.ke))return;const e={x:t.jt(n.ke),y:this.we.Ft().Nt(n.gt,s.Wt)},r=n.R,h=this.we.N().lineWidth,l=this.Re(this.De(),r);this.Kt.ht({ne:r,ee:h,re:l.re,he:l.he,ft:l.ft,se:e})}xe(){const t=this.Kt.ie();if(null!==t){const i=this.Re(this.De(),t.ne);t.re=i.re,t.he=i.he,t.ft=i.ft}}De(){return this.Se()?performance.now()-this.ve:2599}Ee(t,i,s,n){const e=s+(n-s)*i;return this.we.Qt().qi().X(t,e)}Re(t,i){const s=t%2600/2600;let n;for(const t of lt)if(s>=t.le&&s<=t.ae){n=t;break}r(void 0!==n,"Last price animation internal logic error");const e=(s-n.le)/(n.ae-n.le);return{re:this.Ee(i,e,n.ue,n.ce),he:this.Ee(i,e,n.de,n.fe),ft:(h=e,l=n.oe,a=n._e,l+(a-l)*h)};var h,l,a}}class ot extends et{constructor(t){super(t)}Qn(){const t=this.qn;t.Et=!1;const i=this.Kn.N();if(!i.priceLineVisible||!this.Kn.Et())return;const s=this.Kn.ye(0===i.priceLineSource);s.Pe||(t.Et=!0,t.ut=s.zi,t.R=this.Kn.Ve(s.R),t.ct=i.priceLineWidth,t.qt=i.priceLineStyle)}}class _t extends O{constructor(t){super(),this.Jt=t}ji(t,i,s){t.Et=!1,i.Et=!1;const n=this.Jt;if(!n.Et())return;const e=n.N(),r=e.lastValueVisible,h=""!==n.ze(),l=0===e.seriesLastValueMode,a=n.ye(!1);if(a.Pe)return;r&&(t.ri=this.Ie(a,r,l),t.Et=0!==t.ri.length),(h||l)&&(i.ri=this.Be(a,r,h,l),i.Et=i.ri.length>0);const o=n.Ve(a.R),_=this.Jt.Qt().qi().q(o);s.G=_.G,s.zi=a.zi,i.Ht=n.Qt().$t(a.zi/n.Ft().Ut()),t.Ht=o,t.R=_.K,i.R=_.K}Be(t,i,s,n){let e="";const r=this.Jt.ze();return s&&0!==r.length&&(e+=`${r} `),i&&n&&(e+=this.Jt.Ft().Ae()?t.Le:t.Oe),e.trim()}Ie(t,i,s){return i?s?this.Jt.Ft().Ae()?t.Oe:t.Le:t.ri:""}}function ut(t,i,s,n){const e=Number.isFinite(i),r=Number.isFinite(s);return e&&r?t(i,s):e||r?e?i:s:n}class ct{constructor(t,i){this.Ne=t,this.Fe=i}We(t){return null!==t&&(this.Ne===t.Ne&&this.Fe===t.Fe)}He(){return new ct(this.Ne,this.Fe)}$e(){return this.Ne}Ue(){return this.Fe}je(){return this.Fe-this.Ne}Zi(){return this.Fe===this.Ne||Number.isNaN(this.Fe)||Number.isNaN(this.Ne)}pn(t){return null===t?this:new ct(ut(Math.min,this.$e(),t.$e(),-1/0),ut(Math.max,this.Ue(),t.Ue(),1/0))}Ye(t){if(!u(t))return;if(0===this.Fe-this.Ne)return;const i=.5*(this.Fe+this.Ne);let s=this.Fe-i,n=this.Ne-i;s*=t,n*=t,this.Fe=i+s,this.Ne=i+n}Xe(t){u(t)&&(this.Fe+=t,this.Ne+=t)}Ze(){return{minValue:this.Ne,maxValue:this.Fe}}static qe(t){return null===t?null:new ct(t.minValue,t.maxValue)}}class dt{constructor(t,i){this.Ge=t,this.Ke=i||null}Je(){return this.Ge}Qe(){return this.Ke}Ze(){return{priceRange:null===this.Ge?null:this.Ge.Ze(),margins:this.Ke||void 0}}static qe(t){return null===t?null:new dt(ct.qe(t.priceRange),t.margins)}}class ft extends et{constructor(t,i){super(t),this.tr=i}Qn(){const t=this.qn;t.Et=!1;const i=this.tr.N();if(!this.Kn.Et()||!i.lineVisible)return;const s=this.tr.ir();null!==s&&(t.Et=!0,t.ut=s,t.R=i.color,t.ct=i.lineWidth,t.qt=i.lineStyle,t.Xn=this.tr.N().id)}}class pt extends O{constructor(t,i){super(),this.we=t,this.tr=i}ji(t,i,s){t.Et=!1,i.Et=!1;const n=this.tr.N(),e=n.axisLabelVisible,r=""!==n.title,h=this.we;if(!e||!h.Et())return;const l=this.tr.ir();if(null===l)return;r&&(i.ri=n.title,i.Et=!0),i.Ht=h.Qt().$t(l/h.Ft().Ut()),t.ri=this.sr(n.price),t.Et=!0;const a=this.we.Qt().qi().q(n.axisLabelColor||n.color);s.G=a.G;const o=n.axisLabelTextColor||a.K;t.R=o,i.R=o,s.zi=l}sr(t){const i=this.we.At();return null===i?"":this.we.Ft().Gi(t,i.Wt)}}class vt{constructor(t,i){this.we=t,this.Cs=i,this.nr=new ft(t,this),this.Nn=new pt(t,this),this.er=new st(this.Nn,t,t.Qt())}rr(t){_(this.Cs,t),this.Pt(),this.we.Qt().hr()}N(){return this.Cs}lr(){return this.nr}ar(){return this.er}_r(){return this.Nn}Pt(){this.nr.Pt(),this.Nn.Pt()}ir(){const t=this.we,i=t.Ft();if(t.Qt().It().Zi()||i.Zi())return null;const s=t.At();return null===s?null:i.Nt(this.Cs.price,s.Wt)}}class mt extends ${constructor(t){super(),this.ts=t}Qt(){return this.ts}}const wt={Bar:(t,i,s,n)=>{const e=i.upColor,r=i.downColor,h=l(t(s,n)),o=a(h.Wt[0])<=a(h.Wt[3]);return{ur:h.R??(o?e:r)}},Candlestick:(t,i,s,n)=>{const e=i.upColor,r=i.downColor,h=i.borderUpColor,o=i.borderDownColor,_=i.wickUpColor,u=i.wickDownColor,c=l(t(s,n)),d=a(c.Wt[0])<=a(c.Wt[3]);return{ur:c.R??(d?e:r),cr:c.Ht??(d?h:o),dr:c.pr??(d?_:u)}},Custom:(t,i,s,n)=>({ur:l(t(s,n)).R??i.color}),Area:(t,i,s,n)=>{const e=l(t(s,n));return{ur:e.vt??i.lineColor,vt:e.vt??i.lineColor,vr:e.vr??i.topColor,mr:e.mr??i.bottomColor}},Baseline:(t,i,s,n)=>{const e=l(t(s,n));return{ur:e.Wt[3]>=i.baseValue.price?i.topLineColor:i.bottomLineColor,wr:e.wr??i.topLineColor,gr:e.gr??i.bottomLineColor,br:e.br??i.topFillColor1,Mr:e.Mr??i.topFillColor2,Sr:e.Sr??i.bottomFillColor1,Cr:e.Cr??i.bottomFillColor2}},Line:(t,i,s,n)=>{const e=l(t(s,n));return{ur:e.R??i.color,vt:e.R??i.color}},Histogram:(t,i,s,n)=>({ur:l(t(s,n)).R??i.color})};class gt{constructor(t){this.yr=(t,i)=>void 0!==i?i.Wt:this.we.Zs().Pr(t),this.we=t,this.Tr=wt[t.kr()]}Rr(t,i){return this.Tr(this.yr,this.we.N(),t,i)}}function bt(t,i,s,n,e=0,r=i.length){let h=r-e;for(;0>1,l=e+r;n(i[l],s)===t?(e=l+1,h-=r+1):h=r}return e}const Mt=bt.bind(null,!0),St=bt.bind(null,!1);var xt;!function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.None=0]="None",t[t.NearestRight=1]="NearestRight"}(xt||(xt={}));const Ct=30;class yt{constructor(){this.Dr=[],this.Er=new Map,this.Vr=new Map,this.zr=[]}Ir(){return this.Br()>0?this.Dr[this.Dr.length-1]:null}Ar(){return this.Br()>0?this.Lr(0):null}Xs(){return this.Br()>0?this.Lr(this.Dr.length-1):null}Br(){return this.Dr.length}Zi(){return 0===this.Br()}Te(t){return null!==this.Or(t,0)}Pr(t){return this.Nr(t)}Nr(t,i=0){const s=this.Or(t,i);return null===s?null:{...this.Fr(s),ke:this.Lr(s)}}Wr(){return this.Dr}Hr(t,i,s){if(this.Zi())return null;let n=null;for(const e of s){n=Pt(n,this.$r(t,i,e))}return n}ht(t){this.Vr.clear(),this.Er.clear(),this.Dr=t,this.zr=t.map((t=>t.ke))}Ur(){return this.zr}Lr(t){return this.Dr[t].ke}Fr(t){return this.Dr[t]}Or(t,i){const s=this.jr(t);if(null===s&&0!==i)switch(i){case-1:return this.Yr(t);case 1:return this.Xr(t);default:throw new TypeError("Unknown search mode")}return s}Yr(t){let i=this.Zr(t);return i>0&&(i-=1),i!==this.Dr.length&&this.Lr(i)t.ket.ke>i))}Gr(t,i,s){let n=null;for(let e=t;en.Jr&&(n.Jr=t)))}return n}$r(t,i,s){if(this.Zi())return null;let n=null;const e=l(this.Ar()),r=l(this.Xs()),h=Math.max(t,e),a=Math.min(i,r),o=Math.ceil(h/Ct)*Ct,_=Math.max(o,Math.floor(a/Ct)*Ct);{const t=this.Zr(h),e=this.qr(Math.min(a,o,i));n=Pt(n,this.Gr(t,e,s))}let u=this.Er.get(s);void 0===u&&(u=new Map,this.Er.set(s,u));for(let t=Math.max(o+1,h);t<_;t+=Ct){const i=Math.floor(t/Ct);let e=u.get(i);if(void 0===e){const t=this.Zr(i*Ct),n=this.qr((i+1)*Ct-1);e=this.Gr(t,n,s),u.set(i,e)}n=Pt(n,e)}{const t=this.Zr(_),i=this.qr(a);n=Pt(n,this.Gr(t,i,s))}return n}}function Pt(t,i){if(null===t)return i;if(null===i)return t;return{Kr:Math.min(t.Kr,i.Kr),Jr:Math.max(t.Jr,i.Jr)}}class Tt{constructor(t){this.Qr=t}nt(t,i,s){this.Qr.draw(t)}th(t,i,s){this.Qr.drawBackground?.(t)}}class kt{constructor(t){this.Rn=null,this.ih=t}kt(){const t=this.ih.renderer();if(null===t)return null;if(this.Rn?.sh===t)return this.Rn.nh;const i=new Tt(t);return this.Rn={sh:t,nh:i},i}eh(){return this.ih.zOrder?.()??"normal"}}class Rt{constructor(t){this.rh=null,this.hh=t}ah(){return this.hh}Os(){this.hh.updateAllViews?.()}Ns(){const t=this.hh.paneViews?.()??[];if(this.rh?.sh===t)return this.rh.nh;const i=t.map((t=>new kt(t)));return this.rh={sh:t,nh:i},i}Yn(t,i){return this.hh.hitTest?.(t,i)??null}}class Dt extends Rt{_s(){return[]}}class Et{constructor(t){this.Qr=t}nt(t,i,s){this.Qr.draw(t)}th(t,i,s){this.Qr.drawBackground?.(t)}}class Vt{constructor(t){this.Rn=null,this.ih=t}kt(){const t=this.ih.renderer();if(null===t)return null;if(this.Rn?.sh===t)return this.Rn.nh;const i=new Et(t);return this.Rn={sh:t,nh:i},i}eh(){return this.ih.zOrder?.()??"normal"}}function zt(t){return{ri:t.text(),zi:t.coordinate(),Vi:t.fixedCoordinate?.(),R:t.textColor(),G:t.backColor(),Et:t.visible?.()??!0,pi:t.tickVisible?.()??!0}}class It{constructor(t,i){this.Kt=new W,this.oh=t,this._h=i}kt(){return this.Kt.ht({Qi:this._h.Qi(),...zt(this.oh)}),this.Kt}}class Bt extends O{constructor(t,i){super(),this.oh=t,this.Yi=i}ji(t,i,s){const n=zt(this.oh);s.G=n.G,t.R=n.R;const e=2/12*this.Yi.P();s.ki=e,s.Ri=e,s.zi=n.zi,s.Vi=n.Vi,t.ri=n.ri,t.Et=n.Et,t.pi=n.pi}}class At extends Rt{constructor(t,i){super(t),this.uh=null,this.dh=null,this.fh=null,this.ph=null,this.we=i}us(){const t=this.hh.timeAxisViews?.()??[];if(this.uh?.sh===t)return this.uh.nh;const i=this.we.Qt().It(),s=t.map((t=>new It(t,i)));return this.uh={sh:t,nh:s},s}Fs(){const t=this.hh.priceAxisViews?.()??[];if(this.dh?.sh===t)return this.dh.nh;const i=this.we.Ft(),s=t.map((t=>new Bt(t,i)));return this.dh={sh:t,nh:s},s}mh(){const t=this.hh.priceAxisPaneViews?.()??[];if(this.fh?.sh===t)return this.fh.nh;const i=t.map((t=>new Vt(t)));return this.fh={sh:t,nh:i},i}wh(){const t=this.hh.timeAxisPaneViews?.()??[];if(this.ph?.sh===t)return this.ph.nh;const i=t.map((t=>new Vt(t)));return this.ph={sh:t,nh:i},i}gh(t,i){return this.hh.autoscaleInfo?.(t,i)??null}}function Lt(t,i,s,n){t.forEach((t=>{i(t).forEach((t=>{t.eh()===s&&n.push(t)}))}))}function Ot(t){return t.Ns()}function Nt(t){return t.mh()}function Ft(t){return t.wh()}const Wt=["Area","Line","Baseline"];class Ht extends mt{constructor(t,i,s,n,e){super(t),this.Yt=new yt,this.nr=new ot(this),this.bh=[],this.Mh=new rt(this),this.Sh=null,this.xh=null,this.Ch=null,this.yh=[],this.Cs=s,this.Ph=i;const r=new _t(this);this.ps=[r],this.er=new st(r,this,t),Wt.includes(this.Ph)&&(this.Sh=new at(this)),this.Th(),this.ih=n(this,this.Qt(),e)}m(){null!==this.Ch&&clearTimeout(this.Ch)}Ve(t){return this.Cs.priceLineColor||t}ye(t){const i={Pe:!0},s=this.Ft();if(this.Qt().It().Zi()||s.Zi()||this.Yt.Zi())return i;const n=this.Qt().It().Ce(),e=this.At();if(null===n||null===e)return i;let r,h;if(t){const t=this.Yt.Ir();if(null===t)return i;r=t,h=t.ke}else{const t=this.Yt.Nr(n.Mi(),-1);if(null===t)return i;if(r=this.Yt.Pr(t.ke),null===r)return i;h=t.ke}const l=r.Wt[3],a=this.kh().Rr(h,{Wt:r}),o=s.Nt(l,e.Wt);return{Pe:!1,gt:l,ri:s.Gi(l,e.Wt),Le:s.Rh(l),Oe:s.Dh(l,e.Wt),R:a.ur,zi:o,ke:h}}kh(){return null!==this.xh||(this.xh=new gt(this)),this.xh}N(){return this.Cs}rr(t){const i=t.priceScaleId;void 0!==i&&i!==this.Cs.priceScaleId&&this.Qt().Eh(this,i),_(this.Cs,t),void 0!==t.priceFormat&&(this.Th(),this.Qt().Vh()),this.Qt().zh(this),this.Qt().Ih(),this.ih.Pt("options")}ht(t,i){this.Yt.ht(t),this.ih.Pt("data"),null!==this.Sh&&(i&&i.Bh?this.Sh.be():0===t.length&&this.Sh.ge());const s=this.Qt().Wn(this);this.Qt().Ah(s),this.Qt().zh(this),this.Qt().Ih(),this.Qt().hr()}Lh(t){const i=new vt(this,t);return this.bh.push(i),this.Qt().zh(this),i}Oh(t){const i=this.bh.indexOf(t);-1!==i&&this.bh.splice(i,1),this.Qt().zh(this)}Nh(){return this.bh}kr(){return this.Ph}At(){const t=this.Fh();return null===t?null:{Wt:t.Wt[3],Wh:t.wt}}Fh(){const t=this.Qt().It().Ce();if(null===t)return null;const i=t.Hh();return this.Yt.Nr(i,1)}Zs(){return this.Yt}$h(t){const i=this.Yt.Pr(t);return null===i?null:"Bar"===this.Ph||"Candlestick"===this.Ph||"Custom"===this.Ph?{Uh:i.Wt[0],jh:i.Wt[1],Yh:i.Wt[2],Xh:i.Wt[3]}:i.Wt[3]}Zh(t){const i=[];Lt(this.yh,Ot,"top",i);const s=this.Sh;return null!==s&&s.Et()?(null===this.Ch&&s.Se()&&(this.Ch=setTimeout((()=>{this.Ch=null,this.Qt().qh()}),0)),s.Me(),i.unshift(s),i):i}Ns(){const t=[];this.Gh()||t.push(this.Mh),t.push(this.ih,this.nr);const i=this.bh.map((t=>t.lr()));return t.push(...i),Lt(this.yh,Ot,"normal",t),t}Kh(){return this.Jh(Ot,"bottom")}Qh(t){return this.Jh(Nt,t)}tl(t){return this.Jh(Ft,t)}il(t,i){return this.yh.map((s=>s.Yn(t,i))).filter((t=>null!==t))}_s(){return[this.er,...this.bh.map((t=>t.ar()))]}Fs(t,i){if(i!==this.es&&!this.Gh())return[];const s=[...this.ps];for(const t of this.bh)s.push(t._r());return this.yh.forEach((t=>{s.push(...t.Fs())})),s}us(){const t=[];return this.yh.forEach((i=>{t.push(...i.us())})),t}gh(t,i){if(void 0!==this.Cs.autoscaleInfoProvider){const s=this.Cs.autoscaleInfoProvider((()=>{const s=this.sl(t,i);return null===s?null:s.Ze()}));return dt.qe(s)}return this.sl(t,i)}nl(){return this.Cs.priceFormat.minMove}el(){return this.rl}Os(){this.ih.Pt();for(const t of this.ps)t.Pt();for(const t of this.bh)t.Pt();this.nr.Pt(),this.Mh.Pt(),this.Sh?.Pt(),this.yh.forEach((t=>t.Os()))}Ft(){return l(super.Ft())}Bt(t){if(!(("Line"===this.Ph||"Area"===this.Ph||"Baseline"===this.Ph)&&this.Cs.crosshairMarkerVisible))return null;const i=this.Yt.Pr(t);if(null===i)return null;return{gt:i.Wt[3],ft:this.hl(),Ht:this.ll(),Ot:this.al(),Lt:this.ol(t)}}ze(){return this.Cs.title}Et(){return this.Cs.visible}_l(t){this.yh.push(new At(t,this))}ul(t){this.yh=this.yh.filter((i=>i.ah()!==t))}cl(){if("Custom"===this.Ph)return t=>this.ih.dl(t)}fl(){if("Custom"===this.Ph)return t=>this.ih.pl(t)}vl(){return this.Yt.Ur()}Gh(){return!Y(this.Ft().ml())}sl(t,i){if(!c(t)||!c(i)||this.Yt.Zi())return null;const s="Line"===this.Ph||"Area"===this.Ph||"Baseline"===this.Ph||"Histogram"===this.Ph?[3]:[2,1],n=this.Yt.Hr(t,i,s);let e=null!==n?new ct(n.Kr,n.Jr):null,r=null;if("Histogram"===this.kr()){const t=this.Cs.base,i=new ct(t,t);e=null!==e?e.pn(i):i}return this.yh.forEach((s=>{const n=s.gh(t,i);if(n?.priceRange){const t=new ct(n.priceRange.minValue,n.priceRange.maxValue);e=null!==e?e.pn(t):t}n?.margins&&(r=n.margins)})),new dt(e,r)}hl(){switch(this.Ph){case"Line":case"Area":case"Baseline":return this.Cs.crosshairMarkerRadius}return 0}ll(){switch(this.Ph){case"Line":case"Area":case"Baseline":{const t=this.Cs.crosshairMarkerBorderColor;if(0!==t.length)return t}}return null}al(){switch(this.Ph){case"Line":case"Area":case"Baseline":return this.Cs.crosshairMarkerBorderWidth}return 0}ol(t){switch(this.Ph){case"Line":case"Area":case"Baseline":{const t=this.Cs.crosshairMarkerBackgroundColor;if(0!==t.length)return t}}return this.kh().Rr(t).ur}Th(){switch(this.Cs.priceFormat.type){case"custom":this.rl={format:this.Cs.priceFormat.formatter};break;case"volume":this.rl=new J(this.Cs.priceFormat.precision);break;case"percent":this.rl=new K(this.Cs.priceFormat.precision);break;default:{const t=Math.pow(10,this.Cs.priceFormat.precision);this.rl=new G(t,this.Cs.priceFormat.minMove*t)}}null!==this.es&&this.es.wl()}Jh(t,i){const s=[];return Lt(this.yh,t,i,s),s}}const $t=[3],Ut=[0,1,2,3];class jt{constructor(t){this.Cs=t}gl(t,i,s){let n=t;if(0===this.Cs.mode)return n;const e=s.Ps(),r=e.At();if(null===r)return n;const h=e.Nt(t,r),l=s.bl().filter((t=>t instanceof Ht)).reduce(((t,n)=>{if(s.Hn(n)||!n.Et())return t;const e=n.Ft(),r=n.Zs();if(e.Zi()||!r.Te(i))return t;const h=r.Pr(i);if(null===h)return t;const l=a(n.At()),o=3===this.Cs.mode?Ut:$t;return t.concat(o.map((t=>e.Nt(h.Wt[t],l.Wt))))}),[]);if(0===l.length)return n;l.sort(((t,i)=>Math.abs(t-h)-Math.abs(i-h)));const o=l[0];return n=e.Ts(o,r),n}}function Yt(t,i,s){return Math.min(Math.max(t,i),s)}function Xt(t,i,s){return i-t<=s}class Zt extends y{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:e}){if(null===this.Yt)return;const r=Math.max(1,Math.floor(s));t.lineWidth=r,function(t,i){t.save(),t.lineWidth%2&&t.translate(.5,.5),i(),t.restore()}(t,(()=>{const h=l(this.Yt);if(h.Ml){t.strokeStyle=h.Sl,n(t,h.xl),t.beginPath();for(const n of h.Cl){const e=Math.round(n.yl*s);t.moveTo(e,-r),t.lineTo(e,i.height+r)}t.stroke()}if(h.Pl){t.strokeStyle=h.Tl,n(t,h.kl),t.beginPath();for(const s of h.Rl){const n=Math.round(s.yl*e);t.moveTo(-r,n),t.lineTo(i.width+r,n)}t.stroke()}}))}}class qt{constructor(t){this.Kt=new Zt,this.xt=!0,this.yt=t}Pt(){this.xt=!0}kt(){if(this.xt){const t=this.yt.Qt().N().grid,i={Pl:t.horzLines.visible,Ml:t.vertLines.visible,Tl:t.horzLines.color,Sl:t.vertLines.color,kl:t.horzLines.style,xl:t.vertLines.style,Rl:this.yt.Ps().Dl(),Cl:(this.yt.Qt().It().Dl()||[]).map((t=>({yl:t.coord})))};this.Kt.ht(i),this.xt=!1}return this.Kt}}class Gt{constructor(t){this.ih=new qt(t)}lr(){return this.ih}}const Kt={El:4,Vl:1e-4};function Jt(t,i){const s=100*(t-i)/i;return i<0?-s:s}function Qt(t,i){const s=Jt(t.$e(),i),n=Jt(t.Ue(),i);return new ct(s,n)}function ti(t,i){const s=100*(t-i)/i+100;return i<0?-s:s}function ii(t,i){const s=ti(t.$e(),i),n=ti(t.Ue(),i);return new ct(s,n)}function si(t,i){const s=Math.abs(t);if(s<1e-15)return 0;const n=Math.log10(s+i.Vl)+i.El;return t<0?-n:n}function ni(t,i){const s=Math.abs(t);if(s<1e-15)return 0;const n=Math.pow(10,s-i.El)-i.Vl;return t<0?-n:n}function ei(t,i){if(null===t)return null;const s=si(t.$e(),i),n=si(t.Ue(),i);return new ct(s,n)}function ri(t,i){if(null===t)return null;const s=ni(t.$e(),i),n=ni(t.Ue(),i);return new ct(s,n)}function hi(t){if(null===t)return Kt;const i=Math.abs(t.Ue()-t.$e());if(i>=1||i<1e-15)return Kt;const s=Math.ceil(Math.abs(Math.log10(i))),n=Kt.El+s;return{El:n,Vl:1/Math.pow(10,n)}}class li{constructor(t,i){if(this.zl=t,this.Il=i,function(t){if(t<0)return!1;for(let i=t;i>1;i/=10)if(i%10!=0)return!1;return!0}(this.zl))this.Bl=[2,2.5,2];else{this.Bl=[];for(let t=this.zl;1!==t;){if(t%2==0)this.Bl.push(2),t/=2;else{if(t%5!=0)throw new Error("unexpected base");this.Bl.push(2,2.5),t/=5}if(this.Bl.length>100)throw new Error("something wrong with base")}}}Al(t,i,s){const n=0===this.zl?0:1/this.zl;let e=Math.pow(10,Math.max(0,Math.ceil(Math.log10(t-i)))),r=0,h=this.Il[0];for(;;){const t=Xt(e,n,1e-14)&&e>n+1e-14,i=Xt(e,s*h,1e-14),l=Xt(e,1,1e-14);if(!(t&&i&&l))break;e/=h,h=this.Il[++r%this.Il.length]}if(e<=n+1e-14&&(e=n),e=Math.max(1,e),this.Bl.length>0&&(l=e,a=1,o=1e-14,Math.abs(l-a)n+1e-14;)e/=h,h=this.Bl[++r%this.Bl.length];var l,a,o;return e}}class ai{constructor(t,i,s,n){this.Ll=[],this.Yi=t,this.zl=i,this.Ol=s,this.Nl=n}Al(t,i){if(t=o?1:-1;let d=null,f=0;for(let s=a-u;s>o;s-=_){const n=this.Nl(s,i,!0);null!==d&&Math.abs(n-d)l||(fl(t.hs())-l(i.hs())))}var _i;!function(t){t[t.Normal=0]="Normal",t[t.Logarithmic=1]="Logarithmic",t[t.Percentage=2]="Percentage",t[t.IndexedTo100=3]="IndexedTo100"}(_i||(_i={}));const ui=new K,ci=new G(100,1);class di{constructor(t,i,s,n,e){this.Yl=0,this.Xl=null,this.Ge=null,this.Zl=null,this.ql={Gl:!1,Kl:null},this.Jl=0,this.Ql=0,this.ta=new o,this.ia=new o,this.sa=[],this.na=null,this.ea=null,this.ra=null,this.ha=null,this.la=null,this.rl=ci,this.aa=hi(null),this.oa=t,this.Cs=i,this._a=s,this.ua=n,this.ca=e,this.da=new ai(this,100,this.fa.bind(this),this.pa.bind(this))}ml(){return this.oa}N(){return this.Cs}rr(t){if(_(this.Cs,t),this.wl(),void 0!==t.mode&&this.va({te:t.mode}),void 0!==t.scaleMargins){const i=h(t.scaleMargins.top),s=h(t.scaleMargins.bottom);if(i<0||i>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${i}`);if(s<0||s>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${s}`);if(i+s>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${i+s}`);this.ma(),this.ra=null}}wa(){return this.Cs.autoScale}jl(){return 1===this.Cs.mode}Ae(){return 2===this.Cs.mode}ga(){return 3===this.Cs.mode}te(){return{tn:this.Cs.autoScale,ba:this.Cs.invertScale,te:this.Cs.mode}}va(t){const i=this.te();let s=null;void 0!==t.tn&&(this.Cs.autoScale=t.tn),void 0!==t.te&&(this.Cs.mode=t.te,2!==t.te&&3!==t.te||(this.Cs.autoScale=!0),this.ql.Gl=!1),1===i.te&&t.te!==i.te&&(!function(t,i){if(null===t)return!1;const s=ni(t.$e(),i),n=ni(t.Ue(),i);return isFinite(s)&&isFinite(n)}(this.Ge,this.aa)?this.Cs.autoScale=!0:(s=ri(this.Ge,this.aa),null!==s&&this.Ma(s))),1===t.te&&t.te!==i.te&&(s=ei(this.Ge,this.aa),null!==s&&this.Ma(s));const n=i.te!==this.Cs.mode;n&&(2===i.te||this.Ae())&&this.wl(),n&&(3===i.te||this.ga())&&this.wl(),void 0!==t.ba&&i.ba!==t.ba&&(this.Cs.invertScale=t.ba,this.Sa()),this.ia.p(i,this.te())}xa(){return this.ia}P(){return this._a.fontSize}Ut(){return this.Yl}Ca(t){this.Yl!==t&&(this.Yl=t,this.ma(),this.ra=null)}ya(){if(this.Xl)return this.Xl;const t=this.Ut()-this.Pa()-this.Ta();return this.Xl=t,t}Je(){return this.ka(),this.Ge}Ma(t,i){const s=this.Ge;(i||null===s&&null!==t||null!==s&&!s.We(t))&&(this.ra=null,this.Ge=t)}Zi(){return this.ka(),0===this.Yl||!this.Ge||this.Ge.Zi()}Ra(t){return this.ba()?t:this.Ut()-1-t}Nt(t,i){return this.Ae()?t=Jt(t,i):this.ga()&&(t=ti(t,i)),this.pa(t,i)}Da(t,i,s){this.ka();const n=this.Ta(),e=l(this.Je()),r=e.$e(),h=e.Ue(),a=this.ya()-1,o=this.ba(),_=a/(h-r),u=void 0===s?0:s.from,c=void 0===s?t.length:s.to,d=this.Ea();for(let s=u;st.Os()))}wl(){this.ra=null;let t=1/0;this.na=null;for(const i of this.sa)i.hs()si(t,this.aa):null}Qa(t,i,s){return void 0===i?(void 0===s&&(s=this.el()),s.format(t)):i(t)}sr(t,i){return this.Qa(t,this.ua.priceFormatter,i)}qa(t,i){return this.Qa(t,this.ua.percentageFormatter,i)}}function fi(t){return t instanceof Ht}class pi{constructor(t,i){this.sa=[],this.io=new Map,this.Yl=0,this.so=0,this.no=1e3,this.ea=null,this.eo=new o,this.yh=[],this._h=t,this.ts=i,this.ro=new Gt(this);const s=i.N();this.ho=this.lo("left",s.leftPriceScale),this.ao=this.lo("right",s.rightPriceScale),this.ho.xa().i(this.oo.bind(this,this.ho),this),this.ao.xa().i(this.oo.bind(this,this.ao),this),this._o(s)}_o(t){if(t.leftPriceScale&&this.ho.rr(t.leftPriceScale),t.rightPriceScale&&this.ao.rr(t.rightPriceScale),t.localization&&(this.ho.wl(),this.ao.wl()),t.overlayPriceScales){const i=Array.from(this.io.values());for(const s of i){const i=l(s[0].Ft());i.rr(t.overlayPriceScales),t.localization&&i.wl()}}}uo(t){switch(t){case"left":return this.ho;case"right":return this.ao}return this.io.has(t)?h(this.io.get(t))[0].Ft():null}m(){this.Qt().co().u(this),this.ho.xa().u(this),this.ao.xa().u(this),this.sa.forEach((t=>{t.m&&t.m()})),this.yh=this.yh.filter((t=>{const i=t.ah();return i.detached&&i.detached(),!1})),this.eo.p()}do(){return this.no}fo(t){this.no=t}Qt(){return this.ts}Qi(){return this.so}Ut(){return this.Yl}po(t){this.so=t,this.vo()}Ca(t){this.Yl=t,this.ho.Ca(t),this.ao.Ca(t),this.sa.forEach((i=>{if(this.Hn(i)){const s=i.Ft();null!==s&&s.Ca(t)}})),this.vo()}mo(){return this.sa.filter(fi)}bl(){return this.sa}Hn(t){const i=t.Ft();return null===i||this.ho!==i&&this.ao!==i}Oa(t,i,s){this.wo(t,i,s?t.hs():this.sa.length)}Fa(t,i){const s=this.sa.indexOf(t);r(-1!==s,"removeDataSource: invalid data source"),this.sa.splice(s,1),i||this.sa.forEach(((t,i)=>t.ls(i)));const n=l(t.Ft()).ml();if(this.io.has(n)){const i=h(this.io.get(n)),s=i.indexOf(t);-1!==s&&(i.splice(s,1),0===i.length&&this.io.delete(n))}const e=t.Ft();e&&e.bl().indexOf(t)>=0&&(e.Fa(t),this.bo(e)),this.ea=null}Un(t){return t===this.ho?"left":t===this.ao?"right":"overlay"}Mo(){return this.ho}So(){return this.ao}xo(t,i){t.$a(i)}Co(t,i){t.Ua(i),this.vo()}yo(t){t.ja()}Po(t,i){t.Ya(i)}To(t,i){t.Xa(i),this.vo()}ko(t){t.Za()}vo(){this.sa.forEach((t=>{t.Os()}))}Ps(){let t=null;return this.ts.N().rightPriceScale.visible&&0!==this.ao.bl().length?t=this.ao:this.ts.N().leftPriceScale.visible&&0!==this.ho.bl().length?t=this.ho:0!==this.sa.length&&(t=this.sa[0].Ft()),null===t&&(t=this.ao),t}$n(){let t=null;return this.ts.N().rightPriceScale.visible?t=this.ao:this.ts.N().leftPriceScale.visible&&(t=this.ho),t}bo(t){null!==t&&t.wa()&&this.Ro(t)}Do(t){const i=this._h.Ce();t.va({tn:!0}),null!==i&&t.Ka(i),this.vo()}Eo(){this.Ro(this.ho),this.Ro(this.ao)}Vo(){this.bo(this.ho),this.bo(this.ao),this.sa.forEach((t=>{this.Hn(t)&&this.bo(t.Ft())})),this.vo(),this.ts.hr()}Dt(){return null===this.ea&&(this.ea=oi(this.sa)),this.ea}zo(t,i){i=Yt(i,0,this.sa.length-1);const s=this.sa.indexOf(t);r(-1!==s,"setSeriesOrder: invalid data source"),this.sa.splice(s,1),this.sa.splice(i,0,t),this.sa.forEach(((t,i)=>t.ls(i))),this.ea=null;for(const t of[this.ho,this.ao])t.Na(),t.wl();this.ts.hr()}Vt(){return this.Dt().filter(fi)}Io(){return this.eo}Bo(){return this.ro}_l(t){this.yh.push(new Dt(t))}ul(t){this.yh=this.yh.filter((i=>i.ah()!==t)),t.detached&&t.detached(),this.ts.hr()}Ao(){return this.yh}il(t,i){return this.yh.map((s=>s.Yn(t,i))).filter((t=>null!==t))}Ro(t){const i=t.Ga();if(i&&i.length>0&&!this._h.Zi()){const i=this._h.Ce();null!==i&&t.Ka(i)}t.Os()}wo(t,i,s){let n=this.uo(i);if(null===n&&(n=this.lo(i,this.ts.N().overlayPriceScales)),this.sa.splice(s,0,t),!Y(i)){const s=this.io.get(i)||[];s.push(t),this.io.set(i,s)}t.ls(s),n.Oa(t),t.os(n),this.bo(n),this.ea=null}oo(t,i,s){i.te!==s.te&&this.Ro(t)}lo(t,i){const s={visible:!0,autoScale:!0,...p(i)},n=new di(t,s,this.ts.N().layout,this.ts.N().localization,this.ts.qi());return n.Ca(this.Ut()),n}}function vi(t){return{Lo:t.Lo,Oo:{Xn:t.No.externalId},Fo:t.No.cursorStyle}}function mi(t,i,s,n){for(const e of t){const t=e.kt(n);if(null!==t&&t.Yn){const n=t.Yn(i,s);if(null!==n)return{Wo:e,Oo:n}}}return null}function wi(t){return void 0!==t.Ns}function gi(t,i,s){const n=[t,...t.Dt()],e=function(t,i,s){let n,e;for(const l of t){const t=l.il?.(i,s)??[];for(const i of t)r=i.zOrder,h=n?.zOrder,(!h||"top"===r&&"top"!==h||"normal"===r&&"bottom"===h)&&(n=i,e=l)}var r,h;return n&&e?{No:n,Lo:e}:null}(n,i,s);if("top"===e?.No.zOrder)return vi(e);for(const r of n){if(e&&e.Lo===r&&"bottom"!==e.No.zOrder&&!e.No.isBackground)return vi(e);if(wi(r)){const n=mi(r.Ns(t),i,s,t);if(null!==n)return{Lo:r,Wo:n.Wo,Oo:n.Oo}}if(e&&e.Lo===r&&"bottom"!==e.No.zOrder&&e.No.isBackground)return vi(e)}return e?.No?vi(e):null}class bi{constructor(t,i,s=50){this.yn=0,this.Pn=1,this.Tn=1,this.Rn=new Map,this.kn=new Map,this.Ho=t,this.$o=i,this.Dn=s}Uo(t){const i=t.time,s=this.$o.cacheKey(i),n=this.Rn.get(s);if(void 0!==n)return n.jo;if(this.yn===this.Dn){const t=this.kn.get(this.Tn);this.kn.delete(this.Tn),this.Rn.delete(h(t)),this.Tn++,this.yn--}const e=this.Ho(t);return this.Rn.set(s,{jo:e,In:this.Pn}),this.kn.set(this.Pn,s),this.yn++,this.Pn++,e}}class Mi{constructor(t,i){r(t<=i,"right should be >= left"),this.Yo=t,this.Xo=i}Hh(){return this.Yo}Mi(){return this.Xo}Zo(){return this.Xo-this.Yo+1}Te(t){return this.Yo<=t&&t<=this.Xo}We(t){return this.Yo===t.Hh()&&this.Xo===t.Mi()}}function Si(t,i){return null===t||null===i?t===i:t.We(i)}class xi{constructor(){this.qo=new Map,this.Rn=null,this.Go=!1}Ko(t){this.Go=t,this.Rn=null}Jo(t,i){this.Qo(i),this.Rn=null;for(let s=i;s{t<=s[0].index?i.push(n):s.splice(Mt(s,t,(i=>i.index!i||s.has(t.index);for(const i of Array.from(this.qo.keys()).sort(((t,i)=>i-t))){if(!this.qo.get(i))continue;const s=n;n=[];const r=s.length;let l=0;const a=h(this.qo.get(i)),o=a.length;let _=1/0,u=-1/0;for(let i=0;i=t&&o-u>=t&&e(h))n.push(h),u=o;else if(this.Go)return s}for(;li.weight?t:i}class Pi{constructor(t,i,s,n){this.so=0,this.o_=null,this.__=[],this.la=null,this.ha=null,this.u_=new xi,this.c_=new Map,this.d_=Ci.a_(),this.f_=!0,this.p_=new o,this.v_=new o,this.m_=new o,this.w_=null,this.g_=null,this.b_=new Map,this.M_=-1,this.S_=[],this.Cs=i,this.ua=s,this.x_=i.rightOffset,this.C_=i.barSpacing,this.ts=t,this.$o=n,this.y_(),this.u_.Ko(i.uniformDistribution),this.P_()}N(){return this.Cs}T_(t){_(this.ua,t),this.k_(),this.y_()}rr(t,i){_(this.Cs,t),this.Cs.fixLeftEdge&&this.R_(),this.Cs.fixRightEdge&&this.D_(),void 0!==t.barSpacing&&this.ts.cn(t.barSpacing),void 0!==t.rightOffset&&this.ts.dn(t.rightOffset),void 0===t.minBarSpacing&&void 0===t.maxBarSpacing||this.ts.cn(t.barSpacing??this.C_),void 0!==t.ignoreWhitespaceIndices&&t.ignoreWhitespaceIndices!==this.Cs.ignoreWhitespaceIndices&&this.P_(),this.k_(),this.y_(),this.m_.p()}ks(t){return this.__[t]?.time??null}ss(t){return this.__[t]??null}E_(t,i){if(this.__.length<1)return null;if(this.$o.key(t)>this.$o.key(this.__[this.__.length-1].time))return i?this.__.length-1:null;const s=Mt(this.__,this.$o.key(t),((t,i)=>this.$o.key(t.time)0}Ce(){return this.z_(),this.d_.h_()}I_(){return this.z_(),this.d_.l_()}B_(){const t=this.Ce();if(null===t)return null;const i={from:t.Hh(),to:t.Mi()};return this.A_(i)}A_(t){const i=Math.round(t.from),s=Math.round(t.to),n=l(this.L_()),e=l(this.O_());return{from:l(this.ss(Math.max(n,i))),to:l(this.ss(Math.min(e,s)))}}N_(t){return{from:l(this.E_(t.from,!0)),to:l(this.E_(t.to,!0))}}Qi(){return this.so}po(t){if(!isFinite(t)||t<=0)return;if(this.so===t)return;const i=this.I_(),s=this.so;if(this.so=t,this.f_=!0,this.Cs.lockVisibleTimeRangeOnResize&&0!==s){const i=this.C_*t/s;this.C_=i}if(this.Cs.fixLeftEdge&&null!==i&&i.Hh()<=0){const i=s-t;this.x_-=Math.round(i/this.C_)+1,this.f_=!0}this.F_(),this.W_()}jt(t){if(this.Zi()||!c(t))return 0;const i=this.H_()+this.x_-t;return this.so-(i+.5)*this.C_-1}U_(t,i){const s=this.H_(),n=void 0===i?0:i.from,e=void 0===i?t.length:i.to;for(let i=n;ii/2&&!_?s.needAlignCoordinate=!1:s.needAlignCoordinate=u&&t.index<=a||c&&t.index>=o,d++}return this.S_.length=d,this.g_=this.S_,this.S_}iu(){this.f_=!0,this.cn(this.Cs.barSpacing),this.dn(this.Cs.rightOffset)}su(t){this.f_=!0,this.o_=t,this.W_(),this.R_()}nu(t,i){const s=this.Y_(t),n=this.G_(),e=n+i*(n/10);this.cn(e),this.Cs.rightBarStaysOnScroll||this.dn(this.J_()+(s-this.Y_(t)))}$a(t){this.la&&this.Za(),null===this.ha&&null===this.w_&&(this.Zi()||(this.ha=t,this.eu()))}Ua(t){if(null===this.w_)return;const i=Yt(this.so-t,0,this.so),s=Yt(this.so-l(this.ha),0,this.so);0!==i&&0!==s&&this.cn(this.w_.G_*i/s)}ja(){null!==this.ha&&(this.ha=null,this.ru())}Ya(t){null===this.la&&null===this.w_&&(this.Zi()||(this.la=t,this.eu()))}Xa(t){if(null===this.la)return;const i=(this.la-t)/this.G_();this.x_=l(this.w_).J_+i,this.f_=!0,this.W_()}Za(){null!==this.la&&(this.la=null,this.ru())}hu(){this.lu(this.Cs.rightOffset)}lu(t,i=400){if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(!isFinite(i)||i<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const s=this.x_,n=performance.now();this.ts.an({au:t=>(t-n)/i>=1,ou:e=>{const r=(e-n)/i;return r>=1?t:s+(t-s)*r}})}Pt(t,i){this.f_=!0,this.__=t,this.u_.Jo(t,i),this.W_()}_u(){return this.p_}uu(){return this.v_}cu(){return this.m_}H_(){return this.o_||0}du(t){const i=t.Zo();this.K_(this.so/i),this.x_=t.Mi()-this.H_(),this.W_(),this.f_=!0,this.ts.q_(),this.ts.hr()}fu(){const t=this.L_(),i=this.O_();null!==t&&null!==i&&this.du(new Mi(t,i+this.Cs.rightOffset))}pu(t){const i=new Mi(t.from,t.to);this.du(i)}ns(t){return void 0!==this.ua.timeFormatter?this.ua.timeFormatter(t.originalTime):this.$o.formatHorzItem(t.time)}P_(){if(!this.Cs.ignoreWhitespaceIndices)return;this.b_.clear();const t=this.ts.Ys();for(const i of t)for(const t of i.vl())this.b_.set(t,!0);this.M_++}Q_(){const t=this.ts.N().handleScroll,i=this.ts.N().handleScale;return!(t.horzTouchDrag||t.mouseWheel||t.pressedMouseMove||t.vertTouchDrag||i.axisDoubleClickReset.time||i.axisPressedMouseMove.time||i.mouseWheel||i.pinch)}L_(){return 0===this.__.length?null:0}O_(){return 0===this.__.length?null:this.__.length-1}vu(t){return(this.so-1-t)/this.C_}Y_(t){const i=this.vu(t),s=this.H_()+this.x_-i;return Math.round(1e6*s)/1e6}K_(t){const i=this.C_;this.C_=t,this.F_(),i!==this.C_&&(this.f_=!0,this.mu())}z_(){if(!this.f_)return;if(this.f_=!1,this.Zi())return void this.wu(Ci.a_());const t=this.H_(),i=this.so/this.C_,s=this.x_+t,n=new Mi(s-i+1,s);this.wu(new Ci(n))}F_(){const t=Yt(this.C_,this.gu(),this.bu());this.C_!==t&&(this.C_=t,this.f_=!0)}bu(){return this.Cs.maxBarSpacing>0?this.Cs.maxBarSpacing:.5*this.so}gu(){return this.Cs.fixLeftEdge&&this.Cs.fixRightEdge&&0!==this.__.length?this.so/this.__.length:this.Cs.minBarSpacing}W_(){const t=this.Mu();null!==t&&this.x_i&&(this.x_=i,this.f_=!0)}Mu(){const t=this.L_(),i=this.o_;if(null===t||null===i)return null;return t-i-1+(this.Cs.fixLeftEdge?this.so/this.C_:Math.min(2,this.__.length))}Su(){return this.Cs.fixRightEdge?0:this.so/this.C_-Math.min(2,this.__.length)}eu(){this.w_={G_:this.G_(),J_:this.J_()}}ru(){this.w_=null}tu(t){let i=this.c_.get(t.weight);return void 0===i&&(i=new bi((t=>this.xu(t)),this.$o),this.c_.set(t.weight,i)),i.Uo(t)}xu(t){return this.$o.formatTickmark(t,this.ua)}wu(t){const i=this.d_;this.d_=t,Si(i.h_(),this.d_.h_())||this.p_.p(),Si(i.l_(),this.d_.l_())||this.v_.p(),this.mu()}mu(){this.g_=null}k_(){this.mu(),this.c_.clear()}y_(){this.$o.updateFormatter(this.ua)}R_(){if(!this.Cs.fixLeftEdge)return;const t=this.L_();if(null===t)return;const i=this.Ce();if(null===i)return;const s=i.Hh()-t;if(s<0){const t=this.x_-s-1;this.dn(t)}this.F_()}D_(){this.W_(),this.F_()}X_(t){return!this.Cs.ignoreWhitespaceIndices||(this.b_.get(t)||!1)}Z_(t){const i=function*(t){const i=Math.round(t),s=is)break}return t}}var Ti,ki,Ri,Di,Ei;!function(t){t[t.OnTouchEnd=0]="OnTouchEnd",t[t.OnNextTap=1]="OnNextTap"}(Ti||(Ti={}));class Vi{constructor(t,i,s){this.Cu=[],this.yu=[],this.so=0,this.Pu=null,this.Tu=new o,this.ku=new o,this.Ru=null,this.Du=t,this.Cs=i,this.$o=s,this.ca=new x(this.Cs.layout.colorParsers),this.Eu=new b(this),this._h=new Pi(this,i.timeScale,this.Cs.localization,s),this.Ct=new j(this,i.crosshair),this.Vu=new jt(i.crosshair),this.zu(0),this.Cu[0].fo(2e3),this.Iu=this.Bu(0),this.Au=this.Bu(1)}Vh(){this.Lu(X.wn())}hr(){this.Lu(X.mn())}qh(){this.Lu(new X(1))}zh(t){const i=this.Ou(t);this.Lu(i)}Nu(){return this.Pu}Fu(t){if(this.Pu?.Lo===t?.Lo&&this.Pu?.Oo?.Xn===t?.Oo?.Xn)return;const i=this.Pu;this.Pu=t,null!==i&&this.zh(i.Lo),null!==t&&t.Lo!==i?.Lo&&this.zh(t.Lo)}N(){return this.Cs}rr(t){_(this.Cs,t),this.Cu.forEach((i=>i._o(t))),void 0!==t.timeScale&&this._h.rr(t.timeScale),void 0!==t.localization&&this._h.T_(t.localization),(t.leftPriceScale||t.rightPriceScale)&&this.Tu.p(),this.Iu=this.Bu(0),this.Au=this.Bu(1),this.Vh()}Wu(t,i,s=0){const n=this.Cu[s];if(void 0===n)return;if("left"===t)return _(this.Cs,{leftPriceScale:i}),n._o({leftPriceScale:i}),this.Tu.p(),void this.Vh();if("right"===t)return _(this.Cs,{rightPriceScale:i}),n._o({rightPriceScale:i}),this.Tu.p(),void this.Vh();const e=this.Hu(t,s);null!==e&&(e.Ft.rr(i),this.Tu.p())}Hu(t,i){const s=this.Cu[i];if(void 0===s)return null;const n=s.uo(t);return null!==n?{Hs:s,Ft:n}:null}It(){return this._h}$s(){return this.Cu}$u(){return this.Ct}Uu(){return this.ku}ju(t,i){t.Ca(i),this.q_()}po(t){this.so=t,this._h.po(this.so),this.Cu.forEach((i=>i.po(t))),this.q_()}Yu(t){1!==this.Cu.length&&(r(t>=0&&t=0&&tt+i.do()),0),e=this.Cu.reduce(((t,i)=>t+i.Ut()),0),h=e-30*(this.Cu.length-1);i=Math.min(h,Math.max(30,i));const l=n/e,a=s.Ut();s.fo(i*l);let o=i-a,_=this.Cu.length-1;for(const t of this.Cu)if(t!==s){const i=Math.min(h,Math.max(30,t.Ut()-o/_));o-=t.Ut()-i,_-=1;const s=i*l;t.fo(s)}this.Vh()}Zu(t,i){r(t>=0&&t=0&&ithis.$o.key(e),a=null!==t&&t>r&&!l,o=this._h.N().allowShiftVisibleRangeOnWhitespaceReplacement,_=i&&(!(void 0===s)||o)&&this._h.N().shiftVisibleRangeOnNewBar;if(a&&!_){const i=t-r;this._h.dn(this._h.J_()-i)}}this._h.su(t)}Ah(t){null!==t&&t.Vo()}Wn(t){if(function(t){return t instanceof pi}(t))return t;const i=this.Cu.find((i=>i.Dt().includes(t)));return void 0===i?null:i}q_(){this.Cu.forEach((t=>t.Vo())),this.Ih()}m(){this.Cu.forEach((t=>t.m())),this.Cu.length=0,this.Cs.localization.priceFormatter=void 0,this.Cs.localization.percentageFormatter=void 0,this.Cs.localization.timeFormatter=void 0}oc(){return this.Eu}jn(){return this.Eu.N()}co(){return this.Tu}_c(t,i){const s=this.zu(i);this.uc(t,s),this.yu.push(t),1===this.yu.length?this.Vh():this.hr()}cc(t){const i=this.Wn(t),s=this.yu.indexOf(t);r(-1!==s,"Series not found");const n=l(i);this.yu.splice(s,1),n.Fa(t),t.m&&t.m(),this._h.P_(),this.dc(n)}Eh(t,i){const s=l(this.Wn(t));s.Fa(t,!0),s.Oa(t,i,!0)}fu(){const t=X.mn();t.en(),this.Lu(t)}fc(t){const i=X.mn();i.ln(t),this.Lu(i)}un(){const t=X.mn();t.un(),this.Lu(t)}cn(t){const i=X.mn();i.cn(t),this.Lu(i)}dn(t){const i=X.mn();i.dn(t),this.Lu(i)}an(t){const i=X.mn();i.an(t),this.Lu(i)}rn(){const t=X.mn();t.rn(),this.Lu(t)}vc(){return this.Cs.rightPriceScale.visible?"right":"left"}mc(t,i){r(i>=0,"Index should be greater or equal to 0");if(i===this.wc(t))return;const s=l(this.Wn(t));s.Fa(t);const n=this.zu(i);this.uc(t,n),0===s.bl().length&&this.dc(s)}gc(){return this.Au}U(){return this.Iu}$t(t){const i=this.Au,s=this.Iu;if(i===s)return i;if(t=Math.max(0,Math.min(100,Math.round(100*t))),null===this.Ru||this.Ru.vr!==s||this.Ru.mr!==i)this.Ru={vr:s,mr:i,bc:new Map};else{const i=this.Ru.bc.get(t);if(void 0!==i)return i}const n=this.ca.tt(s,i,t/100);return this.Ru.bc.set(t,n),n}Mc(t){return this.Cu.indexOf(t)}qi(){return this.ca}zu(t){if(r(t>=0,"Index should be greater or equal to 0"),(t=Math.min(this.Cu.length,t))i.mo().includes(t)))}qu(t,i){const s=new X(i);if(null!==t){const n=this.Cu.indexOf(t);s.Js(n,{Qs:i})}return s}Ou(t,i){return void 0===i&&(i=2),this.qu(this.Wn(t),i)}Lu(t){this.Du&&this.Du(t),this.Cu.forEach((t=>t.Bo().lr().Pt()))}uc(t,i){const s=t.N().priceScaleId,n=void 0!==s?s:this.vc();i.Oa(t,n),Y(n)||t.rr(t.N())}Bu(t){const i=this.Cs.layout;return"gradient"===i.background.type?0===t?i.background.topColor:i.background.bottomColor:i.background.color}dc(t){0===t.bl().length&&this.Cu.length>1&&(this.Cu.splice(this.Mc(t),1),this.Vh())}}function zi(t){return!u(t)&&!d(t)}function Ii(t){return u(t)}!function(t){t[t.Disabled=0]="Disabled",t[t.Continuous=1]="Continuous",t[t.OnDataUpdate=2]="OnDataUpdate"}(ki||(ki={})),function(t){t[t.LastBar=0]="LastBar",t[t.LastVisible=1]="LastVisible"}(Ri||(Ri={})),function(t){t.Solid="solid",t.VerticalGradient="gradient"}(Di||(Di={})),function(t){t[t.Year=0]="Year",t[t.Month=1]="Month",t[t.DayOfMonth=2]="DayOfMonth",t[t.Time=3]="Time",t[t.TimeWithSeconds=4]="TimeWithSeconds"}(Ei||(Ei={}));const Bi=t=>t.getUTCFullYear();function Ai(t,i,s){return i.replace(/yyyy/g,(t=>q(Bi(t),4))(t)).replace(/yy/g,(t=>q(Bi(t)%100,2))(t)).replace(/MMMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(t,s)).replace(/MMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(t,s)).replace(/MM/g,(t=>q((t=>t.getUTCMonth()+1)(t),2))(t)).replace(/dd/g,(t=>q((t=>t.getUTCDate())(t),2))(t))}class Li{constructor(t="yyyy-MM-dd",i="default"){this.Sc=t,this.xc=i}Uo(t){return Ai(t,this.Sc,this.xc)}}class Oi{constructor(t){this.Cc=t||"%h:%m:%s"}Uo(t){return this.Cc.replace("%h",q(t.getUTCHours(),2)).replace("%m",q(t.getUTCMinutes(),2)).replace("%s",q(t.getUTCSeconds(),2))}}const Ni={yc:"yyyy-MM-dd",Pc:"%h:%m:%s",Tc:" ",kc:"default"};class Fi{constructor(t={}){const i={...Ni,...t};this.Rc=new Li(i.yc,i.kc),this.Dc=new Oi(i.Pc),this.Ec=i.Tc}Uo(t){return`${this.Rc.Uo(t)}${this.Ec}${this.Dc.Uo(t)}`}}function Wi(t){return 60*t*60*1e3}function Hi(t){return 60*t*1e3}const $i=[{Vc:(Ui=1,1e3*Ui),zc:10},{Vc:Hi(1),zc:20},{Vc:Hi(5),zc:21},{Vc:Hi(30),zc:22},{Vc:Wi(1),zc:30},{Vc:Wi(3),zc:31},{Vc:Wi(6),zc:32},{Vc:Wi(12),zc:33}];var Ui;function ji(t,i){if(t.getUTCFullYear()!==i.getUTCFullYear())return 70;if(t.getUTCMonth()!==i.getUTCMonth())return 60;if(t.getUTCDate()!==i.getUTCDate())return 50;for(let s=$i.length-1;s>=0;--s)if(Math.floor(i.getTime()/$i[s].Vc)!==Math.floor(t.getTime()/$i[s].Vc))return $i[s].zc;return 0}function Yi(t){let i=t;if(d(t)&&(i=Zi(t)),!zi(i))throw new Error("time must be of type BusinessDay");const s=new Date(Date.UTC(i.year,i.month-1,i.day,0,0,0,0));return{Ic:Math.round(s.getTime()/1e3),Bc:i}}function Xi(t){if(!Ii(t))throw new Error("time must be of type isUTCTimestamp");return{Ic:t}}function Zi(t){const i=new Date(t);if(isNaN(i.getTime()))throw new Error(`Invalid date string=${t}, expected format=yyyy-mm-dd`);return{day:i.getUTCDate(),month:i.getUTCMonth()+1,year:i.getUTCFullYear()}}function qi(t){d(t.time)&&(t.time=Zi(t.time))}class Gi{options(){return this.Cs}setOptions(t){this.Cs=t,this.updateFormatter(t.localization)}preprocessData(t){Array.isArray(t)?function(t){t.forEach(qi)}(t):qi(t)}createConverterToInternalObj(t){return l(function(t){return 0===t.length?null:zi(t[0].time)||d(t[0].time)?Yi:Xi}(t))}key(t){return"object"==typeof t&&"Ic"in t?t.Ic:this.key(this.convertHorzItemToInternal(t))}cacheKey(t){const i=t;return void 0===i.Bc?new Date(1e3*i.Ic).getTime():new Date(Date.UTC(i.Bc.year,i.Bc.month-1,i.Bc.day)).getTime()}convertHorzItemToInternal(t){return Ii(i=t)?Xi(i):zi(i)?Yi(i):Yi(Zi(i));var i}updateFormatter(t){if(!this.Cs)return;const i=t.dateFormat;this.Cs.timeScale.timeVisible?this.Ac=new Fi({yc:i,Pc:this.Cs.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Tc:" ",kc:t.locale}):this.Ac=new Li(i,t.locale)}formatHorzItem(t){const i=t;return this.Ac.Uo(new Date(1e3*i.Ic))}formatTickmark(t,i){const s=function(t,i,s){switch(t){case 0:case 10:return i?s?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return i?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(t.weight,this.Cs.timeScale.timeVisible,this.Cs.timeScale.secondsVisible),n=this.Cs.timeScale;if(void 0!==n.tickMarkFormatter){const e=n.tickMarkFormatter(t.originalTime,s,i.locale);if(null!==e)return e}return function(t,i,s){const n={};switch(i){case 0:n.year="numeric";break;case 1:n.month="short";break;case 2:n.day="numeric";break;case 3:n.hour12=!1,n.hour="2-digit",n.minute="2-digit";break;case 4:n.hour12=!1,n.hour="2-digit",n.minute="2-digit",n.second="2-digit"}const e=void 0===t.Bc?new Date(1e3*t.Ic):new Date(Date.UTC(t.Bc.year,t.Bc.month-1,t.Bc.day));return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()).toLocaleString(s,n)}(t.time,s,i.locale)}maxTickMarkWeight(t){let i=t.reduce(yi,t[0]).weight;return i>30&&i<50&&(i=30),i}fillWeightsForPoints(t,i){!function(t,i=0){if(0===t.length)return;let s=0===i?null:t[i-1].time.Ic,n=null!==s?new Date(1e3*s):null,e=0;for(let r=i;r1){const i=Math.ceil(e/(t.length-1)),s=new Date(1e3*(t[0].time.Ic-i));t[0].timeWeight=ji(new Date(1e3*t[0].time.Ic),s)}}(t,i)}static Lc(t){return _({localization:{dateFormat:"dd MMM 'yy"}},t??{})}}function Ki(t){var i=t.width,s=t.height;if(i<0)throw new Error("Negative width is not allowed for Size");if(s<0)throw new Error("Negative height is not allowed for Size");return{width:i,height:s}}function Ji(t,i){return t.width===i.width&&t.height===i.height}var Qi=function(){function t(t){var i=this;this._resolutionListener=function(){return i._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return t.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(t.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),t.prototype.subscribe=function(t){var i=this,s={next:t};return this._observers.push(s),{unsubscribe:function(){i._observers=i._observers.filter((function(t){return t!==s}))}}},t.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw new Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},t.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},t.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},t.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach((function(i){return i.next(t._window.devicePixelRatio)})),this._reinstallResolutionListener()},t}();var ts=function(){function t(t,i,s){var n;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=Ki({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=null!=i?i:function(t){return t},this._allowResizeObserver=null===(n=null==s?void 0:s.allowResizeObserver)||void 0===n||n,this._chooseAndInitObserver()}return t.prototype.dispose=function(){var t,i;if(null===this._canvasElement)throw new Error("Object is disposed");null===(t=this._canvasElementResizeObserver)||void 0===t||t.disconnect(),this._canvasElementResizeObserver=null,null===(i=this._devicePixelRatioObservable)||void 0===i||i.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(t.prototype,"canvasElement",{get:function(){if(null===this._canvasElement)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bitmapSize",{get:function(){return Ki({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),t.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=Ki(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},t.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},t.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter((function(i){return i!==t}))},Object.defineProperty(t.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),t.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},t.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter((function(i){return i!==t}))},t.prototype.applySuggestedBitmapSize=function(){if(null!==this._suggestedBitmapSize){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},t.prototype._resizeBitmap=function(t){var i=this.bitmapSize;Ji(i,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(i,t))},t.prototype._emitBitmapSizeChanged=function(t,i){var s=this;this._bitmapSizeChangedListeners.forEach((function(n){return n.call(s,t,i)}))},t.prototype._suggestNewBitmapSize=function(t){var i=this._suggestedBitmapSize,s=Ki(this._transformBitmapSize(t,this._canvasElementClientSize)),n=Ji(this.bitmapSize,s)?null:s;null===i&&null===n||null!==i&&null!==n&&Ji(i,n)||(this._suggestedBitmapSize=n,this._emitSuggestedBitmapSizeChanged(i,n))},t.prototype._emitSuggestedBitmapSizeChanged=function(t,i){var s=this;this._suggestedBitmapSizeChangedListeners.forEach((function(n){return n.call(s,t,i)}))},t.prototype._chooseAndInitObserver=function(){var t=this;this._allowResizeObserver?new Promise((function(t){var i=new ResizeObserver((function(s){t(s.every((function(t){return"devicePixelContentBoxSize"in t}))),i.disconnect()}));i.observe(document.body,{box:"device-pixel-content-box"})})).catch((function(){return!1})).then((function(i){return i?t._initResizeObserver():t._initDevicePixelRatioObservable()})):this._initDevicePixelRatioObservable()},t.prototype._initDevicePixelRatioObservable=function(){var t=this;if(null!==this._canvasElement){var i=is(this._canvasElement);if(null===i)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=function(t){return new Qi(t)}(i),this._devicePixelRatioObservable.subscribe((function(){return t._invalidateBitmapSize()})),this._invalidateBitmapSize()}},t.prototype._invalidateBitmapSize=function(){var t,i;if(null!==this._canvasElement){var s=is(this._canvasElement);if(null!==s){var n=null!==(i=null===(t=this._devicePixelRatioObservable)||void 0===t?void 0:t.value)&&void 0!==i?i:s.devicePixelRatio,e=this._canvasElement.getClientRects(),r=void 0!==e[0]?function(t,i){return Ki({width:Math.round(t.left*i+t.width*i)-Math.round(t.left*i),height:Math.round(t.top*i+t.height*i)-Math.round(t.top*i)})}(e[0],n):Ki({width:this._canvasElementClientSize.width*n,height:this._canvasElementClientSize.height*n});this._suggestNewBitmapSize(r)}}},t.prototype._initResizeObserver=function(){var t=this;null!==this._canvasElement&&(this._canvasElementResizeObserver=new ResizeObserver((function(i){var s=i.find((function(i){return i.target===t._canvasElement}));if(s&&s.devicePixelContentBoxSize&&s.devicePixelContentBoxSize[0]){var n=s.devicePixelContentBoxSize[0],e=Ki({width:n.inlineSize,height:n.blockSize});t._suggestNewBitmapSize(e)}})),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},t}();function is(t){return t.ownerDocument.defaultView}var ss=function(){function t(t,i,s){if(0===i.width||0===i.height)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=i,0===s.width||0===s.height)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=s,this._context=t}return t.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},t.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(t.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),t}();function ns(t,i){var s=t.canvasElementClientSize;if(0===s.width||0===s.height)return null;var n=t.bitmapSize;if(0===n.width||0===n.height)return null;var e=t.canvasElement.getContext("2d",i);return null===e?null:new ss(e,s,n)}const es="undefined"!=typeof window;function rs(){return!!es&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function hs(){return!!es&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function ls(t){return t+t%2}function as(t){es&&void 0!==window.chrome&&t.addEventListener("mousedown",(t=>{if(1===t.button)return t.preventDefault(),!1}))}class os{constructor(t,i,s){this.Oc=0,this.Nc=null,this.Fc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Wc=0,this.Hc=null,this.$c={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Uc=null,this.jc=!1,this.Yc=null,this.Xc=null,this.Zc=!1,this.qc=!1,this.Gc=!1,this.Kc=null,this.Jc=null,this.Qc=null,this.td=null,this.sd=null,this.nd=null,this.ed=null,this.rd=0,this.hd=!1,this.ld=!1,this.ad=!1,this.od=0,this._d=null,this.ud=!hs(),this.dd=t=>{this.fd(t)},this.pd=t=>{if(this.vd(t)){const i=this.md(t);if(++this.Wc,this.Hc&&this.Wc>1){const{wd:s}=this.gd(cs(t),this.$c);s<30&&!this.Gc&&this.bd(i,this.Sd.Md),this.xd()}}else{const i=this.md(t);if(++this.Oc,this.Nc&&this.Oc>1){const{wd:s}=this.gd(cs(t),this.Fc);s<5&&!this.qc&&this.Cd(i,this.Sd.yd),this.Pd()}}},this.Td=t,this.Sd=i,this.Cs=s,this.kd()}m(){null!==this.Kc&&(this.Kc(),this.Kc=null),null!==this.Jc&&(this.Jc(),this.Jc=null),null!==this.td&&(this.td(),this.td=null),null!==this.sd&&(this.sd(),this.sd=null),null!==this.nd&&(this.nd(),this.nd=null),null!==this.Qc&&(this.Qc(),this.Qc=null),this.Rd(),this.Pd()}Dd(t){this.td&&this.td();const i=this.Ed.bind(this);if(this.td=()=>{this.Td.removeEventListener("mousemove",i)},this.Td.addEventListener("mousemove",i),this.vd(t))return;const s=this.md(t);this.Cd(s,this.Sd.Vd),this.ud=!0}Pd(){null!==this.Nc&&clearTimeout(this.Nc),this.Oc=0,this.Nc=null,this.Fc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}xd(){null!==this.Hc&&clearTimeout(this.Hc),this.Wc=0,this.Hc=null,this.$c={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Ed(t){if(this.ad||null!==this.Xc)return;if(this.vd(t))return;const i=this.md(t);this.Cd(i,this.Sd.zd),this.ud=!0}Id(t){const i=fs(t.changedTouches,l(this._d));if(null===i)return;if(this.od=ds(t),null!==this.ed)return;if(this.ld)return;this.hd=!0;const s=this.gd(cs(i),l(this.Xc)),{Bd:n,Ad:e,wd:r}=s;if(this.Zc||!(r<5)){if(!this.Zc){const t=.5*n,i=e>=t&&!this.Cs.Ld(),s=t>e&&!this.Cs.Od();i||s||(this.ld=!0),this.Zc=!0,this.Gc=!0,this.Rd(),this.xd()}if(!this.ld){const s=this.md(t,i);this.bd(s,this.Sd.Nd),us(t)}}}Fd(t){if(0!==t.button)return;const i=this.gd(cs(t),l(this.Yc)),{wd:s}=i;if(s>=5&&(this.qc=!0,this.Pd()),this.qc){const i=this.md(t);this.Cd(i,this.Sd.Wd)}}gd(t,i){const s=Math.abs(i._t-t._t),n=Math.abs(i.ut-t.ut);return{Bd:s,Ad:n,wd:s+n}}Hd(t){let i=fs(t.changedTouches,l(this._d));if(null===i&&0===t.touches.length&&(i=t.changedTouches[0]),null===i)return;this._d=null,this.od=ds(t),this.Rd(),this.Xc=null,this.nd&&(this.nd(),this.nd=null);const s=this.md(t,i);if(this.bd(s,this.Sd.$d),++this.Wc,this.Hc&&this.Wc>1){const{wd:t}=this.gd(cs(i),this.$c);t<30&&!this.Gc&&this.bd(s,this.Sd.Md),this.xd()}else this.Gc||(this.bd(s,this.Sd.Ud),this.Sd.Ud&&us(t));0===this.Wc&&us(t),0===t.touches.length&&this.jc&&(this.jc=!1,us(t))}fd(t){if(0!==t.button)return;const i=this.md(t);if(this.Yc=null,this.ad=!1,this.sd&&(this.sd(),this.sd=null),rs()){this.Td.ownerDocument.documentElement.removeEventListener("mouseleave",this.dd)}if(!this.vd(t))if(this.Cd(i,this.Sd.jd),++this.Oc,this.Nc&&this.Oc>1){const{wd:s}=this.gd(cs(t),this.Fc);s<5&&!this.qc&&this.Cd(i,this.Sd.yd),this.Pd()}else this.qc||this.Cd(i,this.Sd.Yd)}Rd(){null!==this.Uc&&(clearTimeout(this.Uc),this.Uc=null)}Xd(t){if(null!==this._d)return;const i=t.changedTouches[0];this._d=i.identifier,this.od=ds(t);const s=this.Td.ownerDocument.documentElement;this.Gc=!1,this.Zc=!1,this.ld=!1,this.Xc=cs(i),this.nd&&(this.nd(),this.nd=null);{const i=this.Id.bind(this),n=this.Hd.bind(this);this.nd=()=>{s.removeEventListener("touchmove",i),s.removeEventListener("touchend",n)},s.addEventListener("touchmove",i,{passive:!1}),s.addEventListener("touchend",n,{passive:!1}),this.Rd(),this.Uc=setTimeout(this.Zd.bind(this,t),240)}const n=this.md(t,i);this.bd(n,this.Sd.qd),this.Hc||(this.Wc=0,this.Hc=setTimeout(this.xd.bind(this),500),this.$c=cs(i))}Gd(t){if(0!==t.button)return;const i=this.Td.ownerDocument.documentElement;rs()&&i.addEventListener("mouseleave",this.dd),this.qc=!1,this.Yc=cs(t),this.sd&&(this.sd(),this.sd=null);{const t=this.Fd.bind(this),s=this.fd.bind(this);this.sd=()=>{i.removeEventListener("mousemove",t),i.removeEventListener("mouseup",s)},i.addEventListener("mousemove",t),i.addEventListener("mouseup",s)}if(this.ad=!0,this.vd(t))return;const s=this.md(t);this.Cd(s,this.Sd.Kd),this.Nc||(this.Oc=0,this.Nc=setTimeout(this.Pd.bind(this),500),this.Fc=cs(t))}kd(){this.Td.addEventListener("mouseenter",this.Dd.bind(this)),this.Td.addEventListener("touchcancel",this.Rd.bind(this));{const t=this.Td.ownerDocument,i=t=>{this.Sd.Jd&&(t.composed&&this.Td.contains(t.composedPath()[0])||t.target&&this.Td.contains(t.target)||this.Sd.Jd())};this.Jc=()=>{t.removeEventListener("touchstart",i)},this.Kc=()=>{t.removeEventListener("mousedown",i)},t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!0})}hs()&&(this.Qc=()=>{this.Td.removeEventListener("dblclick",this.pd)},this.Td.addEventListener("dblclick",this.pd)),this.Td.addEventListener("mouseleave",this.Qd.bind(this)),this.Td.addEventListener("touchstart",this.Xd.bind(this),{passive:!0}),as(this.Td),this.Td.addEventListener("mousedown",this.Gd.bind(this)),this.tf(),this.Td.addEventListener("touchmove",(()=>{}),{passive:!1})}tf(){void 0===this.Sd.if&&void 0===this.Sd.sf&&void 0===this.Sd.nf||(this.Td.addEventListener("touchstart",(t=>this.ef(t.touches)),{passive:!0}),this.Td.addEventListener("touchmove",(t=>{if(2===t.touches.length&&null!==this.ed&&void 0!==this.Sd.sf){const i=_s(t.touches[0],t.touches[1])/this.rd;this.Sd.sf(this.ed,i),us(t)}}),{passive:!1}),this.Td.addEventListener("touchend",(t=>{this.ef(t.touches)})))}ef(t){1===t.length&&(this.hd=!1),2!==t.length||this.hd||this.jc?this.rf():this.hf(t)}hf(t){const i=this.Td.getBoundingClientRect()||{left:0,top:0};this.ed={_t:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,ut:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this.rd=_s(t[0],t[1]),void 0!==this.Sd.if&&this.Sd.if(),this.Rd()}rf(){null!==this.ed&&(this.ed=null,void 0!==this.Sd.nf&&this.Sd.nf())}Qd(t){if(this.td&&this.td(),this.vd(t))return;if(!this.ud)return;const i=this.md(t);this.Cd(i,this.Sd.lf),this.ud=!hs()}Zd(t){const i=fs(t.touches,l(this._d));if(null===i)return;const s=this.md(t,i);this.bd(s,this.Sd.af),this.Gc=!0,this.jc=!0}vd(t){return t.sourceCapabilities&&void 0!==t.sourceCapabilities.firesTouchEvents?t.sourceCapabilities.firesTouchEvents:ds(t){"touchstart"!==t.type&&us(t)}}}}function _s(t,i){const s=t.clientX-i.clientX,n=t.clientY-i.clientY;return Math.sqrt(s*s+n*n)}function us(t){t.cancelable&&t.preventDefault()}function cs(t){return{_t:t.pageX,ut:t.pageY}}function ds(t){return t.timeStamp||performance.now()}function fs(t,i){for(let s=0;s!1,Od:()=>!0}),this.ff={Ef:s,Df:t}}Cf(){this.xf.style.background=this.wf.N().layout.panes.separatorColor}Vf(t){null!==this.ff&&(this.ff.Ef.style.backgroundColor=this.wf.N().layout.panes.separatorHoverColor)}zf(t){null!==this.ff&&null===this.mf&&(this.ff.Ef.style.backgroundColor="")}If(t){if(null===this.ff)return;const i=this.gf.Lf().do()+this.Mf.Lf().do(),s=i/(this.gf.Tf().height+this.Mf.Tf().height),n=30*s;i<=2*n||(this.mf={Of:t.pageY,Nf:this.gf.Lf().do(),Ff:i-n,Wf:i,Hf:s,$f:n},this.ff.Df.style.display="block")}Bf(t){const i=this.mf;if(null===i)return;const s=(t.pageY-i.Of)*i.Hf,n=Yt(i.Nf+s,i.$f,i.Ff);this.gf.Lf().fo(n),this.Mf.Lf().fo(i.Wf-n),this.wf.Qt().Vh()}Af(t){null!==this.mf&&null!==this.ff&&(this.mf=null,this.ff.Df.style.display="none")}}function vs(t,i){return t.Uf-i.Uf}function ms(t,i,s){const n=(t.Uf-i.Uf)/(t.wt-i.wt);return Math.sign(n)*Math.min(Math.abs(n),s)}class ws{constructor(t,i,s,n){this.jf=null,this.Yf=null,this.Xf=null,this.Zf=null,this.qf=null,this.Gf=0,this.Kf=0,this.Jf=t,this.Qf=i,this.tp=s,this.gn=n}ip(t,i){if(null!==this.jf){if(this.jf.wt===i)return void(this.jf.Uf=t);if(Math.abs(this.jf.Uf-t)50)return;let s=0;const n=ms(this.jf,this.Yf,this.Qf),e=vs(this.jf,this.Yf),r=[n],h=[e];if(s+=e,null!==this.Xf){const t=ms(this.Yf,this.Xf,this.Qf);if(Math.sign(t)===Math.sign(n)){const i=vs(this.Yf,this.Xf);if(r.push(t),h.push(i),s+=i,null!==this.Zf){const t=ms(this.Xf,this.Zf,this.Qf);if(Math.sign(t)===Math.sign(n)){const i=vs(this.Xf,this.Zf);r.push(t),h.push(i),s+=i}}}}let l=0;for(let t=0;t160?"dark":"light"}up(){return this.lp.N().layout.attributionLogo}dp(){const t=new URL(location.href);return t.hostname?"&utm_source="+t.hostname+t.pathname:""}ap(){this._p()&&(this.op(),this.fs=this.up(),this.fs&&(this.rp=this.cp(),this.ep=document.createElement("style"),this.ep.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.np=document.createElement("a"),this.np.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.dp()}`,this.np.title="Charting by TradingView",this.np.id="tv-attr-logo",this.np.target="_blank",this.np.innerHTML='',this.np.toggleAttribute("data-dark","dark"===this.rp),this.hp.appendChild(this.ep),this.hp.appendChild(this.np)))}}function bs(t,i){const s=l(t.ownerDocument).createElement("canvas");t.appendChild(s);const n=function(t,i){if("device-pixel-content-box"===i.type)return new ts(t,i.transform,i.options);throw new Error("Unsupported binding target")}(s,{type:"device-pixel-content-box",options:{allowResizeObserver:!0},transform:(t,i)=>({width:Math.max(t.width,i.width),height:Math.max(t.height,i.height)})});return n.resizeCanvasElement(i),n}function Ms(t){t.width=1,t.height=1,t.getContext("2d")?.clearRect(0,0,1,1)}function Ss(t,i,s,n){t.th&&t.th(i,s,n)}function xs(t,i,s,n){t.nt(i,s,n)}function Cs(t,i,s,n){const e=t(s,n);for(const t of e){const s=t.kt(n);null!==s&&i(s)}}function ys(t,i){return s=>{if(!function(t){return void 0!==t.Ft}(s))return[];return(s.Ft()?.ml()??"")!==i?[]:s.Qh?.(t)??[]}}function Ps(t,i,s,n){if(!t.length)return;let e=0;const r=t[0].Ut(n,!0);let h=1===i?s/2-(t[0].Fi()-r/2):t[0].Fi()-r/2-s/2;h=Math.max(0,h);for(let r=1;ru-o:_s)&&h>0){const n=1===i?-1-r:r-s,l=Math.min(n,h);for(let s=e;s{this.gp||this.yt.Mp().Qt().hr()},this.Sp=()=>{this.gp||this.yt.Mp().Qt().hr()},this.yt=t,this.Cs=i,this._a=i.layout,this.Eu=s,this.xp="left"===n,this.Cp=ys("normal",n),this.yp=ys("top",n),this.Pp=ys("bottom",n),this.xf=document.createElement("div"),this.xf.style.height="100%",this.xf.style.overflow="hidden",this.xf.style.width="25px",this.xf.style.left="0",this.xf.style.position="relative",this.Tp=bs(this.xf,Ki({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp);const e=this.Tp.canvasElement;e.style.position="absolute",e.style.zIndex="1",e.style.left="0",e.style.top="0",this.kp=bs(this.xf,Ki({width:16,height:16})),this.kp.subscribeSuggestedBitmapSizeChanged(this.Sp);const r=this.kp.canvasElement;r.style.position="absolute",r.style.zIndex="2",r.style.left="0",r.style.top="0";const h={Kd:this.If.bind(this),qd:this.If.bind(this),Wd:this.Bf.bind(this),Nd:this.Bf.bind(this),Jd:this.Rp.bind(this),jd:this.Af.bind(this),$d:this.Af.bind(this),yd:this.Dp.bind(this),Md:this.Dp.bind(this),Vd:this.Ep.bind(this),lf:this.zf.bind(this)};this.pf=new os(this.kp.canvasElement,h,{Ld:()=>!this.Cs.handleScroll.vertTouchDrag,Od:()=>!0})}m(){this.pf.m(),this.kp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),Ms(this.kp.canvasElement),this.kp.dispose(),this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),Ms(this.Tp.canvasElement),this.Tp.dispose(),null!==this.Yi&&this.Yi.Ha().u(this),this.Yi=null}Pf(){return this.xf}P(){return this._a.fontSize}Vp(){const t=this.Eu.N();return this.mp!==t.T&&(this.vp.En(),this.mp=t.T),t}zp(){if(null===this.Yi)return 0;let t=0;const i=this.Vp(),s=l(this.Tp.canvasElement.getContext("2d",{colorSpace:this.yt.Mp().N().layout.colorSpace}));s.save();const n=this.Yi.Dl();s.font=this.Ip(),n.length>0&&(t=Math.max(this.vp.Ei(s,n[0].$l),this.vp.Ei(s,n[n.length-1].$l)));const e=this.Bp();for(let i=e.length;i--;){const n=this.vp.Ei(s,e[i].ri());n>t&&(t=n)}const r=this.Yi.At();if(null!==r&&null!==this.fp&&(2!==(h=this.Cs.crosshair).mode&&h.horzLine.visible&&h.horzLine.labelVisible)){const i=this.Yi.Ts(1,r),n=this.Yi.Ts(this.fp.height-2,r);t=Math.max(t,this.vp.Ei(s,this.Yi.Gi(Math.floor(Math.min(i,n))+.11111111111111,r)),this.vp.Ei(s,this.Yi.Gi(Math.ceil(Math.max(i,n))-.11111111111111,r)))}var h;s.restore();const a=t||34;return ls(Math.ceil(i.S+i.C+i.I+i.B+5+a))}Ap(t){null!==this.fp&&Ji(this.fp,t)||(this.fp=t,this.gp=!0,this.Tp.resizeCanvasElement(t),this.kp.resizeCanvasElement(t),this.gp=!1,this.xf.style.width=`${t.width}px`,this.xf.style.height=`${t.height}px`)}Lp(){return l(this.fp).width}os(t){this.Yi!==t&&(null!==this.Yi&&this.Yi.Ha().u(this),this.Yi=t,t.Ha().i(this.ta.bind(this),this))}Ft(){return this.Yi}En(){const t=this.yt.Lf();this.yt.Mp().Qt().Do(t,l(this.Ft()))}Op(t){if(null===this.fp)return;const i={colorSpace:this.yt.Mp().N().layout.colorSpace};if(1!==t){this.Np(),this.Tp.applySuggestedBitmapSize();const t=ns(this.Tp,i);null!==t&&(t.useBitmapCoordinateSpace((t=>{this.Fp(t),this.Wp(t)})),this.yt.Hp(t,this.Pp),this.$p(t),this.yt.Hp(t,this.Cp),this.Up(t))}this.kp.applySuggestedBitmapSize();const s=ns(this.kp,i);null!==s&&(s.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.jp(s),this.yt.Hp(s,this.yp))}kf(){return this.Tp.bitmapSize}Rf(t,i,s){const n=this.kf();n.width>0&&n.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Pt(){this.Yi?.Dl()}If(t){if(null===this.Yi||this.Yi.Zi()||!this.Cs.handleScale.axisPressedMouseMove.price)return;const i=this.yt.Mp().Qt(),s=this.yt.Lf();this.pp=!0,i.xo(s,this.Yi,t.localY)}Bf(t){if(null===this.Yi||!this.Cs.handleScale.axisPressedMouseMove.price)return;const i=this.yt.Mp().Qt(),s=this.yt.Lf(),n=this.Yi;i.Co(s,n,t.localY)}Rp(){if(null===this.Yi||!this.Cs.handleScale.axisPressedMouseMove.price)return;const t=this.yt.Mp().Qt(),i=this.yt.Lf(),s=this.Yi;this.pp&&(this.pp=!1,t.yo(i,s))}Af(t){if(null===this.Yi||!this.Cs.handleScale.axisPressedMouseMove.price)return;const i=this.yt.Mp().Qt(),s=this.yt.Lf();this.pp=!1,i.yo(s,this.Yi)}Dp(t){this.Cs.handleScale.axisDoubleClickReset.price&&this.En()}Ep(t){if(null===this.Yi)return;!this.yt.Mp().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Ae()||this.Yi.ga()||this.Yp(1)}zf(t){this.Yp(0)}Bp(){const t=[],i=null===this.Yi?void 0:this.Yi;return(s=>{for(let n=0;n{t.fillStyle=s.borderColor;const l=Math.max(1,Math.floor(h)),a=Math.floor(.5*h),o=Math.round(n.C*r);t.beginPath();for(const s of i)t.rect(Math.floor(e*r),Math.round(s.yl*h)-a,o,l);t.fill()})),t.useMediaCoordinateSpace((({context:t})=>{t.font=this.Ip(),t.fillStyle=s.textColor??this._a.textColor,t.textAlign=this.xp?"right":"left",t.textBaseline="middle";const r=this.xp?Math.round(e-n.I):Math.round(e+n.C+n.I),h=i.map((i=>this.vp.Di(t,i.$l)));for(let s=i.length;s--;){const n=i[s];t.fillText(n.$l,r,n.yl+h[s])}}))}Np(){if(null===this.fp||null===this.Yi)return;let t=this.fp.height/2;const i=[],s=this.Yi.Dt().slice(),n=this.yt.Lf(),e=this.Vp();this.Yi===n.$n()&&this.yt.Lf().Dt().forEach((t=>{n.Hn(t)&&s.push(t)}));const r=this.Yi.bl()[0],h=this.Yi;s.forEach((s=>{const e=s.Fs(n,h);e.forEach((t=>{t.Wi(null),t.Hi()&&i.push(t)})),r===s&&e.length>0&&(t=e[0].zi())})),i.forEach((t=>t.Wi(t.zi())));this.Yi.N().alignLabels&&this.Xp(i,e,t)}Xp(t,i,s){if(null===this.fp)return;const n=t.filter((t=>t.zi()<=s)),e=t.filter((t=>t.zi()>s));n.sort(((t,i)=>i.zi()-t.zi())),n.length&&e.length&&e.push(n[0]),e.sort(((t,i)=>t.zi()-i.zi()));for(const s of t){const t=Math.floor(s.Ut(i)/2),n=s.zi();n>-t&&nthis.fp.height-t&&n{if(i.$i()){i.kt(l(this.Yi)).nt(t,s,this.vp,n)}}))}jp(t){if(null===this.fp||null===this.Yi)return;const i=this.yt.Mp().Qt(),s=[],n=this.yt.Lf(),e=i.$u().Fs(n,this.Yi);e.length&&s.push(e);const r=this.Vp(),h=this.xp?"right":"left";s.forEach((i=>{i.forEach((i=>{i.kt(l(this.Yi)).nt(t,r,this.vp,h)}))}))}Yp(t){this.xf.style.cursor=1===t?"ns-resize":"default"}ta(){const t=this.zp();this.wp{this.gp||null===this.lv||this.ts().hr()},this.Sp=()=>{this.gp||null===this.lv||this.ts().hr()},this.lp=t,this.lv=i,this.lv.Io().i(this.av.bind(this),this,!0),this.ov=document.createElement("td"),this.ov.style.padding="0",this.ov.style.position="relative";const s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",s.style.overflow="hidden",this._v=document.createElement("td"),this._v.style.padding="0",this.uv=document.createElement("td"),this.uv.style.padding="0",this.ov.appendChild(s),this.Tp=bs(s,Ki({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp);const n=this.Tp.canvasElement;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.kp=bs(s,Ki({width:16,height:16})),this.kp.subscribeSuggestedBitmapSizeChanged(this.Sp);const e=this.kp.canvasElement;e.style.position="absolute",e.style.zIndex="2",e.style.left="0",e.style.top="0",this.Sf=document.createElement("tr"),this.Sf.appendChild(this._v),this.Sf.appendChild(this.ov),this.Sf.appendChild(this.uv),this.cv(),this.pf=new os(this.kp.canvasElement,this,{Ld:()=>null===this.nv&&!this.lp.N().handleScroll.vertTouchDrag,Od:()=>null===this.nv&&!this.lp.N().handleScroll.horzTouchDrag})}m(){null!==this.Zp&&this.Zp.m(),null!==this.qp&&this.qp.m(),this.Gp=null,this.kp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),Ms(this.kp.canvasElement),this.kp.dispose(),this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),Ms(this.Tp.canvasElement),this.Tp.dispose(),null!==this.lv&&(this.lv.Io().u(this),this.lv.m()),this.pf.m()}Lf(){return l(this.lv)}dv(t){null!==this.lv&&this.lv.Io().u(this),this.lv=t,null!==this.lv&&this.lv.Io().i(Vs.prototype.av.bind(this),this,!0),this.cv(),this.lp.bf().indexOf(this)===this.lp.bf().length-1?(this.Gp=this.Gp??new gs(this.ov,this.lp),this.Gp.Pt()):(this.Gp?.op(),this.Gp=null)}Mp(){return this.lp}Pf(){return this.Sf}cv(){if(null!==this.lv&&(this.fv(),0!==this.ts().Ys().length)){if(null!==this.Zp){const t=this.lv.Mo();this.Zp.os(l(t))}if(null!==this.qp){const t=this.lv.So();this.qp.os(l(t))}}}pv(){null!==this.Zp&&this.Zp.Pt(),null!==this.qp&&this.qp.Pt()}do(){return null!==this.lv?this.lv.do():0}fo(t){this.lv&&this.lv.fo(t)}Vd(t){if(!this.lv)return;this.vv();const i=t.localX,s=t.localY;this.mv(i,s,t)}Kd(t){this.vv(),this.wv(),this.mv(t.localX,t.localY,t)}zd(t){if(!this.lv)return;this.vv();const i=t.localX,s=t.localY;this.mv(i,s,t)}Yd(t){null!==this.lv&&(this.vv(),this.gv(t))}yd(t){null!==this.lv&&this.bv(this.tv,t)}Md(t){this.yd(t)}Wd(t){this.vv(),this.Mv(t),this.mv(t.localX,t.localY,t)}jd(t){null!==this.lv&&(this.vv(),this.sv=!1,this.Sv(t))}Ud(t){null!==this.lv&&this.gv(t)}af(t){if(this.sv=!0,null===this.nv){const i={x:t.localX,y:t.localY};this.xv(i,i,t)}}lf(t){null!==this.lv&&(this.vv(),this.lv.Qt().Fu(null),this.Cv())}yv(){return this.Qp}Pv(){return this.tv}if(){this.iv=1,this.ts().rn()}sf(t,i){if(!this.lp.N().handleScale.pinch)return;const s=5*(i-this.iv);this.iv=i,this.ts().Ku(t._t,s)}qd(t){this.sv=!1,this.ev=null!==this.nv,this.wv();const i=this.ts().$u();null!==this.nv&&i.Et()&&(this.rv={x:i.si(),y:i.ni()},this.nv={x:t.localX,y:t.localY})}Nd(t){if(null===this.lv)return;const i=t.localX,s=t.localY;if(null===this.nv)this.Mv(t);else{this.ev=!1;const n=l(this.rv),e=n.x+(i-this.nv.x),r=n.y+(s-this.nv.y);this.mv(e,r,t)}}$d(t){0===this.Mp().N().trackingMode.exitMode&&(this.ev=!0),this.Tv(),this.Sv(t)}Yn(t,i){const s=this.lv;return null===s?null:gi(s,t,i)}kv(t,i){l("left"===i?this.Zp:this.qp).Ap(Ki({width:t,height:this.fp.height}))}Tf(){return this.fp}Ap(t){Ji(this.fp,t)||(this.fp=t,this.gp=!0,this.Tp.resizeCanvasElement(t),this.kp.resizeCanvasElement(t),this.gp=!1,this.ov.style.width=t.width+"px",this.ov.style.height=t.height+"px")}Rv(){const t=l(this.lv);t.bo(t.Mo()),t.bo(t.So());for(const i of t.bl())if(t.Hn(i)){const s=i.Ft();null!==s&&t.bo(s),i.Os()}for(const i of t.Ao())i.Os()}kf(){return this.Tp.bitmapSize}Rf(t,i,s){const n=this.kf();n.width>0&&n.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Op(t){if(0===t)return;if(null===this.lv)return;t>1&&this.Rv(),null!==this.Zp&&this.Zp.Op(t),null!==this.qp&&this.qp.Op(t);const i={colorSpace:this.lp.N().layout.colorSpace};if(1!==t){this.Tp.applySuggestedBitmapSize();const t=ns(this.Tp,i);null!==t&&(t.useBitmapCoordinateSpace((t=>{this.Fp(t)})),this.lv&&(this.Dv(t,ks),this.Ev(t),this.Dv(t,Rs),this.Dv(t,Ds)))}this.kp.applySuggestedBitmapSize();const s=ns(this.kp,i);null!==s&&(s.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.Vv(s),this.Dv(s,Es),this.Dv(s,Ds))}zv(){return this.Zp}Iv(){return this.qp}Hp(t,i){this.Dv(t,i)}av(){null!==this.lv&&this.lv.Io().u(this),this.lv=null}gv(t){this.bv(this.Qp,t)}bv(t,i){const s=i.localX,n=i.localY;t.v()&&t.p(this.ts().It().j_(s),{x:s,y:n},i)}Fp({context:t,bitmapSize:i}){const{width:s,height:n}=i,e=this.ts(),r=e.U(),h=e.gc();r===h?z(t,0,0,s,n,h):A(t,0,0,s,n,r,h)}Ev(t){const i=l(this.lv),s=i.Bo().lr().kt(i);null!==s&&s.nt(t,!1)}Vv(t){this.Bv(t,Rs,xs,this.ts().$u())}Dv(t,i){const s=l(this.lv),n=s.Dt(),e=s.Ao();for(const s of e)this.Bv(t,i,Ss,s);for(const s of n)this.Bv(t,i,Ss,s);for(const s of e)this.Bv(t,i,xs,s);for(const s of n)this.Bv(t,i,xs,s)}Bv(t,i,s,n){const e=l(this.lv),r=e.Qt().Nu(),h=null!==r&&r.Lo===n,a=null!==r&&h&&void 0!==r.Oo?r.Oo.Zn:void 0;Cs(i,(i=>s(i,t,h,a)),n,e)}fv(){if(null===this.lv)return;const t=this.lp,i=this.lv.Mo().N().visible,s=this.lv.So().N().visible;i||null===this.Zp||(this._v.removeChild(this.Zp.Pf()),this.Zp.m(),this.Zp=null),s||null===this.qp||(this.uv.removeChild(this.qp.Pf()),this.qp.m(),this.qp=null);const n=t.Qt().oc();i&&null===this.Zp&&(this.Zp=new Ts(this,t.N(),n,"left"),this._v.appendChild(this.Zp.Pf())),s&&null===this.qp&&(this.qp=new Ts(this,t.N(),n,"right"),this.uv.appendChild(this.qp.Pf()))}Av(t){return t._f&&this.sv||null!==this.nv}Lv(t){return Math.max(0,Math.min(t,this.fp.width-1))}Ov(t){return Math.max(0,Math.min(t,this.fp.height-1))}mv(t,i,s){this.ts().rc(this.Lv(t),this.Ov(i),s,l(this.lv))}Cv(){this.ts().lc()}Tv(){this.ev&&(this.nv=null,this.Cv())}xv(t,i,s){this.nv=t,this.ev=!1,this.mv(i.x,i.y,s);const n=this.ts().$u();this.rv={x:n.si(),y:n.ni()}}ts(){return this.lp.Qt()}Sv(t){if(!this.Jp)return;const i=this.ts(),s=this.Lf();if(i.ko(s,s.Ps()),this.Kp=null,this.Jp=!1,i.sc(),null!==this.hv){const t=performance.now(),s=i.It();this.hv.le(s.J_(),t),this.hv.au(t)||i.an(this.hv)}}vv(){this.nv=null}wv(){if(!this.lv)return;if(this.ts().rn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)l(document.activeElement).blur();else{const t=document.getSelection();null!==t&&t.removeAllRanges()}!this.lv.Ps().Zi()&&this.ts().It().Zi()}Mv(t){if(null===this.lv)return;const i=this.ts(),s=i.It();if(s.Zi())return;const n=this.lp.N(),e=n.handleScroll,r=n.kineticScroll;if((!e.pressedMouseMove||t._f)&&(!e.horzTouchDrag&&!e.vertTouchDrag||!t._f))return;const h=this.lv.Ps(),l=performance.now();if(null!==this.Kp||this.Av(t)||(this.Kp={x:t.clientX,y:t.clientY,Ic:l,Nv:t.localX,Fv:t.localY}),null!==this.Kp&&!this.Jp&&(this.Kp.x!==t.clientX||this.Kp.y!==t.clientY)){if(t._f&&r.touch||!t._f&&r.mouse){const t=s.G_();this.hv=new ws(.2/t,7/t,.997,15/t),this.hv.ip(s.J_(),this.Kp.Ic)}else this.hv=null;h.Zi()||i.Po(this.lv,h,t.localY),i.Qu(t.localX),this.Jp=!0}this.Jp&&(h.Zi()||i.To(this.lv,h,t.localY),i.tc(t.localX),null!==this.hv&&this.hv.ip(s.J_(),l))}}class zs{constructor(t,i,s,n,e){this.xt=!0,this.fp=Ki({width:0,height:0}),this.bp=()=>this.Op(3),this.xp="left"===t,this.Eu=s.oc,this.Cs=i,this.Wv=n,this.Hv=e,this.xf=document.createElement("div"),this.xf.style.width="25px",this.xf.style.height="100%",this.xf.style.overflow="hidden",this.Tp=bs(this.xf,Ki({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp)}m(){this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),Ms(this.Tp.canvasElement),this.Tp.dispose()}Pf(){return this.xf}Tf(){return this.fp}Ap(t){Ji(this.fp,t)||(this.fp=t,this.Tp.resizeCanvasElement(t),this.xf.style.width=`${t.width}px`,this.xf.style.height=`${t.height}px`,this.xt=!0)}Op(t){if(t<3&&!this.xt)return;if(0===this.fp.width||0===this.fp.height)return;this.xt=!1,this.Tp.applySuggestedBitmapSize();const i=ns(this.Tp,{colorSpace:this.Cs.layout.colorSpace});null!==i&&i.useBitmapCoordinateSpace((t=>{this.Fp(t),this.Wp(t)}))}kf(){return this.Tp.bitmapSize}Rf(t,i,s){const n=this.kf();n.width>0&&n.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Wp({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:n}){if(!this.Wv())return;t.fillStyle=this.Cs.timeScale.borderColor;const e=Math.floor(this.Eu.N().S*s),r=Math.floor(this.Eu.N().S*n),h=this.xp?i.width-e:0;t.fillRect(h,0,e,r)}Fp({context:t,bitmapSize:i}){z(t,0,0,i.width,i.height,this.Hv())}}function Is(t){return i=>i.tl?.(t)??[]}const Bs=Is("normal"),As=Is("top"),Ls=Is("bottom");class Os{constructor(t,i){this.$v=null,this.Uv=null,this.M=null,this.jv=!1,this.fp=Ki({width:0,height:0}),this.Yv=new o,this.vp=new tt(5),this.gp=!1,this.bp=()=>{this.gp||this.lp.Qt().hr()},this.Sp=()=>{this.gp||this.lp.Qt().hr()},this.lp=t,this.$o=i,this.Cs=t.N().layout,this.np=document.createElement("tr"),this.Xv=document.createElement("td"),this.Xv.style.padding="0",this.Zv=document.createElement("td"),this.Zv.style.padding="0",this.xf=document.createElement("td"),this.xf.style.height="25px",this.xf.style.padding="0",this.qv=document.createElement("div"),this.qv.style.width="100%",this.qv.style.height="100%",this.qv.style.position="relative",this.qv.style.overflow="hidden",this.xf.appendChild(this.qv),this.Tp=bs(this.qv,Ki({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp);const s=this.Tp.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.kp=bs(this.qv,Ki({width:16,height:16})),this.kp.subscribeSuggestedBitmapSizeChanged(this.Sp);const n=this.kp.canvasElement;n.style.position="absolute",n.style.zIndex="2",n.style.left="0",n.style.top="0",this.np.appendChild(this.Xv),this.np.appendChild(this.xf),this.np.appendChild(this.Zv),this.Gv(),this.lp.Qt().co().i(this.Gv.bind(this),this),this.pf=new os(this.kp.canvasElement,this,{Ld:()=>!0,Od:()=>!this.lp.N().handleScroll.horzTouchDrag})}m(){this.pf.m(),null!==this.$v&&this.$v.m(),null!==this.Uv&&this.Uv.m(),this.kp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),Ms(this.kp.canvasElement),this.kp.dispose(),this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),Ms(this.Tp.canvasElement),this.Tp.dispose()}Pf(){return this.np}Kv(){return this.$v}Jv(){return this.Uv}Kd(t){if(this.jv)return;this.jv=!0;const i=this.lp.Qt();!i.It().Zi()&&this.lp.N().handleScale.axisPressedMouseMove.time&&i.Gu(t.localX)}qd(t){this.Kd(t)}Jd(){const t=this.lp.Qt();!t.It().Zi()&&this.jv&&(this.jv=!1,this.lp.N().handleScale.axisPressedMouseMove.time&&t.ec())}Wd(t){const i=this.lp.Qt();!i.It().Zi()&&this.lp.N().handleScale.axisPressedMouseMove.time&&i.nc(t.localX)}Nd(t){this.Wd(t)}jd(){this.jv=!1;const t=this.lp.Qt();t.It().Zi()&&!this.lp.N().handleScale.axisPressedMouseMove.time||t.ec()}$d(){this.jd()}yd(){this.lp.N().handleScale.axisDoubleClickReset.time&&this.lp.Qt().un()}Md(){this.yd()}Vd(){this.lp.Qt().N().handleScale.axisPressedMouseMove.time&&this.Yp(1)}lf(){this.Yp(0)}Tf(){return this.fp}Qv(){return this.Yv}tm(t,i,s){Ji(this.fp,t)||(this.fp=t,this.gp=!0,this.Tp.resizeCanvasElement(t),this.kp.resizeCanvasElement(t),this.gp=!1,this.xf.style.width=`${t.width}px`,this.xf.style.height=`${t.height}px`,this.Yv.p(t)),null!==this.$v&&this.$v.Ap(Ki({width:i,height:t.height})),null!==this.Uv&&this.Uv.Ap(Ki({width:s,height:t.height}))}im(){const t=this.sm();return Math.ceil(t.S+t.C+t.P+t.A+t.V+t.nm)}Pt(){this.lp.Qt().It().Dl()}kf(){return this.Tp.bitmapSize}Rf(t,i,s){const n=this.kf();n.width>0&&n.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Op(t){if(0===t)return;const i={colorSpace:this.Cs.colorSpace};if(1!==t){this.Tp.applySuggestedBitmapSize();const s=ns(this.Tp,i);null!==s&&(s.useBitmapCoordinateSpace((t=>{this.Fp(t),this.Wp(t),this.rm(s,Ls)})),this.$p(s),this.rm(s,Bs)),null!==this.$v&&this.$v.Op(t),null!==this.Uv&&this.Uv.Op(t)}this.kp.applySuggestedBitmapSize();const s=ns(this.kp,i);null!==s&&(s.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.hm([...this.lp.Qt().Ys(),this.lp.Qt().$u()],s),this.rm(s,As))}rm(t,i){const s=this.lp.Qt().Ys();for(const n of s)Cs(i,(i=>Ss(i,t,!1,void 0)),n,void 0);for(const n of s)Cs(i,(i=>xs(i,t,!1,void 0)),n,void 0)}Fp({context:t,bitmapSize:i}){z(t,0,0,i.width,i.height,this.lp.Qt().gc())}Wp({context:t,bitmapSize:i,verticalPixelRatio:s}){if(this.lp.N().timeScale.borderVisible){t.fillStyle=this.lm();const n=Math.max(1,Math.floor(this.sm().S*s));t.fillRect(0,0,i.width,n)}}$p(t){const i=this.lp.Qt().It(),s=i.Dl();if(!s||0===s.length)return;const n=this.$o.maxTickMarkWeight(s),e=this.sm(),r=i.N();r.borderVisible&&r.ticksVisible&&t.useBitmapCoordinateSpace((({context:t,horizontalPixelRatio:i,verticalPixelRatio:n})=>{t.strokeStyle=this.lm(),t.fillStyle=this.lm();const r=Math.max(1,Math.floor(i)),h=Math.floor(.5*i);t.beginPath();const l=Math.round(e.C*n);for(let n=s.length;n--;){const e=Math.round(s[n].coord*i);t.rect(e-h,0,r,l)}t.fill()})),t.useMediaCoordinateSpace((({context:t})=>{const i=e.S+e.C+e.A+e.P/2;t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.H(),t.font=this.Ip();for(const e of s)if(e.weight=n){const s=e.needAlignCoordinate?this.am(t,e.coord,e.label):e.coord;t.fillText(e.label,s,i)}}))}am(t,i,s){const n=this.vp.Ei(t,s),e=n/2,r=Math.floor(i-e)+.5;return r<0?i+=Math.abs(0-r):r+n>this.fp.width&&(i-=Math.abs(this.fp.width-(r+n))),i}hm(t,i){const s=this.sm();for(const n of t)for(const t of n.us())t.kt().nt(i,s)}lm(){return this.lp.N().timeScale.borderColor}H(){return this.Cs.textColor}F(){return this.Cs.fontSize}Ip(){return g(this.F(),this.Cs.fontFamily)}om(){return g(this.F(),this.Cs.fontFamily,"bold")}sm(){null===this.M&&(this.M={S:1,L:NaN,A:NaN,V:NaN,Ji:NaN,C:5,P:NaN,T:"",Ki:new tt,nm:0});const t=this.M,i=this.Ip();if(t.T!==i){const s=this.F();t.P=s,t.T=i,t.A=3*s/12,t.V=3*s/12,t.Ji=9*s/12,t.L=0,t.nm=4*s/12,t.Ki.En()}return this.M}Yp(t){this.xf.style.cursor=1===t?"ew-resize":"default"}Gv(){const t=this.lp.Qt(),i=t.N();i.leftPriceScale.visible||null===this.$v||(this.Xv.removeChild(this.$v.Pf()),this.$v.m(),this.$v=null),i.rightPriceScale.visible||null===this.Uv||(this.Zv.removeChild(this.Uv.Pf()),this.Uv.m(),this.Uv=null);const s={oc:this.lp.Qt().oc()},n=()=>i.leftPriceScale.borderVisible&&t.It().N().borderVisible,e=()=>t.gc();i.leftPriceScale.visible&&null===this.$v&&(this.$v=new zs("left",i,s,n,e),this.Xv.appendChild(this.$v.Pf())),i.rightPriceScale.visible&&null===this.Uv&&(this.Uv=new zs("right",i,s,n,e),this.Zv.appendChild(this.Uv.Pf()))}}const Ns=!!es&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((t=>t.brand.includes("Chromium")))&&!!es&&(navigator?.userAgentData?.platform?"Windows"===navigator.userAgentData.platform:navigator.userAgent.toLowerCase().indexOf("win")>=0);class Fs{constructor(t,i,s){var n;this._m=[],this.um=[],this.dm=0,this.Yl=0,this.so=0,this.fm=0,this.pm=0,this.vm=null,this.wm=!1,this.Qp=new o,this.tv=new o,this.ku=new o,this.gm=null,this.bm=null,this.hp=t,this.Cs=i,this.$o=s,this.np=document.createElement("div"),this.np.classList.add("tv-lightweight-charts"),this.np.style.overflow="hidden",this.np.style.direction="ltr",this.np.style.width="100%",this.np.style.height="100%",(n=this.np).style.userSelect="none",n.style.webkitUserSelect="none",n.style.msUserSelect="none",n.style.MozUserSelect="none",n.style.webkitTapHighlightColor="transparent",this.Mm=document.createElement("table"),this.Mm.setAttribute("cellspacing","0"),this.np.appendChild(this.Mm),this.Sm=this.xm.bind(this),Ws(this.Cs)&&this.Cm(!0),this.ts=new Vi(this.Du.bind(this),this.Cs,s),this.Qt().Uu().i(this.ym.bind(this),this),this.Pm=new Os(this,this.$o),this.Mm.appendChild(this.Pm.Pf());const e=i.autoSize&&this.Tm();let r=this.Cs.width,h=this.Cs.height;if(e||0===r||0===h){const i=t.getBoundingClientRect();r=r||i.width,h=h||i.height}this.km(r,h),this.Rm(),t.appendChild(this.np),this.Dm(),this.ts.It().cu().i(this.ts.Vh.bind(this.ts),this),this.ts.co().i(this.ts.Vh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.Cs}bf(){return this._m}Em(){return this.Pm}m(){this.Cm(!1),0!==this.dm&&window.cancelAnimationFrame(this.dm),this.ts.Uu().u(this),this.ts.It().cu().u(this),this.ts.co().u(this),this.ts.m();for(const t of this._m)this.Mm.removeChild(t.Pf()),t.yv().u(this),t.Pv().u(this),t.m();this._m=[];for(const t of this.um)this.Vm(t);this.um=[],l(this.Pm).m(),null!==this.np.parentElement&&this.np.parentElement.removeChild(this.np),this.ku.m(),this.Qp.m(),this.tv.m(),this.zm()}km(t,i,s=!1){if(this.Yl===i&&this.so===t)return;const n=function(t){const i=Math.floor(t.width),s=Math.floor(t.height);return Ki({width:i-i%2,height:s-s%2})}(Ki({width:t,height:i}));this.Yl=n.height,this.so=n.width;const e=this.Yl+"px",r=this.so+"px";l(this.np).style.height=e,l(this.np).style.width=r,this.Mm.style.height=e,this.Mm.style.width=r,s?this.Im(X.wn(),performance.now()):this.ts.Vh()}Op(t){void 0===t&&(t=X.wn());for(let i=0;i{t.Pt()}))}Am(t){(void 0!==t.autoSize||!this.gm||void 0===t.width&&void 0===t.height)&&(t.autoSize&&!this.gm&&this.Tm(),!1===t.autoSize&&null!==this.gm&&this.zm(),t.autoSize||void 0===t.width&&void 0===t.height||this.km(t.width||this.so,t.height||this.Yl))}Om(t){let i=0,s=0;const n=this._m[0],e=(i,s)=>{let n=0;for(let e=0;e{l("left"===i?this.Pm.Kv():this.Pm.Jv()).Rf(l(t),s,n)};if(this.Cs.timeScale.visible){const i=this.Pm.kf();if(null!==t){let e=0;this.Fm()&&(r("left",e,s),e=l(n.zv()).kf().width),this.Pm.Rf(t,e,s),e+=i.width,this.Wm()&&r("right",e,s)}s+=i.height}return Ki({width:i,height:s})}Ym(){let t=0,i=0,s=0;for(const n of this._m)this.Fm()&&(i=Math.max(i,l(n.zv()).zp(),this.Cs.leftPriceScale.minimumWidth)),this.Wm()&&(s=Math.max(s,l(n.Iv()).zp(),this.Cs.rightPriceScale.minimumWidth)),t+=n.do();i=ls(i),s=ls(s);const n=this.so,e=this.Yl,r=Math.max(n-i-s,0),h=1*this.um.length,a=this.Cs.timeScale.visible;let o=a?Math.max(this.Pm.im(),this.Cs.timeScale.minimumHeight):0;var _;o=(_=o)+_%2;const u=h+o,c=e{t.pv()})),3===this.vm?.sn()&&(this.vm.pn(t),this.Zm(),this.qm(this.vm),this.Gm(this.vm,i),t=this.vm,this.vm=null)),this.Op(t)}Gm(t,i){for(const s of t.fn())this.vn(s,i)}qm(t){const i=this.ts.$s();for(let s=0;s{if(this.wm=!1,this.dm=0,null!==this.vm){const i=this.vm;this.vm=null,this.Im(i,t);for(const s of i.fn())if(5===s.hn&&!s.Wt.au(t)){this.Qt().an(s.Wt);break}}})))}Zm(){this.Rm()}Vm(t){this.Mm.removeChild(t.Pf()),t.m()}Rm(){const t=this.ts.$s(),i=t.length,s=this._m.length;for(let t=i;t0){const t=new ps(this,n-1,n);this.um.push(t),this.Mm.insertBefore(t.Pf(),this.Pm.Pf())}this.Mm.insertBefore(i.Pf(),this.Pm.Pf())}for(let s=0;s{const s=i.Zs().Nr(t);null!==s&&e.set(i,s)}))}let r;if(null!==t){const i=this.ts.It().ss(t)?.originalTime;void 0!==i&&(r=i)}const h=this.Qt().Nu(),l=null!==h&&h.Lo instanceof Ht?h.Lo:void 0,a=null!==h&&void 0!==h.Oo?h.Oo.Xn:void 0,o=this.tw(n);return{iw:r,ke:t??void 0,sw:i??void 0,nw:-1!==o?o:void 0,ew:l,rw:e,hw:a,lw:s??void 0}}tw(t){let i=-1;if(t)i=this._m.indexOf(t);else{const t=this.Qt().$u().Hs();null!==t&&(i=this.Qt().$s().indexOf(t))}return i}Km(t,i,s,n){this.Qp.p((()=>this.Qm(i,s,n,t)))}Jm(t,i,s,n){this.tv.p((()=>this.Qm(i,s,n,t)))}ym(t,i,s){this.$m(this.Qt().Nu()?.Fo??null),this.ku.p((()=>this.Qm(t,i,s)))}Dm(){const t=this.Cs.timeScale.visible?"":"none";this.Pm.Pf().style.display=t}Fm(){return this._m[0].Lf().Mo().N().visible}Wm(){return this._m[0].Lf().So().N().visible}Tm(){return"ResizeObserver"in window&&(this.gm=new ResizeObserver((t=>{const i=t[t.length-1];i&&this.km(i.contentRect.width,i.contentRect.height)})),this.gm.observe(this.hp,{box:"border-box"}),!0)}zm(){null!==this.gm&&this.gm.disconnect(),this.gm=null}}function Ws(t){return Boolean(t.handleScroll.mouseWheel||t.handleScale.mouseWheel)}function Hs(t){return function(t){return void 0!==t.open}(t)||function(t){return void 0!==t.value}(t)}function $s(t,i,s,n){const e=s.value,r={ke:i,wt:t,Wt:[e,e,e,e],iw:n};return void 0!==s.color&&(r.R=s.color),r}function Us(t,i,s,n){const e=s.value,r={ke:i,wt:t,Wt:[e,e,e,e],iw:n};return void 0!==s.lineColor&&(r.vt=s.lineColor),void 0!==s.topColor&&(r.vr=s.topColor),void 0!==s.bottomColor&&(r.mr=s.bottomColor),r}function js(t,i,s,n){const e=s.value,r={ke:i,wt:t,Wt:[e,e,e,e],iw:n};return void 0!==s.topLineColor&&(r.wr=s.topLineColor),void 0!==s.bottomLineColor&&(r.gr=s.bottomLineColor),void 0!==s.topFillColor1&&(r.br=s.topFillColor1),void 0!==s.topFillColor2&&(r.Mr=s.topFillColor2),void 0!==s.bottomFillColor1&&(r.Sr=s.bottomFillColor1),void 0!==s.bottomFillColor2&&(r.Cr=s.bottomFillColor2),r}function Ys(t,i,s,n){const e={ke:i,wt:t,Wt:[s.open,s.high,s.low,s.close],iw:n};return void 0!==s.color&&(e.R=s.color),e}function Xs(t,i,s,n){const e={ke:i,wt:t,Wt:[s.open,s.high,s.low,s.close],iw:n};return void 0!==s.color&&(e.R=s.color),void 0!==s.borderColor&&(e.Ht=s.borderColor),void 0!==s.wickColor&&(e.pr=s.wickColor),e}function Zs(t,i,s,n,e){const r=h(e)(s),l=Math.max(...r),a=Math.min(...r),o=r[r.length-1],_=[o,l,a,o],{time:u,color:c,...d}=s;return{ke:i,wt:t,Wt:_,iw:n,ie:d,R:c}}function qs(t){return void 0!==t.Wt}function Gs(t,i){return void 0!==i.customValues&&(t.aw=i.customValues),t}function Ks(t){return(i,s,n,e,r,h)=>function(t,i){return i?i(t):void 0===(s=t).open&&void 0===s.value;var s}(n,h)?Gs({wt:i,ke:s,iw:e},n):Gs(t(i,s,n,e,r),n)}function Js(t){return{Candlestick:Ks(Xs),Bar:Ks(Ys),Area:Ks(Us),Baseline:Ks(js),Histogram:Ks($s),Line:Ks($s),Custom:Ks(Zs)}[t]}function Qs(t){return{ke:0,ow:new Map,Wh:t}}function tn(t,i){if(void 0!==t&&0!==t.length)return{_w:i.key(t[0].wt),uw:i.key(t[t.length-1].wt)}}function sn(t){let i;return t.forEach((t=>{void 0===i&&(i=t.iw)})),h(i)}class nn{constructor(t){this.cw=new Map,this.dw=new Map,this.fw=new Map,this.pw=[],this.$o=t}m(){this.cw.clear(),this.dw.clear(),this.fw.clear(),this.pw=[]}mw(t,i){let s=0!==this.cw.size,n=!1;const e=this.dw.get(t);if(void 0!==e)if(1===this.dw.size)s=!1,n=!0,this.cw.clear();else for(const i of this.pw)i.pointData.ow.delete(t)&&(n=!0);let r=[];if(0!==i.length){const s=i.map((t=>t.time)),e=this.$o.createConverterToInternalObj(i),h=Js(t.kr()),l=t.cl(),a=t.fl();r=i.map(((i,r)=>{const o=e(i.time),_=this.$o.key(o);let u=this.cw.get(_);void 0===u&&(u=Qs(o),this.cw.set(_,u),n=!0);const c=h(o,u.ke,i,s[r],l,a);return u.ow.set(t,c),c}))}s&&this.ww(),this.gw(t,r);let h=-1;if(n){const t=[];this.cw.forEach((i=>{t.push({timeWeight:0,time:i.Wh,pointData:i,originalTime:sn(i.ow)})})),t.sort(((t,i)=>this.$o.key(t.time)-this.$o.key(i.time))),h=this.bw(t)}return this.Mw(t,h,function(t,i,s){const n=tn(t,s),e=tn(i,s);if(void 0!==n&&void 0!==e)return{Sw:!1,Bh:n.uw>=e.uw&&n._w>=e._w}}(this.dw.get(t),e,this.$o))}cc(t){return this.mw(t,[])}xw(t,i,s){const n=i;!function(t){void 0===t.iw&&(t.iw=t.time)}(n),this.$o.preprocessData(i);const e=this.$o.createConverterToInternalObj([i])(i.time),r=this.fw.get(t);if(!s&&void 0!==r&&this.$o.key(e)this.$o.key(t.time)this.$o.key(n.wt)?qs(i)&&s.push(i):qs(i)?s[s.length-1]=i:s.splice(-1,1),this.fw.set(t,i.wt)}Cw(t,i,s){const n=this.dw.get(t);if(void 0===n)return;const e=Mt(n,s,((t,i)=>t.ke{0!==i.length&&(t=Math.max(t,i[i.length-1].ke))})),t}Mw(t,i,s){const n={mo:new Map,It:{H_:this.Pw()}};if(-1!==i)this.dw.forEach(((i,e)=>{n.mo.set(e,{ie:i,Tw:e===t?s:void 0})})),this.dw.has(t)||n.mo.set(t,{ie:[],Tw:s}),n.It.kw=this.pw,n.It.Rw=i;else{const i=this.dw.get(t);n.mo.set(t,{ie:i||[],Tw:s})}return n}}function en(t,i){t.ke=i,t.ow.forEach((t=>{t.ke=i}))}function rn(t,i){return t.wt({...t,...this.Kn.kh().Rr(t.wt)})))}Nw(){this.Iw=null}Aw(){this.Ew&&(this.Fw(),this.Ew=!1),this.Vw&&(this.Ow(),this.Vw=!1),this.Dw&&(this.Ww(),this.Dw=!1)}Ww(){const t=this.Kn.Ft(),i=this.Jn.It();if(this.Nw(),i.Zi()||t.Zi())return;const s=i.Ce();if(null===s)return;if(0===this.Kn.Zs().Br())return;const n=this.Kn.At();null!==n&&(this.Iw=function(t,i,s){const n=i.Hh(),e=i.Mi(),r=Mt(t,n,rn),h=St(t,e,hn);if(!s)return{from:r,to:h};let l=r,a=h;return r>0&&r=n&&(l=r-1),h>0&&h{const s=t.At();return null===s?null:t.Ft().Nt(i,s.Wt)}))}dl(t){return this.ih.priceValueBuilder(t)}pl(t){return this.ih.isWhitespace(t)}Fw(){const t=this.Kn.kh();this.zw=this.Kn.Zs().Wr().map((i=>({wt:i.ke,_t:NaN,...t.Rr(i.ke),jw:i.ie})))}Hw(t,i){i.U_(this.zw,m(this.Iw))}$w(){this.ih.update({bars:this.zw.map(_n),barSpacing:this.Jn.It().G_(),visibleRange:this.Iw},this.Kn.N())}}function _n(t){return{x:t._t,time:t.wt,originalData:t.jw,barColor:t.ur}}const un={color:"#2196f3"},cn=(t,i,s)=>{const n=a(s);return new on(t,i,n)};function dn(t){const i={value:t.Wt[3],time:t.iw};return void 0!==t.aw&&(i.customValues=t.aw),i}function fn(t){const i=dn(t);return void 0!==t.R&&(i.color=t.R),i}function pn(t){const i=dn(t);return void 0!==t.vt&&(i.lineColor=t.vt),void 0!==t.vr&&(i.topColor=t.vr),void 0!==t.mr&&(i.bottomColor=t.mr),i}function vn(t){const i=dn(t);return void 0!==t.wr&&(i.topLineColor=t.wr),void 0!==t.gr&&(i.bottomLineColor=t.gr),void 0!==t.br&&(i.topFillColor1=t.br),void 0!==t.Mr&&(i.topFillColor2=t.Mr),void 0!==t.Sr&&(i.bottomFillColor1=t.Sr),void 0!==t.Cr&&(i.bottomFillColor2=t.Cr),i}function mn(t){const i={open:t.Wt[0],high:t.Wt[1],low:t.Wt[2],close:t.Wt[3],time:t.iw};return void 0!==t.aw&&(i.customValues=t.aw),i}function wn(t){const i=mn(t);return void 0!==t.R&&(i.color=t.R),i}function gn(t){const i=mn(t),{R:s,Ht:n,pr:e}=t;return void 0!==s&&(i.color=s),void 0!==n&&(i.borderColor=n),void 0!==e&&(i.wickColor=e),i}function bn(t){return{Area:pn,Line:fn,Baseline:vn,Histogram:fn,Bar:wn,Candlestick:gn,Custom:Mn}[t]}function Mn(t){const i=t.iw;return{...t.ie,time:i}}const Sn={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},xn={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},Cn={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:w,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},yn={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0},Pn={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1};function Tn(){return{width:0,height:0,autoSize:!1,layout:Cn,crosshair:Sn,grid:xn,overlayPriceScales:{...yn},leftPriceScale:{...yn,visible:!1},rightPriceScale:{...yn,visible:!0},timeScale:Pn,localization:{locale:es?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class kn{constructor(t,i,s){this.wf=t,this.Yw=i,this.Xw=s??0}applyOptions(t){this.wf.Qt().Wu(this.Yw,t,this.Xw)}options(){return this.Yi().N()}width(){return Y(this.Yw)?this.wf.Nm(this.Yw):0}Yi(){return l(this.wf.Qt().Hu(this.Yw,this.Xw)).Ft}}class Rn{constructor(t,i,s,n){this.wf=t,this.yt=s,this.Zw=i,this.qw=n}getHeight(){return this.yt.Ut()}setHeight(t){const i=this.wf.Qt(),s=i.Mc(this.yt);i.Xu(s,t)}paneIndex(){return this.wf.Qt().Mc(this.yt)}moveTo(t){const i=this.paneIndex();i!==t&&(r(t>=0&&tthis.Zw(t)))??[]}getHTMLElement(){return this.wf.bf()[this.paneIndex()].Pf()}attachPrimitive(t){this.yt._l(t),t.attached&&t.attached({chart:this.qw,requestUpdate:()=>this.yt.Qt().Vh()})}detachPrimitive(t){this.yt.ul(t)}priceScale(t){if(null===this.yt.uo(t))throw new Error(`Cannot find price scale with id: ${t}`);return new kn(this.wf,t,this.paneIndex())}}const Dn={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class En{constructor(t){this.tr=t}applyOptions(t){this.tr.rr(t)}options(){return this.tr.N()}Gw(){return this.tr}}class Vn{constructor(t,i,s,n,e,r){this.Kw=new o,this.Kn=t,this.Jw=i,this.Qw=s,this.$o=e,this.qw=n,this.tg=r}m(){this.Kw.m()}priceFormatter(){return this.Kn.el()}priceToCoordinate(t){const i=this.Kn.At();return null===i?null:this.Kn.Ft().Nt(t,i.Wt)}coordinateToPrice(t){const i=this.Kn.At();return null===i?null:this.Kn.Ft().Ts(t,i.Wt)}barsInLogicalRange(t){if(null===t)return null;const i=new Ci(new Mi(t.from,t.to)).h_(),s=this.Kn.Zs();if(s.Zi())return null;const n=s.Nr(i.Hh(),1),e=s.Nr(i.Mi(),-1),r=l(s.Ar()),h=l(s.Xs());if(null!==n&&null!==e&&n.ke>e.ke)return{barsBefore:t.from-r,barsAfter:h-t.to};const a={barsBefore:null===n||n.ke===r?t.from-r:n.ke-r,barsAfter:null===e||e.ke===h?h-t.to:h-e.ke};return null!==n&&null!==e&&(a.from=n.iw,a.to=e.iw),a}setData(t){this.$o,this.Kn.kr(),this.Jw.ig(this.Kn,t),this.sg("full")}update(t,i=!1){this.Kn.kr(),this.Jw.ng(this.Kn,t,i),this.sg("update")}dataByIndex(t,i){const s=this.Kn.Zs().Nr(t,i);if(null===s)return null;return bn(this.seriesType())(s)}data(){const t=bn(this.seriesType());return this.Kn.Zs().Wr().map((i=>t(i)))}subscribeDataChanged(t){this.Kw.i(t)}unsubscribeDataChanged(t){this.Kw._(t)}applyOptions(t){this.Kn.rr(t)}options(){return p(this.Kn.N())}priceScale(){return this.Qw.priceScale(this.Kn.Ft().ml(),this.getPane().paneIndex())}createPriceLine(t){const i=_(p(Dn),t),s=this.Kn.Lh(i);return new En(s)}removePriceLine(t){this.Kn.Oh(t.Gw())}priceLines(){return this.Kn.Nh().map((t=>new En(t)))}seriesType(){return this.Kn.kr()}attachPrimitive(t){this.Kn._l(t),t.attached&&t.attached({chart:this.qw,series:this,requestUpdate:()=>this.Kn.Qt().Vh(),horzScaleBehavior:this.$o})}detachPrimitive(t){this.Kn.ul(t),t.detached&&t.detached(),this.Kn.Qt().Vh()}getPane(){const t=this.Kn,i=l(this.Kn.Qt().Wn(t));return this.tg(i)}moveToPane(t){this.Kn.Qt().mc(this.Kn,t)}seriesOrder(){const t=this.Kn.Qt().Wn(this.Kn);return null===t?-1:t.mo().indexOf(this.Kn)}setSeriesOrder(t){const i=this.Kn.Qt().Wn(this.Kn);null!==i&&i.zo(this.Kn,t)}sg(t){this.Kw.v()&&this.Kw.p(t)}}class zn{constructor(t,i,s){this.eg=new o,this.v_=new o,this.Yv=new o,this.ts=t,this._h=t.It(),this.Pm=i,this._h._u().i(this.rg.bind(this)),this._h.uu().i(this.hg.bind(this)),this.Pm.Qv().i(this.lg.bind(this)),this.$o=s}m(){this._h._u().u(this),this._h.uu().u(this),this.Pm.Qv().u(this),this.eg.m(),this.v_.m(),this.Yv.m()}scrollPosition(){return this._h.J_()}scrollToPosition(t,i){i?this._h.lu(t,1e3):this.ts.dn(t)}scrollToRealTime(){this._h.hu()}getVisibleRange(){const t=this._h.B_();return null===t?null:{from:t.from.originalTime,to:t.to.originalTime}}setVisibleRange(t){const i={from:this.$o.convertHorzItemToInternal(t.from),to:this.$o.convertHorzItemToInternal(t.to)},s=this._h.N_(i);this.ts.fc(s)}getVisibleLogicalRange(){const t=this._h.I_();return null===t?null:{from:t.Hh(),to:t.Mi()}}setVisibleLogicalRange(t){r(t.from<=t.to,"The from index cannot be after the to index."),this.ts.fc(t)}resetTimeScale(){this.ts.un()}fitContent(){this.ts.fu()}logicalToCoordinate(t){const i=this.ts.It();return i.Zi()?null:i.jt(t)}coordinateToLogical(t){return this._h.Zi()?null:this._h.j_(t)}timeToIndex(t,i){const s=this.$o.convertHorzItemToInternal(t);return this._h.E_(s,i)}timeToCoordinate(t){const i=this.timeToIndex(t,!1);return null===i?null:this._h.jt(i)}coordinateToTime(t){const i=this.ts.It(),s=i.j_(t),n=i.ss(s);return null===n?null:n.originalTime}width(){return this.Pm.Tf().width}height(){return this.Pm.Tf().height}subscribeVisibleTimeRangeChange(t){this.eg.i(t)}unsubscribeVisibleTimeRangeChange(t){this.eg._(t)}subscribeVisibleLogicalRangeChange(t){this.v_.i(t)}unsubscribeVisibleLogicalRangeChange(t){this.v_._(t)}subscribeSizeChange(t){this.Yv.i(t)}unsubscribeSizeChange(t){this.Yv._(t)}applyOptions(t){this._h.rr(t)}options(){return{...p(this._h.N()),barSpacing:this._h.G_()}}rg(){this.eg.v()&&this.eg.p(this.getVisibleRange())}hg(){this.v_.v()&&this.v_.p(this.getVisibleLogicalRange())}lg(t){this.Yv.p(t.width,t.height)}}function In(t){if(void 0===t||"custom"===t.type)return;const i=t;void 0!==i.minMove&&void 0===i.precision&&(i.precision=function(t){if(t>=1)return 0;let i=0;for(;i<8;i++){const s=Math.round(t);if(Math.abs(s-t)<1e-8)return i;t*=10}return i}(i.minMove))}function Bn(t){return function(t){if(f(t.handleScale)){const i=t.handleScale;t.handleScale={axisDoubleClickReset:{time:i,price:i},axisPressedMouseMove:{time:i,price:i},mouseWheel:i,pinch:i}}else if(void 0!==t.handleScale){const{axisPressedMouseMove:i,axisDoubleClickReset:s}=t.handleScale;f(i)&&(t.handleScale.axisPressedMouseMove={time:i,price:i}),f(s)&&(t.handleScale.axisDoubleClickReset={time:s,price:s})}const i=t.handleScroll;f(i)&&(t.handleScroll={horzTouchDrag:i,vertTouchDrag:i,mouseWheel:i,pressedMouseMove:i})}(t),t}class An{constructor(t,i,s){this.ag=new Map,this.og=new Map,this._g=new o,this.ug=new o,this.cg=new o,this.Cu=new WeakMap,this.dg=new nn(i);const n=void 0===s?p(Tn()):_(p(Tn()),Bn(s));this.fg=i,this.wf=new Fs(t,n,i),this.wf.yv().i((t=>{this._g.v()&&this._g.p(this.pg(t()))}),this),this.wf.Pv().i((t=>{this.ug.v()&&this.ug.p(this.pg(t()))}),this),this.wf.Uu().i((t=>{this.cg.v()&&this.cg.p(this.pg(t()))}),this);const e=this.wf.Qt();this.vg=new zn(e,this.wf.Em(),this.fg)}remove(){this.wf.yv().u(this),this.wf.Pv().u(this),this.wf.Uu().u(this),this.vg.m(),this.wf.m(),this.ag.clear(),this.og.clear(),this._g.m(),this.ug.m(),this.cg.m(),this.dg.m()}resize(t,i,s){this.autoSizeActive()||this.wf.km(t,i,s)}addCustomSeries(t,i={},s=0){const n=(t=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...un,...t.defaultOptions()},mg:cn,wg:t}))(a(t));return this.gg(n,i,s)}addSeries(t,i={},s=0){return this.gg(t,i,s)}removeSeries(t){const i=h(this.ag.get(t)),s=this.dg.cc(i);this.wf.Qt().cc(i),this.bg(s),this.ag.delete(t),this.og.delete(i)}ig(t,i){this.bg(this.dg.mw(t,i))}ng(t,i,s){this.bg(this.dg.xw(t,i,s))}subscribeClick(t){this._g.i(t)}unsubscribeClick(t){this._g._(t)}subscribeCrosshairMove(t){this.cg.i(t)}unsubscribeCrosshairMove(t){this.cg._(t)}subscribeDblClick(t){this.ug.i(t)}unsubscribeDblClick(t){this.ug._(t)}priceScale(t,i=0){return new kn(this.wf,t,i)}timeScale(){return this.vg}applyOptions(t){this.wf.rr(Bn(t))}options(){return this.wf.N()}takeScreenshot(){return this.wf.Lm()}removePane(t){this.wf.Qt().Yu(t)}swapPanes(t,i){this.wf.Qt().Zu(t,i)}autoSizeActive(){return this.wf.Hm()}chartElement(){return this.wf.Ef()}panes(){return this.wf.Qt().$s().map((t=>this.Mg(t)))}paneSize(t=0){const i=this.wf.jm(t);return{height:i.height,width:i.width}}setCrosshairPosition(t,i,s){const n=this.ag.get(s);if(void 0===n)return;const e=this.wf.Qt().Wn(n);null!==e&&this.wf.Qt().hc(t,i,e)}clearCrosshairPosition(){this.wf.Qt().lc(!0)}horzBehaviour(){return this.fg}gg(i,s={},n=0){r(void 0!==i.mg),In(s.priceFormat),"Candlestick"===i.type&&function(t){void 0!==t.borderColor&&(t.borderUpColor=t.borderColor,t.borderDownColor=t.borderColor),void 0!==t.wickColor&&(t.wickUpColor=t.wickColor,t.wickDownColor=t.wickColor)}(s);const e=_(p(t),p(i.defaultOptions),s),h=i.mg,l=new Ht(this.wf.Qt(),i.type,e,h,i.wg);this.wf.Qt()._c(l,n);const a=new Vn(l,this,this,this,this.fg,(t=>this.Mg(t)));return this.ag.set(a,l),this.og.set(l,a),a}bg(t){const i=this.wf.Qt();i.ac(t.It.H_,t.It.kw,t.It.Rw),t.mo.forEach(((t,i)=>i.ht(t.ie,t.Tw))),i.It().P_(),i.q_()}Sg(t){return h(this.og.get(t))}pg(t){const i=new Map;t.rw.forEach(((t,s)=>{const n=s.kr(),e=bn(n)(t);if("Custom"!==n)r(Hs(e));else{const t=s.fl();r(!t||!1===t(e))}i.set(this.Sg(s),e)}));const s=void 0!==t.ew&&this.og.has(t.ew)?this.Sg(t.ew):void 0;return{time:t.iw,logical:t.ke,point:t.sw,paneIndex:t.nw,hoveredSeries:s,hoveredObjectId:t.hw,seriesData:i,sourceEvent:t.lw}}Mg(t){let i=this.Cu.get(t);return i||(i=new Rn(this.wf,(t=>this.Sg(t)),t,this),this.Cu.set(t,i)),i}}function Ln(t,i,s){const n=function(t){if(d(t)){const i=document.getElementById(t);return r(null!==i,`Cannot find element in DOM with id=${t}`),i}return t}(t),e=new An(n,i,s);return i.setOptions(e.options()),e}function On(t,i){return Ln(t,new Gi,Gi.Lc(i))}class Nn extends ln{constructor(t,i){super(t,i,!0)}Hw(t,i,s){i.U_(this.zw,m(this.Iw)),t.Da(this.zw,s,m(this.Iw))}xg(t,i){return{wt:t,gt:i,_t:NaN,ut:NaN}}Fw(){const t=this.Kn.kh();this.zw=this.Kn.Zs().Wr().map((i=>{const s=i.Wt[3];return this.Cg(i.ke,s,t)}))}}function Fn(t,i,s,n,e,r,h){if(0===i.length||n.from>=i.length||n.to<=0)return;const{context:l,horizontalPixelRatio:a,verticalPixelRatio:o}=t,_=i[n.from];let u=r(t,_),c=_;if(n.to-n.from<2){const i=e/2;l.beginPath();const s={_t:_._t-i,ut:_.ut},n={_t:_._t+i,ut:_.ut};l.moveTo(s._t*a,s.ut*o),l.lineTo(n._t*a,n.ut*o),h(t,u,s,n)}else{const e=(i,s)=>{h(t,u,c,s),l.beginPath(),u=i,c=s};let d=c;l.beginPath(),l.moveTo(_._t*a,_.ut*o);for(let h=n.from+1;h=n.from;--s){const n=i[s];if(n){const i=e(t,n);i!==a&&(l.beginPath(),null!==a&&l.fill(),l.fillStyle=i,a=i);const s=Math.round(n._t*r)+o,u=n.ut*h;l.moveTo(s,u),l.arc(s,u,_,0,2*Math.PI)}}l.fill()}(t,i,a,s,_)}}class Xn extends Yn{kg(t,i){return i.vt}}class Zn extends Nn{constructor(){super(...arguments),this.Lw=new Xn}Cg(t,i,s){return{...this.xg(t,i),...s.Rr(t)}}$w(){const t=this.Kn.N(),i={ot:this.zw,qt:t.lineStyle,Pg:t.lineVisible?t.lineType:void 0,ct:t.lineWidth,Tg:t.pointMarkersVisible?t.pointMarkersRadius||t.lineWidth/2+2:void 0,lt:this.Iw,yg:this.Jn.It().G_()};this.Lw.ht(i)}}const qn={type:"Line",isBuiltIn:!0,defaultOptions:{color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},mg:(t,i)=>new Zn(t,i)};function Gn(t,i,s,n,e){const{context:r,horizontalPixelRatio:h,verticalPixelRatio:l}=i;r.lineTo(e._t*h,t*l),r.lineTo(n._t*h,t*l),r.closePath(),r.fillStyle=s,r.fill()}class Kn extends y{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et(t){if(null===this.rt)return;const{ot:i,lt:s,yg:e,ct:r,qt:h,Pg:l}=this.rt,a=this.rt.Rg??(this.rt.Dg?0:t.mediaSize.height);if(null===s)return;const o=t.context;o.lineCap="butt",o.lineJoin="round",o.lineWidth=r,n(o,h),o.lineWidth=1,Fn(t,i,l,s,e,this.Eg.bind(this),Gn.bind(null,a))}}class Jn{Vg(t,i){const s=this.zg,{Ig:n,Bg:e,Ag:r,Lg:h,Rg:l,Og:a,Ng:o}=i;if(void 0===this.Fg||void 0===s||s.Ig!==n||s.Bg!==e||s.Ag!==r||s.Lg!==h||s.Rg!==l||s.Og!==a||s.Ng!==o){const{verticalPixelRatio:s}=t,_=l||a>0?s:1,u=a*_,c=o===t.bitmapSize.height?o:o*_,d=(l??0)*_,f=t.context.createLinearGradient(0,u,0,c);if(f.addColorStop(0,n),null!=l){const t=Yt((d-u)/(c-u),0,1);f.addColorStop(t,e),f.addColorStop(t,r)}f.addColorStop(1,h),this.Fg=f,this.zg=i}return this.Fg}}class Qn extends Kn{constructor(){super(...arguments),this.Wg=new Jn}Eg(t,i){const s=this.rt;return this.Wg.Vg(t,{Ig:i.br,Bg:i.Mr,Ag:i.Sr,Lg:i.Cr,Rg:s.Rg,Og:s.Og??0,Ng:s.Ng??t.bitmapSize.height})}}class te extends Yn{constructor(){super(...arguments),this.Hg=new Jn}kg(t,i){const s=this.rt;return this.Hg.Vg(t,{Ig:i.wr,Bg:i.wr,Ag:i.gr,Lg:i.gr,Rg:s.Rg,Og:s.Og??0,Ng:s.Ng??t.bitmapSize.height})}}class ie extends Nn{constructor(t,i){super(t,i),this.Lw=new C,this.$g=new Qn,this.Ug=new te,this.Lw.st([this.$g,this.Ug])}Cg(t,i,s){return{...this.xg(t,i),...s.Rr(t)}}$w(){const t=this.Kn.At();if(null===t)return;const i=this.Kn.N(),s=this.Kn.Ft().Nt(i.baseValue.price,t.Wt),n=this.Jn.It().G_();if(null===this.Iw||0===this.zw.length)return;let e,r;if(i.relativeGradient){e=this.zw[this.Iw.from].ut,r=this.zw[this.Iw.from].ut;for(let t=this.Iw.from;tr&&(r=i.ut)}}this.$g.ht({ot:this.zw,ct:i.lineWidth,qt:i.lineStyle,Pg:i.lineType,Rg:s,Og:e,Ng:r,Dg:!1,lt:this.Iw,yg:n}),this.Ug.ht({ot:this.zw,ct:i.lineWidth,qt:i.lineStyle,Pg:i.lineVisible?i.lineType:void 0,Tg:i.pointMarkersVisible?i.pointMarkersRadius||i.lineWidth/2+2:void 0,Rg:s,Og:e,Ng:r,lt:this.Iw,yg:n})}}const se={type:"Baseline",isBuiltIn:!0,defaultOptions:{baseValue:{type:"price",price:0},relativeGradient:!1,topFillColor1:"rgba(38, 166, 154, 0.28)",topFillColor2:"rgba(38, 166, 154, 0.05)",topLineColor:"rgba(38, 166, 154, 1)",bottomFillColor1:"rgba(239, 83, 80, 0.05)",bottomFillColor2:"rgba(239, 83, 80, 0.28)",bottomLineColor:"rgba(239, 83, 80, 1)",lineWidth:3,lineStyle:0,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},mg:(t,i)=>new ie(t,i)};class ne extends y{constructor(){super(...arguments),this.Yt=null,this.jg=0}ht(t){this.Yt=t}et(t){if(null===this.Yt||0===this.Yt.Zs.length||null===this.Yt.lt)return;const{horizontalPixelRatio:i}=t;if(this.jg=function(t,i){if(t>=2.5&&t<=4)return Math.floor(3*i);const s=1-.2*Math.atan(Math.max(4,t)-4)/(.5*Math.PI),n=Math.floor(t*s*i),e=Math.floor(t*i),r=Math.min(n,e);return Math.max(Math.floor(i),r)}(this.Yt.G_,i),this.jg>=2){Math.floor(i)%2!=this.jg%2&&this.jg--}const s=this.Yt.Zs;this.Yt.Yg&&this.Xg(t,s,this.Yt.lt),this.Yt.bi&&this.Wp(t,s,this.Yt.lt);const n=this.Zg(i);(!this.Yt.bi||this.jg>2*n)&&this.qg(t,s,this.Yt.lt)}Xg(t,i,s){if(null===this.Yt)return;const{context:n,horizontalPixelRatio:e,verticalPixelRatio:r}=t;let h="",l=Math.min(Math.floor(e),Math.floor(this.Yt.G_*e));l=Math.max(Math.floor(e),Math.min(l,this.jg));const a=Math.floor(.5*l);let o=null;for(let t=s.from;t2*l)V(n,o,u,_-o+1,c-u+1,l);else{const t=_-o+1;n.fillRect(o,u,t,c-u+1)}a=_}}qg(t,i,s){if(null===this.Yt)return;const{context:n,horizontalPixelRatio:e,verticalPixelRatio:r}=t;let h="";const l=this.Zg(e);for(let t=s.from;to||n.fillRect(_,a,u-_+1,o-a+1)}}}class ee extends ln{constructor(t,i){super(t,i,!1)}Hw(t,i,s){i.U_(this.zw,m(this.Iw)),t.Va(this.zw,s,m(this.Iw))}Gg(t,i,s){return{wt:t,Uh:i.Wt[0],jh:i.Wt[1],Yh:i.Wt[2],Xh:i.Wt[3],_t:NaN,za:NaN,Ia:NaN,Ba:NaN,Aa:NaN}}Fw(){const t=this.Kn.kh();this.zw=this.Kn.Zs().Wr().map((i=>this.Cg(i.ke,i,t)))}}class re extends ee{constructor(){super(...arguments),this.Lw=new ne}Cg(t,i,s){return{...this.Gg(t,i,s),...s.Rr(t)}}$w(){const t=this.Kn.N();this.Lw.ht({Zs:this.zw,G_:this.Jn.It().G_(),Yg:t.wickVisible,bi:t.borderVisible,lt:this.Iw})}}const he={type:"Candlestick",isBuiltIn:!0,defaultOptions:{upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},mg:(t,i)=>new re(t,i)},le={...t,color:"#2196f3"};export{se as BaselineSeries,he as CandlestickSeries,Di as ColorType,U as CrosshairMode,ki as LastPriceAnimationMode,qn as LineSeries,s as LineStyle,i as LineType,xt as MismatchDirection,Ri as PriceLineSource,_i as PriceScaleMode,Ei as TickMarkType,Ti as TrackingModeExitMode,On as createChart,le as customSeriesDefaultOptions,zi as isBusinessDay,Ii as isUTCTimestamp};
diff --git a/websites/default/packages/lightweight-charts/v5.0.6-treeshaked/types.d.ts b/websites/default/packages/lightweight-charts/v5.0.6-treeshaked/types.d.ts
deleted file mode 100644
index 583cad3f6..000000000
--- a/websites/default/packages/lightweight-charts/v5.0.6-treeshaked/types.d.ts
+++ /dev/null
@@ -1,3922 +0,0 @@
-// Generated by dts-bundle-generator v9.5.1
-
-type CanvasRenderingTarget2D = any;
-
-declare const baselineSeries: SeriesDefinition<"Baseline">;
-declare const candlestickSeries: SeriesDefinition<"Candlestick">;
-declare const lineSeries: SeriesDefinition<"Line">;
-export declare const customSeriesDefaultOptions: CustomSeriesOptions;
-/**
- * Represents a type of color.
- */
-export declare enum ColorType {
- /** Solid color */
- Solid = "solid",
- /** Vertical gradient color */
- VerticalGradient = "gradient"
-}
-/**
- * Represents the crosshair mode.
- */
-export declare enum CrosshairMode {
- /**
- * This mode allows crosshair to move freely on the chart.
- */
- Normal = 0,
- /**
- * This mode sticks crosshair's horizontal line to the price value of a single-value series or to the close price of OHLC-based series.
- */
- Magnet = 1,
- /**
- * This mode disables rendering of the crosshair.
- */
- Hidden = 2,
- /**
- * This mode sticks crosshair's horizontal line to the price value of a single-value series or to the open/high/low/close price of OHLC-based series.
- */
- MagnetOHLC = 3
-}
-/**
- * Represents the type of the last price animation for series such as area or line.
- */
-export declare enum LastPriceAnimationMode {
- /**
- * Animation is always disabled
- */
- Disabled = 0,
- /**
- * Animation is always enabled.
- */
- Continuous = 1,
- /**
- * Animation is active after new data.
- */
- OnDataUpdate = 2
-}
-/**
- * Represents the possible line styles.
- */
-export declare enum LineStyle {
- /**
- * A solid line.
- */
- Solid = 0,
- /**
- * A dotted line.
- */
- Dotted = 1,
- /**
- * A dashed line.
- */
- Dashed = 2,
- /**
- * A dashed line with bigger dashes.
- */
- LargeDashed = 3,
- /**
- * A dotted line with more space between dots.
- */
- SparseDotted = 4
-}
-/**
- * Represents the possible line types.
- */
-export declare enum LineType {
- /**
- * A line.
- */
- Simple = 0,
- /**
- * A stepped line.
- */
- WithSteps = 1,
- /**
- * A curved line.
- */
- Curved = 2
-}
-/**
- * Search direction if no data found at provided index
- */
-export declare enum MismatchDirection {
- /**
- * Search the nearest left item
- */
- NearestLeft = -1,
- /**
- * Do not search
- */
- None = 0,
- /**
- * Search the nearest right item
- */
- NearestRight = 1
-}
-/**
- * Represents the source of data to be used for the horizontal price line.
- */
-export declare enum PriceLineSource {
- /**
- * Use the last bar data.
- */
- LastBar = 0,
- /**
- * Use the last visible data of the chart viewport.
- */
- LastVisible = 1
-}
-/**
- * Represents the price scale mode.
- */
-export declare enum PriceScaleMode {
- /**
- * Price scale shows prices. Price range changes linearly.
- */
- Normal = 0,
- /**
- * Price scale shows prices. Price range changes logarithmically.
- */
- Logarithmic = 1,
- /**
- * Price scale shows percentage values according the first visible value of the price scale.
- * The first visible value is 0% in this mode.
- */
- Percentage = 2,
- /**
- * The same as percentage mode, but the first value is moved to 100.
- */
- IndexedTo100 = 3
-}
-/**
- * Represents the type of a tick mark on the time axis.
- */
-export declare enum TickMarkType {
- /**
- * The start of the year (e.g. it's the first tick mark in a year).
- */
- Year = 0,
- /**
- * The start of the month (e.g. it's the first tick mark in a month).
- */
- Month = 1,
- /**
- * A day of the month.
- */
- DayOfMonth = 2,
- /**
- * A time without seconds.
- */
- Time = 3,
- /**
- * A time with seconds.
- */
- TimeWithSeconds = 4
-}
-/**
- * Determine how to exit the tracking mode.
- *
- * By default, mobile users will long press to deactivate the scroll and have the ability to check values and dates.
- * Another press is required to activate the scroll, be able to move left/right, zoom, etc.
- */
-export declare enum TrackingModeExitMode {
- /**
- * Tracking Mode will be deactivated on touch end event.
- */
- OnTouchEnd = 0,
- /**
- * Tracking Mode will be deactivated on the next tap event.
- */
- OnNextTap = 1
-}
-/**
- * This function is the simplified main entry point of the Lightweight Charting Library with time points for the horizontal scale.
- *
- * @param container - ID of HTML element or element itself
- * @param options - Any subset of options to be applied at start.
- * @returns An interface to the created chart
- */
-export declare function createChart(container: string | HTMLElement, options?: DeepPartial): IChartApi;
-/**
- * Check if a time value is a business day object.
- *
- * @param time - The time to check.
- * @returns `true` if `time` is a {@link BusinessDay} object, false otherwise.
- */
-export declare function isBusinessDay(time: Time): time is BusinessDay;
-/**
- * Check if a time value is a UTC timestamp number.
- *
- * @param time - The time to check.
- * @returns `true` if `time` is a {@link UTCTimestamp} number, false otherwise.
- */
-export declare function isUTCTimestamp(time: Time): time is UTCTimestamp;
-/**
- * Structure describing a single item of data for area series
- */
-export interface AreaData extends SingleValueData {
- /**
- * Optional line color value for certain data item. If missed, color from options is used
- */
- lineColor?: string;
- /**
- * Optional top color value for certain data item. If missed, color from options is used
- */
- topColor?: string;
- /**
- * Optional bottom color value for certain data item. If missed, color from options is used
- */
- bottomColor?: string;
-}
-/**
- * Represents style options for an area series.
- */
-export interface AreaStyleOptions {
- /**
- * Color of the top part of the area.
- *
- * @defaultValue `'rgba( 46, 220, 135, 0.4)'`
- */
- topColor: string;
- /**
- * Color of the bottom part of the area.
- *
- * @defaultValue `'rgba( 40, 221, 100, 0)'`
- */
- bottomColor: string;
- /**
- * Gradient is relative to the base value and the currently visible range.
- * If it is false, the gradient is relative to the top and bottom of the chart.
- *
- * @defaultValue `false`
- */
- relativeGradient: boolean;
- /**
- * Invert the filled area. Fills the area above the line if set to true.
- *
- * @defaultValue `false`
- */
- invertFilledArea: boolean;
- /**
- * Line color.
- *
- * @defaultValue `'#33D778'`
- */
- lineColor: string;
- /**
- * Line style.
- *
- * @defaultValue {@link LineStyle.Solid}
- */
- lineStyle: LineStyle;
- /**
- * Line width in pixels.
- *
- * @defaultValue `3`
- */
- lineWidth: LineWidth;
- /**
- * Line type.
- *
- * @defaultValue {@link LineType.Simple}
- */
- lineType: LineType;
- /**
- * Show series line.
- *
- * @defaultValue `true`
- */
- lineVisible: boolean;
- /**
- * Show circle markers on each point.
- *
- * @defaultValue `false`
- */
- pointMarkersVisible: boolean;
- /**
- * Circle markers radius in pixels.
- *
- * @defaultValue `undefined`
- */
- pointMarkersRadius?: number;
- /**
- * Show the crosshair marker.
- *
- * @defaultValue `true`
- */
- crosshairMarkerVisible: boolean;
- /**
- * Crosshair marker radius in pixels.
- *
- * @defaultValue `4`
- */
- crosshairMarkerRadius: number;
- /**
- * Crosshair marker border color. An empty string falls back to the color of the series under the crosshair.
- *
- * @defaultValue `''`
- */
- crosshairMarkerBorderColor: string;
- /**
- * The crosshair marker background color. An empty string falls back to the color of the series under the crosshair.
- *
- * @defaultValue `''`
- */
- crosshairMarkerBackgroundColor: string;
- /**
- * Crosshair marker border width in pixels.
- *
- * @defaultValue `2`
- */
- crosshairMarkerBorderWidth: number;
- /**
- * Last price animation mode.
- *
- * @defaultValue {@link LastPriceAnimationMode.Disabled}
- */
- lastPriceAnimation: LastPriceAnimationMode;
-}
-/**
- * Represents the margin used when updating a price scale.
- */
-export interface AutoScaleMargins {
- /** The number of pixels for bottom margin */
- below: number;
- /** The number of pixels for top margin */
- above: number;
-}
-/**
- * Represents information used to update a price scale.
- */
-export interface AutoscaleInfo {
- /**
- * Price range.
- */
- priceRange: PriceRange | null;
- /**
- * Scale margins.
- */
- margins?: AutoScaleMargins;
-}
-/**
- * Represents options for how the time and price axes react to mouse double click.
- */
-export interface AxisDoubleClickOptions {
- /**
- * Enable resetting scaling the time axis by double-clicking the left mouse button.
- *
- * @defaultValue `true`
- */
- time: boolean;
- /**
- * Enable reseting scaling the price axis by by double-clicking the left mouse button.
- *
- * @defaultValue `true`
- */
- price: boolean;
-}
-/**
- * Represents options for how the time and price axes react to mouse movements.
- */
-export interface AxisPressedMouseMoveOptions {
- /**
- * Enable scaling the time axis by holding down the left mouse button and moving the mouse.
- *
- * @defaultValue `true`
- */
- time: boolean;
- /**
- * Enable scaling the price axis by holding down the left mouse button and moving the mouse.
- *
- * @defaultValue `true`
- */
- price: boolean;
-}
-/**
- * Structure describing a single item of data for bar series
- */
-export interface BarData extends OhlcData {
- /**
- * Optional color value for certain data item. If missed, color from options is used
- */
- color?: string;
-}
-/**
- * Represents style options for a bar series.
- */
-export interface BarStyleOptions {
- /**
- * Color of rising bars.
- *
- * @defaultValue `'#26a69a'`
- */
- upColor: string;
- /**
- * Color of falling bars.
- *
- * @defaultValue `'#ef5350'`
- */
- downColor: string;
- /**
- * Show open lines on bars.
- *
- * @defaultValue `true`
- */
- openVisible: boolean;
- /**
- * Show bars as sticks.
- *
- * @defaultValue `true`
- */
- thinBars: boolean;
-}
-/**
- * Represents a range of bars and the number of bars outside the range.
- */
-export interface BarsInfo extends Partial> {
- /**
- * The number of bars before the start of the range.
- * Positive value means that there are some bars before (out of logical range from the left) the {@link IRange.from} logical index in the series.
- * Negative value means that the first series' bar is inside the passed logical range, and between the first series' bar and the {@link IRange.from} logical index are some bars.
- */
- barsBefore: number;
- /**
- * The number of bars after the end of the range.
- * Positive value in the `barsAfter` field means that there are some bars after (out of logical range from the right) the {@link IRange.to} logical index in the series.
- * Negative value means that the last series' bar is inside the passed logical range, and between the last series' bar and the {@link IRange.to} logical index are some bars.
- */
- barsAfter: number;
-}
-/**
- * Represents a type of priced base value of baseline series type.
- */
-export interface BaseValuePrice {
- /**
- * Distinguished type value.
- */
- type: "price";
- /**
- * Price value.
- */
- price: number;
-}
-/**
- * Structure describing a single item of data for baseline series
- */
-export interface BaselineData extends SingleValueData {
- /**
- * Optional top area top fill color value for certain data item. If missed, color from options is used
- */
- topFillColor1?: string;
- /**
- * Optional top area bottom fill color value for certain data item. If missed, color from options is used
- */
- topFillColor2?: string;
- /**
- * Optional top area line color value for certain data item. If missed, color from options is used
- */
- topLineColor?: string;
- /**
- * Optional bottom area top fill color value for certain data item. If missed, color from options is used
- */
- bottomFillColor1?: string;
- /**
- * Optional bottom area bottom fill color value for certain data item. If missed, color from options is used
- */
- bottomFillColor2?: string;
- /**
- * Optional bottom area line color value for certain data item. If missed, color from options is used
- */
- bottomLineColor?: string;
-}
-/**
- * Represents style options for a baseline series.
- */
-export interface BaselineStyleOptions {
- /**
- * Base value of the series.
- *
- * @defaultValue `{ type: 'price', price: 0 }`
- */
- baseValue: BaseValueType;
- /**
- * Gradient is relative to the base value and the currently visible range.
- * If it is false, the gradient is relative to the top and bottom of the chart.
- *
- * @defaultValue `false`
- */
- relativeGradient: boolean;
- /**
- * The first color of the top area.
- *
- * @defaultValue `'rgba(38, 166, 154, 0.28)'`
- */
- topFillColor1: string;
- /**
- * The second color of the top area.
- *
- * @defaultValue `'rgba(38, 166, 154, 0.05)'`
- */
- topFillColor2: string;
- /**
- * The line color of the top area.
- *
- * @defaultValue `'rgba(38, 166, 154, 1)'`
- */
- topLineColor: string;
- /**
- * The first color of the bottom area.
- *
- * @defaultValue `'rgba(239, 83, 80, 0.05)'`
- */
- bottomFillColor1: string;
- /**
- * The second color of the bottom area.
- *
- * @defaultValue `'rgba(239, 83, 80, 0.28)'`
- */
- bottomFillColor2: string;
- /**
- * The line color of the bottom area.
- *
- * @defaultValue `'rgba(239, 83, 80, 1)'`
- */
- bottomLineColor: string;
- /**
- * Line width.
- *
- * @defaultValue `3`
- */
- lineWidth: LineWidth;
- /**
- * Line style.
- *
- * @defaultValue {@link LineStyle.Solid}
- */
- lineStyle: LineStyle;
- /**
- * Line type.
- *
- * @defaultValue {@link LineType.Simple}
- */
- lineType: LineType;
- /**
- * Show series line.
- *
- * @defaultValue `true`
- */
- lineVisible: boolean;
- /**
- * Show circle markers on each point.
- *
- * @defaultValue `false`
- */
- pointMarkersVisible: boolean;
- /**
- * Circle markers radius in pixels.
- *
- * @defaultValue `undefined`
- */
- pointMarkersRadius?: number;
- /**
- * Show the crosshair marker.
- *
- * @defaultValue `true`
- */
- crosshairMarkerVisible: boolean;
- /**
- * Crosshair marker radius in pixels.
- *
- * @defaultValue `4`
- */
- crosshairMarkerRadius: number;
- /**
- * Crosshair marker border color. An empty string falls back to the color of the series under the crosshair.
- *
- * @defaultValue `''`
- */
- crosshairMarkerBorderColor: string;
- /**
- * The crosshair marker background color. An empty string falls back to the color of the series under the crosshair.
- *
- * @defaultValue `''`
- */
- crosshairMarkerBackgroundColor: string;
- /**
- * Crosshair marker border width in pixels.
- *
- * @defaultValue `2`
- */
- crosshairMarkerBorderWidth: number;
- /**
- * Last price animation mode.
- *
- * @defaultValue {@link LastPriceAnimationMode.Disabled}
- */
- lastPriceAnimation: LastPriceAnimationMode;
-}
-/**
- * Represents a time as a day/month/year.
- *
- * @example
- * ```js
- * const day = { year: 2019, month: 6, day: 1 }; // June 1, 2019
- * ```
- */
-export interface BusinessDay {
- /**
- * The year.
- */
- year: number;
- /**
- * The month.
- */
- month: number;
- /**
- * The day.
- */
- day: number;
-}
-/**
- * Structure describing a single item of data for candlestick series
- */
-export interface CandlestickData extends OhlcData {
- /**
- * Optional color value for certain data item. If missed, color from options is used
- */
- color?: string;
- /**
- * Optional border color value for certain data item. If missed, color from options is used
- */
- borderColor?: string;
- /**
- * Optional wick color value for certain data item. If missed, color from options is used
- */
- wickColor?: string;
-}
-/**
- * Represents style options for a candlestick series.
- */
-export interface CandlestickStyleOptions {
- /**
- * Color of rising candles.
- *
- * @defaultValue `'#26a69a'`
- */
- upColor: string;
- /**
- * Color of falling candles.
- *
- * @defaultValue `'#ef5350'`
- */
- downColor: string;
- /**
- * Enable high and low prices candle wicks.
- *
- * @defaultValue `true`
- */
- wickVisible: boolean;
- /**
- * Enable candle borders.
- *
- * @defaultValue `true`
- */
- borderVisible: boolean;
- /**
- * Border color.
- *
- * @defaultValue `'#378658'`
- */
- borderColor: string;
- /**
- * Border color of rising candles.
- *
- * @defaultValue `'#26a69a'`
- */
- borderUpColor: string;
- /**
- * Border color of falling candles.
- *
- * @defaultValue `'#ef5350'`
- */
- borderDownColor: string;
- /**
- * Wick color.
- *
- * @defaultValue `'#737375'`
- */
- wickColor: string;
- /**
- * Wick color of rising candles.
- *
- * @defaultValue `'#26a69a'`
- */
- wickUpColor: string;
- /**
- * Wick color of falling candles.
- *
- * @defaultValue `'#ef5350'`
- */
- wickDownColor: string;
-}
-/**
- * Represents common chart options
- */
-export interface ChartOptionsBase {
- /**
- * Width of the chart in pixels
- *
- * @defaultValue If `0` (default) or none value provided, then a size of the widget will be calculated based its container's size.
- */
- width: number;
- /**
- * Height of the chart in pixels
- *
- * @defaultValue If `0` (default) or none value provided, then a size of the widget will be calculated based its container's size.
- */
- height: number;
- /**
- * Setting this flag to `true` will make the chart watch the chart container's size and automatically resize the chart to fit its container whenever the size changes.
- *
- * This feature requires [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) class to be available in the global scope.
- * Note that calling code is responsible for providing a polyfill if required. If the global scope does not have `ResizeObserver`, a warning will appear and the flag will be ignored.
- *
- * Please pay attention that `autoSize` option and explicit sizes options `width` and `height` don't conflict with one another.
- * If you specify `autoSize` flag, then `width` and `height` options will be ignored unless `ResizeObserver` has failed. If it fails then the values will be used as fallback.
- *
- * The flag `autoSize` could also be set with and unset with `applyOptions` function.
- * ```js
- * const chart = LightweightCharts.createChart(document.body, {
- * autoSize: true,
- * });
- * ```
- */
- autoSize: boolean;
- /**
- * Layout options
- */
- layout: LayoutOptions;
- /**
- * Left price scale options
- */
- leftPriceScale: VisiblePriceScaleOptions;
- /**
- * Right price scale options
- */
- rightPriceScale: VisiblePriceScaleOptions;
- /**
- * Overlay price scale options
- */
- overlayPriceScales: OverlayPriceScaleOptions;
- /**
- * Time scale options
- */
- timeScale: HorzScaleOptions;
- /**
- * The crosshair shows the intersection of the price and time scale values at any point on the chart.
- *
- */
- crosshair: CrosshairOptions;
- /**
- * A grid is represented in the chart background as a vertical and horizontal lines drawn at the levels of visible marks of price and the time scales.
- */
- grid: GridOptions;
- /**
- * Scroll options, or a boolean flag that enables/disables scrolling
- */
- handleScroll: HandleScrollOptions | boolean;
- /**
- * Scale options, or a boolean flag that enables/disables scaling
- */
- handleScale: HandleScaleOptions | boolean;
- /**
- * Kinetic scroll options
- */
- kineticScroll: KineticScrollOptions;
- /** @inheritDoc TrackingModeOptions
- */
- trackingMode: TrackingModeOptions;
- /**
- * Basic localization options
- */
- localization: LocalizationOptionsBase;
-}
-/**
- * Structure describing options of the chart. Series options are to be set separately
- */
-export interface ChartOptionsImpl extends ChartOptionsBase {
- /**
- * Localization options.
- */
- localization: LocalizationOptions;
-}
-/** Structure describing a crosshair line (vertical or horizontal) */
-export interface CrosshairLineOptions {
- /**
- * Crosshair line color.
- *
- * @defaultValue `'#758696'`
- */
- color: string;
- /**
- * Crosshair line width.
- *
- * @defaultValue `1`
- */
- width: LineWidth;
- /**
- * Crosshair line style.
- *
- * @defaultValue {@link LineStyle.LargeDashed}
- */
- style: LineStyle;
- /**
- * Display the crosshair line.
- *
- * Note that disabling crosshair lines does not disable crosshair marker on Line and Area series.
- * It can be disabled by using `crosshairMarkerVisible` option of a relevant series.
- *
- * @see {@link LineStyleOptions.crosshairMarkerVisible}
- * @see {@link AreaStyleOptions.crosshairMarkerVisible}
- * @see {@link BaselineStyleOptions.crosshairMarkerVisible}
- * @defaultValue `true`
- */
- visible: boolean;
- /**
- * Display the crosshair label on the relevant scale.
- *
- * @defaultValue `true`
- */
- labelVisible: boolean;
- /**
- * Crosshair label background color.
- *
- * @defaultValue `'#4c525e'`
- */
- labelBackgroundColor: string;
-}
-/** Structure describing crosshair options */
-export interface CrosshairOptions {
- /**
- * Crosshair mode
- *
- * @defaultValue {@link CrosshairMode.Magnet}
- */
- mode: CrosshairMode;
- /**
- * Vertical line options.
- */
- vertLine: CrosshairLineOptions;
- /**
- * Horizontal line options.
- */
- horzLine: CrosshairLineOptions;
-}
-/**
- * Renderer data for an item within the custom series.
- */
-export interface CustomBarItemData = CustomData> {
- /**
- * Horizontal coordinate for the item. Measured from the left edge of the pane in pixels.
- */
- x: number;
- /**
- * Time scale index for the item. This isn't the timestamp but rather the logical index.
- */
- time: number;
- /**
- * Original data for the item.
- */
- originalData: TData;
- /**
- * Color assigned for the item, typically used for price line and price scale label.
- */
- barColor: string;
-}
-/**
- * Base structure describing a single item of data for a custom series.
- *
- * This type allows for any properties to be defined
- * within the interface. It is recommended that you extend this interface with
- * the required data structure.
- */
-export interface CustomData extends CustomSeriesWhitespaceData {
- /**
- * If defined then this color will be used for the price line and price scale line
- * for this specific data item of the custom series.
- */
- color?: string;
-}
-/**
- * Represents a whitespace data item, which is a data point without a value.
- */
-export interface CustomSeriesWhitespaceData {
- /**
- * The time of the data.
- */
- time: HorzScaleItem;
- /**
- * Additional custom values which will be ignored by the library, but
- * could be used by plugins.
- */
- customValues?: Record;
-}
-/**
- * Represents style options for a custom series.
- */
-export interface CustomStyleOptions {
- /**
- * Color used for the price line and price scale label.
- */
- color: string;
-}
-/** Grid line options. */
-export interface GridLineOptions {
- /**
- * Line color.
- *
- * @defaultValue `'#D6DCDE'`
- */
- color: string;
- /**
- * Line style.
- *
- * @defaultValue {@link LineStyle.Solid}
- */
- style: LineStyle;
- /**
- * Display the lines.
- *
- * @defaultValue `true`
- */
- visible: boolean;
-}
-/** Structure describing grid options. */
-export interface GridOptions {
- /**
- * Vertical grid line options.
- */
- vertLines: GridLineOptions;
- /**
- * Horizontal grid line options.
- */
- horzLines: GridLineOptions;
-}
-/**
- * Represents options for how the chart is scaled by the mouse and touch gestures.
- */
-export interface HandleScaleOptions {
- /**
- * Enable scaling with the mouse wheel.
- *
- * @defaultValue `true`
- */
- mouseWheel: boolean;
- /**
- * Enable scaling with pinch/zoom gestures.
- *
- * @defaultValue `true`
- */
- pinch: boolean;
- /**
- * Enable scaling the price and/or time scales by holding down the left mouse button and moving the mouse.
- */
- axisPressedMouseMove: AxisPressedMouseMoveOptions | boolean;
- /**
- * Enable resetting scaling by double-clicking the left mouse button.
- */
- axisDoubleClickReset: AxisDoubleClickOptions | boolean;
-}
-/**
- * Represents options for how the chart is scrolled by the mouse and touch gestures.
- */
-export interface HandleScrollOptions {
- /**
- * Enable scrolling with the mouse wheel.
- *
- * @defaultValue `true`
- */
- mouseWheel: boolean;
- /**
- * Enable scrolling by holding down the left mouse button and moving the mouse.
- *
- * @defaultValue `true`
- */
- pressedMouseMove: boolean;
- /**
- * Enable horizontal touch scrolling.
- *
- * When enabled the chart handles touch gestures that would normally scroll the webpage horizontally.
- *
- * @defaultValue `true`
- */
- horzTouchDrag: boolean;
- /**
- * Enable vertical touch scrolling.
- *
- * When enabled the chart handles touch gestures that would normally scroll the webpage vertically.
- *
- * @defaultValue `true`
- */
- vertTouchDrag: boolean;
-}
-/**
- * Structure describing a single item of data for histogram series
- */
-export interface HistogramData extends SingleValueData {
- /**
- * Optional color value for certain data item. If missed, color from options is used
- */
- color?: string;
-}
-/**
- * Represents style options for a histogram series.
- */
-export interface HistogramStyleOptions {
- /**
- * Column color.
- *
- * @defaultValue `'#26a69a'`
- */
- color: string;
- /**
- * Initial level of histogram columns.
- *
- * @defaultValue `0`
- */
- base: number;
-}
-/**
- * Options for the time scale; the horizontal scale at the bottom of the chart that displays the time of data.
- */
-export interface HorzScaleOptions {
- /**
- * The margin space in bars from the right side of the chart.
- *
- * @defaultValue `0`
- */
- rightOffset: number;
- /**
- * The space between bars in pixels.
- *
- * @defaultValue `6`
- */
- barSpacing: number;
- /**
- * The minimum space between bars in pixels.
- *
- * @defaultValue `0.5`
- */
- minBarSpacing: number;
- /**
- * The maximum space between bars in pixels.
- *
- * Has no effect if value is set to `0`.
- *
- * @defaultValue `0`
- */
- maxBarSpacing: number;
- /**
- * Prevent scrolling to the left of the first bar.
- *
- * @defaultValue `false`
- */
- fixLeftEdge: boolean;
- /**
- * Prevent scrolling to the right of the most recent bar.
- *
- * @defaultValue `false`
- */
- fixRightEdge: boolean;
- /**
- * Prevent changing the visible time range during chart resizing.
- *
- * @defaultValue `false`
- */
- lockVisibleTimeRangeOnResize: boolean;
- /**
- * Prevent the hovered bar from moving when scrolling.
- *
- * @defaultValue `false`
- */
- rightBarStaysOnScroll: boolean;
- /**
- * Show the time scale border.
- *
- * @defaultValue `true`
- */
- borderVisible: boolean;
- /**
- * The time scale border color.
- *
- * @defaultValue `'#2B2B43'`
- */
- borderColor: string;
- /**
- * Show the time scale.
- *
- * @defaultValue `true`
- */
- visible: boolean;
- /**
- * Show the time, not just the date, in the time scale and vertical crosshair label.
- *
- * @defaultValue `false`
- */
- timeVisible: boolean;
- /**
- * Show seconds in the time scale and vertical crosshair label in `hh:mm:ss` format for intraday data.
- *
- * @defaultValue `true`
- */
- secondsVisible: boolean;
- /**
- * Shift the visible range to the right (into the future) by the number of new bars when new data is added.
- *
- * Note that this only applies when the last bar is visible.
- *
- * @defaultValue `true`
- */
- shiftVisibleRangeOnNewBar: boolean;
- /**
- * Allow the visible range to be shifted to the right when a new bar is added which
- * is replacing an existing whitespace time point on the chart.
- *
- * Note that this only applies when the last bar is visible & `shiftVisibleRangeOnNewBar` is enabled.
- *
- * @defaultValue `false`
- */
- allowShiftVisibleRangeOnWhitespaceReplacement: boolean;
- /**
- * Draw small vertical line on time axis labels.
- *
- * @defaultValue `false`
- */
- ticksVisible: boolean;
- /**
- * Maximum tick mark label length. Used to override the default 8 character maximum length.
- *
- * @defaultValue `undefined`
- */
- tickMarkMaxCharacterLength?: number;
- /**
- * Changes horizontal scale marks generation.
- * With this flag equal to `true`, marks of the same weight are either all drawn or none are drawn at all.
- */
- uniformDistribution: boolean;
- /**
- * Define a minimum height for the time scale.
- * Note: This value will be exceeded if the
- * time scale needs more space to display it's contents.
- *
- * Setting a minimum height could be useful for ensuring that
- * multiple charts positioned in a horizontal stack each have
- * an identical time scale height, or for plugins which
- * require a bit more space within the time scale pane.
- *
- * @defaultValue 0
- */
- minimumHeight: number;
- /**
- * Allow major time scale labels to be rendered in a bolder font weight.
- *
- * @defaultValue true
- */
- allowBoldLabels: boolean;
- /**
- * Ignore time scale points containing only whitespace (for all series) when
- * drawing grid lines, tick marks, and snapping the crosshair to time scale points.
- *
- * For the yield curve chart type it defaults to `true`.
- *
- * @defaultValue false
- */
- ignoreWhitespaceIndices: boolean;
-}
-/**
- * The main interface of a single chart using time for horizontal scale.
- */
-export interface IChartApi extends IChartApiBase