@orderly.network/ui-scaffold 2.0.0-alpha.1
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/dist/index.d.mts +234 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +17 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +49 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
|
|
4
|
+
import { LogoProps, SizeType } from '@orderly.network/ui';
|
|
5
|
+
import { AccountStatusEnum, NetworkId } from '@orderly.network/types';
|
|
6
|
+
import { WsNetworkStatus } from '@orderly.network/hooks';
|
|
7
|
+
|
|
8
|
+
declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
type MainNavItem = {
|
|
11
|
+
id?: string;
|
|
12
|
+
testid?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
href: string;
|
|
15
|
+
target?: HTMLAttributeAnchorTarget;
|
|
16
|
+
icon?: string | React__default.ReactElement;
|
|
17
|
+
activeIcon?: string | React__default.ReactElement;
|
|
18
|
+
tag?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
children?: MainNavItem[];
|
|
22
|
+
className?: string;
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type MainNavClassNames = {
|
|
27
|
+
root?: string;
|
|
28
|
+
navItem?: string;
|
|
29
|
+
subMenu?: string;
|
|
30
|
+
};
|
|
31
|
+
type MainNavItemsProps = {
|
|
32
|
+
items?: MainNavItem[];
|
|
33
|
+
current?: string[];
|
|
34
|
+
classNames?: MainNavClassNames;
|
|
35
|
+
onItemClick?: (item: MainNavItem[]) => void;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type ProductItem = {
|
|
39
|
+
name: string;
|
|
40
|
+
href: string;
|
|
41
|
+
};
|
|
42
|
+
declare const ProductItem: FC<{
|
|
43
|
+
item: ProductItem;
|
|
44
|
+
active?: boolean;
|
|
45
|
+
onClick?: (product: ProductItem) => void;
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
type ProductsProps = {
|
|
49
|
+
items?: ProductItem[];
|
|
50
|
+
current?: string;
|
|
51
|
+
className?: string;
|
|
52
|
+
onItemClick?: (product: ProductItem) => void;
|
|
53
|
+
};
|
|
54
|
+
declare const ProductsMenu: FC<ProductsProps>;
|
|
55
|
+
|
|
56
|
+
declare enum CampaignPositionEnum {
|
|
57
|
+
menuLeading = "menuLeading",
|
|
58
|
+
menuTailing = "menuTailing",
|
|
59
|
+
navTailing = "navTailing"
|
|
60
|
+
}
|
|
61
|
+
type MainNavWidgetProps = {
|
|
62
|
+
logo: {
|
|
63
|
+
src: string;
|
|
64
|
+
alt: string;
|
|
65
|
+
};
|
|
66
|
+
mainMenus: MainNavItem[];
|
|
67
|
+
products: MainNavItem[];
|
|
68
|
+
campaigns?: MainNavItem;
|
|
69
|
+
campaignPosition?: CampaignPositionEnum;
|
|
70
|
+
initialProduct: string;
|
|
71
|
+
/**
|
|
72
|
+
* initial menu path, if it has submenus, use array
|
|
73
|
+
* @type string | string[]
|
|
74
|
+
*/
|
|
75
|
+
initialMenu: string | string[];
|
|
76
|
+
onItemClick?: (options: {
|
|
77
|
+
href: string;
|
|
78
|
+
name: string;
|
|
79
|
+
scope?: string;
|
|
80
|
+
}) => void;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type CampaignProps = {
|
|
84
|
+
item: MainNavItem;
|
|
85
|
+
className?: string;
|
|
86
|
+
onItemClick?: (item: MainNavItem[]) => void;
|
|
87
|
+
current?: string[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
type MainNavProps = {
|
|
91
|
+
className?: string;
|
|
92
|
+
logo: LogoProps;
|
|
93
|
+
products: ProductsProps;
|
|
94
|
+
mainMenus: MainNavItemsProps;
|
|
95
|
+
wrongNetwork: boolean;
|
|
96
|
+
isConnected: boolean;
|
|
97
|
+
campaigns?: CampaignProps;
|
|
98
|
+
campaignPosition?: CampaignPositionEnum;
|
|
99
|
+
classNames?: {
|
|
100
|
+
root?: string;
|
|
101
|
+
mainNav?: MainNavClassNames;
|
|
102
|
+
logo?: string;
|
|
103
|
+
products?: string;
|
|
104
|
+
account?: string;
|
|
105
|
+
chains?: string;
|
|
106
|
+
campaignButton?: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
declare const MainNavWidget: (props: PropsWithChildren<Partial<MainNavWidgetProps & Pick<MainNavProps, "classNames">>>) => react_jsx_runtime.JSX.Element;
|
|
111
|
+
|
|
112
|
+
declare const AccountSummaryWidget: () => react_jsx_runtime.JSX.Element;
|
|
113
|
+
|
|
114
|
+
declare const ChainMenuWidget: () => react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
116
|
+
type ChainItem = {
|
|
117
|
+
name: string;
|
|
118
|
+
id: number;
|
|
119
|
+
lowestFee?: boolean;
|
|
120
|
+
isTestnet?: boolean;
|
|
121
|
+
};
|
|
122
|
+
declare const ChainMenu: (props: {
|
|
123
|
+
chains: {
|
|
124
|
+
mainnet: ChainItem[];
|
|
125
|
+
testnet: ChainItem[];
|
|
126
|
+
};
|
|
127
|
+
onChange?: ((chain: ChainItem) => Promise<any>) | undefined;
|
|
128
|
+
currentChainId?: number | undefined;
|
|
129
|
+
wrongNetwork: boolean;
|
|
130
|
+
isConnected: boolean;
|
|
131
|
+
accountStatus: AccountStatusEnum;
|
|
132
|
+
networkId: NetworkId;
|
|
133
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
134
|
+
|
|
135
|
+
type SideMenuItem = {
|
|
136
|
+
name: string;
|
|
137
|
+
icon?: React__default.ReactNode;
|
|
138
|
+
href?: string;
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
onClick?: () => void;
|
|
141
|
+
};
|
|
142
|
+
type SideBarProps = {
|
|
143
|
+
title?: React__default.ReactNode;
|
|
144
|
+
items: SideMenuItem[];
|
|
145
|
+
open?: boolean;
|
|
146
|
+
onOpenChange?: (open: boolean) => void;
|
|
147
|
+
onItemSelect?: (item: SideMenuItem) => void;
|
|
148
|
+
current?: string;
|
|
149
|
+
className?: string;
|
|
150
|
+
maxWidth?: number;
|
|
151
|
+
minWidth?: number;
|
|
152
|
+
style?: React__default.CSSProperties;
|
|
153
|
+
};
|
|
154
|
+
declare const SideBar: {
|
|
155
|
+
(props: SideBarProps): react_jsx_runtime.JSX.Element;
|
|
156
|
+
displayName: string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
declare const SideNavbarWidget: (props?: Partial<SideBarProps>) => react_jsx_runtime.JSX.Element;
|
|
160
|
+
|
|
161
|
+
type FooterReturns = {
|
|
162
|
+
wsStatus: WsNetworkStatus;
|
|
163
|
+
config?: FooterConfig;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
declare const FooterUI: FC<FooterReturns>;
|
|
167
|
+
|
|
168
|
+
declare const FooterWidget: () => react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
type FooterConfig = {
|
|
171
|
+
telegramUrl?: string;
|
|
172
|
+
twitterUrl?: string;
|
|
173
|
+
discordmUrl?: string;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
type routerAdapter = {
|
|
177
|
+
onRouteChange: (options: {
|
|
178
|
+
href: string;
|
|
179
|
+
name: string;
|
|
180
|
+
scope?: string;
|
|
181
|
+
}) => void;
|
|
182
|
+
currentPath?: string;
|
|
183
|
+
};
|
|
184
|
+
type ExpandableState = {
|
|
185
|
+
routerAdapter?: routerAdapter;
|
|
186
|
+
expanded?: boolean;
|
|
187
|
+
setExpand: (expand: boolean) => void;
|
|
188
|
+
checkChainSupport: (chainId: number | string) => boolean;
|
|
189
|
+
footerConfig?: FooterConfig;
|
|
190
|
+
};
|
|
191
|
+
declare const ExpandableContext: React.Context<ExpandableState>;
|
|
192
|
+
declare const useScaffoldContext: () => ExpandableState;
|
|
193
|
+
|
|
194
|
+
type LayoutProps = {
|
|
195
|
+
/**
|
|
196
|
+
* Custom left sidebar component,
|
|
197
|
+
* if provided, the layout will use this component over the default sidebar component
|
|
198
|
+
*/
|
|
199
|
+
leftSidebar?: React__default.ReactNode;
|
|
200
|
+
gap?: number;
|
|
201
|
+
maxWidth?: number;
|
|
202
|
+
bodyPadding?: SizeType;
|
|
203
|
+
leftSideProps?: SideBarProps;
|
|
204
|
+
rightSidebar?: React__default.ReactNode;
|
|
205
|
+
topBar?: React__default.ReactNode;
|
|
206
|
+
mainNavProps?: PropsWithChildren<MainNavWidgetProps>;
|
|
207
|
+
footer?: React__default.ReactNode;
|
|
208
|
+
routerAdapter?: routerAdapter;
|
|
209
|
+
footerHeight?: number;
|
|
210
|
+
footerIsSticky?: boolean;
|
|
211
|
+
footerConfig?: FooterConfig;
|
|
212
|
+
classNames?: {
|
|
213
|
+
content?: string;
|
|
214
|
+
body?: string;
|
|
215
|
+
leftSidebar?: string;
|
|
216
|
+
topNavbar?: string;
|
|
217
|
+
footer?: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
declare const Scaffold: (props: PropsWithChildren<LayoutProps>) => react_jsx_runtime.JSX.Element;
|
|
221
|
+
|
|
222
|
+
interface MaintenanceTipInterface {
|
|
223
|
+
tipsContent: string;
|
|
224
|
+
showTips: boolean;
|
|
225
|
+
closeTips: () => void;
|
|
226
|
+
showDialog: boolean;
|
|
227
|
+
dialogContent?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare const MaintenanceTipsUI: (props: MaintenanceTipInterface) => react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
declare const MaintenanceTipsWidget: () => react_jsx_runtime.JSX.Element;
|
|
233
|
+
|
|
234
|
+
export { AccountMenuWidget, AccountSummaryWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, ExpandableContext, type FooterConfig, FooterUI, FooterWidget, type LayoutProps, MainNavWidget, MaintenanceTipsUI, MaintenanceTipsWidget, ProductsMenu, Scaffold, SideBar, type SideBarProps, type SideMenuItem, SideNavbarWidget, useScaffoldContext };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { HTMLAttributeAnchorTarget, FC, PropsWithChildren } from 'react';
|
|
4
|
+
import { LogoProps, SizeType } from '@orderly.network/ui';
|
|
5
|
+
import { AccountStatusEnum, NetworkId } from '@orderly.network/types';
|
|
6
|
+
import { WsNetworkStatus } from '@orderly.network/hooks';
|
|
7
|
+
|
|
8
|
+
declare const AccountMenuWidget: () => react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
type MainNavItem = {
|
|
11
|
+
id?: string;
|
|
12
|
+
testid?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
href: string;
|
|
15
|
+
target?: HTMLAttributeAnchorTarget;
|
|
16
|
+
icon?: string | React__default.ReactElement;
|
|
17
|
+
activeIcon?: string | React__default.ReactElement;
|
|
18
|
+
tag?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
children?: MainNavItem[];
|
|
22
|
+
className?: string;
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type MainNavClassNames = {
|
|
27
|
+
root?: string;
|
|
28
|
+
navItem?: string;
|
|
29
|
+
subMenu?: string;
|
|
30
|
+
};
|
|
31
|
+
type MainNavItemsProps = {
|
|
32
|
+
items?: MainNavItem[];
|
|
33
|
+
current?: string[];
|
|
34
|
+
classNames?: MainNavClassNames;
|
|
35
|
+
onItemClick?: (item: MainNavItem[]) => void;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type ProductItem = {
|
|
39
|
+
name: string;
|
|
40
|
+
href: string;
|
|
41
|
+
};
|
|
42
|
+
declare const ProductItem: FC<{
|
|
43
|
+
item: ProductItem;
|
|
44
|
+
active?: boolean;
|
|
45
|
+
onClick?: (product: ProductItem) => void;
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
type ProductsProps = {
|
|
49
|
+
items?: ProductItem[];
|
|
50
|
+
current?: string;
|
|
51
|
+
className?: string;
|
|
52
|
+
onItemClick?: (product: ProductItem) => void;
|
|
53
|
+
};
|
|
54
|
+
declare const ProductsMenu: FC<ProductsProps>;
|
|
55
|
+
|
|
56
|
+
declare enum CampaignPositionEnum {
|
|
57
|
+
menuLeading = "menuLeading",
|
|
58
|
+
menuTailing = "menuTailing",
|
|
59
|
+
navTailing = "navTailing"
|
|
60
|
+
}
|
|
61
|
+
type MainNavWidgetProps = {
|
|
62
|
+
logo: {
|
|
63
|
+
src: string;
|
|
64
|
+
alt: string;
|
|
65
|
+
};
|
|
66
|
+
mainMenus: MainNavItem[];
|
|
67
|
+
products: MainNavItem[];
|
|
68
|
+
campaigns?: MainNavItem;
|
|
69
|
+
campaignPosition?: CampaignPositionEnum;
|
|
70
|
+
initialProduct: string;
|
|
71
|
+
/**
|
|
72
|
+
* initial menu path, if it has submenus, use array
|
|
73
|
+
* @type string | string[]
|
|
74
|
+
*/
|
|
75
|
+
initialMenu: string | string[];
|
|
76
|
+
onItemClick?: (options: {
|
|
77
|
+
href: string;
|
|
78
|
+
name: string;
|
|
79
|
+
scope?: string;
|
|
80
|
+
}) => void;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type CampaignProps = {
|
|
84
|
+
item: MainNavItem;
|
|
85
|
+
className?: string;
|
|
86
|
+
onItemClick?: (item: MainNavItem[]) => void;
|
|
87
|
+
current?: string[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
type MainNavProps = {
|
|
91
|
+
className?: string;
|
|
92
|
+
logo: LogoProps;
|
|
93
|
+
products: ProductsProps;
|
|
94
|
+
mainMenus: MainNavItemsProps;
|
|
95
|
+
wrongNetwork: boolean;
|
|
96
|
+
isConnected: boolean;
|
|
97
|
+
campaigns?: CampaignProps;
|
|
98
|
+
campaignPosition?: CampaignPositionEnum;
|
|
99
|
+
classNames?: {
|
|
100
|
+
root?: string;
|
|
101
|
+
mainNav?: MainNavClassNames;
|
|
102
|
+
logo?: string;
|
|
103
|
+
products?: string;
|
|
104
|
+
account?: string;
|
|
105
|
+
chains?: string;
|
|
106
|
+
campaignButton?: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
declare const MainNavWidget: (props: PropsWithChildren<Partial<MainNavWidgetProps & Pick<MainNavProps, "classNames">>>) => react_jsx_runtime.JSX.Element;
|
|
111
|
+
|
|
112
|
+
declare const AccountSummaryWidget: () => react_jsx_runtime.JSX.Element;
|
|
113
|
+
|
|
114
|
+
declare const ChainMenuWidget: () => react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
116
|
+
type ChainItem = {
|
|
117
|
+
name: string;
|
|
118
|
+
id: number;
|
|
119
|
+
lowestFee?: boolean;
|
|
120
|
+
isTestnet?: boolean;
|
|
121
|
+
};
|
|
122
|
+
declare const ChainMenu: (props: {
|
|
123
|
+
chains: {
|
|
124
|
+
mainnet: ChainItem[];
|
|
125
|
+
testnet: ChainItem[];
|
|
126
|
+
};
|
|
127
|
+
onChange?: ((chain: ChainItem) => Promise<any>) | undefined;
|
|
128
|
+
currentChainId?: number | undefined;
|
|
129
|
+
wrongNetwork: boolean;
|
|
130
|
+
isConnected: boolean;
|
|
131
|
+
accountStatus: AccountStatusEnum;
|
|
132
|
+
networkId: NetworkId;
|
|
133
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
134
|
+
|
|
135
|
+
type SideMenuItem = {
|
|
136
|
+
name: string;
|
|
137
|
+
icon?: React__default.ReactNode;
|
|
138
|
+
href?: string;
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
onClick?: () => void;
|
|
141
|
+
};
|
|
142
|
+
type SideBarProps = {
|
|
143
|
+
title?: React__default.ReactNode;
|
|
144
|
+
items: SideMenuItem[];
|
|
145
|
+
open?: boolean;
|
|
146
|
+
onOpenChange?: (open: boolean) => void;
|
|
147
|
+
onItemSelect?: (item: SideMenuItem) => void;
|
|
148
|
+
current?: string;
|
|
149
|
+
className?: string;
|
|
150
|
+
maxWidth?: number;
|
|
151
|
+
minWidth?: number;
|
|
152
|
+
style?: React__default.CSSProperties;
|
|
153
|
+
};
|
|
154
|
+
declare const SideBar: {
|
|
155
|
+
(props: SideBarProps): react_jsx_runtime.JSX.Element;
|
|
156
|
+
displayName: string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
declare const SideNavbarWidget: (props?: Partial<SideBarProps>) => react_jsx_runtime.JSX.Element;
|
|
160
|
+
|
|
161
|
+
type FooterReturns = {
|
|
162
|
+
wsStatus: WsNetworkStatus;
|
|
163
|
+
config?: FooterConfig;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
declare const FooterUI: FC<FooterReturns>;
|
|
167
|
+
|
|
168
|
+
declare const FooterWidget: () => react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
type FooterConfig = {
|
|
171
|
+
telegramUrl?: string;
|
|
172
|
+
twitterUrl?: string;
|
|
173
|
+
discordmUrl?: string;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
type routerAdapter = {
|
|
177
|
+
onRouteChange: (options: {
|
|
178
|
+
href: string;
|
|
179
|
+
name: string;
|
|
180
|
+
scope?: string;
|
|
181
|
+
}) => void;
|
|
182
|
+
currentPath?: string;
|
|
183
|
+
};
|
|
184
|
+
type ExpandableState = {
|
|
185
|
+
routerAdapter?: routerAdapter;
|
|
186
|
+
expanded?: boolean;
|
|
187
|
+
setExpand: (expand: boolean) => void;
|
|
188
|
+
checkChainSupport: (chainId: number | string) => boolean;
|
|
189
|
+
footerConfig?: FooterConfig;
|
|
190
|
+
};
|
|
191
|
+
declare const ExpandableContext: React.Context<ExpandableState>;
|
|
192
|
+
declare const useScaffoldContext: () => ExpandableState;
|
|
193
|
+
|
|
194
|
+
type LayoutProps = {
|
|
195
|
+
/**
|
|
196
|
+
* Custom left sidebar component,
|
|
197
|
+
* if provided, the layout will use this component over the default sidebar component
|
|
198
|
+
*/
|
|
199
|
+
leftSidebar?: React__default.ReactNode;
|
|
200
|
+
gap?: number;
|
|
201
|
+
maxWidth?: number;
|
|
202
|
+
bodyPadding?: SizeType;
|
|
203
|
+
leftSideProps?: SideBarProps;
|
|
204
|
+
rightSidebar?: React__default.ReactNode;
|
|
205
|
+
topBar?: React__default.ReactNode;
|
|
206
|
+
mainNavProps?: PropsWithChildren<MainNavWidgetProps>;
|
|
207
|
+
footer?: React__default.ReactNode;
|
|
208
|
+
routerAdapter?: routerAdapter;
|
|
209
|
+
footerHeight?: number;
|
|
210
|
+
footerIsSticky?: boolean;
|
|
211
|
+
footerConfig?: FooterConfig;
|
|
212
|
+
classNames?: {
|
|
213
|
+
content?: string;
|
|
214
|
+
body?: string;
|
|
215
|
+
leftSidebar?: string;
|
|
216
|
+
topNavbar?: string;
|
|
217
|
+
footer?: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
declare const Scaffold: (props: PropsWithChildren<LayoutProps>) => react_jsx_runtime.JSX.Element;
|
|
221
|
+
|
|
222
|
+
interface MaintenanceTipInterface {
|
|
223
|
+
tipsContent: string;
|
|
224
|
+
showTips: boolean;
|
|
225
|
+
closeTips: () => void;
|
|
226
|
+
showDialog: boolean;
|
|
227
|
+
dialogContent?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare const MaintenanceTipsUI: (props: MaintenanceTipInterface) => react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
declare const MaintenanceTipsWidget: () => react_jsx_runtime.JSX.Element;
|
|
233
|
+
|
|
234
|
+
export { AccountMenuWidget, AccountSummaryWidget, CampaignPositionEnum, ChainMenu, ChainMenuWidget, ExpandableContext, type FooterConfig, FooterUI, FooterWidget, type LayoutProps, MainNavWidget, MaintenanceTipsUI, MaintenanceTipsWidget, ProductsMenu, Scaffold, SideBar, type SideBarProps, type SideMenuItem, SideNavbarWidget, useScaffoldContext };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var types = require('@orderly.network/types');
|
|
4
|
+
var ui = require('@orderly.network/ui');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var hooks = require('@orderly.network/hooks');
|
|
7
|
+
var uiConnector = require('@orderly.network/ui-connector');
|
|
8
|
+
var fe = require('react');
|
|
9
|
+
var reactApp = require('@orderly.network/react-app');
|
|
10
|
+
var uiChainSelector = require('@orderly.network/ui-chain-selector');
|
|
11
|
+
var dateFns = require('date-fns');
|
|
12
|
+
var utc = require('@date-fns/utc');
|
|
13
|
+
var utils = require('@orderly.network/utils');
|
|
14
|
+
|
|
15
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var fe__default = /*#__PURE__*/_interopDefault(fe);
|
|
18
|
+
|
|
19
|
+
var ae=e=>{let{accountState:t,onDisconnect:n,onOpenExplorer:o}=e;if(t.status<=types.AccountStatusEnum.NotConnected||t.validating)return jsxRuntime.jsx(ui.Tooltip,{open:!0,content:"Please connect wallet before starting to trade",align:"end",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsxRuntime.jsx(ui.Button,{"data-testid":"oui-testid-nav-bar-connectWallet-btn",size:"md",variant:"gradient",angle:45,className:"wallet-connect-button",loading:t.validating,disabled:t.validating,onClick:()=>{e.connect().then(a=>{}).catch(a=>{});},children:"Connect wallet"})});if(t.status<=types.AccountStatusEnum.NotSignedIn)return jsxRuntime.jsx(ui.Tooltip,{open:!0,content:"Please sign in before starting to trade",align:"end",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsxRuntime.jsx(ui.Button,{size:"md",onClick:()=>e.onCrateAccount(),children:"Sign in"})});if(t.status<=types.AccountStatusEnum.DisabledTrading)return jsxRuntime.jsx(ui.Tooltip,{open:!0,className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},content:"Please enable trading before starting to trade",align:"end",children:jsxRuntime.jsx(ui.Button,{size:"md",onClick:()=>{e.onCreateOrderlyKey().then(a=>{}).catch(a=>{});},children:"Enable trading"})});if(t.status===types.AccountStatusEnum.EnableTrading)return jsxRuntime.jsx(yt,{address:t.address,onDisconnect:n,onOpenExplorer:o})},yt=e=>{let{address:t,onDisconnect:n}=e;return jsxRuntime.jsxs(ui.DropdownMenuRoot,{children:[jsxRuntime.jsx(ui.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsx(ui.Button,{size:"md",variant:"gradient",angle:45,"data-testid":"oui-testid-nav-bar-address-btn",children:jsxRuntime.jsx(ui.Text.formatted,{rule:"address",className:"oui-text-[rgba(0,0,0,.88)]",children:t})})}),jsxRuntime.jsx(ui.DropdownMenuPortal,{children:jsxRuntime.jsxs(ui.DropdownMenuContent,{size:"xl",align:"end",onCloseAutoFocus:o=>o.preventDefault(),style:{width:"280px"},className:"oui-py-5 oui-font-semibold",sideOffset:12,children:[jsxRuntime.jsx(ui.DropdownMenuGroup,{children:jsxRuntime.jsxs(ui.Flex,{px:4,children:[jsxRuntime.jsxs(ui.Flex,{gap:2,className:"oui-flex-1",children:[jsxRuntime.jsx(ui.EVMAvatar,{address:t,size:"md"}),jsxRuntime.jsx(ui.Text.formatted,{rule:"address",size:"base",children:t})]}),jsxRuntime.jsxs(ui.Flex,{gap:2,children:[jsxRuntime.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t);},children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",className:"oui-fill-[rgba(255,255,255,0.36)] hover:oui-fill-primary",children:jsxRuntime.jsx("path",{d:"M5.249 2.243a3 3 0 0 0-3 3v4.5a3 3 0 0 0 3 3 3 3 0 0 0 3 3h4.5a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3 3 3 0 0 0-3-3zm7.5 4.5a1.5 1.5 0 0 1 1.5 1.5v4.5a1.5 1.5 0 0 1-1.5 1.5h-4.5a1.5 1.5 0 0 1-1.5-1.5h3a3 3 0 0 0 3-3z"})})}),jsxRuntime.jsx("button",{onClick:()=>e.onOpenExplorer(),children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",className:"oui-fill-[rgba(255,255,255,0.36)] hover:oui-fill-primary",children:jsxRuntime.jsx("path",{d:"M12.7432 15.7432C14.3999 15.7432 15.7432 14.3999 15.7432 12.7432V5.24316C15.7432 3.58641 14.3999 2.24316 12.7432 2.24316H5.24316C3.58641 2.24316 2.24316 3.58641 2.24316 5.24316V12.7432C2.24316 14.3999 3.58641 15.7432 5.24316 15.7432H12.7432ZM6.74316 11.9932C6.55116 11.9932 6.35092 11.9287 6.20392 11.7824C5.91142 11.4892 5.91142 10.9972 6.20392 10.7039L9.20392 7.70392L7.49316 5.99316H11.9932V10.4932L10.2824 8.78241L7.28241 11.7824C7.13616 11.9287 6.93516 11.9932 6.74316 11.9932Z"})})})]})]})}),jsxRuntime.jsx(ui.Divider,{className:"oui-mx-4 oui-my-3",intensity:8}),jsxRuntime.jsx(ui.DropdownMenuGroup,{children:jsxRuntime.jsx(ui.DropdownMenuItem,{size:"xl",onSelect:o=>{o.preventDefault(),n();},"data-testid":"oui-testid-nav-bar-dropDownMenuItem-disconnect",children:jsxRuntime.jsxs(ui.Flex,{gap:2,className:"oui-text-danger-light",children:[jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.97 14.03a.75.75 0 0 1 0-1.06l.262-.263C2.594 12.354 1.5 11.108 1.5 9.06c0-2.447 1.563-3.75 3.75-3.75H6a.75.75 0 0 1 0 1.5h-.75C3.837 6.81 3 7.508 3 9.06s.837 2.25 2.25 2.25h.38l1.188-1.188a.75.75 0 0 1-.068-.312v-.75c0-1.162.381-2.19 1.172-2.883.645-.565 1.512-.867 2.578-.867h1.13l1.34-1.34a.75.75 0 0 1 1.061 1.06l-9 9a.75.75 0 0 1-1.06 0m6.14-7.2L8.27 8.668c.065-.583.281-1.056.635-1.367.289-.253.684-.419 1.205-.473M7.825 12.8l3.414-3.415c-.126 2.12-1.496 3.297-3.414 3.415m7.705-6.58a.75.75 0 0 0-1.06 1.06c.508.509.53 1.202.53 1.72 0 .739-.014 1.203-.53 1.72-.165.164-.455.307-.825.405a3.8 3.8 0 0 1-.895.125H12a.75.75 0 0 0 0 1.5h.75c.31 0 .787-.045 1.28-.175.48-.127 1.065-.36 1.5-.795.97-.97.97-1.991.97-2.75v-.06c0-.51.002-1.778-.97-2.75",fill:"currentcolor"})}),jsxRuntime.jsx("span",{children:"Disconnect"})]})})})]})})]})};var O=fe.createContext({}),I=()=>fe.useContext(O);var Fe=()=>{let {disconnect:e,connectedChain:t}=hooks.useWalletConnector(),{account:n,state:o}=hooks.useAccount();I();let {connectWallet:s}=reactApp.useAppContext(),[c,{findByChainId:d}]=hooks.useChains(),g=async()=>{ui.modal.show(uiConnector.WalletConnectorModalId).then(l=>{},l=>{});},w=async()=>{ui.modal.show(uiConnector.WalletConnectorModalId).then(l=>{},l=>{});},u=()=>{n.once("validate:end",l=>{l<types.AccountStatusEnum.EnableTrading?b({status:l}):ui.toast.success("Wallet connected");}),ui.modal.show(uiChainSelector.ChainSelectorId).then(l=>{l.wrongNetwork||(o.status<types.AccountStatusEnum.EnableTrading?b(o):ui.toast.success("Wallet connected"));},l=>{});},f=async()=>{let l=await s();l&&(l.wrongNetwork?u():b(l));},b=l=>{l.validating||l.status<=types.AccountStatusEnum.Connected||(l.status<types.AccountStatusEnum.SignedIn&&g(),l.status<types.AccountStatusEnum.EnableTrading&&w());},p=fe.useCallback(()=>{if(!t)return;let l=d(t.id,"network_infos");if(l){let{explorer_base_url:P}=l;P&&(P.endsWith("/")?window.open(`${P}address/${n.address}`):window.open(`${P}/address/${n.address}`));}},[o,t]);return {address:o.address,accountState:o,connect:f,onCrateAccount:g,onCreateOrderlyKey:w,onOpenExplorer:p,onDisconnect:async()=>{await e({label:o.connectWallet?.name}),await n.disconnect();}}};var H=()=>{let e=Fe();return jsxRuntime.jsx(ae,{...e})};var G=e=>{let{classNames:t,currentPath:n,item:o,onClick:a,...s}=e,c=fe.useMemo(()=>e.currentPath?.[0]===e.item.href,[n]),d=fe.useCallback(()=>{Array.isArray(e.item.children)||e.onClick?.([e.item]);},[e.item]),g=jsxRuntime.jsxs("button",{id:o.id,"data-testid":o.testid,...s,disabled:e.item.disabled,"data-actived":c,className:ui.cn("oui-text-base-contrast-36 oui-text-sm oui-relative oui-group oui-rounded oui-px-3 oui-py-1 oui-h-[32px] hover:oui-bg-base-7",t?.navItem),onClick:d,children:[jsxRuntime.jsxs("span",{className:"oui-flex oui-items-center",children:[jsxRuntime.jsx(Ve,{isActive:c,item:e.item}),jsxRuntime.jsx(ui.Text.gradient,{color:c?"brand":"inherit",angle:45,children:e.item.name}),Array.isArray(e.item.children)&&jsxRuntime.jsx("span",{className:"oui-ml-1 group-data-[open=true]:oui-rotate-180",children:c?jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2.913 4.515a.5.5 0 0 0-.328.202.51.51 0 0 0 .14.701L5.722 7.41a.51.51 0 0 0 .562 0l2.995-1.992a.51.51 0 0 0 .14-.7.51.51 0 0 0-.701-.14L6.002 6.382 3.287 4.577a.5.5 0 0 0-.374-.062",fill:"url(#mainNavDropDownIcon)"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"mainNavDropDownIcon",x1:"9.502",y1:"5.994",x2:"2.502",y2:"5.994",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{"stop-color":"#59B0FE"}),jsxRuntime.jsx("stop",{offset:"1","stop-color":"#26FEFE"})]})})]}):jsxRuntime.jsx(ui.ChevronDownIcon,{size:12,color:"white"})})]}),jsxRuntime.jsx(ui.Box,{invisible:!c,position:"absolute",bottom:0,left:"50%",height:"3px",r:"full",width:"60%",gradient:"brand",angle:45,className:"-oui-translate-x-1/2 "})]});return Array.isArray(e.item.children)?jsxRuntime.jsx(Ot,{items:e.item.children,className:t?.subMenu,current:e.currentPath?.[1],onItemClick:w=>{e.onClick?.([e.item,w]);},children:g}):g},Ot=e=>{let[t,n]=fe.useState(!1),o=fe.useRef(null),a=fe.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null);},[]),s=e.children.props.className;return jsxRuntime.jsxs(ui.PopoverRoot,{open:t,children:[jsxRuntime.jsx(ui.PopoverAnchor,{children:jsxRuntime.jsx("div",{className:"oui-group","data-open":t,onMouseEnter:()=>{n(!0);},onMouseLeave:()=>{o.current=setTimeout(()=>{n(!1);},150);},children:fe.cloneElement(e.children,{className:ui.cn(s,t&&"oui-bg-base-7")})})}),jsxRuntime.jsx(ui.PopoverContent,{align:"start",onMouseEnter:a,onMouseLeave:()=>{n(!1),o.current&&clearTimeout(o.current);},className:ui.cn("oui-p-1 oui-w-[260px] oui-border oui-border-line-6 oui-space-y-[2px]",e.className),children:e.items.map((c,d)=>jsxRuntime.jsx(Ht,{item:c,onClick:e.onItemClick,active:c.href===e.current},d))})]})},Ht=e=>{let{item:t}=e;return jsxRuntime.jsxs(ui.Flex,{px:2,py:3,gapX:2,"data-active":e.active??!1,className:ui.cn("hover:oui-bg-base-6 oui-cursor-pointer oui-text-base-contrast-80 oui-items-start oui-w-full oui-group data-[active=true]:oui-bg-base-5"),r:"md",onClick:()=>{e.onClick(t);},"data-testid":t.testid,children:[!!e.item.icon&&jsxRuntime.jsx("div",{className:"oui-translate-y-1 oui-relative oui-w-6 oui-h-6",children:jsxRuntime.jsx(Ve,{isActive:e.active??!1,item:e.item})}),jsxRuntime.jsxs("div",{className:"oui-flex-1",children:[jsxRuntime.jsx(Ut,{item:t,isActive:e.active}),typeof t.description<"u"&&jsxRuntime.jsx(ui.Text,{size:"2xs",as:"div",intensity:36,children:t.description})]})]})},Ut=e=>{let{item:{name:t},isActive:n}=e;return jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",width:"100%",position:"relative",children:[jsxRuntime.jsxs("div",{className:"oui-flex-1 oui-flex",children:[jsxRuntime.jsx(ui.Text.gradient,{color:n?"brand":"inherit",size:"xs",as:"div",intensity:80,weight:"semibold",children:t}),typeof e.item.tag<"u"&&jsxRuntime.jsx(Gt,{item:e.item})]}),e.item.target==="_blank"&&jsxRuntime.jsx($t,{})]})},Gt=e=>jsxRuntime.jsx("div",{className:"oui-px-2 oui-py-1 oui-ml-1 oui-rounded oui-inline-flex oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)]",children:jsxRuntime.jsx(ui.Text.gradient,{color:"brand",size:"3xs",children:e.item.tag})}),Ae="oui-flex oui-border oui-border-line oui-w-6 oui-h-6 oui-rounded-md oui-justify-center oui-items-center oui-absolute oui-left-0 oui-top-0",Ve=e=>{let{item:t,isActive:n}=e;return e.item.icon?typeof e.item.icon=="string"?jsxRuntime.jsx("span",{className:"oui-w-[20px] oui-h-[20px] oui-mr-1",children:jsxRuntime.jsx("img",{src:n&&e.item.activeIcon||e.item.icon,className:"oui-max-w-full oui-max-h-full"})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:ui.cn(Ae,"group-data-[active=true]:oui-invisible group-hover:oui-invisible"),children:e.item.icon}),jsxRuntime.jsx("div",{className:ui.cn(Ae,"oui-invisible group-data-[active=true]:oui-visible group-hover:oui-visible"),children:e.item.activeIcon||e.item.icon})]}):null},$t=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-right-0 oui-top-0 group-hover:oui-invisible",children:jsxRuntime.jsx("path",{d:"M14.159 17.492a3.333 3.333 0 0 0 3.333-3.333V5.826a3.333 3.333 0 0 0-3.333-3.334H5.826a3.333 3.333 0 0 0-3.334 3.334v8.333a3.333 3.333 0 0 0 3.334 3.333zm-6.667-4.166a.85.85 0 0 1-.599-.235.86.86 0 0 1 0-1.198l3.333-3.333-1.9-1.901h5v5l-1.901-1.9L8.09 13.09a.84.84 0 0 1-.599.235",fill:"#fff",fillOpacity:".2"})}),jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-right-0 oui-top-0 oui-invisible group-hover:oui-visible",children:[jsxRuntime.jsx("path",{d:"M14.159 17.492a3.333 3.333 0 0 0 3.333-3.333V5.826a3.333 3.333 0 0 0-3.333-3.334H5.826a3.333 3.333 0 0 0-3.334 3.334v8.333a3.333 3.333 0 0 0 3.334 3.333zm-6.667-4.166a.85.85 0 0 1-.599-.235.86.86 0 0 1 0-1.198l3.333-3.333-1.9-1.901h5v5l-1.901-1.9L8.09 13.09a.84.84 0 0 1-.599.235",fill:"url(#outlineIcon)"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"outlineIcon",x1:"17.492",y1:"9.992",x2:"2.492",y2:"9.992",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#59B0FE"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})]})]});var ze=e=>{let{items:t,classNames:n}=e;return !Array.isArray(t)||t.length===0?null:jsxRuntime.jsx(ui.Flex,{gap:2,className:n?.root,children:t?.map((o,a)=>jsxRuntime.jsx(G,{item:o,currentPath:e.current,onClick:e.onItemClick},a))})};var De=e=>{let{active:t,item:n,onClick:o}=e;return jsxRuntime.jsx(ui.Button,{variant:t?"gradient":"text",color:"secondary",size:"sm",angle:45,className:ui.cn(t?"oui-text-[rgba(0_,_0_,_0_,_0.88)]":"hover:oui-bg-base-7"),onClick:()=>{o?.(n);},children:n.name})};var se=e=>{let{items:t,onItemClick:n,current:o,className:a}=e,s=fe.useMemo(()=>typeof o<"u"?o:t?.[0]?.href,[o,t]);return !Array.isArray(t)||t.length===0?null:jsxRuntime.jsx(ui.Flex,{gap:0,border:!0,r:"md",className:ui.cn("oui-p-[1px]",a),borderColor:12,children:t?.map((c,d)=>jsxRuntime.jsx(De,{item:c,onClick:n,active:s==c.href},d))})};var ue=e=>{let{type:t,...n}=e,o;switch(e.type){case"freeCollateral":o=jsxRuntime.jsx(to,{freeCollateral:e.freeCollateral,visible:e.visible,onToggleVisibility:e.onToggleVisibility});break;case"unrealPnL":o=jsxRuntime.jsx(io,{unrealPnL:e.unrealPnL,unrealized_pnl_ROI:e.unrealized_pnl_ROI,visible:e.visible,onToggleVisibility:e.onToggleVisibility});break;case"currentLeverage":o=jsxRuntime.jsx(oo,{currentLeverage:e.currentLeverage});break;case"maxLeverage":o=jsxRuntime.jsx(no,{maxLeverage:e.maxLeverage});break;case"totalValue":default:o=jsxRuntime.jsx(eo,{totalValue:e.totalValue,onToggleVisibility:e.onToggleVisibility,visible:e.visible});}return jsxRuntime.jsx(ui.Popover,{content:jsxRuntime.jsx(ao,{totalValue:n.totalValue,freeCollateral:e.freeCollateral,maxLeverage:e.maxLeverage,currentLeverage:e.currentLeverage,unrealized_pnl_ROI:e.unrealized_pnl_ROI,unrealPnL:e.unrealPnL,type:e.type,onTypeChange:e.onTypeChange,visible:e.visible}),contentProps:{onOpenAutoFocus:a=>a.preventDefault(),sideOffset:12},arrow:!0,children:jsxRuntime.jsx("div",{className:"oui-cursor-pointer",children:o})})},eo=e=>{let{totalValue:t=0,visible:n=!0,onToggleVisibility:o}=e;return jsxRuntime.jsxs(ui.Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxRuntime.jsxs(ui.Flex,{gap:1,itemAlign:"center",children:[jsxRuntime.jsx(ui.Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Total Value"}),jsxRuntime.jsx("button",{onClick:()=>o?.(),children:n?jsxRuntime.jsx(ui.EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsxRuntime.jsx(ui.EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})}),jsxRuntime.jsx(ui.Text,{intensity:54,children:"\u2248"})]}),jsxRuntime.jsx(ui.Text.numeral,{visible:e.visible,unit:"USDC",unitClassName:"oui-text-base-contrast-20 oui-ml-1",as:"div",children:t??"-"})]})},to=e=>{let{freeCollateral:t,visible:n,onToggleVisibility:o}=e;return jsxRuntime.jsxs(ui.Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxRuntime.jsxs(ui.Flex,{gap:1,itemAlign:"center",children:[jsxRuntime.jsx(ui.Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Free collateral"}),jsxRuntime.jsx("button",{onClick:()=>o?.(),children:n?jsxRuntime.jsx(ui.EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsxRuntime.jsx(ui.EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})})]}),jsxRuntime.jsx(ui.Text.numeral,{unit:"USDC",unitClassName:"oui-text-base-contrast-20 oui-ml-1",visible:n,as:"div",children:t??"-"})]})},oo=e=>{let{currentLeverage:t}=e;return jsxRuntime.jsxs(ui.Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxRuntime.jsx(ui.Box,{children:jsxRuntime.jsx(ui.Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Current leverage"})}),jsxRuntime.jsx(ui.Text.numeral,{as:"div",unit:"x",children:t??0})]})},no=e=>jsxRuntime.jsxs(ui.Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxRuntime.jsx(ui.Box,{children:jsxRuntime.jsx(ui.Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Max leverage"})}),jsxRuntime.jsx(ui.Text,{color:"primary",as:"div",children:`${e.maxLeverage??"--"}x`})]}),io=e=>{let{visible:t,onToggleVisibility:n}=e;return jsxRuntime.jsxs(ui.Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxRuntime.jsxs(ui.Flex,{gap:1,itemAlign:"center",children:[jsxRuntime.jsx(ui.Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Unreal. PnL"}),jsxRuntime.jsx("button",{onClick:()=>n?.(),children:t?jsxRuntime.jsx(ui.EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsxRuntime.jsx(ui.EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})})]}),jsxRuntime.jsx(ui.Text.numeral,{as:"div",coloring:!0,showIdentifier:!0,weight:"semibold",visible:t,suffix:jsxRuntime.jsx(ui.Text.numeral,{coloring:!0,prefix:"(",suffix:")",rule:"percentages",children:e.unrealized_pnl_ROI??"-"}),children:e.unrealPnL??"-"})]})},ao=e=>{let{totalValue:t}=e;return jsxRuntime.jsxs(ui.Flex,{className:"oui-text-2xs oui-font-semibold",direction:"column",gapY:1,children:[jsxRuntime.jsxs(ui.Flex,{justify:"between",width:"100%",children:[jsxRuntime.jsxs(ui.Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsxRuntime.jsx(E,{active:e.type==="totalValue",onClick:()=>e.onTypeChange("totalValue")}),jsxRuntime.jsx("span",{children:"Total Value"})]}),jsxRuntime.jsx(ui.Text.numeral,{visible:e.visible,unit:"USDC",unitClassName:"oui-text-base-contrast-36 oui-ml-1",children:t??"-"})]}),jsxRuntime.jsxs(ui.Flex,{justify:"between",width:"100%",children:[jsxRuntime.jsxs(ui.Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsxRuntime.jsx(E,{active:e.type==="freeCollateral",onClick:()=>e.onTypeChange("freeCollateral")}),jsxRuntime.jsx("span",{children:"Free collateral"})]}),jsxRuntime.jsx(ui.Text.numeral,{unit:"USDC",visible:e.visible,unitClassName:"oui-text-base-contrast-36 oui-ml-1",children:e.freeCollateral??"-"})]}),jsxRuntime.jsxs(ui.Flex,{justify:"between",width:"100%",children:[jsxRuntime.jsxs(ui.Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsxRuntime.jsx(E,{active:e.type==="unrealPnL",onClick:()=>e.onTypeChange("unrealPnL")}),jsxRuntime.jsx("span",{children:"Unreal. PnL"})]}),jsxRuntime.jsx(ui.Text.numeral,{coloring:!0,showIdentifier:!0,visible:e.visible,suffix:jsxRuntime.jsx(ui.Text.numeral,{coloring:!0,prefix:"(",visible:e.visible,suffix:")",rule:"percentages",children:e.unrealized_pnl_ROI??"-"}),children:e.unrealPnL??"-"})]}),jsxRuntime.jsxs(ui.Flex,{justify:"between",width:"100%",children:[jsxRuntime.jsxs(ui.Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsxRuntime.jsx(E,{active:e.type==="currentLeverage",onClick:()=>e.onTypeChange("currentLeverage")}),jsxRuntime.jsx("span",{children:"Current leverage"})]}),jsxRuntime.jsx(ui.Text.numeral,{unit:"x",children:e.currentLeverage??"-"})]}),jsxRuntime.jsxs(ui.Flex,{justify:"between",width:"100%",children:[jsxRuntime.jsxs(ui.Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsxRuntime.jsx(E,{active:e.type==="maxLeverage",onClick:()=>e.onTypeChange("maxLeverage")}),jsxRuntime.jsx("span",{children:"Max leverage"})]}),jsxRuntime.jsx(ui.Text,{color:"primary",children:`${e.maxLeverage??"-"}x`})]})]})},E=e=>jsxRuntime.jsx("button",{onClick:e.onClick,children:e.active?jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M7.506.977a.56.56 0 0 0-.365.16C6.367 1.88 6.13 2.5 6.413 3.348c-.661.506-1.078.63-1.903.63-1.127 0-1.863.137-2.364.637v.016a1.187 1.187 0 0 0 0 1.686l1.4 1.411-2.385 2.385a.513.513 0 0 0-.015.717.514.514 0 0 0 .719 0l2.394-2.395 1.403 1.396a1.19 1.19 0 0 0 1.687 0h.016c.501-.5.64-1.142.64-2.358 0-.773.16-1.319.64-1.893.924.271 1.462.012 2.22-.746a.5.5 0 0 0 .14-.36c0-.175-.044-.445-.156-.78a4 4 0 0 0-.984-1.577 4 4 0 0 0-1.578-.984C7.95 1.02 7.682.977 7.506.977",fill:"currentcolor",className:"oui-text-primary-light"})}):jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M7.506.977a.56.56 0 0 0-.365.16C6.367 1.88 6.13 2.5 6.413 3.348c-.661.506-1.078.63-1.903.63-1.127 0-1.863.137-2.364.637v.016a1.187 1.187 0 0 0 0 1.686l1.4 1.411-2.385 2.385a.513.513 0 0 0-.015.717.514.514 0 0 0 .719 0l2.394-2.395 1.403 1.396a1.19 1.19 0 0 0 1.687 0h.016c.501-.5.64-1.142.64-2.358 0-.773.16-1.319.64-1.893.924.271 1.462.012 2.22-.746a.5.5 0 0 0 .14-.36c0-.175-.044-.445-.156-.78a4 4 0 0 0-.984-1.577 4 4 0 0 0-1.578-.984C7.95 1.02 7.682.977 7.506.977m.193 1.027c.531.098 1.066.45 1.447.83.381.382.706.848.84 1.459-.477.458-.77.494-1.247.243a.5.5 0 0 0-.583.087c-.91.91-1.15 1.736-1.15 2.85 0 .97-.057 1.33-.36 1.655-.085.092-.203.078-.281 0L2.849 5.615a.18.18 0 0 1-.012-.255c.178-.217.576-.386 1.669-.386 1.306.001 2-.335 2.859-1.14a.5.5 0 0 0 .094-.578c-.257-.513-.217-.784.24-1.252",fill:"currentcolor"})})});var He=()=>{let[e,t]=hooks.useLocalStorage("accountSummaryType","totalValue"),{freeCollateral:n,totalValue:o}=hooks.useCollateral({dp:2}),{state:a}=hooks.useAccount(),[s,c]=hooks.useLocalStorage("orderly_assets_visible",!0),[{aggregated:d,totalUnrealizedROI:g}]=hooks.usePositionStream(),{wrongNetwork:w}=reactApp.useAppContext(),{currentLeverage:u}=hooks.useMarginRatio(),[f]=hooks.useLeverage(),b=l=>{t(l);},p=w||a.status<types.AccountStatusEnum.EnableTrading;return {totalValue:p?null:o,freeCollateral:p?null:n,maxLeverage:p?null:f,currentLeverage:p?null:u,unrealPnL:p?null:d?.unrealPnL,unrealized_pnl_ROI:p?null:g,type:e,onTypeChange:b,visible:s,wrongNetwork:w,onToggleVisibility:()=>c(!s)}};var $=()=>{let e=He();return jsxRuntime.jsx(ue,{...e})};var X=e=>e.wrongNetwork&&e.isConnected?jsxRuntime.jsx(ui.Tooltip,{open:!0,content:"Please switch to a supported network to continue.",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsxRuntime.jsx(ui.Button,{color:"warning",size:"md",onClick:()=>{ui.modal.show(uiChainSelector.ChainSelectorId,{networkId:e.networkId}).then(t=>{!t.wrongNetwork&&e.accountStatus<types.AccountStatusEnum.EnableTrading&&ui.modal.show(uiConnector.WalletConnectorModalId).then(n=>{},n=>{});},t=>{});},children:"Wrong network"})}):jsxRuntime.jsx(ui.Flex,{justify:"center",children:jsxRuntime.jsx(ui.Select.chains,{chains:e.chains,size:"md",value:e.currentChainId,variant:"contained",onChange:e.onChange})});var Ge=()=>{let[e]=hooks.useChains(),{state:t}=hooks.useAccount(),{setChain:n,connectedChain:o}=hooks.useWalletConnector(),[a,s]=fe.useState(),{wrongNetwork:c,onChainChanged:d}=reactApp.useAppContext(),g=hooks.useConfig("networkId");fe.useEffect(()=>{if(o)s(typeof o.id=="number"?o.id:parseInt(o.id));else {if(a)return;let u=g==="mainnet"?e.mainnet?.[0]?.network_infos:e.testnet?.[0]?.network_infos;if(!u)return;s(u.chain_id);}},[o,e,a,g]);let w=async u=>{if(o){if(!await n({chainId:u.id}))return;d?.(u.id,{isTestnet:u.isTestnet,isWalletConnected:!0});}else d?.(u.id,{isTestnet:u.isTestnet,isWalletConnected:!1});};return {chains:{mainnet:e.mainnet.map(u=>({name:u.network_infos.name,id:u.network_infos.chain_id,lowestFee:u.network_infos.bridgeless,isTestnet:!1})),testnet:e.testnet.map(u=>({name:u.network_infos.name,id:u.network_infos.chain_id,lowestFee:u.network_infos.bridgeless,isTestnet:!0}))},currentChainId:a,onChange:w,isConnected:!!o,wrongNetwork:c,accountStatus:t.status,networkId:g}};var K=()=>{let e=Ge();return jsxRuntime.jsx(X,{...e})};var me=(o=>(o.menuLeading="menuLeading",o.menuTailing="menuTailing",o.navTailing="navTailing",o))(me||{}),Ze=e=>{let{onItemClick:t,campaignPosition:n="navTailing"}=e,{routerAdapter:o}=I(),{connectedChain:a}=hooks.useWalletConnector(),{wrongNetwork:s}=reactApp.useAppContext(),[c,d]=fe.useState(()=>typeof e.initialMenu>"u"?[]:Array.isArray(e.initialMenu)?e.initialMenu:[e.initialMenu]),[g,w]=fe.useState(()=>e?.initialProduct??e?.products?.[0].href??""),u=p=>l=>{let P=l[l.length-1];if(!P)return;P.target!=="_blank"&&d(l.map(pt=>pt.href));let ne=l[l.length-1],Ie={href:ne.href,name:ne.name,scope:p,target:ne.target};if(typeof t=="function"){t(Ie);return}o?.onRouteChange(Ie);},f=fe.useMemo(()=>{let p={logo:{src:"https://testnet-dex-evm.woo.org/images/woofipro.svg",alt:"woofipro"},mainMenus:[],products:[],...e,campaignPosition:n};return e.campaigns&&(n==="menuTailing"?p.mainMenus=[...p.mainMenus,e.campaigns]:n==="menuLeading"?p.mainMenus=[e.campaigns,...p.mainMenus]:p.campaigns=e.campaigns),p},[e]),b={};return f.products&&f.products.length&&(b.products={items:f.products,current:g,onItemClick:p=>{let l={href:p.href,name:p.name,scope:"product"};if(typeof t=="function"){t(l);return}o?.onRouteChange(l);}}),f.mainMenus&&f.mainMenus.length&&(b.mainMenus={items:f.mainMenus,current:c,onItemClick:u("mainMenu")}),f.campaigns&&f.campaigns.children?.length&&(b.campaigns={item:f.campaigns,current:c,onItemClick:u("campaign")}),{...f,isConnected:!!a,wrongNetwork:s,...b}};var Ke=e=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(G,{item:e.item,style:{"--oui-gradient-angle":"188deg","--oui-gradient-primary-stop-start":"26%","--oui-gradient-primary-stop-end":"80%"},onClick:e.onItemClick,classNames:{navItem:ui.cn("oui-gradient-primary oui-text-white",e.className)}}),jsxRuntime.jsx(ui.Divider,{direction:"vertical",className:"oui-h-8",intensity:8})]});var ge=e=>{let{className:t,logo:n,products:o,classNames:a,campaigns:s,campaignPosition:c}=e,d=fe.useMemo(()=>typeof e.children>"u"?null:jsxRuntime.jsx(ui.Flex,{grow:!0,children:e.children}),[e.children]);return jsxRuntime.jsxs(ui.Flex,{as:"header",itemAlign:"center",height:"48px",justify:"between",px:3,className:`orderly-main-nav ${t} ${a?.root} oui-font-semibold`,children:[jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",gap:4,children:[jsxRuntime.jsx(ui.Logo,{...n}),jsxRuntime.jsx(se,{...o,className:a?.products}),jsxRuntime.jsx(ze,{...e.mainMenus,classNames:a?.mainNav})]}),d,jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",gap:4,children:[c==="navTailing"&&s?jsxRuntime.jsx(Ke,{...s,className:a?.campaignButton}):null,jsxRuntime.jsx($,{}),jsxRuntime.jsx(K,{}),e.wrongNetwork&&e.isConnected?null:jsxRuntime.jsx(H,{})]})]})};ge.displayName="MainNav";var pe=e=>{let{children:t,...n}=e,o=Ze(n);return jsxRuntime.jsx(ge,{...o,children:t})};var Go=ui.tv({slots:{button:["oui-h-10","oui-px-3","oui-rounded-md","oui-w-full","oui-text-left","oui-text-base","oui-text-base-contrast-36","oui-group","hover:oui-bg-base-8","oui-transition-colors","group-data-[state=closed]/bar:oui-w-[42px]","oui-overflow-hidden"],icon:[]},variants:{mode:{"icon-only":{button:"oui-w-10",icon:"w-6 h-6"},full:{button:"oui-full",icon:"w-6 h-6"}},active:{true:{button:"oui-bg-base-5 hover:oui-bg-base-5"}},open:{true:{button:""}}}}),$o=fe.memo(e=>{let{item:t,mode:n,open:o,onClick:a,active:s,...c}=e,{button:d}=Go({mode:n,active:e.active,open:e.open}),g=jsxRuntime.jsx("button",{"data-actived":e.active,disabled:t.disabled,className:d(),onClick:()=>{e.onClick?.(t);},children:jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",gap:2,as:"span",children:[t.icon,e.open&&jsxRuntime.jsx(ui.Text.gradient,{color:e.active?"brand":"inherit",angle:45,size:"base",className:"oui-animate-in oui-fade-in",children:t.name})]})});return e.open?jsxRuntime.jsx("li",{className:"oui-min-w-[120px]",children:g}):jsxRuntime.jsx("li",{children:jsxRuntime.jsx(ui.Tooltip,{content:t.name,side:"right",align:"center",sideOffset:20,children:g})})}),Zo=e=>jsxRuntime.jsxs(ui.Box,{py:6,children:[jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-invisible oui-pointer-events-none",children:jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"side-menu-gradient",x1:"15.7432",y1:"8.94726",x2:"2.24316",y2:"8.94726",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#59B0FE"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})}),jsxRuntime.jsx("ul",{className:"oui-space-y-4",children:e.menus.map((t,n)=>jsxRuntime.jsx($o,{item:t,open:e.open,active:t.href===e.current,onClick:e.onItemSelect},n))})]}),Xo=e=>{let{title:t}=e,n=typeof t=="string"?jsxRuntime.jsx(ui.Text,{intensity:54,size:"xs",children:t}):t;return jsxRuntime.jsxs(ui.Flex,{justify:e.open?"between":"center",itemAlign:"center",className:"oui-h-6",children:[e.open?n:null,jsxRuntime.jsx("button",{onClick:()=>{e.onToggle?.();},children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"group-data-[state=closed]/bar:oui-rotate-90",children:jsxRuntime.jsx("path",{d:"M5.82552 17.4922C3.98469 17.4922 2.49219 15.9997 2.49219 14.1589V5.82552C2.49219 3.98469 3.98469 2.49219 5.82552 2.49219H14.1589C15.9997 2.49219 17.4922 3.98469 17.4922 5.82552V14.1589C17.4922 15.9997 15.9997 17.4922 14.1589 17.4922H5.82552ZM12.4922 13.3255C12.7055 13.3255 12.928 13.2538 13.0913 13.0913C13.4163 12.7655 13.4163 12.2189 13.0913 11.893L9.75802 8.55969L11.6589 6.65885H6.65885V11.6589L8.55969 9.75802L11.893 13.0913C12.0555 13.2538 12.2789 13.3255 12.4922 13.3255Z",fill:"white",fillOpacity:"0.2"})})})]})},z=e=>{let{open:t=!0,items:n,current:o,onItemSelect:a}=e;return jsxRuntime.jsxs(ui.Box,{"data-state":t?"opened":"closed",className:ui.cn("oui-group/bar",e.className),style:e.style,children:[jsxRuntime.jsx(Xo,{open:t,title:e.title,onToggle:()=>{e.onOpenChange?.(!t);}}),jsxRuntime.jsx(Zo,{menus:n,current:o,onItemSelect:a,open:t})]})};z.displayName="SideBar";var Ye=e=>{let[t,n]=fe.useState(e?.items?.[0].href||"/"),{expanded:o,setExpand:a}=I();return {items:[],current:t,open:o,onOpenChange:s=>{a?.(s);},onItemSelect:s=>{s.href&&n(s.href);},...e}};var J=e=>{let t=Ye(e);return jsxRuntime.jsx(z,{...t})};var Q=fe__default.default.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsxRuntime.jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntime.jsx("path",{d:"M4.108 9.464S9.645 7.13 11.565 6.31c.736-.328 3.233-1.38 3.233-1.38s1.152-.46 1.056.658c-.032.46-.288 2.069-.544 3.81-.384 2.463-.8 5.157-.8 5.157s-.064.755-.608.887c-.544.13-1.44-.46-1.6-.592-.129-.098-2.401-1.576-3.233-2.299-.224-.197-.48-.591.032-1.051a124 124 0 0 0 3.36-3.285c.384-.394.768-1.313-.832-.197-2.272 1.61-4.513 3.12-4.513 3.12s-.512.33-1.472.034-2.08-.69-2.08-.69-.768-.493.544-1.018"})})}),Y=fe__default.default.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsxRuntime.jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",...o,xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M14.956 5.522c1.604 2.374 2.396 5.053 2.1 8.136a.05.05 0 0 1-.02.033 11.7 11.7 0 0 1-3.55 1.805.045.045 0 0 1-.05-.017 9.6 9.6 0 0 1-.725-1.188.046.046 0 0 1 .024-.063 7 7 0 0 0 1.108-.531.046.046 0 0 0 .004-.076 6 6 0 0 1-.22-.174.04.04 0 0 0-.047-.006c-2.296 1.068-4.812 1.068-7.136 0a.04.04 0 0 0-.046.006 6 6 0 0 1-.22.174.046.046 0 0 0 .005.076c.353.204.721.384 1.107.531.025.01.037.039.025.063a8.5 8.5 0 0 1-.725 1.188.05.05 0 0 1-.05.017 11.7 11.7 0 0 1-3.546-1.805.05.05 0 0 1-.018-.033c-.248-2.667.257-5.368 2.097-8.137a.04.04 0 0 1 .02-.016 11.6 11.6 0 0 1 2.89-.903.05.05 0 0 1 .046.022c.125.224.269.51.366.744a10.7 10.7 0 0 1 3.246 0 8 8 0 0 1 .36-.744.044.044 0 0 1 .046-.022 11.7 11.7 0 0 1 2.89.903q.012.005.019.017m-6.018 5.07c.011-.788-.56-1.44-1.276-1.44-.71 0-1.276.647-1.276 1.44 0 .795.576 1.442 1.276 1.442.71 0 1.276-.647 1.276-1.441m4.718 0c.011-.788-.56-1.44-1.276-1.44-.71 0-1.276.647-1.276 1.44 0 .795.577 1.442 1.276 1.442.717 0 1.276-.647 1.276-1.441"})})}),j=fe__default.default.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsxRuntime.jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntime.jsx("path",{d:"m4.42 4.73 4.633 6.194-4.662 5.037H5.44l4.082-4.41 3.298 4.41h3.57l-4.893-6.543 4.34-4.689h-1.05l-3.759 4.062-3.037-4.062zm1.543.772h1.64l7.244 9.686h-1.64z"})})});j.displayName="CommuntiyXIcon";Q.displayName="CommuntiyTelegramIcon";Y.displayName="CommuntiyDiscordIcon";var he=fe__default.default.forwardRef((e,t)=>{let{opacity:n=.54,...o}=e;return jsxRuntime.jsxs("svg",{width:96,hanging:11,ref:t,viewBox:"0 0 96 11",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsxRuntime.jsx("path",{d:"M10.757 8.635h1.862V6.164c0-1.485.874-1.904 1.69-1.904.148 0 .284.011.477.034V2.729a1.8 1.8 0 0 0-.454-.056c-.896 0-1.452.6-1.68 1.53h-.033V2.74h-1.862zm7.221.113c.874 0 1.475-.464 1.634-.907v.794h1.861V.7h-1.86v2.834c-.16-.442-.761-.907-1.635-.907-1.203 0-2.565.885-2.565 3.06 0 2.188 1.362 3.061 2.565 3.061m-.817-3.06c0-1.043.624-1.52 1.282-1.52.647 0 1.249.477 1.249 1.52s-.602 1.519-1.249 1.519c-.658 0-1.282-.476-1.282-1.52m8.538 3.061c1.453 0 2.508-.748 2.78-2.108h-1.634c-.102.385-.352.703-1.112.703-.726 0-1.18-.329-1.282-1.19h4.074c.023-.136.034-.25.034-.465 0-2.301-1.34-3.06-2.86-3.06-1.578 0-3.007.838-3.007 3.037 0 2.29 1.543 3.083 3.007 3.083m-1.237-3.672c.114-.68.5-1.043 1.192-1.043.85 0 1.112.533 1.146 1.043zm5.304 3.559h1.861V6.164c0-1.485.874-1.904 1.691-1.904.148 0 .284.011.477.034V2.729a1.8 1.8 0 0 0-.454-.056c-.897 0-1.453.6-1.68 1.53h-.034V2.74h-1.861zm5.117 0h1.861V.7h-1.861zm3.481.725v1.565c1.827.192 2.588-.42 3.382-2.358L44.13 2.74h-1.906L40.93 6.265 39.67 2.74h-1.895l2.145 5.293c.148.352.159.533.034.816-.102.227-.363.669-1.589.51m9.808-.724h1.895V3.897h.045l2.86 4.738h2.043V.7h-1.907v4.863h-.045L50.136.7h-1.963zm11.054.113c1.453 0 2.508-.748 2.78-2.108h-1.633c-.102.385-.352.703-1.113.703-.726 0-1.18-.329-1.282-1.19h4.074c.023-.136.034-.25.034-.465 0-2.301-1.339-3.06-2.86-3.06-1.577 0-3.007.838-3.007 3.037 0 2.29 1.543 3.083 3.007 3.083M57.99 5.076c.114-.68.5-1.043 1.192-1.043.851 0 1.112.533 1.146 1.043zm8.005 3.638c.352 0 .692-.045.976-.124V7.218c-.26.023-.363.023-.488.023-.601 0-.715-.329-.715-.737V4.18h1.158V2.74h-1.158V1.2h-1.86v1.54h-1.01v1.44h1.01v2.585c0 1.371.816 1.95 2.087 1.95m3.365-.08h2.1l.942-3.423.942 3.423h2.088l1.543-5.894h-1.759l-.919 4.103h-.045l-1.056-4.103h-1.6l-1.055 4.103h-.046l-.919-4.103h-1.748zm11.195.113c1.486 0 2.995-.895 2.995-3.06s-1.509-3.06-2.995-3.06c-1.499 0-2.997.895-2.997 3.06s1.498 3.06 2.996 3.06m-1.26-3.06c0-1.043.533-1.52 1.26-1.52.714 0 1.248.477 1.248 1.52s-.534 1.519-1.248 1.519c-.727 0-1.26-.476-1.26-1.52m5.461 2.948h1.86V6.164c0-1.485.875-1.904 1.692-1.904.147 0 .283.011.476.034V2.729a1.8 1.8 0 0 0-.454-.056c-.896 0-1.452.6-1.68 1.53h-.033V2.74h-1.861zm5.117 0h1.86v-1.7l.466-.5 1.76 2.2H96l-2.667-3.4 2.36-2.494h-2.03l-1.93 2.199V.7h-1.861z",fill:"#fff",fillOpacity:n}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.632 1.043c.046.037.02.11-.04.11H1.779c-.06 0-.087-.073-.04-.11A4.67 4.67 0 0 1 4.685 0a4.66 4.66 0 0 1 2.947 1.043M2.862 5.96a.18.18 0 0 0-.146-.078H.265a.084.084 0 0 0-.081.107 4.687 4.687 0 0 0 9.001 0 .084.084 0 0 0-.081-.107H6.653a.18.18 0 0 0-.146.078 2.22 2.22 0 0 1-1.823.948c-.753 0-1.42-.375-1.822-.948m3.471-2.77c.034.037.082.06.132.06H9.03c.058 0 .1-.057.08-.112a4.7 4.7 0 0 0-.79-1.412.17.17 0 0 0-.13-.061H1.18a.17.17 0 0 0-.13.061c-.34.417-.609.894-.79 1.412a.084.084 0 0 0 .08.111h2.564c.05 0 .098-.022.132-.06.407-.448.995-.73 1.648-.73a2.22 2.22 0 0 1 1.648.73M6.89 5.37a.066.066 0 0 1-.063-.084 2.23 2.23 0 0 0-.077-1.43.067.067 0 0 1 .06-.091h2.417c.03 0 .057.021.063.051a4.7 4.7 0 0 1 .038 1.5.064.064 0 0 1-.063.054zm-4.347-.084a.066.066 0 0 1-.063.084H.105a.064.064 0 0 1-.063-.055A4.7 4.7 0 0 1 .08 3.816a.064.064 0 0 1 .063-.051H2.56c.046 0 .078.048.06.091a2.22 2.22 0 0 0-.077 1.43",fill:"#fff",fillOpacity:n})]})});var ee=fe__default.default.forwardRef((e,t)=>{let{size:n=18,...o}=e;return jsxRuntime.jsx("svg",{width:n,height:n,viewBox:"0 0 18 18",ref:t,className:"oui-fill-success-light",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntime.jsx("path",{d:"M9.02092 2.92969C6.18562 2.92969 3.51037 4.13854 1.68502 6.18754C1.40947 6.49676 1.446 6.96671 1.75537 7.24218C2.0646 7.51743 2.53447 7.48143 2.81002 7.17183C4.35112 5.44196 6.6141 4.42969 9.02092 4.42969C11.4205 4.42969 13.6369 5.43123 15.185 7.17183C15.4603 7.48143 15.9301 7.51743 16.2397 7.24218C16.5492 6.96694 16.5853 6.49699 16.31 6.18754C14.4787 4.12856 11.8512 2.92969 9.02092 2.92969ZM9.02092 5.92969C7.04092 5.92969 5.20867 6.78461 3.93502 8.25019C3.6633 8.56294 3.6927 9.03318 4.00537 9.30468C4.31797 9.57618 4.7883 9.54693 5.06002 9.23418C6.05175 8.09343 7.47982 7.42968 9.02092 7.42968C10.5348 7.42968 11.9446 8.08144 12.935 9.18769C13.2113 9.49593 13.681 9.51093 13.9897 9.23418C14.2983 8.95818 14.3364 8.48793 14.06 8.17968C12.7879 6.75896 10.9659 5.92969 9.02092 5.92969ZM9.02092 8.92968C7.91917 8.92968 6.89242 9.40218 6.18502 10.2189C5.91375 10.5317 5.94225 11.0019 6.25537 11.2734C6.56835 11.5449 7.03875 11.5164 7.31002 11.2029C7.73542 10.7124 8.3589 10.4297 9.02092 10.4297C9.6684 10.4297 10.2604 10.7072 10.685 11.1797C10.962 11.4879 11.4552 11.5037 11.7631 11.2262C12.0712 10.9494 12.087 10.4799 11.81 10.1717C11.1037 9.38643 10.0983 8.92968 9.02092 8.92968ZM8.99752 11.9297C8.81609 11.9297 8.64374 12.0047 8.50537 12.1404C8.50537 12.1404 7.3935 13.2362 6.95842 13.6637C6.52342 14.0919 6.7968 14.9319 7.49752 14.9297H9.63037H10.4975C11.1864 14.9319 11.477 14.0739 11.0366 13.6404C10.5961 13.2069 9.51322 12.1404 9.51314 12.1404C9.37469 12.0047 9.17894 11.9297 8.99752 11.9297Z"})})});ee.displayName="SignalIcon";var ve=e=>{let{size:t=20,viewBox:n,...o}=e;return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t}px`,height:`${t}px`,fill:"none",viewBox:"0 0 20 20",...o,children:jsxRuntime.jsx("path",{d:"M10.012 1.66602C5.40954 1.66602 1.67871 5.39685 1.67871 9.99935C1.67871 14.6018 5.40954 18.3327 10.012 18.3327C14.6145 18.3327 18.3454 14.6018 18.3454 9.99935C18.3454 5.39685 14.6145 1.66602 10.012 1.66602ZM10.012 5.83268C10.472 5.83268 10.8454 6.20602 10.8454 6.66602V10.8327C10.8454 11.2927 10.472 11.666 10.012 11.666C9.55204 11.666 9.17871 11.2927 9.17871 10.8327V6.66602C9.17871 6.20602 9.55204 5.83268 10.012 5.83268ZM10.012 12.4993C10.472 12.4993 10.8454 12.8727 10.8454 13.3327C10.8454 13.7927 10.472 14.166 10.012 14.166C9.55204 14.166 9.17871 13.7927 9.17871 13.3327C9.17871 12.8727 9.55204 12.4993 10.012 12.4993Z",fill:"#FF7D00"})})};var xe=e=>{let{size:t=16,viewBox:n,...o}=e;return jsxRuntime.jsx("svg",{width:`${t}px`,height:`${t}px`,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntime.jsx("path",{d:"M3.32972 2.60449C3.15912 2.60449 2.98072 2.66183 2.85052 2.79183C2.59019 3.0525 2.59019 3.48982 2.85052 3.75049L7.03806 7.93782L2.85052 12.1252C2.59019 12.3858 2.59019 12.8232 2.85052 13.0838C3.11092 13.3438 3.54852 13.3438 3.80892 13.0838L7.99639 8.89649L12.1839 13.0838C12.4443 13.3438 12.8819 13.3438 13.1423 13.0838C13.4026 12.8232 13.4026 12.3858 13.1423 12.1252L8.95472 7.93782L13.1423 3.75049C13.4026 3.48982 13.4026 3.0525 13.1423 2.79183C13.0121 2.66183 12.8336 2.60449 12.6631 2.60449C12.4925 2.60449 12.3141 2.66183 12.1839 2.79183L7.99639 6.97916L3.80892 2.79183C3.67872 2.66183 3.50032 2.60449 3.32972 2.60449Z",fill:"currentColor"})})};var we=e=>{let t=fe.useMemo(()=>{switch(e.wsStatus){case hooks.WsNetworkStatus.Connected:return "oui-fill-success-light oui-text-success-light";case hooks.WsNetworkStatus.Disconnected:return "oui-fill-danger-light oui-text-danger-light";case hooks.WsNetworkStatus.Unstable:return "oui-fill-warning-light oui-text-warning-light"}},[e.wsStatus]),n=o=>{window.open(o,"_blank");};return jsxRuntime.jsxs(ui.Flex,{direction:"row",justify:"between",height:29,px:3,className:"oui-hidden lg:oui-flex oui-bg-base-9 oui-border-t-2 oui-border-line-6",children:[jsxRuntime.jsxs(ui.Flex,{children:[jsxRuntime.jsxs(ui.Flex,{direction:"row",itemAlign:"center",gap:1,className:t,children:[jsxRuntime.jsx(ee,{fillOpacity:1,fill:"currentColor"}),jsxRuntime.jsx(ui.Text,{size:"2xs",children:"Operational"})]}),jsxRuntime.jsx(ui.Divider,{direction:"vertical",className:"oui-h-[18px] oui-px-1 oui-ml-2 oui-border-line-12"}),jsxRuntime.jsxs(ui.Flex,{gap:2,children:[jsxRuntime.jsx(ui.Text,{intensity:54,size:"2xs",children:"Join our community"}),jsxRuntime.jsxs(ui.Flex,{direction:"row",gap:1,children:[typeof e.config?.telegramUrl<"u"&&jsxRuntime.jsx(Q,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.config?.telegramUrl)}),typeof e.config?.discordmUrl<"u"&&jsxRuntime.jsx(Y,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.config?.discordmUrl)}),typeof e.config?.twitterUrl<"u"&&jsxRuntime.jsx(j,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.config?.twitterUrl)})]})]})]}),jsxRuntime.jsxs(ui.Flex,{direction:"row",gap:1,children:[jsxRuntime.jsx(ui.Text,{intensity:54,size:"2xs",children:"Powered by"}),jsxRuntime.jsx(he,{})]})]})};var nt=()=>{let e=hooks.useWsStatus(),{footerConfig:t}=I();return {wsStatus:e,config:t}};var ye=()=>{let e=nt();return jsxRuntime.jsx(we,{...e})};var Ne=e=>{if(hooks.useMediaQuery(types.MEDIA_TABLET))return jsxRuntime.jsx(jsxRuntime.Fragment,{});let{showTips:n,showDialog:o,tipsContent:a,closeTips:s,dialogContent:c}=e;return o?jsxRuntime.jsx(ui.Dialog,{open:!0,children:jsxRuntime.jsxs(ui.DialogContent,{closable:!1,children:[jsxRuntime.jsx(ui.DialogHeader,{children:jsxRuntime.jsx(ui.DialogTitle,{children:"System upgrade in progress"})}),jsxRuntime.jsx(ui.Divider,{}),jsxRuntime.jsx(ui.DialogBody,{children:c})]})}):n?jsxRuntime.jsxs(ui.Flex,{className:ui.cn("oui-w-full oui-bg-warning/10 oui-text-warning oui-text-sm oui-relative oui-gap-1 oui-pl-4 oui-pr-[60px] oui-py-3","oui-min-h-[48px]","oui-justify-start oui-items-start","xl:oui-justify-center xl:oui-items-center xl:oui-px-4"),children:[jsxRuntime.jsx(ve,{size:20,className:"oui-flex-shrink-0 oui-w-5 oui-h-5 "}),jsxRuntime.jsx(ui.Box,{className:"oui-font-semibold ",children:a}),jsxRuntime.jsx(xe,{size:16,className:"oui-absolute oui-right-4 oui-text-secondary/[0.36] hover:oui-text-secondary/80 oui-cursor-pointer -oui-translate-y-2/4 oui-top-2/4",onClick:s})]}):jsxRuntime.jsx(jsxRuntime.Fragment,{})};function ut(e){let t=dateFns.format(new utc.UTCDateMini(e),"MMM dd");return `${dateFns.format(new utc.UTCDateMini(e),"h:mm aa")} (UTC) on ${t}`}var xn=1e3*60*60*24,mt=()=>{let[e,t]=fe.useState(!1),[n,o]=fe.useState(!1),{startTime:a,endTime:s,status:c,brokerName:d}=hooks.useMaintenanceStatus(),g=fe.useMemo(()=>a?ut(a):"-",[a]),w=fe.useMemo(()=>s?ut(s):"-",[s]),u=()=>{window.localStorage.setItem(`Maintenance_${a}`,"1"),t(!1);};fe.useEffect(()=>{if(c===2){t(!1),o(!0);return}o(!1),a&&a<utils.getTimestamp()+xn&&(window.localStorage.getItem(`Maintenance_${a}`)||t(!0));},[a,c]);let f=`${d} will be temporarily unavailable for a scheduled upgrade from ${g} to ${w}.`,b=`Sorry, ${d} is temporarily unavailable due to a scheduled upgrade. The service is expected to be back by ${w}.`;return {tipsContent:f,showTips:e,closeTips:u,showDialog:n,dialogContent:b}};var Me=()=>{let e=mt();return jsxRuntime.jsx(Ne,{...e})};function dt(e,t){return typeof e=="string"&&(e=parseInt(e)),t.some(n=>n.network_infos.chain_id===e)}var Sn=e=>{let{classNames:t,footerConfig:n,routerAdapter:o}=e,[a,s]=hooks.useLocalStorage("orderly_scaffold_expanded",!0),[c]=hooks.useChains(),d=fe.useMemo(()=>e.maxWidth||185,[]),{networkId:g}=fe.useContext(hooks.OrderlyContext),w=b=>dt(b,g==="testnet"?c.testnet:c.mainnet),u=b=>{s(b);},f=e.footerHeight!==void 0?e.footerHeight:29;return jsxRuntime.jsx("div",{className:"oui-flex oui-flex-col oui-overflow-auto",style:{height:`calc(100vh - ${f}px)`},children:jsxRuntime.jsxs(O.Provider,{value:{routerAdapter:o,expanded:a,setExpand:u,checkChainSupport:w,footerConfig:n},children:[jsxRuntime.jsx(ui.Box,{className:ui.cn("oui-hidden xl:oui-block","oui-border-b oui-border-line-12",t?.topNavbar),children:e.topBar??jsxRuntime.jsx(pe,{...e.mainNavProps})}),jsxRuntime.jsx(Me,{}),e.leftSidebar===null?jsxRuntime.jsx(ui.Box,{className:t?.content,children:e.children}):jsxRuntime.jsxs(ui.Grid,{className:ui.cn("oui-box-content oui-transition-all oui-flex xl:oui-grid","oui-flex-1",t?.body),style:{gridTemplateColumns:`${a?d+"px":"98px"} 1fr`},children:[jsxRuntime.jsx("div",{className:ui.cn(t?.leftSidebar),children:typeof e.leftSidebar<"u"?e.leftSidebar:jsxRuntime.jsx(J,{...e.leftSideProps})}),jsxRuntime.jsx(ui.Box,{width:"100%",className:t?.content,children:e.children})]}),jsxRuntime.jsx(ui.Box,{className:ui.cn("oui-fixed oui-bottom-0 oui-z-50","oui-w-full",t?.footer),children:e.footer||jsxRuntime.jsx(ye,{})})]})})};
|
|
20
|
+
|
|
21
|
+
exports.AccountMenuWidget = H;
|
|
22
|
+
exports.AccountSummaryWidget = $;
|
|
23
|
+
exports.CampaignPositionEnum = me;
|
|
24
|
+
exports.ChainMenu = X;
|
|
25
|
+
exports.ChainMenuWidget = K;
|
|
26
|
+
exports.ExpandableContext = O;
|
|
27
|
+
exports.FooterUI = we;
|
|
28
|
+
exports.FooterWidget = ye;
|
|
29
|
+
exports.MainNavWidget = pe;
|
|
30
|
+
exports.MaintenanceTipsUI = Ne;
|
|
31
|
+
exports.MaintenanceTipsWidget = Me;
|
|
32
|
+
exports.ProductsMenu = se;
|
|
33
|
+
exports.Scaffold = Sn;
|
|
34
|
+
exports.SideBar = z;
|
|
35
|
+
exports.SideNavbarWidget = J;
|
|
36
|
+
exports.useScaffoldContext = I;
|
|
37
|
+
//# sourceMappingURL=out.js.map
|
|
38
|
+
//# sourceMappingURL=index.js.map
|