ctrader-ts 0.1.0 → 0.1.2
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/README.md +6 -6
- package/dist/src/connect.d.ts +32 -1
- package/dist/src/connect.d.ts.map +1 -1
- package/dist/src/connect.js +48 -3
- package/dist/src/connect.js.map +1 -1
- package/dist/src/index.d.ts +10 -10
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -9
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,18 +34,18 @@ No manual auth flows, no volume unit conversions, no raw WebSocket management.
|
|
|
34
34
|
|
|
35
35
|
## 🚀 Getting started
|
|
36
36
|
|
|
37
|
-
**
|
|
37
|
+
**Install from npm:**
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
|
|
41
|
-
cd ctrader-ts
|
|
42
|
-
npm install && npm run build && npm link
|
|
40
|
+
npm install ctrader-ts
|
|
43
41
|
```
|
|
44
42
|
|
|
45
|
-
**Or
|
|
43
|
+
**Or clone & link globally** (gets you the CLI too):
|
|
46
44
|
|
|
47
45
|
```bash
|
|
48
|
-
|
|
46
|
+
git clone https://github.com/thecommandcat/ctrader-ts
|
|
47
|
+
cd ctrader-ts
|
|
48
|
+
npm install && npm run build && npm link
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### 🔐 Authenticate
|
package/dist/src/connect.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { type PartialConfig, DEMO_ENDPOINT, LIVE_ENDPOINT } from "./config.js";
|
|
2
2
|
import { CTrader } from "./client.js";
|
|
3
3
|
export { DEMO_ENDPOINT, LIVE_ENDPOINT };
|
|
4
|
+
export interface ConnectOptions extends PartialConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Dynamic token resolver — called on every reconnect to get a fresh access token.
|
|
7
|
+
* Use this when tokens may expire and need refreshing (e.g. long-running daemons).
|
|
8
|
+
*
|
|
9
|
+
* When provided, this function is called instead of using the static `accessToken`
|
|
10
|
+
* from config on reconnect. The initial connection still uses `accessToken` from config.
|
|
11
|
+
*
|
|
12
|
+
* The function receives the CTrader client instance so it can call
|
|
13
|
+
* `client.raw.auth.refreshToken()` if needed.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const ct = await connect({
|
|
17
|
+
* getAccessToken: async (client) => {
|
|
18
|
+
* const { accessToken } = await client.raw.auth.refreshToken(myRefreshToken);
|
|
19
|
+
* return accessToken;
|
|
20
|
+
* },
|
|
21
|
+
* });
|
|
22
|
+
*/
|
|
23
|
+
getAccessToken?: (client: CTrader) => Promise<string>;
|
|
24
|
+
}
|
|
4
25
|
/**
|
|
5
26
|
* Connect to cTrader Open API and authenticate in one call.
|
|
6
27
|
*
|
|
@@ -15,6 +36,16 @@ export { DEMO_ENDPOINT, LIVE_ENDPOINT };
|
|
|
15
36
|
*
|
|
16
37
|
* @example
|
|
17
38
|
* const ct = await connect({ environment: "live" });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // With dynamic token refresh for long-running processes:
|
|
42
|
+
* const ct = await connect({
|
|
43
|
+
* getAccessToken: async (client) => {
|
|
44
|
+
* const { accessToken } = await client.raw.auth.refreshToken(refreshToken);
|
|
45
|
+
* myRefreshToken = refreshToken; // update stored refresh token
|
|
46
|
+
* return accessToken;
|
|
47
|
+
* },
|
|
48
|
+
* });
|
|
18
49
|
*/
|
|
19
|
-
export declare function connect(overrides?:
|
|
50
|
+
export declare function connect(overrides?: ConnectOptions): Promise<CTrader>;
|
|
20
51
|
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,aAAa,EACb,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAExC,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,OAAO,CAAC,SAAS,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAwE1E"}
|
package/dist/src/connect.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { resolveConfig, endpointForEnvironment, DEMO_ENDPOINT, LIVE_ENDPOINT } from "./config.js";
|
|
1
|
+
import { resolveConfig, endpointForEnvironment, DEMO_ENDPOINT, LIVE_ENDPOINT, } from "./config.js";
|
|
2
2
|
import { CTrader } from "./client.js";
|
|
3
|
+
import { CTraderError } from "./errors.js";
|
|
3
4
|
export { DEMO_ENDPOINT, LIVE_ENDPOINT };
|
|
4
5
|
/**
|
|
5
6
|
* Connect to cTrader Open API and authenticate in one call.
|
|
@@ -15,16 +16,60 @@ export { DEMO_ENDPOINT, LIVE_ENDPOINT };
|
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* const ct = await connect({ environment: "live" });
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // With dynamic token refresh for long-running processes:
|
|
22
|
+
* const ct = await connect({
|
|
23
|
+
* getAccessToken: async (client) => {
|
|
24
|
+
* const { accessToken } = await client.raw.auth.refreshToken(refreshToken);
|
|
25
|
+
* myRefreshToken = refreshToken; // update stored refresh token
|
|
26
|
+
* return accessToken;
|
|
27
|
+
* },
|
|
28
|
+
* });
|
|
18
29
|
*/
|
|
19
30
|
export async function connect(overrides) {
|
|
20
|
-
const
|
|
31
|
+
const { getAccessToken, ...configOverrides } = overrides ?? {};
|
|
32
|
+
const config = resolveConfig(configOverrides);
|
|
21
33
|
const endpoint = endpointForEnvironment(config.environment);
|
|
34
|
+
// Track the current access token in a mutable variable so reconnects
|
|
35
|
+
// always use the latest token (whether refreshed or original).
|
|
36
|
+
let currentAccessToken = config.accessToken;
|
|
22
37
|
const client = new CTrader({
|
|
23
38
|
endpoint,
|
|
24
39
|
accountId: config.accountId,
|
|
25
40
|
onReconnect: async () => {
|
|
26
41
|
await client.raw.auth.authenticateApp(config.clientId, config.clientSecret);
|
|
27
|
-
|
|
42
|
+
// If a dynamic token getter is provided, use it to get a fresh token.
|
|
43
|
+
// Otherwise fall back to the current (possibly refreshed) access token.
|
|
44
|
+
if (getAccessToken) {
|
|
45
|
+
try {
|
|
46
|
+
currentAccessToken = await getAccessToken(client);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
// If the getter fails, try with the last known token anyway
|
|
50
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
51
|
+
console.warn(`[ctrader-ts] getAccessToken failed (${msg}), trying last known token`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
await client.raw.auth.authenticateAccount(config.accountId, currentAccessToken);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
// If auth fails and we have a refresh token, attempt one automatic refresh
|
|
59
|
+
if (err instanceof CTraderError &&
|
|
60
|
+
err.isAuthError &&
|
|
61
|
+
config.refreshToken) {
|
|
62
|
+
const refreshed = await client.raw.auth.refreshToken(config.refreshToken);
|
|
63
|
+
currentAccessToken = refreshed.accessToken;
|
|
64
|
+
if (refreshed.refreshToken) {
|
|
65
|
+
config.refreshToken = refreshed.refreshToken;
|
|
66
|
+
}
|
|
67
|
+
await client.raw.auth.authenticateAccount(config.accountId, currentAccessToken);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
28
73
|
await client.raw.market.restoreSubscriptions();
|
|
29
74
|
},
|
|
30
75
|
});
|
package/dist/src/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,sBAAsB,EAEtB,aAAa,EACb,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAwBxC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,SAA0B;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,eAAe,EAAE,GAAG,SAAS,IAAI,EAAE,CAAC;IAC/D,MAAM,MAAM,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE5D,qEAAqE;IACrE,+DAA+D;IAC/D,IAAI,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC;QACzB,QAAQ;QACR,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,WAAW,EAAE,KAAK,IAAI,EAAE;YACtB,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CACnC,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,YAAY,CACpB,CAAC;YAEF,sEAAsE;YACtE,wEAAwE;YACxE,IAAI,cAAc,EAAE,CAAC;gBACnB,IAAI,CAAC;oBACH,kBAAkB,GAA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,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5E,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CACvC,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,WAAW,CACnB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { connect, DEMO_ENDPOINT, LIVE_ENDPOINT } from "./connect.js";
|
|
2
|
-
export { CTrader, lotsToUnits, unitsToLots, pipsToRelative, type CTraderClientConfig, type Lots, type Symbol, type MarketOrderOptions, type LimitOrderOptions, type StopOrderOptions, type StopLimitOptions, type ModifyOptions, type SpotPrice } from "./client.js";
|
|
3
|
-
export { type CTraderConfig, type PartialConfig, loadStoredConfig, saveConfig, getConfigPath, resolveConfig } from "./config.js";
|
|
4
|
-
export { CTraderConnection, type CTraderConnectionConfig, type ConnectionEvent } from "./connection.js";
|
|
1
|
+
export { connect, DEMO_ENDPOINT, LIVE_ENDPOINT, type ConnectOptions, } from "./connect.js";
|
|
2
|
+
export { CTrader, lotsToUnits, unitsToLots, pipsToRelative, type CTraderClientConfig, type Lots, type Symbol, type MarketOrderOptions, type LimitOrderOptions, type StopOrderOptions, type StopLimitOptions, type ModifyOptions, type SpotPrice, } from "./client.js";
|
|
3
|
+
export { type CTraderConfig, type PartialConfig, loadStoredConfig, saveConfig, getConfigPath, resolveConfig, } from "./config.js";
|
|
4
|
+
export { CTraderConnection, type CTraderConnectionConfig, type ConnectionEvent, } from "./connection.js";
|
|
5
5
|
export { CTraderAuth } from "./modules/auth.js";
|
|
6
|
-
export { CTraderTrading, type NewOrderParams, type LimitOrderParams, type StopOrderParams, type MarketRangeOrderParams, type StopLimitOrderParams, type AmendOrderParams, type AmendSltpParams } from "./modules/trading.js";
|
|
7
|
-
export { CTraderAccount, type DealListParams, type OrderListParams, type TimeRangeParams } from "./modules/account.js";
|
|
8
|
-
export { CTraderMarket, type GetTrendbarsParams, type GetTickDataParams } from "./modules/market.js";
|
|
9
|
-
export { CTraderError, RequestTimeoutError, NotConnectedError } from "./errors.js";
|
|
10
|
-
export { PayloadType, ProtoErrorCode, ProtoOAErrorCode, OrderType, TradeSide, TimeInForce, ExecutionType, PositionStatus, OrderStatus, DealStatus, TrendbarPeriod, QuoteType, OrderTriggerMethod, DayOfWeek, CommissionType, SymbolDistanceType, MinCommissionType, TradingMode, SwapCalculationType, AccessRights, TotalMarginCalculationType, AccountType, LimitedRiskMarginCalculationStrategy, StopOutStrategy, ClientPermissionScope, NotificationType, ChangeBonusType, ChangeBalanceType } from "./enums.js";
|
|
11
|
-
export type { Envelope, ConnectionState, Asset, AssetClass, Interval, Holiday, SymbolCategory, LightSymbol, ArchivedSymbol, FullSymbol, CtidTraderAccount, CtidProfile, Trader, TradeData, Position, Order, ClosePositionDetail, Deal, DealOffset, BonusDepositWithdraw, DepositWithdraw, Trendbar, TickData, DepthQuote, ExpectedMargin, PositionUnrealizedPnL, DynamicLeverageTier, DynamicLeverage, MarginCall, SpotEvent, ExecutionEvent, OrderErrorEvent, TraderUpdatedEvent, MarginChangedEvent, TokenInvalidatedEvent, ClientDisconnectEvent, AccountDisconnectEvent, SymbolChangedEvent, DepthEvent, TrailingSLChangedEvent, MarginCallEvent, OAErrorPayload, TokenPair, SlTpSpec, AccountState } from "./types.js";
|
|
6
|
+
export { CTraderTrading, type NewOrderParams, type LimitOrderParams, type StopOrderParams, type MarketRangeOrderParams, type StopLimitOrderParams, type AmendOrderParams, type AmendSltpParams, } from "./modules/trading.js";
|
|
7
|
+
export { CTraderAccount, type DealListParams, type OrderListParams, type TimeRangeParams, } from "./modules/account.js";
|
|
8
|
+
export { CTraderMarket, type GetTrendbarsParams, type GetTickDataParams, } from "./modules/market.js";
|
|
9
|
+
export { CTraderError, RequestTimeoutError, NotConnectedError, } from "./errors.js";
|
|
10
|
+
export { PayloadType, ProtoErrorCode, ProtoOAErrorCode, OrderType, TradeSide, TimeInForce, ExecutionType, PositionStatus, OrderStatus, DealStatus, TrendbarPeriod, QuoteType, OrderTriggerMethod, DayOfWeek, CommissionType, SymbolDistanceType, MinCommissionType, TradingMode, SwapCalculationType, AccessRights, TotalMarginCalculationType, AccountType, LimitedRiskMarginCalculationStrategy, StopOutStrategy, ClientPermissionScope, NotificationType, ChangeBonusType, ChangeBalanceType, } from "./enums.js";
|
|
11
|
+
export type { Envelope, ConnectionState, Asset, AssetClass, Interval, Holiday, SymbolCategory, LightSymbol, ArchivedSymbol, FullSymbol, CtidTraderAccount, CtidProfile, Trader, TradeData, Position, Order, ClosePositionDetail, Deal, DealOffset, BonusDepositWithdraw, DepositWithdraw, Trendbar, TickData, DepthQuote, ExpectedMargin, PositionUnrealizedPnL, DynamicLeverageTier, DynamicLeverage, MarginCall, SpotEvent, ExecutionEvent, OrderErrorEvent, TraderUpdatedEvent, MarginChangedEvent, TokenInvalidatedEvent, ClientDisconnectEvent, AccountDisconnectEvent, SymbolChangedEvent, DepthEvent, TrailingSLChangedEvent, MarginCallEvent, OAErrorPayload, TokenPair, SlTpSpec, AccountState, } from "./types.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,aAAa,EACb,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAC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AAQ,EACR,OAAO,EACP,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,KAAK,EACL,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { connect, DEMO_ENDPOINT, LIVE_ENDPOINT } from "./connect.js";
|
|
2
|
-
export { CTrader, lotsToUnits, unitsToLots, pipsToRelative } from "./client.js";
|
|
3
|
-
export { loadStoredConfig, saveConfig, getConfigPath, resolveConfig } from "./config.js";
|
|
4
|
-
export { CTraderConnection } from "./connection.js";
|
|
1
|
+
export { connect, DEMO_ENDPOINT, LIVE_ENDPOINT, } from "./connect.js";
|
|
2
|
+
export { CTrader, lotsToUnits, unitsToLots, pipsToRelative, } from "./client.js";
|
|
3
|
+
export { loadStoredConfig, saveConfig, getConfigPath, resolveConfig, } from "./config.js";
|
|
4
|
+
export { CTraderConnection, } from "./connection.js";
|
|
5
5
|
export { CTraderAuth } from "./modules/auth.js";
|
|
6
|
-
export { CTraderTrading } from "./modules/trading.js";
|
|
7
|
-
export { CTraderAccount } from "./modules/account.js";
|
|
8
|
-
export { CTraderMarket } from "./modules/market.js";
|
|
9
|
-
export { CTraderError, RequestTimeoutError, NotConnectedError } from "./errors.js";
|
|
10
|
-
export { PayloadType, ProtoErrorCode, ProtoOAErrorCode, OrderType, TradeSide, TimeInForce, ExecutionType, PositionStatus, OrderStatus, DealStatus, TrendbarPeriod, QuoteType, OrderTriggerMethod, DayOfWeek, CommissionType, SymbolDistanceType, MinCommissionType, TradingMode, SwapCalculationType, AccessRights, TotalMarginCalculationType, AccountType, LimitedRiskMarginCalculationStrategy, StopOutStrategy, ClientPermissionScope, NotificationType, ChangeBonusType, ChangeBalanceType } from "./enums.js";
|
|
6
|
+
export { CTraderTrading, } from "./modules/trading.js";
|
|
7
|
+
export { CTraderAccount, } from "./modules/account.js";
|
|
8
|
+
export { CTraderMarket, } from "./modules/market.js";
|
|
9
|
+
export { CTraderError, RequestTimeoutError, NotConnectedError, } from "./errors.js";
|
|
10
|
+
export { PayloadType, ProtoErrorCode, ProtoOAErrorCode, OrderType, TradeSide, TimeInForce, ExecutionType, PositionStatus, OrderStatus, DealStatus, TrendbarPeriod, QuoteType, OrderTriggerMethod, DayOfWeek, CommissionType, SymbolDistanceType, MinCommissionType, TradingMode, SwapCalculationType, AccessRights, TotalMarginCalculationType, AccountType, LimitedRiskMarginCalculationStrategy, StopOutStrategy, ClientPermissionScope, NotificationType, ChangeBonusType, ChangeBalanceType, } from "./enums.js";
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,aAAa,GAEd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,GAUf,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,cAAc,GAQf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,GAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,0BAA0B,EAC1B,WAAW,EACX,oCAAoC,EACpC,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|