dipping-charts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +216 -0
- package/dist/__tests__/FullFeaturedChart.test.d.ts +2 -0
- package/dist/__tests__/FullFeaturedChart.test.d.ts.map +1 -0
- package/dist/__tests__/indicators-accuracy.test.d.ts +2 -0
- package/dist/__tests__/indicators-accuracy.test.d.ts.map +1 -0
- package/dist/__tests__/indicators.test.d.ts +2 -0
- package/dist/__tests__/indicators.test.d.ts.map +1 -0
- package/dist/__tests__/setup.d.ts +1 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/validateCandle.test.d.ts +2 -0
- package/dist/__tests__/validateCandle.test.d.ts.map +1 -0
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.js +5 -0
- package/dist/chart/index.js.map +1 -0
- package/dist/components/TradingChart.d.ts +24 -0
- package/dist/components/TradingChart.d.ts.map +1 -0
- package/dist/components/TradingChart.js +100 -0
- package/dist/components/TradingChart.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/dipping-charts.css +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/indicators/atr.d.ts +15 -0
- package/dist/indicators/atr.d.ts.map +1 -0
- package/dist/indicators/atr.js +30 -0
- package/dist/indicators/atr.js.map +1 -0
- package/dist/indicators/bollingerBands.d.ts +11 -0
- package/dist/indicators/bollingerBands.d.ts.map +1 -0
- package/dist/indicators/bollingerBands.js +39 -0
- package/dist/indicators/bollingerBands.js.map +1 -0
- package/dist/indicators/currencyStrength.d.ts +43 -0
- package/dist/indicators/currencyStrength.d.ts.map +1 -0
- package/dist/indicators/currencyStrength.js +53 -0
- package/dist/indicators/currencyStrength.js.map +1 -0
- package/dist/indicators/ema.d.ts +11 -0
- package/dist/indicators/ema.d.ts.map +1 -0
- package/dist/indicators/ema.js +24 -0
- package/dist/indicators/ema.js.map +1 -0
- package/dist/indicators/index.d.ts +19 -0
- package/dist/indicators/index.d.ts.map +1 -0
- package/dist/indicators/index.js +23 -0
- package/dist/indicators/index.js.map +1 -0
- package/dist/indicators/macd.d.ts +11 -0
- package/dist/indicators/macd.d.ts.map +1 -0
- package/dist/indicators/macd.js +52 -0
- package/dist/indicators/macd.js.map +1 -0
- package/dist/indicators/rsi.d.ts +11 -0
- package/dist/indicators/rsi.d.ts.map +1 -0
- package/dist/indicators/rsi.js +29 -0
- package/dist/indicators/rsi.js.map +1 -0
- package/dist/indicators/sma.d.ts +13 -0
- package/dist/indicators/sma.d.ts.map +1 -0
- package/dist/indicators/sma.js +22 -0
- package/dist/indicators/sma.js.map +1 -0
- package/dist/indicators/stochastic.d.ts +15 -0
- package/dist/indicators/stochastic.d.ts.map +1 -0
- package/dist/indicators/stochastic.js +34 -0
- package/dist/indicators/stochastic.js.map +1 -0
- package/dist/indicators/types.d.ts +102 -0
- package/dist/indicators/types.d.ts.map +1 -0
- package/dist/indicators/vwap.d.ts +14 -0
- package/dist/indicators/vwap.d.ts.map +1 -0
- package/dist/indicators/vwap.js +17 -0
- package/dist/indicators/vwap.js.map +1 -0
- package/dist/indicators/williamsR.d.ts +17 -0
- package/dist/indicators/williamsR.d.ts.map +1 -0
- package/dist/indicators/williamsR.js +19 -0
- package/dist/indicators/williamsR.js.map +1 -0
- package/dist/react/FullFeaturedChart.d.ts +3 -0
- package/dist/react/FullFeaturedChart.d.ts.map +1 -0
- package/dist/react/FullFeaturedChart.js +640 -0
- package/dist/react/FullFeaturedChart.js.map +1 -0
- package/dist/react/components/IndicatorSettings.d.ts +20 -0
- package/dist/react/components/IndicatorSettings.d.ts.map +1 -0
- package/dist/react/components/IndicatorSettings.js +748 -0
- package/dist/react/components/IndicatorSettings.js.map +1 -0
- package/dist/react/hooks/useChart.d.ts +15 -0
- package/dist/react/hooks/useChart.d.ts.map +1 -0
- package/dist/react/hooks/useChart.js +155 -0
- package/dist/react/hooks/useChart.js.map +1 -0
- package/dist/react/hooks/useIndicators.d.ts +10 -0
- package/dist/react/hooks/useIndicators.d.ts.map +1 -0
- package/dist/react/hooks/useIndicators.js +264 -0
- package/dist/react/hooks/useIndicators.js.map +1 -0
- package/dist/react/hooks/useLineTools.d.ts +26 -0
- package/dist/react/hooks/useLineTools.d.ts.map +1 -0
- package/dist/react/hooks/useLineTools.js +189 -0
- package/dist/react/hooks/useLineTools.js.map +1 -0
- package/dist/react/hooks/useShiftSnap.d.ts +12 -0
- package/dist/react/hooks/useShiftSnap.d.ts.map +1 -0
- package/dist/react/hooks/useShiftSnap.js +54 -0
- package/dist/react/hooks/useShiftSnap.js.map +1 -0
- package/dist/react/index.d.ts +14 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +18 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/loadLightweightCharts.d.ts +18 -0
- package/dist/react/loadLightweightCharts.d.ts.map +1 -0
- package/dist/react/loadLightweightCharts.js +32 -0
- package/dist/react/loadLightweightCharts.js.map +1 -0
- package/dist/react/locale.d.ts +79 -0
- package/dist/react/locale.d.ts.map +1 -0
- package/dist/react/locale.js +158 -0
- package/dist/react/locale.js.map +1 -0
- package/dist/react/types.d.ts +130 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/getToolId.d.ts +9 -0
- package/dist/utils/getToolId.d.ts.map +1 -0
- package/dist/utils/getToolId.js +12 -0
- package/dist/utils/getToolId.js.map +1 -0
- package/dist/utils/mockData.d.ts +10 -0
- package/dist/utils/mockData.d.ts.map +1 -0
- package/dist/utils/mockData.js +61 -0
- package/dist/utils/mockData.js.map +1 -0
- package/dist/utils/snapCrosshair.d.ts +25 -0
- package/dist/utils/snapCrosshair.d.ts.map +1 -0
- package/dist/utils/validateCandle.d.ts +30 -0
- package/dist/utils/validateCandle.d.ts.map +1 -0
- package/dist/utils/validateCandle.js +21 -0
- package/dist/utils/validateCandle.js.map +1 -0
- package/examples/css/base.css +209 -0
- package/examples/css/chart.css +282 -0
- package/examples/css/indicators.css +255 -0
- package/examples/index.html +163 -0
- package/examples/js/chart.js +370 -0
- package/examples/js/indicators.js +27 -0
- package/examples/js/main.js +6 -0
- package/examples/js/ui.js +1641 -0
- package/lib/lightweight-charts.standalone.production.js +7 -0
- package/package.json +106 -0
- package/src/react/FullFeaturedChart.css +1007 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 QuantrumAI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# dipping-charts
|
|
2
|
+
|
|
3
|
+
Financial charting library with technical indicators and drawing tools, built on [TradingView Lightweight Charts](https://github.com/tradingview/lightweight-charts).
|
|
4
|
+
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[](https://www.npmjs.com/package/dipping-charts)
|
|
7
|
+
|
|
8
|
+
**[Live Demo](https://quantrumai.github.io/dipping-charts/)**
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- **9 Technical Indicators** — SMA, EMA, RSI, MACD, Bollinger Bands, Stochastic, ATR, VWAP, Williams %R
|
|
13
|
+
- **6 Drawing Tools** — Trend Line, Horizontal, Vertical, Rectangle, Fibonacci, Text
|
|
14
|
+
- **8 Timeframes** — 1m, 5m, 15m, 30m, 1H, D, W, M
|
|
15
|
+
- **React Component** — Drop-in `<FullFeaturedChart />` with all features
|
|
16
|
+
- **Vanilla TS/JS** — Use the chart engine and indicators without React
|
|
17
|
+
- **Realtime Updates** — Push candle updates via props
|
|
18
|
+
- **i18n** — English (default) and Korean, extensible
|
|
19
|
+
- **TypeScript** — Full type definitions included
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### React
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install dipping-charts lightweight-charts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Copy the standalone chart script to your `public/` folder:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cp node_modules/dipping-charts/lib/lightweight-charts.standalone.production.js public/
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Add it to your `index.html`:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<script src="/lightweight-charts.standalone.production.js"></script>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use the component:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { FullFeaturedChart } from 'dipping-charts/react';
|
|
45
|
+
import 'dipping-charts/react/style.css';
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return <FullFeaturedChart height={600} data={candles} />;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Indicators Only (No React)
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import {
|
|
56
|
+
calculateSMA, calculateEMA, calculateRSI,
|
|
57
|
+
calculateMACD, calculateBollingerBands,
|
|
58
|
+
calculateStochastic, calculateATR, calculateVWAP, calculateWilliamsR,
|
|
59
|
+
} from 'dipping-charts/indicators';
|
|
60
|
+
|
|
61
|
+
const sma20 = calculateSMA(candles, { period: 20 });
|
|
62
|
+
const rsi14 = calculateRSI(candles, { period: 14 });
|
|
63
|
+
const stoch = calculateStochastic(candles, { kPeriod: 14, dPeriod: 3, smooth: 3 });
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## API
|
|
67
|
+
|
|
68
|
+
### `<FullFeaturedChart />` Props
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
|------|------|---------|-------------|
|
|
72
|
+
| `data` | `CandleData[]` | — | OHLCV candle data |
|
|
73
|
+
| `height` | `number` | `600` | Chart height in pixels |
|
|
74
|
+
| `locale` | `'en' \| 'ko'` | `'en'` | UI language |
|
|
75
|
+
| `enableTimeframes` | `boolean` | `true` | Show timeframe buttons |
|
|
76
|
+
| `enableIndicators` | `boolean` | `true` | Show indicator panel |
|
|
77
|
+
| `enableDrawingTools` | `boolean` | `true` | Show drawing tools |
|
|
78
|
+
| `defaultTimeframe` | `TimeFrame` | `'5m'` | Initial timeframe |
|
|
79
|
+
| `onTimeframeChange` | `(tf: TimeFrame) => void` | — | Timeframe change callback |
|
|
80
|
+
| `realtimeCandle` | `CandleData` | — | Push realtime candle update |
|
|
81
|
+
| `loading` | `boolean` | `false` | Show loading overlay |
|
|
82
|
+
| `error` | `string \| null` | `null` | Show error overlay |
|
|
83
|
+
| `showVolume` | `boolean` | `true` | Show volume bars |
|
|
84
|
+
| `priceLines` | `PriceLine[]` | — | Horizontal price lines (e.g. avg cost) |
|
|
85
|
+
| `initialLineTools` | `LineTool[]` | — | Restore saved drawings |
|
|
86
|
+
| `onLineToolsChange` | `(tools: LineTool[]) => void` | — | Drawing change callback |
|
|
87
|
+
| `onDrawingToolClick` | `() => boolean` | — | Gate drawing tool access (return `false` to block) |
|
|
88
|
+
| `indicatorStorageKey` | `string` | — | localStorage key for indicator persistence |
|
|
89
|
+
|
|
90
|
+
### `CandleData`
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
interface CandleData {
|
|
94
|
+
time: number; // Unix timestamp (seconds)
|
|
95
|
+
open: number;
|
|
96
|
+
high: number;
|
|
97
|
+
low: number;
|
|
98
|
+
close: number;
|
|
99
|
+
volume?: number;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Indicators
|
|
104
|
+
|
|
105
|
+
All indicator functions accept `CandleData[]` and return `IndicatorDataPoint[]` (or a multi-line result object).
|
|
106
|
+
|
|
107
|
+
#### Moving Averages
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
calculateSMA(candles, { period: 20 }): IndicatorDataPoint[]
|
|
111
|
+
calculateEMA(candles, { period: 20 }): IndicatorDataPoint[]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Momentum / Oscillators
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
calculateRSI(candles, { period: 14 }): IndicatorDataPoint[]
|
|
118
|
+
// Range: 0–100 | Overbought: 70, Oversold: 30
|
|
119
|
+
|
|
120
|
+
calculateMACD(candles, {
|
|
121
|
+
fastPeriod: 12, slowPeriod: 26, signalPeriod: 9
|
|
122
|
+
}): { macd, signal, histogram } // each IndicatorDataPoint[]
|
|
123
|
+
|
|
124
|
+
calculateStochastic(candles, {
|
|
125
|
+
kPeriod: 14, dPeriod: 3, smooth: 3
|
|
126
|
+
}): { k, d } // each IndicatorDataPoint[], range 0–100
|
|
127
|
+
|
|
128
|
+
calculateWilliamsR(candles, { period: 14 }): IndicatorDataPoint[]
|
|
129
|
+
// Range: -100–0 | Overbought: -20, Oversold: -80
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### Volatility
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
calculateBollingerBands(candles, {
|
|
136
|
+
period: 20, stdDev: 2
|
|
137
|
+
}): { upper, middle, lower } // each IndicatorDataPoint[]
|
|
138
|
+
|
|
139
|
+
calculateATR(candles, { period: 14 }): IndicatorDataPoint[]
|
|
140
|
+
// Average True Range with Wilder's smoothing (RMA)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Volume
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
calculateVWAP(candles): IndicatorDataPoint[]
|
|
147
|
+
// Volume Weighted Average Price — cumulative TP×Vol / Vol
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Result Types
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
interface IndicatorDataPoint {
|
|
154
|
+
time: number; // Unix timestamp (seconds)
|
|
155
|
+
value: number;
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Package Exports
|
|
160
|
+
|
|
161
|
+
| Entry Point | Description |
|
|
162
|
+
|-------------|-------------|
|
|
163
|
+
| `dipping-charts` | Core types and utilities |
|
|
164
|
+
| `dipping-charts/react` | React component + hooks |
|
|
165
|
+
| `dipping-charts/react/style.css` | Component styles |
|
|
166
|
+
| `dipping-charts/indicators` | Indicator functions (no React dependency) |
|
|
167
|
+
| `dipping-charts/chart` | Low-level chart engine |
|
|
168
|
+
|
|
169
|
+
## Keyboard Shortcuts
|
|
170
|
+
|
|
171
|
+
| Key | Action |
|
|
172
|
+
|-----|--------|
|
|
173
|
+
| `Shift + Mouse` | Snap to High/Low |
|
|
174
|
+
| `Right Click` | Context menu (color, width) |
|
|
175
|
+
| `Double Click` | Edit text annotation |
|
|
176
|
+
| `Ctrl/Cmd + Z` | Undo last deleted drawing |
|
|
177
|
+
| `Escape` | Cancel active tool / deselect |
|
|
178
|
+
|
|
179
|
+
## Development
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
git clone https://github.com/QuantrumAI/dipping-charts.git
|
|
183
|
+
cd dipping-charts
|
|
184
|
+
npm install
|
|
185
|
+
npm run demo # Interactive demo
|
|
186
|
+
npm test # Run tests
|
|
187
|
+
npm run type-check # TypeScript check
|
|
188
|
+
npm run build # Build library
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Project Structure
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
src/
|
|
195
|
+
├── react/ # React component & hooks
|
|
196
|
+
│ ├── FullFeaturedChart.tsx
|
|
197
|
+
│ ├── FullFeaturedChart.css
|
|
198
|
+
│ ├── locale.ts # i18n (en/ko)
|
|
199
|
+
│ ├── components/ # IndicatorSettings, etc.
|
|
200
|
+
│ └── hooks/ # useChart, useIndicators, useLineTools, useShiftSnap
|
|
201
|
+
├── indicators/ # Pure TS indicator implementations
|
|
202
|
+
├── components/ # TradingChart (vanilla)
|
|
203
|
+
├── types/ # Shared TypeScript types
|
|
204
|
+
└── utils/ # Validation utilities
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Contributing
|
|
208
|
+
|
|
209
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
[MIT](./LICENSE) — Copyright (c) 2025 [QuantrumAI](https://github.com/QuantrumAI)
|
|
214
|
+
|
|
215
|
+
This library includes a custom build of [TradingView Lightweight Charts](https://github.com/tradingview/lightweight-charts) (Apache-2.0).
|
|
216
|
+
See [NOTICE](./NOTICE) for third-party license details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullFeaturedChart.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/FullFeaturedChart.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indicators-accuracy.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/indicators-accuracy.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indicators.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/indicators.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateCandle.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/validateCandle.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IChartApi } from 'lightweight-charts';
|
|
2
|
+
import { CandleData, ChartOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* TradingView 스타일 차트
|
|
5
|
+
*/
|
|
6
|
+
export declare class TradingChart {
|
|
7
|
+
private chart;
|
|
8
|
+
private candleSeries;
|
|
9
|
+
private volumeSeries;
|
|
10
|
+
constructor(container: HTMLElement, options?: ChartOptions);
|
|
11
|
+
/**
|
|
12
|
+
* 캔들 데이터 설정
|
|
13
|
+
*/
|
|
14
|
+
setData(candles: CandleData[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* 차트 제거
|
|
17
|
+
*/
|
|
18
|
+
destroy(): void;
|
|
19
|
+
/**
|
|
20
|
+
* 차트 인스턴스 반환
|
|
21
|
+
*/
|
|
22
|
+
getChart(): IChartApi;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=TradingChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TradingChart.d.ts","sourceRoot":"","sources":["../../src/components/TradingChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAA8C,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGpD;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,YAAY,CAA0B;gBAElC,SAAS,EAAE,WAAW,EAAE,OAAO,GAAE,YAAiB;IA6E9D;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE;IA+B7B;;OAEG;IACH,OAAO;IAIP;;OAEG;IACH,QAAQ,IAAI,SAAS;CAGtB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createChart as s } from "lightweight-charts";
|
|
2
|
+
import { filterValidCandles as a } from "../utils/validateCandle.js";
|
|
3
|
+
class d {
|
|
4
|
+
constructor(o, t = {}) {
|
|
5
|
+
this.chart = s(o, {
|
|
6
|
+
width: t.width || o.clientWidth,
|
|
7
|
+
height: t.height || 600,
|
|
8
|
+
layout: {
|
|
9
|
+
background: { color: "#ffffff" },
|
|
10
|
+
textColor: "#333"
|
|
11
|
+
},
|
|
12
|
+
grid: {
|
|
13
|
+
vertLines: { color: "#f0f0f0" },
|
|
14
|
+
horzLines: { color: "#f0f0f0" }
|
|
15
|
+
},
|
|
16
|
+
crosshair: {
|
|
17
|
+
mode: 0
|
|
18
|
+
// 0 = Normal (자연스러운 움직임), 1 = Magnet (snap)
|
|
19
|
+
},
|
|
20
|
+
rightPriceScale: {
|
|
21
|
+
borderColor: "#cccccc"
|
|
22
|
+
},
|
|
23
|
+
timeScale: {
|
|
24
|
+
borderColor: "#cccccc",
|
|
25
|
+
timeVisible: !0,
|
|
26
|
+
secondsVisible: !1
|
|
27
|
+
}
|
|
28
|
+
}), this.candleSeries = this.chart.addCandlestickSeries({
|
|
29
|
+
upColor: "#ef4444",
|
|
30
|
+
downColor: "#3b82f6",
|
|
31
|
+
borderUpColor: "#ef4444",
|
|
32
|
+
borderDownColor: "#3b82f6",
|
|
33
|
+
wickUpColor: "#ef4444",
|
|
34
|
+
wickDownColor: "#3b82f6"
|
|
35
|
+
}), this.volumeSeries = this.chart.addHistogramSeries({
|
|
36
|
+
color: "#ef4444",
|
|
37
|
+
priceFormat: {
|
|
38
|
+
type: "volume"
|
|
39
|
+
},
|
|
40
|
+
priceScaleId: ""
|
|
41
|
+
}), this.volumeSeries.priceScale().applyOptions({
|
|
42
|
+
scaleMargins: {
|
|
43
|
+
top: 0.8,
|
|
44
|
+
bottom: 0
|
|
45
|
+
}
|
|
46
|
+
}), window.addEventListener("resize", () => {
|
|
47
|
+
this.chart.applyOptions({
|
|
48
|
+
width: o.clientWidth
|
|
49
|
+
});
|
|
50
|
+
}), window.addEventListener("keydown", (i) => {
|
|
51
|
+
i.key === "Shift" && this.chart.applyOptions({
|
|
52
|
+
crosshair: { mode: 1 }
|
|
53
|
+
// Magnet mode
|
|
54
|
+
});
|
|
55
|
+
}), window.addEventListener("keyup", (i) => {
|
|
56
|
+
i.key === "Shift" && this.chart.applyOptions({
|
|
57
|
+
crosshair: { mode: 0 }
|
|
58
|
+
// Normal mode
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 캔들 데이터 설정
|
|
64
|
+
*/
|
|
65
|
+
setData(o) {
|
|
66
|
+
const t = a(o, "TradingChart");
|
|
67
|
+
if (t.length === 0) {
|
|
68
|
+
console.warn("[TradingChart] No valid candle data to display");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const i = t.map((e) => ({
|
|
72
|
+
time: e.time,
|
|
73
|
+
open: e.open,
|
|
74
|
+
high: e.high,
|
|
75
|
+
low: e.low,
|
|
76
|
+
close: e.close
|
|
77
|
+
})), r = t.map((e) => ({
|
|
78
|
+
time: e.time,
|
|
79
|
+
value: e.volume ?? 0,
|
|
80
|
+
color: e.close >= e.open ? "#ef444466" : "#3b82f666"
|
|
81
|
+
}));
|
|
82
|
+
this.candleSeries.setData(i), this.volumeSeries.setData(r), this.chart.timeScale().fitContent();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 차트 제거
|
|
86
|
+
*/
|
|
87
|
+
destroy() {
|
|
88
|
+
this.chart.remove();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 차트 인스턴스 반환
|
|
92
|
+
*/
|
|
93
|
+
getChart() {
|
|
94
|
+
return this.chart;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
d as TradingChart
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=TradingChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TradingChart.js","sources":["../../src/components/TradingChart.ts"],"sourcesContent":["import { createChart, IChartApi, ISeriesApi, CandlestickData, HistogramData } from 'lightweight-charts';\nimport { CandleData, ChartOptions } from '../types';\nimport { filterValidCandles } from '../utils/validateCandle';\n\n/**\n * TradingView 스타일 차트\n */\nexport class TradingChart {\n private chart: IChartApi;\n private candleSeries: ISeriesApi<'Candlestick'>;\n private volumeSeries: ISeriesApi<'Histogram'>;\n\n constructor(container: HTMLElement, options: ChartOptions = {}) {\n // 차트 생성\n this.chart = createChart(container, {\n width: options.width || container.clientWidth,\n height: options.height || 600,\n layout: {\n background: { color: '#ffffff' },\n textColor: '#333',\n },\n grid: {\n vertLines: { color: '#f0f0f0' },\n horzLines: { color: '#f0f0f0' },\n },\n crosshair: {\n mode: 0, // 0 = Normal (자연스러운 움직임), 1 = Magnet (snap)\n },\n rightPriceScale: {\n borderColor: '#cccccc',\n },\n timeScale: {\n borderColor: '#cccccc',\n timeVisible: true,\n secondsVisible: false,\n },\n });\n\n // 캔들스틱 시리즈 추가\n this.candleSeries = this.chart.addCandlestickSeries({\n upColor: '#ef4444',\n downColor: '#3b82f6',\n borderUpColor: '#ef4444',\n borderDownColor: '#3b82f6',\n wickUpColor: '#ef4444',\n wickDownColor: '#3b82f6',\n });\n\n // 거래량 시리즈 추가 (하단)\n this.volumeSeries = this.chart.addHistogramSeries({\n color: '#ef4444',\n priceFormat: {\n type: 'volume',\n },\n priceScaleId: '',\n });\n\n this.volumeSeries.priceScale().applyOptions({\n scaleMargins: {\n top: 0.8,\n bottom: 0,\n },\n });\n\n // 반응형 처리\n window.addEventListener('resize', () => {\n this.chart.applyOptions({\n width: container.clientWidth,\n });\n });\n\n // Shift 키로 snap 모드 전환\n window.addEventListener('keydown', (e) => {\n if (e.key === 'Shift') {\n this.chart.applyOptions({\n crosshair: { mode: 1 }, // Magnet mode\n });\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (e.key === 'Shift') {\n this.chart.applyOptions({\n crosshair: { mode: 0 }, // Normal mode\n });\n }\n });\n }\n\n /**\n * 캔들 데이터 설정\n */\n setData(candles: CandleData[]) {\n const validCandles = filterValidCandles(candles, 'TradingChart');\n\n if (validCandles.length === 0) {\n console.warn('[TradingChart] No valid candle data to display');\n return;\n }\n\n // 캔들 데이터 변환\n const candleData: CandlestickData[] = validCandles.map(candle => ({\n time: candle.time as any,\n open: candle.open,\n high: candle.high,\n low: candle.low,\n close: candle.close,\n }));\n\n // 거래량 데이터 변환\n const volumeData: HistogramData[] = validCandles.map(candle => ({\n time: candle.time as any,\n value: candle.volume ?? 0,\n color: candle.close >= candle.open ? '#ef444466' : '#3b82f666',\n }));\n\n this.candleSeries.setData(candleData);\n this.volumeSeries.setData(volumeData);\n\n // 차트 범위 자동 조정\n this.chart.timeScale().fitContent();\n }\n\n /**\n * 차트 제거\n */\n destroy() {\n this.chart.remove();\n }\n\n /**\n * 차트 인스턴스 반환\n */\n getChart(): IChartApi {\n return this.chart;\n }\n}\n"],"names":["TradingChart","container","options","createChart","e","candles","validCandles","filterValidCandles","candleData","candle","volumeData"],"mappings":";;AAOO,MAAMA,EAAa;AAAA,EAKxB,YAAYC,GAAwBC,IAAwB,IAAI;AAE9D,SAAK,QAAQC,EAAYF,GAAW;AAAA,MAClC,OAAOC,EAAQ,SAASD,EAAU;AAAA,MAClC,QAAQC,EAAQ,UAAU;AAAA,MAC1B,QAAQ;AAAA,QACN,YAAY,EAAE,OAAO,UAAA;AAAA,QACrB,WAAW;AAAA,MAAA;AAAA,MAEb,MAAM;AAAA,QACJ,WAAW,EAAE,OAAO,UAAA;AAAA,QACpB,WAAW,EAAE,OAAO,UAAA;AAAA,MAAU;AAAA,MAEhC,WAAW;AAAA,QACT,MAAM;AAAA;AAAA,MAAA;AAAA,MAER,iBAAiB;AAAA,QACf,aAAa;AAAA,MAAA;AAAA,MAEf,WAAW;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,QACb,gBAAgB;AAAA,MAAA;AAAA,IAClB,CACD,GAGD,KAAK,eAAe,KAAK,MAAM,qBAAqB;AAAA,MAClD,SAAS;AAAA,MACT,WAAW;AAAA,MACX,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,eAAe;AAAA,IAAA,CAChB,GAGD,KAAK,eAAe,KAAK,MAAM,mBAAmB;AAAA,MAChD,OAAO;AAAA,MACP,aAAa;AAAA,QACX,MAAM;AAAA,MAAA;AAAA,MAER,cAAc;AAAA,IAAA,CACf,GAED,KAAK,aAAa,WAAA,EAAa,aAAa;AAAA,MAC1C,cAAc;AAAA,QACZ,KAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IACV,CACD,GAGD,OAAO,iBAAiB,UAAU,MAAM;AACtC,WAAK,MAAM,aAAa;AAAA,QACtB,OAAOD,EAAU;AAAA,MAAA,CAClB;AAAA,IACH,CAAC,GAGD,OAAO,iBAAiB,WAAW,CAACG,MAAM;AACxC,MAAIA,EAAE,QAAQ,WACZ,KAAK,MAAM,aAAa;AAAA,QACtB,WAAW,EAAE,MAAM,EAAA;AAAA;AAAA,MAAE,CACtB;AAAA,IAEL,CAAC,GAED,OAAO,iBAAiB,SAAS,CAACA,MAAM;AACtC,MAAIA,EAAE,QAAQ,WACZ,KAAK,MAAM,aAAa;AAAA,QACtB,WAAW,EAAE,MAAM,EAAA;AAAA;AAAA,MAAE,CACtB;AAAA,IAEL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,QAAQC,GAAuB;AAC7B,UAAMC,IAAeC,EAAmBF,GAAS,cAAc;AAE/D,QAAIC,EAAa,WAAW,GAAG;AAC7B,cAAQ,KAAK,gDAAgD;AAC7D;AAAA,IACF;AAGA,UAAME,IAAgCF,EAAa,IAAI,CAAAG,OAAW;AAAA,MAChE,MAAMA,EAAO;AAAA,MACb,MAAMA,EAAO;AAAA,MACb,MAAMA,EAAO;AAAA,MACb,KAAKA,EAAO;AAAA,MACZ,OAAOA,EAAO;AAAA,IAAA,EACd,GAGIC,IAA8BJ,EAAa,IAAI,CAAAG,OAAW;AAAA,MAC9D,MAAMA,EAAO;AAAA,MACb,OAAOA,EAAO,UAAU;AAAA,MACxB,OAAOA,EAAO,SAASA,EAAO,OAAO,cAAc;AAAA,IAAA,EACnD;AAEF,SAAK,aAAa,QAAQD,CAAU,GACpC,KAAK,aAAa,QAAQE,CAAU,GAGpC,KAAK,MAAM,UAAA,EAAY,WAAA;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,SAAK,MAAM,OAAA;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKA,WAAsB;AACpB,WAAO,KAAK;AAAA,EACd;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://cdn.jsdelivr.net/gh/toss/tossface/dist/tossface.css";.tossface{font-family:Tossface}.container *,.container *:before,.container *:after{box-sizing:border-box}.container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;overflow:hidden}.header{padding:8px 12px;border-bottom:1px solid #e0e0e0;background:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px}.header-right{display:flex;align-items:center;gap:6px}.timeframe-group{display:flex;gap:2px;background:#f5f5f5;padding:3px;border-radius:6px}.btn-timeframe{padding:4px 10px;border:none;background:transparent;border-radius:4px;cursor:pointer;font-size:13px;font-weight:500;color:#666;transition:all .15s}.btn-timeframe:hover{background:#e8e8e8;color:#333}.btn-timeframe.active{background:#fff;color:#333;box-shadow:0 1px 2px #0000001a}.btn-icon{width:32px;height:32px;border:none;background:transparent;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#666;font-size:16px;transition:all .15s}.btn-icon:hover{background:#f5f5f5;color:#333}.btn-icon.active{background:#e8f2ff;color:#2563eb}.separator{width:1px;height:20px;background:#e0e0e0;margin:0 4px}.btn-text{padding:6px 12px;border:none;background:transparent;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;color:#666;transition:all .15s;display:flex;align-items:center;gap:4px}.btn-text:hover{background:#f5f5f5;color:#333}.btn-text.active{background:#e8f2ff;color:#2563eb}.btn-delete{padding:6px 12px;border:none;background:#fee;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;color:#dc2626;transition:all .15s}.btn-delete:hover{background:#fdd}.dropdown{position:relative}.dropdown-menu{position:absolute;top:calc(100% + 4px);right:0;background:#fff;border:1px solid #e0e0e0;border-radius:12px;box-shadow:0 4px 12px #00000026;min-width:200px;padding:8px;display:none;z-index:1000}.dropdown-menu.show{display:block;animation:fadeInDown .15s ease-out}#indicatorMenu.show{display:flex;animation:fadeInDown .15s ease-out}@keyframes fadeInDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.dropdown-item{width:100%;padding:8px 12px;border:none;background:transparent;border-radius:4px;cursor:pointer;display:flex;align-items:center;gap:8px;font-size:13px;color:#333;transition:all .15s;text-align:left}.dropdown-item:hover{background:#f5f5f5}.dropdown-item.active{background:#e8f2ff;color:#2563eb}.item-icon{font-size:16px;width:20px;text-align:center}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:none;align-items:center;justify-content:center;z-index:10000}.modal-overlay.show{display:flex;animation:fadeIn .15s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.modal-content{background:#fff;border-radius:8px;padding:20px;min-width:300px;box-shadow:0 8px 24px #0003}.modal-title{font-size:16px;font-weight:600;margin-bottom:12px;color:#333}.modal-input{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:6px;font-size:14px;margin-bottom:16px;box-sizing:border-box}.modal-input:focus{outline:none;border-color:#2563eb}.modal-buttons{display:flex;gap:8px;justify-content:flex-end}.modal-btn{padding:8px 16px;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .15s}.modal-btn-cancel{background:#f5f5f5;color:#666}.modal-btn-cancel:hover{background:#e8e8e8}.modal-btn-confirm{background:#2563eb;color:#fff}.modal-btn-confirm:hover{background:#1d4ed8}#chart{width:100%;height:600px;position:relative}.info{padding:20px;border-top:1px solid #e5e5e5;background:#fafafa}.info h3{font-size:16px;margin-bottom:10px;color:#666}.info ul{list-style:none;padding-left:0}.info li{padding:4px 0;color:#666;font-size:14px}.context-menu{position:absolute;background:#fffffff2;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(0,0,0,.1);border-radius:8px;box-shadow:0 4px 20px #00000026;padding:6px;z-index:10000;display:none;gap:4px;flex-direction:row;align-items:center;cursor:move;-webkit-user-select:none;user-select:none}.context-menu.show{display:flex;animation:fadeInScale .15s ease-out}@keyframes fadeInScale{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.context-menu.dragging{cursor:grabbing}.context-menu-btn{width:36px;height:36px;border:none;background:transparent;color:#333;cursor:pointer;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:18px;transition:all .2s;position:relative}.context-menu-btn:hover{background:#0000000d}.context-menu-btn.active{background:#3b82f626;color:#2563eb}.context-menu-btn.danger:hover{background:#ef44441a;color:#dc2626}.context-menu-separator{width:1px;height:24px;background:#0000001a;margin:0 4px}.width-display{min-width:32px;height:36px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;color:#333;background:#0000000d;border-radius:6px;padding:0 8px;-webkit-user-select:none;user-select:none}.color-picker-dropdown{position:relative}.color-current-btn{width:36px;height:36px;border:none;background:transparent;cursor:pointer;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s;position:relative;padding:0}.color-current-btn:hover{background:#0000000d}.color-current-display{width:24px;height:24px;border-radius:4px;border:2px solid rgba(0,0,0,.2)}.color-palette{position:absolute;top:100%;left:50%;transform:translate(-50%);margin-top:4px;background:#fffffff2;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(0,0,0,.1);border-radius:8px;padding:8px;display:none;gap:6px;flex-wrap:wrap;width:120px;box-shadow:0 4px 12px #00000026;z-index:10002}.color-palette.show{display:flex;animation:fadeInDown .15s ease-out}.color-option{width:28px;height:28px;border:2px solid transparent;border-radius:6px;cursor:pointer;transition:all .2s;padding:0}.color-option:hover{transform:scale(1.1);box-shadow:0 2px 8px #0003}.context-menu-btn:after,.color-current-btn:after{content:attr(data-tooltip);position:absolute;bottom:-32px;left:50%;transform:translate(-50%);background:#000000d9;color:#fff;padding:4px 8px;border-radius:4px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s;z-index:10001}.context-menu-btn:hover:after,.color-current-btn:hover:after{opacity:1}#indicatorMenu{width:600px;padding:0;max-height:500px}.indicator-menu-layout{display:flex;width:100%;height:100%;overflow:hidden;border-radius:12px}.indicator-list-side{width:180px;background:#f8f9fa;border-right:1px solid #e0e0e0;overflow-y:auto;max-height:500px;border-radius:12px 0 0 12px}.indicator-category{padding:12px 16px 8px;font-size:11px;font-weight:600;color:#999}.indicator-item{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;cursor:pointer;font-size:13px;color:#333;transition:all .15s}.indicator-item:hover{background:#00000008}.indicator-item.selected{background:#fff;color:#2563eb;border-left:3px solid #2563eb}.indicator-checkbox{width:20px;height:20px;border:2px solid #d0d0d0;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:all .15s;cursor:pointer;padding:4px}.indicator-checkbox:hover{border-color:#2563eb;background:#f0f5ff}.indicator-item.checked .indicator-checkbox{background:#2563eb;border-color:#2563eb}.indicator-item.checked .indicator-checkbox:after{content:"✓";color:#fff;font-size:12px;font-weight:700}.indicator-settings-side{flex:1;padding:16px;overflow-y:auto;max-height:500px;border-radius:0 12px 12px 0}.indicator-settings-title{font-size:14px;font-weight:600;margin-bottom:4px}.indicator-settings-desc{font-size:12px;color:#666;margin-bottom:16px}.indicator-period-row{display:flex;align-items:center;gap:8px;margin-bottom:12px}.period-label-col{min-width:60px;font-size:13px;color:#666}.period-color-picker{width:60px;height:36px;border:2px solid #e0e0e0;border-radius:6px;cursor:pointer;transition:all .15s}.period-color-picker:hover{border-color:#999}.color-palette-popup{position:fixed;background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:12px 20px 12px 12px;box-shadow:0 4px 12px #00000026;display:none;z-index:10000;width:280px}.color-palette-popup.show{display:block;animation:fadeIn .15s ease-out}.color-palette-title{font-size:12px;font-weight:600;color:#333;margin-bottom:8px}.color-palette-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}.color-palette-item{width:28px;height:28px;border-radius:50%;cursor:pointer;border:2px solid transparent;transition:all .15s}.color-palette-item:hover{transform:scale(1.1);border-color:#333}.color-palette-item.selected{border-color:#2563eb;box-shadow:0 0 0 2px #2563eb33}.period-thickness-display{width:60px;height:36px;border:1px solid #e0e0e0;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:13px;background:#fff;cursor:pointer}.period-source-dropdown{width:90px;height:36px;padding:0 8px;border:1px solid #e0e0e0;border-radius:6px;font-size:13px;background:#fff;cursor:pointer}.period-value-field{width:80px;height:36px;padding:0 8px;border:1px solid #e0e0e0;border-radius:6px;font-size:13px;text-align:center}.period-delete-btn{width:32px;height:32px;border:none;background:transparent;border-radius:6px;cursor:pointer;font-size:18px;color:#999;transition:all .15s}.period-delete-btn:hover{background:#ef44441a;color:#dc2626}.add-period-button{width:100%;padding:10px;border:2px dashed #e0e0e0;background:transparent;border-radius:6px;cursor:pointer;font-size:13px;color:#666;display:flex;align-items:center;justify-content:center;gap:6px;transition:all .15s;margin-top:8px}.add-period-button:hover{border-color:#2563eb;color:#2563eb}.indicator-empty-state{text-align:center;padding:40px 20px;color:#999;font-size:13px}.btn-timeframe.disabled{color:#ccc;cursor:not-allowed;opacity:.5}.btn-timeframe.disabled:hover{background:transparent;color:#ccc}.chart-symbol{font-size:14px;font-weight:600;color:#333;margin-left:12px}.chart-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#ffffffe6;z-index:10}.loading-overlay .loading-spinner{width:32px;height:32px;border:3px solid #f3f3f3;border-top:3px solid #3b82f6;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-overlay span,.empty-overlay span{color:#666;font-size:14px}.error-overlay{background:#fef2f2f2}.error-overlay .error-icon{font-size:24px}.error-overlay span{color:#dc2626;font-size:14px}.active-tool-badge{padding:4px 10px;background:#e8f2ff;color:#2563eb;font-size:12px;font-weight:600;border-radius:12px;animation:fadeIn .15s ease-out;white-space:nowrap}@media(max-width:1024px){#indicatorMenu{width:480px}.indicator-list-side{width:140px}}@media(max-width:768px){.header{padding:6px 8px;flex-wrap:wrap;gap:6px}.header-left{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.header-right{width:100%;justify-content:flex-end;flex-wrap:wrap}.timeframe-group{flex-shrink:0}.btn-timeframe{padding:4px 8px;font-size:12px}.btn-text,.btn-delete{padding:4px 8px;font-size:13px}#indicatorMenu{width:calc(100vw - 32px);max-width:480px;right:-8px}.indicator-list-side{width:120px}.indicator-settings-side{padding:12px}.modal-content{min-width:auto;width:calc(100vw - 40px);max-width:360px}}@media(max-width:480px){.header{padding:4px 6px}.btn-timeframe{padding:4px 6px;font-size:11px}.btn-text,.btn-delete{padding:4px 6px;font-size:12px}.active-tool-badge{font-size:11px;padding:2px 8px}#indicatorMenu{position:fixed;top:auto;bottom:0;left:0;right:0;width:100%;max-width:100%;max-height:70vh;border-radius:12px 12px 0 0}.indicator-menu-layout{flex-direction:column;border-radius:12px 12px 0 0}.indicator-list-side{width:100%;max-height:160px;border-right:none;border-bottom:1px solid #e0e0e0;border-radius:12px 12px 0 0;display:flex;flex-wrap:wrap;align-content:flex-start}.indicator-category{width:100%;padding:8px 12px 4px}.indicator-item{padding:8px 12px}.indicator-settings-side{border-radius:0;max-height:calc(70vh - 160px)}.context-menu{padding:4px}.context-menu-btn{width:32px;height:32px;font-size:16px}.width-display{min-width:28px;height:32px;font-size:14px}.dropdown-menu:not(#indicatorMenu){right:-6px;min-width:160px}}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { TradingChart } from './components/TradingChart';
|
|
2
|
+
export { generateMockCandles, generateAllTimeFrames } from './utils/mockData';
|
|
3
|
+
export type { CandleData, TimeFrame, ChartOptions } from './types';
|
|
4
|
+
export { type IndicatorDataPoint, type MultiLineIndicatorResult, type IndicatorOptions, type SMAOptions, type EMAOptions, type RSIOptions, type MACDOptions, type MACDResult, type BollingerBandsOptions, type BollingerBandsResult, type StochasticOptions, type StochasticResult, type ATROptions, type VWAPOptions, type WilliamsROptions, type CurrencyStrengthOptions, type CurrencyStrengthResult, calculateSMA, calculateEMA, calculateRSI, calculateMACD, calculateBollingerBands, calculateATR, calculateStochastic, calculateWilliamsR, calculateVWAP, calculateCurrencyStrength, } from './indicators';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9E,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGnE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAE3B,YAAY,EACZ,YAAY,EAEZ,YAAY,EACZ,aAAa,EAEb,uBAAuB,EACvB,YAAY,EAEZ,mBAAmB,EACnB,kBAAkB,EAElB,aAAa,EAEb,yBAAyB,GAC1B,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TradingChart as a } from "./components/TradingChart.js";
|
|
2
|
+
import { generateAllTimeFrames as l, generateMockCandles as o } from "./utils/mockData.js";
|
|
3
|
+
import { calculateSMA as m } from "./indicators/sma.js";
|
|
4
|
+
import { calculateEMA as p } from "./indicators/ema.js";
|
|
5
|
+
import { calculateRSI as u } from "./indicators/rsi.js";
|
|
6
|
+
import { calculateMACD as i } from "./indicators/macd.js";
|
|
7
|
+
import { calculateBollingerBands as g } from "./indicators/bollingerBands.js";
|
|
8
|
+
import { calculateATR as C } from "./indicators/atr.js";
|
|
9
|
+
import { calculateStochastic as S } from "./indicators/stochastic.js";
|
|
10
|
+
import { calculateWilliamsR as h } from "./indicators/williamsR.js";
|
|
11
|
+
import { calculateVWAP as T } from "./indicators/vwap.js";
|
|
12
|
+
import { calculateCurrencyStrength as W } from "./indicators/currencyStrength.js";
|
|
13
|
+
export {
|
|
14
|
+
a as TradingChart,
|
|
15
|
+
C as calculateATR,
|
|
16
|
+
g as calculateBollingerBands,
|
|
17
|
+
W as calculateCurrencyStrength,
|
|
18
|
+
p as calculateEMA,
|
|
19
|
+
i as calculateMACD,
|
|
20
|
+
u as calculateRSI,
|
|
21
|
+
m as calculateSMA,
|
|
22
|
+
S as calculateStochastic,
|
|
23
|
+
T as calculateVWAP,
|
|
24
|
+
h as calculateWilliamsR,
|
|
25
|
+
l as generateAllTimeFrames,
|
|
26
|
+
o as generateMockCandles
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CandleData } from '../types';
|
|
2
|
+
import { ATROptions, IndicatorDataPoint } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Average True Range (ATR) — Wilder's smoothing (RMA)
|
|
5
|
+
*
|
|
6
|
+
* TR = max(H-L, |H-prevC|, |L-prevC|)
|
|
7
|
+
* First ATR = SMA(TR, period)
|
|
8
|
+
* Subsequent ATR = (prevATR * (period-1) + TR) / period
|
|
9
|
+
*
|
|
10
|
+
* @param candles OHLCV data
|
|
11
|
+
* @param options period (default 14)
|
|
12
|
+
* @returns IndicatorDataPoint[]
|
|
13
|
+
*/
|
|
14
|
+
export declare function calculateATR(candles: CandleData[], options?: ATROptions): IndicatorDataPoint[];
|
|
15
|
+
//# sourceMappingURL=atr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atr.d.ts","sourceRoot":"","sources":["../../src/indicators/atr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,GAAE,UAA2B,GACnC,kBAAkB,EAAE,CA0CtB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function a(o, n = { period: 14 }) {
|
|
2
|
+
const { period: e } = n, h = [];
|
|
3
|
+
if (!o || o.length < e + 1) return h;
|
|
4
|
+
const i = [];
|
|
5
|
+
for (let t = 1; t < o.length; t++) {
|
|
6
|
+
const u = o[t].high, l = o[t].low, s = o[t - 1].close, p = Math.max(
|
|
7
|
+
u - l,
|
|
8
|
+
Math.abs(u - s),
|
|
9
|
+
Math.abs(l - s)
|
|
10
|
+
);
|
|
11
|
+
i.push(p);
|
|
12
|
+
}
|
|
13
|
+
let r = 0;
|
|
14
|
+
for (let t = 0; t < e; t++)
|
|
15
|
+
r += i[t];
|
|
16
|
+
r /= e, h.push({
|
|
17
|
+
time: o[e].time,
|
|
18
|
+
value: r
|
|
19
|
+
});
|
|
20
|
+
for (let t = e; t < i.length; t++)
|
|
21
|
+
r = (r * (e - 1) + i[t]) / e, h.push({
|
|
22
|
+
time: o[t + 1].time,
|
|
23
|
+
value: r
|
|
24
|
+
});
|
|
25
|
+
return h;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
a as calculateATR
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=atr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atr.js","sources":["../../src/indicators/atr.ts"],"sourcesContent":["import type { CandleData } from '../types';\nimport type { ATROptions, IndicatorDataPoint } from './types';\n\n/**\n * Average True Range (ATR) — Wilder's smoothing (RMA)\n *\n * TR = max(H-L, |H-prevC|, |L-prevC|)\n * First ATR = SMA(TR, period)\n * Subsequent ATR = (prevATR * (period-1) + TR) / period\n *\n * @param candles OHLCV data\n * @param options period (default 14)\n * @returns IndicatorDataPoint[]\n */\nexport function calculateATR(\n candles: CandleData[],\n options: ATROptions = { period: 14 },\n): IndicatorDataPoint[] {\n const { period } = options;\n const result: IndicatorDataPoint[] = [];\n\n if (!candles || candles.length < period + 1) return result;\n\n // Calculate True Range values (starts from index 1)\n const trValues: number[] = [];\n for (let i = 1; i < candles.length; i++) {\n const high = candles[i].high;\n const low = candles[i].low;\n const prevClose = candles[i - 1].close;\n const tr = Math.max(\n high - low,\n Math.abs(high - prevClose),\n Math.abs(low - prevClose),\n );\n trValues.push(tr);\n }\n\n // First ATR = SMA of first `period` TR values\n let atr = 0;\n for (let i = 0; i < period; i++) {\n atr += trValues[i];\n }\n atr /= period;\n\n result.push({\n time: candles[period].time,\n value: atr,\n });\n\n // Wilder smoothing (RMA)\n for (let i = period; i < trValues.length; i++) {\n atr = (atr * (period - 1) + trValues[i]) / period;\n result.push({\n time: candles[i + 1].time,\n value: atr,\n });\n }\n\n return result;\n}\n"],"names":["calculateATR","candles","options","period","result","trValues","i","high","low","prevClose","tr","atr"],"mappings":"AAcO,SAASA,EACdC,GACAC,IAAsB,EAAE,QAAQ,MACV;AACtB,QAAM,EAAE,QAAAC,MAAWD,GACbE,IAA+B,CAAA;AAErC,MAAI,CAACH,KAAWA,EAAQ,SAASE,IAAS,EAAG,QAAOC;AAGpD,QAAMC,IAAqB,CAAA;AAC3B,WAASC,IAAI,GAAGA,IAAIL,EAAQ,QAAQK,KAAK;AACvC,UAAMC,IAAON,EAAQK,CAAC,EAAE,MAClBE,IAAMP,EAAQK,CAAC,EAAE,KACjBG,IAAYR,EAAQK,IAAI,CAAC,EAAE,OAC3BI,IAAK,KAAK;AAAA,MACdH,IAAOC;AAAA,MACP,KAAK,IAAID,IAAOE,CAAS;AAAA,MACzB,KAAK,IAAID,IAAMC,CAAS;AAAA,IAAA;AAE1B,IAAAJ,EAAS,KAAKK,CAAE;AAAA,EAClB;AAGA,MAAIC,IAAM;AACV,WAASL,IAAI,GAAGA,IAAIH,GAAQG;AAC1B,IAAAK,KAAON,EAASC,CAAC;AAEnB,EAAAK,KAAOR,GAEPC,EAAO,KAAK;AAAA,IACV,MAAMH,EAAQE,CAAM,EAAE;AAAA,IACtB,OAAOQ;AAAA,EAAA,CACR;AAGD,WAASL,IAAIH,GAAQG,IAAID,EAAS,QAAQC;AACxC,IAAAK,KAAOA,KAAOR,IAAS,KAAKE,EAASC,CAAC,KAAKH,GAC3CC,EAAO,KAAK;AAAA,MACV,MAAMH,EAAQK,IAAI,CAAC,EAAE;AAAA,MACrB,OAAOK;AAAA,IAAA,CACR;AAGH,SAAOP;AACT;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CandleData } from '../types';
|
|
2
|
+
import { BollingerBandsOptions, BollingerBandsResult } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Bollinger Bands (볼린저 밴드)
|
|
5
|
+
*
|
|
6
|
+
* @param data - 캔들 데이터 배열
|
|
7
|
+
* @param options - Bollinger Bands 옵션
|
|
8
|
+
* @returns Bollinger Bands 계산 결과 (upper, middle, lower)
|
|
9
|
+
*/
|
|
10
|
+
export declare function calculateBollingerBands(data: CandleData[], options?: BollingerBandsOptions): BollingerBandsResult;
|
|
11
|
+
//# sourceMappingURL=bollingerBands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bollingerBands.d.ts","sourceRoot":"","sources":["../../src/indicators/bollingerBands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAsB,MAAM,SAAS,CAAC;AAa1F;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,UAAU,EAAE,EAClB,OAAO,GAAE,qBAKR,GACA,oBAAoB,CAkDtB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { calculateSMA as M } from "./sma.js";
|
|
2
|
+
import { calculateEMA as D } from "./ema.js";
|
|
3
|
+
function A(e, u) {
|
|
4
|
+
const s = e.map((l) => Math.pow(l - u, 2)).reduce((l, c) => l + c, 0) / e.length;
|
|
5
|
+
return Math.sqrt(s);
|
|
6
|
+
}
|
|
7
|
+
function V(e, u = {
|
|
8
|
+
period: 20,
|
|
9
|
+
stdDev: 2,
|
|
10
|
+
source: "close",
|
|
11
|
+
maType: "SMA"
|
|
12
|
+
}) {
|
|
13
|
+
const { period: t, stdDev: s, source: l = "close", maType: c = "SMA" } = u, n = [], i = [], p = [];
|
|
14
|
+
if (e.length < t)
|
|
15
|
+
return { upper: n, middle: i, lower: p };
|
|
16
|
+
let m;
|
|
17
|
+
c === "EMA" ? m = D(e, { period: t, source: l }) : m = M(e, { period: t, source: l });
|
|
18
|
+
for (let o = t - 1; o < e.length; o++) {
|
|
19
|
+
const f = [];
|
|
20
|
+
for (let a = 0; a < t; a++)
|
|
21
|
+
f.push(e[o - a][l]);
|
|
22
|
+
const r = m[o - (t - 1)].value, d = A(f, r), h = r + s * d, v = r - s * d;
|
|
23
|
+
n.push({
|
|
24
|
+
time: e[o].time,
|
|
25
|
+
value: h
|
|
26
|
+
}), i.push({
|
|
27
|
+
time: e[o].time,
|
|
28
|
+
value: r
|
|
29
|
+
}), p.push({
|
|
30
|
+
time: e[o].time,
|
|
31
|
+
value: v
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return { upper: n, middle: i, lower: p };
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
V as calculateBollingerBands
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=bollingerBands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bollingerBands.js","sources":["../../src/indicators/bollingerBands.ts"],"sourcesContent":["import { CandleData } from '../types';\nimport { BollingerBandsOptions, BollingerBandsResult, IndicatorDataPoint } from './types';\nimport { calculateSMA } from './sma';\nimport { calculateEMA } from './ema';\n\n/**\n * 표준편차 계산\n */\nfunction calculateStdDev(values: number[], mean: number): number {\n const squaredDiffs = values.map(value => Math.pow(value - mean, 2));\n const variance = squaredDiffs.reduce((a, b) => a + b, 0) / values.length;\n return Math.sqrt(variance);\n}\n\n/**\n * Bollinger Bands (볼린저 밴드)\n *\n * @param data - 캔들 데이터 배열\n * @param options - Bollinger Bands 옵션\n * @returns Bollinger Bands 계산 결과 (upper, middle, lower)\n */\nexport function calculateBollingerBands(\n data: CandleData[],\n options: BollingerBandsOptions = {\n period: 20,\n stdDev: 2,\n source: 'close',\n maType: 'SMA',\n }\n): BollingerBandsResult {\n const { period, stdDev, source = 'close', maType = 'SMA' } = options;\n\n const upper: IndicatorDataPoint[] = [];\n const middle: IndicatorDataPoint[] = [];\n const lower: IndicatorDataPoint[] = [];\n\n if (data.length < period) {\n return { upper, middle, lower };\n }\n\n // 중간 밴드 계산 (이동평균)\n let middleValues: IndicatorDataPoint[];\n\n if (maType === 'EMA') {\n middleValues = calculateEMA(data, { period, source });\n } else {\n middleValues = calculateSMA(data, { period, source });\n }\n\n // 각 시점의 표준편차 계산 및 밴드 생성\n for (let i = period - 1; i < data.length; i++) {\n const values: number[] = [];\n for (let j = 0; j < period; j++) {\n values.push(data[i - j][source]);\n }\n\n const middleValue = middleValues[i - (period - 1)].value;\n const standardDeviation = calculateStdDev(values, middleValue);\n\n const upperValue = middleValue + stdDev * standardDeviation;\n const lowerValue = middleValue - stdDev * standardDeviation;\n\n upper.push({\n time: data[i].time,\n value: upperValue,\n });\n\n middle.push({\n time: data[i].time,\n value: middleValue,\n });\n\n lower.push({\n time: data[i].time,\n value: lowerValue,\n });\n }\n\n return { upper, middle, lower };\n}\n"],"names":["calculateStdDev","values","mean","variance","value","a","b","calculateBollingerBands","data","options","period","stdDev","source","maType","upper","middle","lower","middleValues","calculateEMA","calculateSMA","i","j","middleValue","standardDeviation","upperValue","lowerValue"],"mappings":";;AAQA,SAASA,EAAgBC,GAAkBC,GAAsB;AAE/D,QAAMC,IADeF,EAAO,IAAI,CAAAG,MAAS,KAAK,IAAIA,IAAQF,GAAM,CAAC,CAAC,EACpC,OAAO,CAACG,GAAGC,MAAMD,IAAIC,GAAG,CAAC,IAAIL,EAAO;AAClE,SAAO,KAAK,KAAKE,CAAQ;AAC3B;AASO,SAASI,EACdC,GACAC,IAAiC;AAAA,EAC/B,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV,GACsB;AACtB,QAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,QAAAC,IAAS,SAAS,QAAAC,IAAS,UAAUJ,GAEvDK,IAA8B,CAAA,GAC9BC,IAA+B,CAAA,GAC/BC,IAA8B,CAAA;AAEpC,MAAIR,EAAK,SAASE;AAChB,WAAO,EAAE,OAAAI,GAAO,QAAAC,GAAQ,OAAAC,EAAA;AAI1B,MAAIC;AAEJ,EAAIJ,MAAW,QACbI,IAAeC,EAAaV,GAAM,EAAE,QAAAE,GAAQ,QAAAE,GAAQ,IAEpDK,IAAeE,EAAaX,GAAM,EAAE,QAAAE,GAAQ,QAAAE,GAAQ;AAItD,WAASQ,IAAIV,IAAS,GAAGU,IAAIZ,EAAK,QAAQY,KAAK;AAC7C,UAAMnB,IAAmB,CAAA;AACzB,aAASoB,IAAI,GAAGA,IAAIX,GAAQW;AAC1B,MAAApB,EAAO,KAAKO,EAAKY,IAAIC,CAAC,EAAET,CAAM,CAAC;AAGjC,UAAMU,IAAcL,EAAaG,KAAKV,IAAS,EAAE,EAAE,OAC7Ca,IAAoBvB,EAAgBC,GAAQqB,CAAW,GAEvDE,IAAaF,IAAcX,IAASY,GACpCE,IAAaH,IAAcX,IAASY;AAE1C,IAAAT,EAAM,KAAK;AAAA,MACT,MAAMN,EAAKY,CAAC,EAAE;AAAA,MACd,OAAOI;AAAA,IAAA,CACR,GAEDT,EAAO,KAAK;AAAA,MACV,MAAMP,EAAKY,CAAC,EAAE;AAAA,MACd,OAAOE;AAAA,IAAA,CACR,GAEDN,EAAM,KAAK;AAAA,MACT,MAAMR,EAAKY,CAAC,EAAE;AAAA,MACd,OAAOK;AAAA,IAAA,CACR;AAAA,EACH;AAEA,SAAO,EAAE,OAAAX,GAAO,QAAAC,GAAQ,OAAAC,EAAA;AAC1B;"}
|