@kvaser/canking-api 7.1.0-beta.231 → 7.1.0-beta.241
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 +101 -37
- package/dist/controls/CanIdentifierControl.d.ts +21 -3
- package/dist/controls/ColumnItemControl.d.ts +36 -0
- package/dist/controls/OneLineButton.d.ts +1 -1
- package/dist/controls/index.d.ts +2 -0
- package/dist/controls.js +1 -1
- package/dist/controls.mjs +1385 -1141
- package/dist/grpc.mjs +114 -114
- package/dist/index.js +1 -1
- package/dist/measurement_settings.js +1 -1
- package/dist/measurement_settings.mjs +449 -403
- package/dist/models.js +1 -1
- package/dist/models.mjs +30 -30
- package/dist/protos/app_service.d.ts +1 -1
- package/dist/protos/device_service.d.ts +1 -1
- package/dist/protos/frame_params.d.ts +6 -0
- package/dist/protos/measurement_service.d.ts +1 -1
- package/dist/status_params.js +1 -1
- package/dist/status_params.mjs +1780 -1780
- package/doc/assets/material-style.css +105 -14
- package/doc/assets/navigation.js +1 -1
- package/doc/assets/search.js +1 -1
- package/doc/functions/controls.ColumnItemControl.html +175 -0
- package/doc/functions/controls.OneLineButton.html +4 -4
- package/doc/functions/controls.useColumnItem.html +176 -0
- package/doc/functions/controls.useColumnItems.html +177 -0
- package/doc/index.html +87 -43
- package/doc/interfaces/controls.CanIdentifierFrameControlProps.html +4 -2
- package/doc/interfaces/controls.CanIdentifierGeneratorControlProps.html +6 -2
- package/doc/interfaces/controls.CanIdentifierGeneratorSettingsControlProps.html +6 -2
- package/doc/interfaces/controls.ColumnItemControlProps.html +177 -0
- package/doc/interfaces/models.SignalValue.html +4 -2
- package/doc/interfaces/models.WriteFrame.html +6 -2
- package/doc/modules/controls.html +4 -0
- package/index.js +14 -0
- package/licenses/ELECTRON-TOOLKIT-PRELOAD_MIT.TXT +21 -0
- package/licenses/FAST-DEEP-EQUAL_MIT.TXT +21 -0
- package/licenses/GOOGLE-PROTOBUF_(BSD-3-CLAUSE AND APACHE-2.0).TXT +29 -0
- package/licenses/REACT-DOM_MIT.TXT +21 -0
- package/licenses/REACT_MIT.TXT +21 -0
- package/licenses/UUID_MIT.TXT +9 -0
- package/licenses/licenses.css +22 -0
- package/licenses/licenses.html +67 -0
- package/package.json +10 -16
- package/scripts/createCanKingExtension.js +0 -403
- package/scripts/index.js +0 -39
- package/scripts/template/_.eslintrc.cjs +0 -38
- package/scripts/template/_.gitignore +0 -24
- package/scripts/template/_.npmrc +0 -2
- package/scripts/template/_.prettierrc +0 -8
- package/scripts/template/_.vscode/_launch.json +0 -28
- package/scripts/template/_index.html +0 -15
- package/scripts/template/_tsconfig.app.json +0 -27
- package/scripts/template/_tsconfig.json +0 -11
- package/scripts/template/_tsconfig.node.json +0 -13
- package/scripts/template/_vite.config.ts +0 -7
- package/scripts/template/src/App.tsx +0 -12
- package/scripts/template/src/WorkspaceView/index.tsx +0 -47
- package/scripts/template/src/main.css +0 -9
- package/scripts/template/src/main.tsx +0 -19
- package/scripts/template/src/vite-env.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,58 +1,116 @@
|
|
|
1
1
|
# Kvaser CanKing GUI Extensions SDK
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
The purpose with this package is to help developers to create user interface extensions for the Kvaser CanKing bus analysis tool.
|
|
6
|
+
|
|
7
|
+
Kvaser CanKing is a free of charge, general-purpose CAN and LIN bus analysis software that is compatible with all Kvaser CAN and LIN interfaces and the Kvaser virtual CAN bus. It's available on Windows (x64) and Linux (x64 and ARM).
|
|
8
|
+
|
|
9
|
+
There are a lot of functionality already included in the base version of CanKing, but it is also possible to extend the functionality and the user interface by creating extensions.
|
|
10
|
+
|
|
11
|
+
An extension is developed as a stand-alone [React](<https://react.dev/>) web application. The web application will be hosted by an express web server inside CanKing and it will be mounted into the CanKing user interface using a webview element.
|
|
12
|
+
|
|
13
|
+
When an extension is mounted into CanKing, then a preload script will run to inject inter-process communication (IPC) functions. These functions will make it possible for the extension to communicate with CanKing to get information and to interact with the CAN/LIN bus.
|
|
14
|
+
|
|
15
|
+
The IPC functions are accessible by importing different modules from the @kvaser/canking-api package.
|
|
16
|
+
|
|
17
|
+
To get or subscribe on CanKing data there are different React hooks to be used. All these can be found in the hooks module.
|
|
18
|
+
|
|
19
|
+
import { useUserSetting, useMeasurementSetup } from '@kvaser/canking-api/hooks';
|
|
20
|
+
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
const userSettings = useUserSettings();
|
|
24
|
+
const measurementSetup = useMeasurementSetup();
|
|
25
|
+
|
|
26
|
+
To interact with CanKing there are different functions that can be imported from the ipc module.
|
|
27
|
+
|
|
28
|
+
import { sendCanMessage } from '@kvaser/canking-api/ipc';
|
|
4
29
|
|
|
5
|
-
|
|
30
|
+
...
|
|
6
31
|
|
|
7
|
-
|
|
32
|
+
sendCanMessage(channelId, frameId, data, flags);
|
|
33
|
+
|
|
34
|
+
The @kvaser/canking-api package also includes some React components that you can use, e.g. there is a component for selecting channel.
|
|
35
|
+
|
|
36
|
+
import { CanChannelSelectControl } from '@kvaser/canking-api/controls';
|
|
37
|
+
|
|
38
|
+
...
|
|
39
|
+
|
|
40
|
+
function WorkspaceView() {
|
|
41
|
+
const [channelId, setChannelId] = useState('');
|
|
42
|
+
return (
|
|
43
|
+
<CanChannelSelectControl
|
|
44
|
+
channelIdentifier={channelId}
|
|
45
|
+
onChannelIdentifierChange={setChannelId}
|
|
46
|
+
hideSectionControl
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
## Prerequisites
|
|
52
|
+
|
|
53
|
+
Before creating a new CanKing Extension the following softwares need to be installed.
|
|
8
54
|
|
|
9
55
|
- Node.js: <https://nodejs.org/>
|
|
10
56
|
- Kvaser CanKing: <https://kvaser.com/canking/>
|
|
11
57
|
- Kvaser Drivers: <https://resources.kvaser.com/7330130980013/latest/kvaser_drivers_setup.exe>
|
|
12
58
|
|
|
13
|
-
|
|
59
|
+
You will also need an IDE (Integrated Development Environment) to edit and debug your code. We recommende that you're using [Visual Studio Code](https://code.visualstudio.com/).
|
|
14
60
|
|
|
15
|
-
|
|
16
|
-
- download latest version from assets
|
|
17
|
-
- install and do ```nvm list``` to display node.js versions
|
|
18
|
-
- install node.js version 22.9: ```nvm install 22.9```
|
|
19
|
-
- change node.js version to 22.9: ```nvm use 22.9```
|
|
20
|
-
- **NOTE:**
|
|
21
|
-
- If nvm keyword can't be found make sure environment path for nvm.exe is set.
|
|
22
|
-
- CanKing is coded with node version 22.9, so version 22.9 is recommended.
|
|
61
|
+
With Visual Studio Code you might also want to install these extensions to help you with code formatting and code analysing:
|
|
23
62
|
|
|
24
|
-
|
|
63
|
+
- ESLint (dbaeumer.vscode-eslint)
|
|
64
|
+
- Prettier - Code formatter (esbenp.prettier-vscode)
|
|
65
|
+
- EditorConfig for VS Code (editorconfig.editorconfig)
|
|
25
66
|
|
|
26
|
-
|
|
27
|
-
package is published to <http://artifact.kvaser.se/artifactory/api/npm/libs-npm>.
|
|
67
|
+
## Generate a new CanKing Extension project
|
|
28
68
|
|
|
29
|
-
The
|
|
30
|
-
The script is used like this:
|
|
69
|
+
The simplest way to create a new CanKing Extension project is to use the script that is included in the [@kvaser/create-canking-extension](<https://www.npmjs.com/package/@kvaser/create-canking-extension>) package. The script is used like this:
|
|
31
70
|
|
|
32
|
-
|
|
71
|
+
npm create @kvaser/canking-extension@latest
|
|
33
72
|
|
|
34
|
-
|
|
35
|
-
project-name The project name. A new project folder with this name will be created in the current folder.
|
|
73
|
+
Then follow the prompts.
|
|
36
74
|
|
|
37
|
-
|
|
38
|
-
-V, --version output the version number
|
|
39
|
-
--view-name <string> workspace view name (default: "")
|
|
40
|
-
--desc <string> project description (default: "A CanKing GUI extension.")
|
|
41
|
-
--author <string> project author (default: "")
|
|
42
|
-
--verbose print additional logs
|
|
43
|
-
--force use installed script even if a newer version exists
|
|
44
|
-
--show-doc opens the documentation
|
|
45
|
-
-h, --help display help for command
|
|
75
|
+
You can also directly specify a project name via a command line argument.
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
npm create @kvaser/canking-extension@latest my-ck-extension
|
|
48
78
|
|
|
49
|
-
|
|
50
|
-
|
|
79
|
+
This command will create a new project in a new folder with the same name as the specified project name.
|
|
80
|
+
You can use `.` for the project name to scaffold your project in the current directory.
|
|
51
81
|
|
|
52
|
-
The
|
|
53
|
-
script to create the project.
|
|
82
|
+
The command above will create a folder structure like this:
|
|
54
83
|
|
|
55
|
-
|
|
84
|
+
my-ck-extension
|
|
85
|
+
│ .gitignore
|
|
86
|
+
│ .prettierrc
|
|
87
|
+
│ eslint.config.mjs
|
|
88
|
+
│ index.html
|
|
89
|
+
│ package.json
|
|
90
|
+
│ tsconfig.app.json
|
|
91
|
+
│ tsconfig.json
|
|
92
|
+
│ tsconfig.node.json
|
|
93
|
+
│ vite.config.ts
|
|
94
|
+
│
|
|
95
|
+
├───.vscode
|
|
96
|
+
│ launch.json
|
|
97
|
+
│
|
|
98
|
+
└───src
|
|
99
|
+
│ App.tsx
|
|
100
|
+
│ main.tsx
|
|
101
|
+
│ vite-env.d.ts
|
|
102
|
+
│
|
|
103
|
+
├───assets
|
|
104
|
+
│ icon.png
|
|
105
|
+
│
|
|
106
|
+
└───WorkspaceView
|
|
107
|
+
index.tsx
|
|
108
|
+
|
|
109
|
+
The project follows a similar file structure as the one that is created for a [Vite](<https://vite.dev/>) project created using the react-ts template. There are some extra information added to the package.json file that are needed for CanKing and the src files are modified to be used inside CanKing.
|
|
110
|
+
|
|
111
|
+
The my-ck-extension/src/WorkspaceView/index.tsx file is the file that includes the React component that will be mounted into CanKing, so this is the file you should implement to create your extension.
|
|
112
|
+
|
|
113
|
+
## Develop a CanKing Extension
|
|
56
114
|
|
|
57
115
|
To match the CanKing look and feel, it's recommended to use Material UI components when applicable,
|
|
58
116
|
<https://mui.com/material-ui/all-components/>.
|
|
@@ -64,7 +122,7 @@ To run the extension from command line enter:
|
|
|
64
122
|
|
|
65
123
|
npm run start
|
|
66
124
|
|
|
67
|
-
To run the extension using
|
|
125
|
+
To run the extension using Visual Studio Code debugger:
|
|
68
126
|
|
|
69
127
|
- Select 'Run and Debug' or press Ctrl+Shift+D
|
|
70
128
|
- Select the configuration named 'Debug'
|
|
@@ -74,7 +132,13 @@ To run a production build of the extension you can enter this command:
|
|
|
74
132
|
|
|
75
133
|
npm run startpreview
|
|
76
134
|
|
|
77
|
-
|
|
135
|
+
If you need more information and help about how to interact with CanKing then you can run this command:
|
|
136
|
+
|
|
137
|
+
npx @kvaser/canking-api --help
|
|
138
|
+
|
|
139
|
+
This will open up a help file in your web browser.
|
|
140
|
+
|
|
141
|
+
## Package and Install a CanKing Extension
|
|
78
142
|
|
|
79
143
|
To package your extension for distribution you should run this command from the command line:
|
|
80
144
|
|
|
@@ -67,6 +67,8 @@ interface CanIdentifierFrameControlProps {
|
|
|
67
67
|
* @param errors The new errors state.
|
|
68
68
|
*/
|
|
69
69
|
onErrorsChange?: (errors: boolean) => void;
|
|
70
|
+
/** Set to true if this control shouldn't be encapsulated inside a SectionControl. */
|
|
71
|
+
hideSection?: boolean;
|
|
70
72
|
/** Set to true if the SectionControl should be collapsible. */
|
|
71
73
|
collapsible?: boolean;
|
|
72
74
|
/** Current collapse state of the SectionControl. */
|
|
@@ -82,7 +84,7 @@ interface CanIdentifierFrameControlProps {
|
|
|
82
84
|
* @param props Component properties.
|
|
83
85
|
* @returns The CanIdentifierFrameControl React component.
|
|
84
86
|
*/
|
|
85
|
-
declare function CanIdentifierFrameControl({ frame, onFrameChange, onErrorsChange, collapsible, collapsed, collapsedChange, }: CanIdentifierFrameControlProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
declare function CanIdentifierFrameControl({ frame, onFrameChange, onErrorsChange, hideSection, collapsible, collapsed, collapsedChange, }: CanIdentifierFrameControlProps): import("react/jsx-runtime").JSX.Element;
|
|
86
88
|
/**
|
|
87
89
|
* Properties of the CanIdentifierGeneratorControl React component.
|
|
88
90
|
*/
|
|
@@ -128,13 +130,21 @@ interface CanIdentifierGeneratorControlProps {
|
|
|
128
130
|
* @param value The new collapse state.
|
|
129
131
|
*/
|
|
130
132
|
collapsedChange?: (value: boolean) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Callback for specifying if the select message dialog should be visible.
|
|
135
|
+
*/
|
|
136
|
+
showSelectMessageDialogChange: (value: boolean) => void;
|
|
137
|
+
/**
|
|
138
|
+
* Callback for specifying if the signal values table should be visible.
|
|
139
|
+
*/
|
|
140
|
+
showSignalValuesTable: (value: boolean) => void;
|
|
131
141
|
}
|
|
132
142
|
/**
|
|
133
143
|
* Creates an UI control for editing CAN identifier(s) used by a message generator.
|
|
134
144
|
* @param props Component properties.
|
|
135
145
|
* @returns The CanIdentifierGeneratorControl React component.
|
|
136
146
|
*/
|
|
137
|
-
declare function CanIdentifierGeneratorControl({ canIdentifier, identifierGeneratorType, minCanIdentifier, maxCanIdentifier, canIdentifierType, onChange, onErrorsChange, canIdentifierGeneratorSettingsError, disabled, collapsible, collapsed, collapsedChange, }: CanIdentifierGeneratorControlProps): import("react/jsx-runtime").JSX.Element;
|
|
147
|
+
declare function CanIdentifierGeneratorControl({ canIdentifier, identifierGeneratorType, minCanIdentifier, maxCanIdentifier, canIdentifierType, onChange, onErrorsChange, canIdentifierGeneratorSettingsError, disabled, collapsible, collapsed, collapsedChange, showSelectMessageDialogChange, showSignalValuesTable, }: CanIdentifierGeneratorControlProps): import("react/jsx-runtime").JSX.Element;
|
|
138
148
|
/**
|
|
139
149
|
* Properties of the CanIdentifierGeneratorSettingsControl React component.
|
|
140
150
|
*/
|
|
@@ -164,6 +174,14 @@ interface CanIdentifierGeneratorSettingsControlProps {
|
|
|
164
174
|
* @param value The new collapse state.
|
|
165
175
|
*/
|
|
166
176
|
collapsedChange?: (value: boolean) => void;
|
|
177
|
+
/**
|
|
178
|
+
* Callback for specifying if the select message dialog should be visible.
|
|
179
|
+
*/
|
|
180
|
+
showSelectMessageDialogChange: (value: boolean) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Callback for specifying if the signal values table should be visible.
|
|
183
|
+
*/
|
|
184
|
+
showSignalValuesTable: (value: boolean) => void;
|
|
167
185
|
}
|
|
168
186
|
/**
|
|
169
187
|
* Creates an UI control for editing CAN identifier(s) used by a message generator
|
|
@@ -171,6 +189,6 @@ interface CanIdentifierGeneratorSettingsControlProps {
|
|
|
171
189
|
* @param props Component properties.
|
|
172
190
|
* @returns The CanIdentifierGeneratorSettingsControl React component.
|
|
173
191
|
*/
|
|
174
|
-
declare function CanIdentifierGeneratorSettingsControl({ settings, onSettingsChange, onErrorsChange, canIdentifierGeneratorSettingsError, disabled, collapsible, collapsed, collapsedChange, }: CanIdentifierGeneratorSettingsControlProps): import("react/jsx-runtime").JSX.Element;
|
|
192
|
+
declare function CanIdentifierGeneratorSettingsControl({ settings, onSettingsChange, onErrorsChange, canIdentifierGeneratorSettingsError, disabled, collapsible, collapsed, collapsedChange, showSelectMessageDialogChange, showSignalValuesTable, }: CanIdentifierGeneratorSettingsControlProps): import("react/jsx-runtime").JSX.Element;
|
|
175
193
|
export default CanIdentifierControl;
|
|
176
194
|
export { type CanIdentifierControlProps, CanIdentifierControl, type CanIdentifierFrameControlProps, CanIdentifierFrameControl, type CanIdentifierGeneratorControlProps, CanIdentifierGeneratorControl, type CanIdentifierGeneratorSettingsControlProps, CanIdentifierGeneratorSettingsControl, };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module includes a form row UI control, a container component that can be used to
|
|
3
|
+
* display form controls on one row.
|
|
4
|
+
*
|
|
5
|
+
* To be able to use these controls the CanKingDataProvider component must be present in the
|
|
6
|
+
* component tree above your component. Normally the CanKingDataProvider is added
|
|
7
|
+
* at the root of the component tree.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
interface ColumnItem {
|
|
13
|
+
ref: React.Ref<HTMLDivElement>;
|
|
14
|
+
width?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Gets a ColumnItem object that can be used in calls to useColumnItems and as props to ColumnItemControl.
|
|
18
|
+
* @returns A ColumnItem object
|
|
19
|
+
*/
|
|
20
|
+
export declare const useColumnItem: () => ColumnItem;
|
|
21
|
+
/**
|
|
22
|
+
* Calculate max width from all specified column items as soon as all items have widths values.
|
|
23
|
+
* @param columnItems All column items to set width for.
|
|
24
|
+
* @returns The max width, the width to use
|
|
25
|
+
*/
|
|
26
|
+
export declare const useColumnItems: (...columnItems: ColumnItem[]) => number;
|
|
27
|
+
export interface ColumnItemControlProps {
|
|
28
|
+
columnItem: ColumnItem;
|
|
29
|
+
width?: number;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A react component to be used when different components should share the same width.
|
|
34
|
+
*/
|
|
35
|
+
declare function ColumnItemControl({ columnItem, width, children }: ColumnItemControlProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export default ColumnItemControl;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare const OneLineButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
5
5
|
ref?: import("react").Ref<HTMLButtonElement>;
|
|
6
|
-
}, "variant" | "color" | "style" | "action" | "className" | "children" | "tabIndex" | "disabled" | "size" | "href" | "sx" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth" | "disableElevation" | "endIcon" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
6
|
+
}, "variant" | "color" | "loading" | "style" | "action" | "className" | "children" | "tabIndex" | "disabled" | "size" | "href" | "sx" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingIndicator" | "fullWidth" | "disableElevation" | "endIcon" | "loadingPosition" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
7
7
|
component?: React.ElementType;
|
|
8
8
|
}, {}, {}>;
|
|
9
9
|
export default OneLineButton;
|
package/dist/controls/index.d.ts
CHANGED
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
export { type ILocalizedStrings, LocalizedStrings, type StringsMap } from './LocalizedStrings';
|
|
60
60
|
export * from './CheckboxControl';
|
|
61
61
|
export { default as CheckboxControl } from './CheckboxControl';
|
|
62
|
+
export * from './ColumnItemControl';
|
|
63
|
+
export { default as ColumnItemControl } from './ColumnItemControl';
|
|
62
64
|
export * from './DropdownButton';
|
|
63
65
|
export { default as OneLineButton } from './OneLineButton';
|
|
64
66
|
export * from './OneLineButton';
|
package/dist/controls.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index.js"),s=require("react/jsx-runtime"),o=require("react"),f=require("@mui/material"),H=require("./icons.js"),Q=require("fast-deep-equal");require("long");const O=require("./measurement_settings.js");function Z({id:e=void 0,label:t,checked:a,onChange:r,disabled:l=!1,size:i="small",sx:u=void 0}){const g=o.useCallback(n=>{if(n.key==="Enter"&&!n.ctrlKey&&!n.altKey&&!n.shiftKey){n.preventDefault();return}},[]);return s.jsx(f.FormControlLabel,{id:e,"aria-label":e,disabled:l,"aria-disabled":l,control:s.jsx(f.Checkbox,{size:i,checked:a,onChange:(n,d)=>r(d),onKeyDown:g}),label:t,slotProps:{typography:{noWrap:!0}},sx:u})}const X=f.styled(f.Button)(()=>({whiteSpace:"nowrap",minWidth:"max-content"}));function le({items:e,onSelect:t,onClose:a=void 0}){const r=o.useCallback(l=>{t(l),a&&a()},[a,t]);return s.jsx(s.Fragment,{children:e.map(l=>s.jsx(f.MenuItem,{onClick:()=>r(l.key),children:l.text},l.key))})}function V({id:e="dropdown-button",startIcon:t=void 0,endIcon:a=void 0,text:r=void 0,variant:l="outlined",color:i=void 0,size:u="medium",disabled:g=!1,children:n}){const[d,C]=o.useState(null),m=!!d,p=o.useCallback(L=>{C(L.currentTarget)},[]),h=o.useCallback(()=>{C(null)},[]),S=o.cloneElement(o.Children.only(n),{onClose:h});return s.jsxs(s.Fragment,{children:[!r&&s.jsx(f.IconButton,{id:e,"data-testid":e,"aria-controls":m?`${e}-popover`:void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:p,size:u,color:i,disabled:g,children:t}),r&&s.jsx(X,{id:e,"data-testid":e,"aria-controls":m?`${e}-popover`:void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,variant:l,disableElevation:!0,onClick:p,startIcon:t,endIcon:a??s.jsx(H.LineArrowDownIcon,{}),size:u,color:i,disabled:g,children:r}),s.jsx(f.Popover,{id:`${e}-popover`,"aria-labelledby":e,anchorEl:d,open:m,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:S})]})}const oe=f.styled("div")(({top:e,left:t,width:a,height:r})=>({top:e,left:t,width:a,height:r,position:"absolute",zIndex:1})),ie=f.styled("div")(({top:e,left:t,width:a,height:r,position:l,theme:i})=>({top:e,left:t,width:a,height:r,position:"absolute",zIndex:2,color:i.palette.primary.contrastText,backgroundColor:i.palette.primary.main,display:"flex",flexDirection:l==="left"||l==="right"?"column":"row",borderTopLeftRadius:l==="top"||l==="left"?0:8,borderTopRightRadius:l==="top"||l==="right"?0:8,borderBottomRightRadius:l==="bottom"||l==="right"?0:8,borderBottomLeftRadius:l==="bottom"||l==="left"?0:8})),q=8;function ce({id:e=void 0,position:t,parentWidth:a,parentHeight:r,maxLength:l,dropDownSize:i,autoHideTimeout:u=0,forceShow:g=!1,children:n=null}){const d=o.useMemo(()=>{switch(t){case"left":case"right":return Math.min(l,r);case"top":case"bottom":return Math.min(l,a);default:return l}},[l,r,a,t]),C=o.useMemo(()=>{switch(t){case"left":case"right":return(r-d)/2;case"top":return 0;case"bottom":return r-q;default:return 0}},[d,r,t]),m=o.useMemo(()=>{switch(t){case"left":return 0;case"right":return a-q;case"top":case"bottom":return(a-d)/2;default:return 0}},[d,a,t]),p=o.useMemo(()=>{switch(t){case"left":case"right":return q;case"top":case"bottom":return d;default:return 0}},[d,t]),h=o.useMemo(()=>{switch(t){case"left":case"right":return d;case"top":case"bottom":return q;default:return 0}},[d,t]),S=o.useMemo(()=>{switch(t){case"left":case"right":return(r-d)/2;case"top":return 0;case"bottom":return r-i;default:return 0}},[i,d,r,t]),L=o.useMemo(()=>{switch(t){case"left":return 0;case"right":return a-i;case"top":case"bottom":return(a-d)/2;default:return 0}},[i,d,a,t]),M=o.useMemo(()=>{switch(t){case"left":case"right":return i;case"top":case"bottom":return d;default:return 0}},[i,d,t]),A=o.useMemo(()=>{switch(t){case"left":case"right":return d;case"top":case"bottom":return i;default:return 0}},[i,d,t]),[j,v]=o.useState(!1),c=o.useCallback(F=>{F.buttons===0&&u&&v(!0)},[u]),y=o.useCallback(()=>{v(!1)},[]);return o.useEffect(()=>{let F;return j&&u&&(F=setTimeout(()=>v(!1),u)),()=>{F&&clearTimeout(F)}},[u,j]),s.jsxs(s.Fragment,{children:[s.jsx(oe,{id:e,top:C,left:m,width:p,height:h,"aria-haspopup":"true",onMouseEnter:c}),(j||g===!0)&&s.jsx(ie,{top:S,left:L,width:M,height:A,position:t,onMouseLeave:y,children:n})]})}function z({children:e,fullWidth:t=!0,spacing:a="4px",alignItems:r="center"}){return s.jsx(f.FormControl,{margin:"dense",fullWidth:t,variant:"standard",children:s.jsx(f.Stack,{direction:"row",spacing:a,alignItems:r,children:e})})}const de=f.styled("input")(({variant:e,theme:t})=>({...t.typography[e]})),ue=f.styled("span")(({variant:e,theme:t})=>({...t.typography[e]}));function fe({value:e,onChange:t,ariaLabel:a=void 0,variant:r="body1"}){const l=o.useRef(null),[i,u]=o.useState(e),g=o.useCallback(C=>u(C.target.value),[]),n=o.useCallback(C=>{(C.key==="Enter"||C.key==="Escape")&&(C.key==="Escape"&&(u(e),C.currentTarget.value=e),C.currentTarget.blur())},[e]),d=o.useCallback(C=>{t(C.target.value)},[t]);return o.useEffect(()=>{var C;(C=l.current)==null||C.focus()},[]),s.jsx(de,{ref:l,variant:r??"body1",type:"text","aria-label":a,value:i,onChange:g,onKeyDown:n,onBlur:d})}function ge({editMode:e,value:t,onValueChange:a,ariaLabel:r=void 0,variant:l="body1"}){return s.jsxs(s.Fragment,{children:[e&&s.jsx(fe,{ariaLabel:r,value:t,onChange:a,variant:l}),!e&&s.jsx(ue,{variant:l??"body1",children:t})]})}function ee({id:e=void 0,label:t=void 0,helperText:a="",value:r,onChange:l=void 0,onBlur:i=void 0,disabled:u=!1,error:g=!1,required:n=!1,margin:d="dense",size:C="small",fullWidth:m=!1,inputMode:p=void 0,pattern:h=void 0,startAdornment:S=void 0,endAdornment:L=void 0,sx:M=void 0,sxStartAdornment:A=void 0,sxEndAdornment:j=void 0}){const v=o.useCallback(R=>{l&&l(R.target.value)},[l]),c=o.useCallback(R=>{if(R.key==="Enter"&&!R.ctrlKey&&!R.altKey&&!R.shiftKey){R.preventDefault(),R.stopPropagation(),document.activeElement instanceof HTMLElement&&document.activeElement.blur();return}},[]),y=A??{marginBottom:1},F=j??{marginBottom:1};return s.jsx(f.TextField,{id:e,"aria-label":e,type:"text",label:t,helperText:a,margin:d,size:C,fullWidth:m,variant:"standard",value:r,onChange:v,onBlur:i,disabled:u,"aria-disabled":u,error:g,required:n,slotProps:{input:{startAdornment:S?s.jsx(f.InputAdornment,{position:"start",sx:{...y},children:S}):null,endAdornment:L?s.jsx(f.InputAdornment,{position:"end",sx:{...F},children:L}):null},htmlInput:{inputMode:p,pattern:h}},sx:M,onKeyDown:c})}function W({id:e,label:t=void 0,helperText:a="",value:r,onChange:l=void 0,onBlur:i=void 0,disabled:u=!1,required:g=!1,margin:n="dense",size:d="small",fullWidth:C=!1,inputMode:m=void 0,pattern:p=void 0,startAdornment:h=void 0,endAdornment:S=void 0,sx:L=void 0,sxStartAdornment:M=void 0,sxEndAdornment:A=void 0,error:j=void 0,onErrorChange:v=void 0,onValidate:c=void 0,numberType:y="int",minValue:F=void 0,maxValue:R=void 0}){const[$,_]=o.useState(r),[D,P]=o.useState(j!==void 0?j:!1);o.useEffect(()=>{_(x=>r!==x?r:x)},[r]),o.useEffect(()=>{P(x=>j!==void 0&&j!==x?j:x)},[j]);const U=o.useCallback(x=>{const E=Number.parseInt(x,x.startsWith("0x")?16:10);let T=Number.isNaN(E);return T||(T=F!==void 0&&E<F),T||(T=R!==void 0&&E>R),{val:x,err:T}},[R,F]),k=o.useCallback(x=>{let E=!1;if(x.endsWith(",")||x.endsWith("."))return E=!0,{val:x,err:E};const T=Number.parseFloat(x.replace(",","."));return E=Number.isNaN(T),E||(E=F!==void 0&&T<F),E||(E=R!==void 0&&T>R),{val:T.toString(),err:E}},[R,F]),I=o.useCallback(x=>y==="int"?U(x):k(x),[y,k,U]),B=o.useCallback((x,E)=>{let T=x,K=!1;return!g&&(T===void 0||T==="")?{val:T,err:K}:(y!==void 0&&({val:T,err:K}=I(x)),!K&&c&&({val:T,err:K}=c(T,E)),{val:T,err:K})},[c,I]),b=o.useCallback(x=>{const{val:E,err:T}=B(x,"change");(j===void 0||j===!1)&&P(T),_(T?x:E),!T&&l&&l(E)},[l,B]),N=o.useCallback(()=>{const{val:x,err:E}=B($,"blur");(j===void 0||j===!1)&&P(E),!E&&i&&i(x)},[i,B,$]);return o.useEffect(()=>{v&&v(D)},[D,v]),s.jsx(ee,{id:e,label:t,helperText:a,value:$,onChange:b,onBlur:N,disabled:u,error:D,required:g,margin:n,size:d,fullWidth:C,inputMode:m,pattern:p,startAdornment:h,endAdornment:S,sx:L,sxStartAdornment:M,sxEndAdornment:A})}function xe({minValue:e,maxValue:t,onChange:a=void 0,onBlur:r=void 0,minError:l=void 0,onMinErrorChange:i=void 0,maxError:u=void 0,onMaxErrorChange:g=void 0,onMinValidate:n=void 0,onMaxValidate:d=void 0,minDisabled:C=!1,maxDisabled:m=!1,unit:p=void 0,lowerLimit:h=void 0,upperLimit:S=void 0}){const L=w.useLocalizedStrings(),M=Number.parseInt(e),A=Number.parseInt(t),[j,v]=o.useState(e.toString()),[c,y]=o.useState(t.toString()),[F,R]=o.useState(l===!0||Number.isNaN(M)||M<(h??0)||S&&M>S||!Number.isNaN(A)&&M>=A),[$,_]=o.useState(u===!0||Number.isNaN(A)||A<(h??0)||S&&A>S||!Number.isNaN(M)&&M>=A);o.useEffect(()=>{v(b=>e.toString()!==b?e.toString():b)},[e]),o.useEffect(()=>{R(b=>l!==void 0&&l!==b?l:b)},[l]),o.useEffect(()=>{y(b=>t.toString()!==b?t.toString():b)},[t]),o.useEffect(()=>{_(b=>u!==void 0&&u!==b?u:b)},[u]);const D=o.useCallback(b=>{const N=Number.parseInt(b,b.startsWith("0x")?16:10),x=Number.parseInt(c),E=Number.isNaN(N)||N<(h??0)||S&&N>S||!Number.isNaN(x)&&N>=x;return{val:b,err:E}},[c,h,S]),P=o.useCallback(b=>{const N=Number.parseInt(b,b.startsWith("0x")?16:10),x=Number.parseInt(j),E=Number.isNaN(N)||N<(h??0)||S&&N>S||!Number.isNaN(x)&&x>=N;return{val:b,err:E}},[j,h,S]),U=o.useCallback(b=>{let{val:N,err:x}=D(b);if(!x&&n&&({val:N,err:x}=n(b,"change")),(l===void 0||l===!1)&&R(x),x)a&&a(b,c);else{const E=Number.parseInt(N,N.startsWith("0x")?16:10).toString();v(E),a&&a(E,c)}},[D,n,l,a,c]),k=o.useCallback(b=>{let{val:N,err:x}=D(b);!x&&n&&({val:N,err:x}=n(N,"blur")),R(x),!x&&r&&r(N,c)},[D,n,r,c]),I=o.useCallback(b=>{let{val:N,err:x}=P(b);if(!x&&d&&({val:N,err:x}=d(b,"change")),(u===void 0||u===!1)&&_(x),x)a&&a(j,b);else{const E=Number.parseInt(N,N.startsWith("0x")?16:10).toString();y(E),a&&a(j,E)}},[P,d,u,a,j]),B=o.useCallback(b=>{let{val:N,err:x}=P(b);!x&&d&&({val:N,err:x}=d(N,"blur")),_(x),!x&&r&&r(j,N)},[P,d,r,j]);return o.useEffect(()=>{i&&i(F),g&&g($)},[$,F,g,i]),s.jsxs(s.Fragment,{children:[s.jsx(W,{id:"min-value",disabled:C,inputMode:"numeric",fullWidth:!0,value:j,onChange:U,onBlur:k,startAdornment:L.getString("LabelFrom"),endAdornment:p,numberType:"int",error:F,onErrorChange:R}),s.jsx(W,{id:"max-value",disabled:m,inputMode:"numeric",fullWidth:!0,value:c,onChange:I,onBlur:B,startAdornment:L.getString("LabelTo"),endAdornment:p,numberType:"int",error:$,onErrorChange:_})]})}function G({id:e=void 0,label:t,value:a,disabled:r=!1,size:l="small",sx:i=void 0}){return s.jsx(f.FormControlLabel,{id:e,"aria-label":e,value:a,disabled:r,"aria-disabled":r,control:s.jsx(f.Radio,{size:l}),label:t,componentsProps:{typography:{noWrap:!0}},sx:i})}function te({children:e,id:t=void 0,value:a,onChange:r}){return s.jsx(f.RadioGroup,{id:t,"aria-label":t,value:a,onChange:(l,i)=>r(i),children:e})}const be=f.styled(f.Box,{shouldForwardProp:e=>e!=="collapsed"})(({collapsed:e,theme:t})=>({paddingTop:e?"4px":"8px",paddingLeft:"2px",paddingRight:"2px",paddingBottom:e?"0px":"2px",marginTop:"2px","&:hover, &:focus-within":{background:t.palette.action.hover}})),ne=f.styled("span")(({theme:e})=>({color:e.palette.divider})),he=f.styled(ne)(()=>({"&:hover":{cursor:"pointer"}})),ve=f.styled(f.IconButton)(({theme:e})=>({color:e.palette.divider,padding:"0px"}));function Y({textAlign:e="left",text:t=void 0,summary:a=void 0,children:r=void 0,collapsible:l=!1,collapsed:i=!1,collapsedChange:u=void 0}){const g=w.useLanguage(),n=w.useLocalizedStrings(),[d,C]=o.useState(i);o.useEffect(()=>C(i),[i]);const m=o.useCallback(p=>{u?u(p):C(p)},[u]);return s.jsxs(be,{collapsed:d,children:[t&&s.jsx(f.Divider,{textAlign:e,variant:"fullWidth",children:l?s.jsxs(f.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s.jsxs(he,{onClick:()=>m(!d),children:[t.toLocaleUpperCase(g),d&&a?` (${a})`:""]}),s.jsx(f.Tooltip,{title:d?n==null?void 0:n.getString("TooltipExpandSection",t):n==null?void 0:n.getString("TooltipCollapseSection",t),children:s.jsx(ve,{onClick:()=>m(!d),children:d?s.jsx(H.LineArrowDownIcon,{}):s.jsx(H.LineArrowUpIcon,{})})})]}):s.jsx(ne,{children:t.toLocaleUpperCase(g)})}),!d&&r]})}function J({id:e,label:t,showLabel:a=!1,helperText:r="",options:l,value:i,onChange:u,disabled:g=!1,required:n=!1,margin:d="dense",size:C="small",fullWidth:m=!1,minWidth:p=void 0,prefixTextWithValue:h=!1}){const S=o.useCallback(v=>{typeof v.target.value=="string"?u(""):u(v.target.value)},[u]),L=o.useCallback(v=>v.map(c=>s.jsx(f.MenuItem,{"aria-label":`menu-item-${c.value}`,value:c.value,children:h?`${c.value} - ${c.displayText}`:c.displayText},c.value)),[h]),M=o.useCallback((v,c)=>{const y=[s.jsx(f.ListSubheader,{color:"primary",children:v},v)];return y.push(...L(c)),y},[L]),A=o.useCallback(v=>{const c=[];return v.forEach((y,F)=>{c.push(...M(F,y))}),c},[M]),j=o.useCallback(v=>{let c="";if(l instanceof Map)l.forEach((y,F)=>{if(c===""){const R=y.find($=>$.value===v);R&&(c=h?`${R.value} - ${F} - ${R.displayText}`:`${F} - ${R.displayText}`)}});else{const y=l.find(F=>F.value===v);y&&(c=h?`${y.value} - ${y.displayText}`:y.displayText)}return c===""&&(c=n?`${t} *`:t),c},[t,l,h,n]);return s.jsxs(f.FormControl,{fullWidth:m,variant:"standard",sx:{minWidth:p},margin:d,size:C,children:[a&&s.jsx(f.InputLabel,{id:`${e}-label`,children:n?`${t} *`:t}),s.jsxs(f.Select,{labelId:`${e}-label`,"aria-label":e,id:e,value:i,renderValue:j,onChange:S,displayEmpty:!a,disabled:g,"aria-disabled":g,children:[l instanceof Map&&A(l),l instanceof Array&&L(l)]}),r&&s.jsx(f.FormHelperText,{children:r})]})}const pe=f.styled(f.Box)(({height:e,width:t})=>({height:e,width:t,padding:"4px",overflow:"auto"}));function Ce({label:e,variant:t="h6"}){return s.jsx(f.Toolbar,{children:s.jsx(f.Typography,{sx:{flex:"1 1 100%"},variant:t,id:"tableTitle",component:"div",children:e})})}function me({data:e,dataKey:t,selectedKey:a=void 0,onClickRow:r=void 0,columns:l,label:i=void 0,labelVariant:u="h6",maxHeight:g=void 0,size:n="medium",stickyHeader:d=!1,hover:C=!1}){const m=o.useCallback(p=>{r&&r(p)},[r]);return s.jsxs(f.Box,{children:[i&&s.jsx(Ce,{label:i,variant:u}),s.jsx(f.TableContainer,{children:s.jsxs(f.Table,{"aria-labelledby":"tableTitle",size:n,stickyHeader:d,sx:{maxHeight:g},padding:"none",children:[s.jsx(f.TableHead,{children:s.jsx(f.TableRow,{children:l.map(p=>s.jsx(f.TableCell,{...p.headProps,children:p.headCell},p.key))})}),s.jsx(f.TableBody,{children:e.map(p=>{const h=t(p);return s.jsx(f.TableRow,{hover:C,selected:h===a,onClick:()=>m(p),children:l.map(S=>s.jsx(f.TableCell,{...S.dataProps,children:S.dataCell(p)},`${h}-${S.key}`))},h)})})]})})]})}const Se=f.styled("div")(({theme:e})=>({borderBottom:"1px solid",borderColor:e.palette.divider})),je=f.styled(f.ToggleButtonGroup)(({theme:e})=>({[`& .${f.toggleButtonGroupClasses.grouped}`]:{margin:e.spacing(.5),padding:e.spacing(1.25),minWidth:24,color:e.palette.action.active,border:0,borderRadius:e.shape.borderRadius,[`&.${f.toggleButtonGroupClasses.disabled}`]:{border:0}}})),Fe=f.styled(f.ButtonGroup)(({theme:e})=>({[`& .${f.buttonGroupClasses.grouped}`]:{margin:e.spacing(.5),padding:e.spacing(1.25),minWidth:24,color:e.palette.action.active,border:0,borderRadius:e.shape.borderRadius,[`&.${f.buttonGroupClasses.disabled}`]:{border:0}},[`& .${f.buttonGroupClasses.middleButton},& .${f.buttonGroupClasses.lastButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent"}}));function ae({onClick:e,icon:t=void 0,text:a=void 0,size:r="small",variant:l=void 0,color:i="inherit",tooltip:u=void 0,ariaLabel:g=void 0,children:n=void 0,disabled:d=!1}){return n?s.jsx(V,{size:typeof r=="string"?r:"small",variant:l,color:i,startIcon:t,text:a,disabled:d,children:n}):a?s.jsxs(X,{size:typeof r=="string"?r:"small",variant:l,color:i,"aria-label":g,onClick:e,startIcon:t,disabled:d,children:[u&&s.jsx(f.Tooltip,{placement:"bottom-start",title:u,children:s.jsx("span",{children:a})}),!u&&a]}):s.jsxs(X,{size:typeof r=="string"?r:"small",variant:l,color:i,"aria-label":g,onClick:e,disabled:d,sx:{height:typeof r=="number"?`${r}px`:void 0,width:typeof r=="number"?`${r}px`:void 0},children:[u&&s.jsx(f.Tooltip,{placement:"bottom-start",title:u,children:s.jsx("span",{children:t})}),!u&&t]})}function Ne({buttons:e,size:t="small",ariaLabel:a=void 0,orientation:r="horizontal"}){return s.jsx(Fe,{size:t,"aria-label":a,orientation:r,children:e.map((l,i)=>s.jsx(ae,{onClick:l.onClick,icon:l.icon,text:l.text,size:l.size,variant:l.variant,color:l.color,tooltip:l.tooltip,ariaLabel:l.ariaLabel,disabled:l.disabled,children:l.children},i))})}function Me({value:e,onChange:t,size:a="small",ariaLabel:r=void 0,exclusive:l=void 0,buttons:i,orientation:u="horizontal"}){return s.jsx(je,{size:a,value:e,onChange:(g,n)=>t(n),"aria-label":r,exclusive:l,orientation:u,children:i.map((g,n)=>s.jsxs(f.ToggleButton,{size:typeof a=="string"?a:"small",value:g.value,"aria-label":g.ariaLabel,sx:{height:typeof a=="number"?`${a}px`:void 0,width:typeof a=="number"?`${a}px`:void 0,padding:g.size==="small"||typeof a=="number"?1:void 0,margin:g.size==="small"||typeof a=="number"?0:void 0},disabled:g.disabled,children:[g.tooltip&&s.jsx(f.Tooltip,{placement:"bottom-start",title:g.tooltip,children:s.jsx("span",{children:g.icon})}),!g.tooltip&&g.icon]},n))})}function ke({items:e,height:t=34,width:a=34,justifyContent:r="left",borderSize:l=1,padding:i=1,backgroundColor:u=void 0,orientation:g="horizontal"}){return s.jsx(f.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",justifyContent:r,border:n=>`${l}px solid ${n.palette.divider}`,flexWrap:"wrap",height:g==="horizontal"?`${t}px`:"100%",minHeight:g==="horizontal"?`${t}px`:void 0,width:g==="vertical"?`${a}px`:"100%",minWidth:g==="vertical"?`${a}px`:void 0,paddingLeft:g==="horizontal"?i:0,paddingRight:g==="horizontal"?i:0,paddingTop:g==="vertical"?i:0,paddingBottom:g==="vertical"?i:0,borderRadius:"0px",backgroundColor:u},children:e.map((n,d)=>n.label?s.jsx(f.Typography,{variant:n.label.variant,component:"div",children:n.label.text},d):n.toggleButtonGroup?s.jsx(Me,{value:n.toggleButtonGroup.value,onChange:n.toggleButtonGroup.onChange,ariaLabel:n.toggleButtonGroup.ariaLabel,exclusive:n.toggleButtonGroup.exclusive,buttons:n.toggleButtonGroup.buttons,orientation:g},d):n.button?s.jsx(ae,{onClick:n.button.onClick,icon:n.button.icon,text:n.button.text,variant:n.button.variant,color:n.button.color,tooltip:n.button.tooltip,ariaLabel:n.button.ariaLabel,disabled:n.button.disabled},d):n.buttonGroup?s.jsx(Ne,{ariaLabel:n.buttonGroup.ariaLabel,buttons:n.buttonGroup.buttons,orientation:g},d):n.other)})}function Ie({options:e,onSelect:t,children:a=void 0}){const[r,l]=o.useState(null),i=o.useCallback(n=>{e.length!==0&&(n.preventDefault(),l(r===null?{mouseX:n.clientX+2,mouseY:n.clientY-6}:null))},[r,e.length]),u=o.useCallback(()=>{l(null)},[]),g=o.useCallback(n=>{t(n),u()},[u,t]);return s.jsxs("div",{onContextMenu:i,style:{cursor:"context-menu"},children:[a,s.jsx(f.Menu,{open:r!==null,onClose:u,anchorReference:"anchorPosition",anchorPosition:r!==null?{top:r.mouseY,left:r.mouseX}:void 0,children:e.map(n=>s.jsxs(f.MenuItem,{onClick:()=>g(n.value),children:[n.icon&&s.jsx(f.ListItemIcon,{children:n.icon}),s.jsx(f.ListItemText,{children:n.displayText}),n.shortcut&&s.jsx(f.ListItemText,{sx:{pl:2,textAlign:"right"},children:n.shortcut})]},n.value))})]})}function re({canIdentifier:e,canIdentifierType:t,onCanIdentifierChange:a,onErrorsChange:r=void 0,hideSection:l=!1,disabled:i=!1,collapsible:u=!1,collapsed:g=!1,collapsedChange:n=void 0}){const d=w.useLocalizedStrings(),C=w.useNumericRadix(),[m,p]=o.useState(!1);o.useEffect(()=>{r&&r(m)},[m,r]);const[h,S]=o.useState(t);o.useEffect(()=>{S(t)},[t]);const L=o.useCallback(v=>{S(v?"extended":"standard")},[]),M=o.useCallback(v=>{let c=v,y=!1;if(c.length>2&&c.toLowerCase().startsWith("0x")&&(c=c.substring(2),y=!0),c=c.toUpperCase(),h==="extended"){const F=parseInt(c,y?16:C);if(Number.isNaN(F)||F<0||F>536870911)return a(v,h),{val:v,err:!0};c=`${F.toString(C).toUpperCase()}`}else if(h==="standard"){const F=parseInt(c,y?16:C);if(Number.isNaN(F)||F<0||F>2047)return a(v,h),{val:v,err:!0};c=`${F.toString(C).toUpperCase()}`}return a(c,h),{val:v,err:!1}},[h,C,a]),A=o.useCallback(v=>{if(v!==h){let c=!1,y=e;if(v==="standard"){const F=parseInt(y,C);(Number.isNaN(F)||F<0||F>2047)&&(c=!0)}else if(v==="extended"){const F=parseInt(y,C);(Number.isNaN(F)||F<0||F>536870911)&&(c=!0)}a(y,v),p(c)}},[h,e,a,C]),j=o.useMemo(()=>s.jsxs(z,{spacing:4,children:[s.jsx(W,{id:"constant-id",fullWidth:!0,value:e,onBlur:M,error:m,onErrorChange:p,disabled:i}),s.jsx(Z,{id:"id-type",label:d.getString("LabelUseExtendedIdentifier"),checked:h==="extended",onChange:v=>{L(v),A(v?"extended":"standard")},disabled:i})]}),[e,h,i,m,d,A,M]);return l?j:s.jsx(Y,{text:d.getString("LabelCanIdentifier"),summary:e,collapsible:u,collapsed:g,collapsedChange:n,children:j})}function ye({frame:e,onFrameChange:t,onErrorsChange:a=void 0,collapsible:r=!1,collapsed:l=!1,collapsedChange:i=void 0}){var C;const u=w.useNumericRadix(),g=o.useMemo(()=>{var m,p;return((p=(m=e.canFrameFlags)==null?void 0:m.flags)==null?void 0:p.includes(O.CanFrameFlag.CAN_FRAME_FLAG_EXT))===!0?"extended":"standard"},[(C=e.canFrameFlags)==null?void 0:C.flags]),n=o.useMemo(()=>`${(e.id??0).toString(u).toUpperCase()}`,[g,e.id,u]),d=o.useCallback((m,p)=>{var A;let h=e.id??0;h=parseInt(m,u);const S=(A=e.canFrameFlags)!=null&&A.flags?{flags:[...e.canFrameFlags.flags]}:{flags:[]},L=S.flags.indexOf(O.CanFrameFlag.CAN_FRAME_FLAG_STD);L!==-1&&S.flags.splice(L,1);const M=S.flags.indexOf(O.CanFrameFlag.CAN_FRAME_FLAG_EXT);if(M!==-1&&S.flags.splice(M,1),p==="extended"?S.flags.push(O.CanFrameFlag.CAN_FRAME_FLAG_EXT):p==="standard"&&S.flags.push(O.CanFrameFlag.CAN_FRAME_FLAG_STD),h!==e.id||!Q(S,e.canFrameFlags)){const j={...e};j.id=h,j.canFrameFlags=S,t(j)}},[e,u,t]);return s.jsx(re,{canIdentifier:n,canIdentifierType:g,onCanIdentifierChange:d,onErrorsChange:a,collapsible:r,collapsed:l,collapsedChange:i})}function se({canIdentifier:e,identifierGeneratorType:t,minCanIdentifier:a,maxCanIdentifier:r,canIdentifierType:l,onChange:i,onErrorsChange:u=void 0,canIdentifierGeneratorSettingsError:g=void 0,disabled:n=!1,collapsible:d=!1,collapsed:C=!1,collapsedChange:m=void 0}){const p=w.useLocalizedStrings(),h=w.useNumericRadix(),[S,L]=o.useState(!1),[M,A]=o.useState(!1),[j,v]=o.useState(!1),[c,y]=o.useState(l);o.useEffect(()=>{y(l)},[l]);const F=o.useCallback(k=>{y(k?"extended":"standard")},[]),R=o.useCallback(k=>{let I=k,B=!1;if(I.length>2&&I.toLowerCase().startsWith("0x")&&(I=I.substring(2),B=!0),I=I.toUpperCase(),c==="extended"){const b=parseInt(I,B?16:h);if(Number.isNaN(b)||b<0||b>536870911)return i(k,t,a,r,c),{val:k,err:!0};I=`${b.toString(h).toUpperCase()}`}else if(c==="standard"){const b=parseInt(I,B?16:h);if(Number.isNaN(b)||b<0||b>2047)return i(k,t,a,r,c),{val:k,err:!0};I=`${b.toString(h).toUpperCase()}`}return i(I,t,a,r,c),{val:k,err:!1}},[c,t,r,a,h,i]),$=o.useCallback((k,I,B)=>{let b=k,N=-1,x=!1;if(b.length>2&&b.toLowerCase().startsWith("0x")&&(b=b.substring(2),x=!0),b=b.toUpperCase(),I==="extended"){if(N=parseInt(b,x?16:h),Number.isNaN(N)||N<0||N>536870911)return B(k),{val:k,err:!0,id:N};b=`${N.toString(h).toUpperCase()}`}else if(I==="standard"){if(N=parseInt(b,x?16:h),Number.isNaN(N)||N<0||N>2047)return B(k),{val:k,err:!0,id:N};b=`${N.toString(h).toUpperCase()}`}return B(b),{val:b,err:!1,id:N}},[h]),_=o.useCallback(k=>{const I=$(k,c,b=>i(e,t,b,r,c)),B=$(r,c,()=>{});return!I.err&&!B.err&&(I.id>=B.id?(I.err=!0,A(!0)):A(!1)),{val:I.val,err:I.err}},[e,c,t,r,i,$]),D=o.useCallback(k=>{const I=$(k,c,b=>i(e,t,a,b,c)),B=$(a,c,()=>{});return!B.err&&!I.err&&(B.id>=I.id?(I.err=!0,v(!0)):v(!1)),{val:I.val,err:I.err}},[e,c,t,a,i,$]),P=o.useCallback(k=>{if(k!==c){let I=e;const B=$(a,k,()=>{}),b=$(r,k,()=>{});i(I,t,B.val,b.val,k)}},[c,e,$,a,r,i,t,h]),U=o.useCallback(k=>{let I=e;const B=$(a,c,()=>{}),b=$(r,c,()=>{});i(I,k,B.val,b.val,c)},[c,e,$,a,r,i,t,h]);return o.useEffect(()=>{u&&u(t==="constant"&&S||(t==="random"||t==="scan")&&(M||j)),g&&(g.current=t==="constant"&&S||(t==="random"||t==="scan")&&(M||j))},[S,g,t,j,M,u]),s.jsx(Y,{text:p.getString("LabelCanIdentifier"),summary:t==="constant"?e:t==="random"?`${p.getString("LabelRandom")} ${a}-${r}`:`${p.getString("LabelScan")} ${a}-${r}`,collapsible:d,collapsed:C,collapsedChange:m,children:s.jsxs(te,{id:"identifier-radio-group",value:t,onChange:k=>{U(k)},children:[s.jsxs(z,{spacing:4,children:[s.jsx(G,{id:"constant-id-radio",value:"constant",label:p.getString("LabelConstantIdentifier"),sx:{marginLeft:"-11px !important"},disabled:n}),s.jsx(W,{id:"constant-id",fullWidth:!0,value:e,error:S,onErrorChange:L,disabled:n||t!=="constant",required:t==="constant",onBlur:R}),s.jsx(Z,{id:"id-type",label:p.getString("LabelUseExtendedIdentifier"),checked:c==="extended",onChange:k=>{F(k),P(k?"extended":"standard")},disabled:n})]}),s.jsxs(z,{spacing:4,children:[s.jsx(G,{id:"random-identifier-radio",value:"random",label:p.getString("LabelRandomIdentifier"),sx:{marginLeft:"-11px !important"},disabled:n}),s.jsx(G,{id:"scan-identifier-radio",value:"scan",label:p.getString("LabelScanIdentifier"),disabled:n}),s.jsx(W,{id:"identifier-min",disabled:n||t!=="random"&&t!=="scan",required:t==="random"||t==="scan",fullWidth:!0,value:a??"",error:M,onErrorChange:A,startAdornment:p.getString("LabelFrom"),onBlur:_,sxStartAdornment:{marginBottom:.8}}),s.jsx(W,{id:"identifier-max",disabled:n||t!=="random"&&t!=="scan",required:t==="random"||t==="scan",fullWidth:!0,value:r??"",error:j,onErrorChange:v,startAdornment:p.getString("LabelTo"),onBlur:D,sxStartAdornment:{marginBottom:.8}})]})]})})}function Le({settings:e,onSettingsChange:t,onErrorsChange:a=void 0,canIdentifierGeneratorSettingsError:r=void 0,disabled:l=!1,collapsible:i=!1,collapsed:u=!1,collapsedChange:g=void 0}){var L,M,A;const n=w.useNumericRadix(),d=o.useMemo(()=>{var j,v,c;return((c=(v=(j=e.frame)==null?void 0:j.canFrameFlags)==null?void 0:v.flags)==null?void 0:c.includes(O.CanFrameFlag.CAN_FRAME_FLAG_EXT))===!0?"extended":"standard"},[(M=(L=e.frame)==null?void 0:L.canFrameFlags)==null?void 0:M.flags]),C=o.useMemo(()=>{var v;return`${(((v=e.frame)==null?void 0:v.id)??0).toString(n).toUpperCase()}`},[n,(A=e.frame)==null?void 0:A.id]),m=o.useMemo(()=>`${(e.identifierMin??0).toString(n).toUpperCase()}`,[n,e.identifierMin]),p=o.useMemo(()=>`${(e.identifierMax??0).toString(n).toUpperCase()}`,[n,e.identifierMax]),h=o.useMemo(()=>e.randomIdentifier===!0?"random":e.scanIdentifier===!0?"scan":"constant",[e.randomIdentifier,e.scanIdentifier]),S=o.useCallback((j,v,c,y,F)=>{var I,B,b,N;const R=F,$=parseInt(j,n),_=(B=(I=e.frame)==null?void 0:I.canFrameFlags)!=null&&B.flags?{flags:[...e.frame.canFrameFlags.flags]}:{flags:[]},D=_.flags.indexOf(O.CanFrameFlag.CAN_FRAME_FLAG_STD),P=parseInt(c,n),U=parseInt(y,n),k=_.flags.indexOf(O.CanFrameFlag.CAN_FRAME_FLAG_EXT);if(D!==-1&&_.flags.splice(D,1),k!==-1&&_.flags.splice(k,1),R==="extended"?_.flags.push(O.CanFrameFlag.CAN_FRAME_FLAG_EXT):R==="standard"&&_.flags.push(O.CanFrameFlag.CAN_FRAME_FLAG_STD),$!==((b=e.frame)==null?void 0:b.id)||!Q(_,(N=e.frame)==null?void 0:N.canFrameFlags)||v!==h||P!==e.identifierMin||U!==e.identifierMax){const x={...e};x.frame=e.frame?{...e.frame}:O.WriteFrame.fromPartial({id:0,canFrameFlags:{flags:[O.CanFrameFlag.CAN_FRAME_FLAG_STD]},data:Array.from({length:8},()=>0)}),x.frame.id=$,x.frame.canFrameFlags=_,v==="constant"?(x.randomIdentifier=!1,x.scanIdentifier=!1):v==="random"?(x.randomIdentifier=!0,x.scanIdentifier=!1):v==="scan"&&(x.randomIdentifier=!1,x.scanIdentifier=!0),x.identifierMin=P,x.identifierMax=U,t(x)}},[h,n,t,e]);return s.jsx(se,{canIdentifier:C,identifierGeneratorType:h,minCanIdentifier:m,maxCanIdentifier:p,canIdentifierType:d,onChange:S,onErrorsChange:a,canIdentifierGeneratorSettingsError:r,disabled:l,collapsible:i,collapsed:u,collapsedChange:g})}function Re(e,t,a,r){const[l,i]=o.useState(""),[u,g]=o.useState([]);return o.useEffect(()=>{g(n=>{var C;const d=(C=a==null?void 0:a.sources)==null?void 0:C.filter(m=>{var h,S;const p=(S=(h=r==null?void 0:r.find(L=>{var M;return L.nodeId===((M=m.baseNode)==null?void 0:M.identifier)}))==null?void 0:h.errorStatus)==null?void 0:S.errors;return p===void 0||p===""?m.baseNode&&m.channelSettings&&m.channelSettings.canConfiguration&&(!t||m.channelSettings.canConfiguration.silentMode!==!0):!1}).map(m=>({value:m.channelSettings.channelNumber,displayText:m.baseNode.name,canFdMode:m.channelSettings.canConfiguration.canMode>0,identifier:m.baseNode.identifier}));return!d||Q(n,d)?n:d})},[t,a==null?void 0:a.sources,r]),o.useEffect(()=>{const n=u.find(d=>d.identifier===e);i(n?d=>n.value===d?d:n.value:"")},[e,u]),{channelOptions:u,selectedChannelOption:l}}function Ae({channelIdentifier:e,onChannelIdentifierChange:t,hideSilentChannels:a=!1,hideSectionControl:r=!1,disabled:l=!1,collapsible:i=!1,collapsed:u=!1,collapsedChange:g=void 0}){var S;const n=w.useMeasurementSetup(),d=w.useMeasurementStatus(),C=w.useLocalizedStrings(),{channelOptions:m,selectedChannelOption:p}=Re(e,a===!0,n,d),h=o.useCallback(L=>{const M=m.find(v=>v.value===L),A=(M==null?void 0:M.identifier)??"",j=(M==null?void 0:M.canFdMode)===!0;t(A,j)},[m,t]);return r===!0?s.jsx(J,{id:"channel",label:C.getString("LabelChannel"),fullWidth:!0,value:p,onChange:h,options:m,required:!0,disabled:l}):s.jsx(Y,{text:C.getString("LabelChannel"),summary:p===""||(S=m.find(L=>L.value===p))==null?void 0:S.displayText,collapsible:i,collapsed:u,collapsedChange:g,children:s.jsx(J,{id:"channel",label:C.getString("LabelChannel"),fullWidth:!0,value:p,onChange:h,options:m,required:!0,disabled:l})})}const Ee=f.styled(f.Box)(()=>({height:"100%",width:"100%",padding:"4px",overflow:"auto"}));exports.CanKingDataProvider=w.CanKingDataProvider;exports.DevicesContext=w.DevicesContext;exports.LocalizedStrings=w.LocalizedStrings;exports.LogMessagesContext=w.LogMessagesContext;exports.MeasurementSetupContext=w.MeasurementSetupContext;exports.MeasurementStatusContext=w.MeasurementStatusContext;exports.OnlineStatusContext=w.OnlineStatusContext;exports.RunningPeriodicTransmissionsContext=w.RunningPeriodicTransmissionsContext;exports.UserSettingsContext=w.UserSettingsContext;exports.WorkspacePanesContext=w.WorkspacePanesContext;exports.addEventListener=w.addEventListener;exports.removeEventListener=w.removeEventListener;exports.CanChannelSelectControl=Ae;exports.CanIdentifierControl=re;exports.CanIdentifierFrameControl=ye;exports.CanIdentifierGeneratorControl=se;exports.CanIdentifierGeneratorSettingsControl=Le;exports.CheckboxControl=Z;exports.ContextMenu=Ie;exports.DropdownButton=V;exports.DropdownButtonTextItems=le;exports.DropdownPanel=ce;exports.FillBox=Ee;exports.FormControlRow=z;exports.InlineEditor=ge;exports.NumberRangeControl=xe;exports.OneLineButton=X;exports.RadioControl=G;exports.RadioGroupControl=te;exports.SectionControl=Y;exports.SelectControl=J;exports.SizedBox=pe;exports.TableControl=me;exports.TabsPanel=Se;exports.TextControl=ee;exports.ToolbarControl=ke;exports.ValidateableTextControl=W;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index.js"),o=require("react/jsx-runtime"),l=require("react"),m=require("@mui/material"),ee=require("./icons.js"),te=require("fast-deep-equal");require("long");const P=require("./measurement_settings.js");function ke(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const K=ke(l);function re({id:e=void 0,label:n,checked:t,onChange:r,disabled:a=!1,size:i="small",sx:b=void 0}){const d=l.useCallback(s=>{if(s.key==="Enter"&&!s.ctrlKey&&!s.altKey&&!s.shiftKey){s.preventDefault();return}},[]);return o.jsx(m.FormControlLabel,{id:e,"aria-label":e,disabled:a,"aria-disabled":a,control:o.jsx(m.Checkbox,{size:i,checked:t,onChange:(s,c)=>r(c),onKeyDown:d}),label:n,slotProps:{typography:{noWrap:!0}},sx:b})}var X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ie(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var ae=Ie,Me=typeof X=="object"&&X&&X.Object===Object&&X,Te=Me,$e=Te,we=typeof self=="object"&&self&&self.Object===Object&&self,Re=$e||we||Function("return this")(),fe=Re,Ee=fe,Le=function(){return Ee.Date.now()},_e=Le,Ae=/\s/;function Be(e){for(var n=e.length;n--&&Ae.test(e.charAt(n)););return n}var Oe=Be,Pe=Oe,De=/^\s+/;function We(e){return e&&e.slice(0,Pe(e)+1).replace(De,"")}var Ue=We,ze=fe,Ge=ze.Symbol,be=Ge,se=be,ge=Object.prototype,Ke=ge.hasOwnProperty,qe=ge.toString,G=se?se.toStringTag:void 0;function Xe(e){var n=Ke.call(e,G),t=e[G];try{e[G]=void 0;var r=!0}catch{}var a=qe.call(e);return r&&(n?e[G]=t:delete e[G]),a}var Ye=Xe,He=Object.prototype,Je=He.toString;function Qe(e){return Je.call(e)}var Ze=Qe,le=be,Ve=Ye,en=Ze,nn="[object Null]",tn="[object Undefined]",oe=le?le.toStringTag:void 0;function rn(e){return e==null?e===void 0?tn:nn:oe&&oe in Object(e)?Ve(e):en(e)}var an=rn;function sn(e){return e!=null&&typeof e=="object"}var ln=sn,on=an,un=ln,dn="[object Symbol]";function cn(e){return typeof e=="symbol"||un(e)&&on(e)==dn}var fn=cn,bn=Ue,ie=ae,gn=fn,ue=NaN,mn=/^[-+]0x[0-9a-f]+$/i,hn=/^0b[01]+$/i,xn=/^0o[0-7]+$/i,pn=parseInt;function Cn(e){if(typeof e=="number")return e;if(gn(e))return ue;if(ie(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ie(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=bn(e);var t=hn.test(e);return t||xn.test(e)?pn(e.slice(2),t?2:8):mn.test(e)?ue:+e}var vn=Cn,Sn=ae,V=_e,de=vn,jn="Expected a function",Fn=Math.max,yn=Math.min;function Nn(e,n,t){var r,a,i,b,d,s,c=0,h=!1,S=!1,N=!0;if(typeof e!="function")throw new TypeError(jn);n=de(n)||0,Sn(t)&&(h=!!t.leading,S="maxWait"in t,i=S?Fn(de(t.maxWait)||0,n):i,N="trailing"in t?!!t.trailing:N);function j(u){var T=r,L=a;return r=a=void 0,c=u,b=e.apply(L,T),b}function F(u){return c=u,d=setTimeout(w,n),h?j(u):b}function k(u){var T=u-s,L=u-c,B=n-T;return S?yn(B,i-L):B}function M(u){var T=u-s,L=u-c;return s===void 0||T>=n||T<0||S&&L>=i}function w(){var u=V();if(M(u))return y(u);d=setTimeout(w,k(u))}function y(u){return d=void 0,N&&r?j(u):(r=a=void 0,b)}function p(){d!==void 0&&clearTimeout(d),c=0,r=s=a=d=void 0}function g(){return d===void 0?b:y(V())}function v(){var u=V(),T=M(u);if(r=arguments,a=this,s=u,T){if(d===void 0)return F(s);if(S)return clearTimeout(d),d=setTimeout(w,n),j(s)}return d===void 0&&(d=setTimeout(w,n)),b}return v.cancel=p,v.flush=g,v}var me=Nn;const kn=ce(me);var In=me,Mn=ae,Tn="Expected a function";function $n(e,n,t){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(Tn);return Mn(t)&&(r="leading"in t?!!t.leading:r,a="trailing"in t?!!t.trailing:a),In(e,n,{leading:r,maxWait:n,trailing:a})}var wn=$n;const Rn=ce(wn),En=(e,n,t,r)=>{switch(n){case"debounce":return kn(e,t,r);case"throttle":return Rn(e,t,r);default:return e}},Ln=e=>{const n=K.useRef(e);return K.useEffect(()=>{n.current=e}),K.useMemo(()=>(...t)=>{var r;return(r=n.current)===null||r===void 0?void 0:r.call(n,...t)},[])},_n=e=>{const[n,t]=K.useState((e==null?void 0:e.current)||null);return e&&setTimeout(()=>{e.current!==n&&t(e.current)},0),{refProxy:K.useMemo(()=>new Proxy(a=>{a!==n&&t(a)},{get(a,i){return i==="current"?n:a[i]},set(a,i,b){return i==="current"?t(b):a[i]=b,!0}}),[n]),refElement:n,setRefElement:t}},An=(e,n)=>n==="border-box"?{width:e.borderBoxSize[0].inlineSize,height:e.borderBoxSize[0].blockSize}:n==="content-box"?{width:e.contentBoxSize[0].inlineSize,height:e.contentBoxSize[0].blockSize}:{width:e.contentRect.width,height:e.contentRect.height};function Bn({skipOnMount:e=!1,refreshMode:n,refreshRate:t=1e3,refreshOptions:r,handleWidth:a=!0,handleHeight:i=!0,targetRef:b,observerOptions:d,onResize:s}={}){const c=l.useRef(e),h=Ln(s),[S,N]=l.useState({width:void 0,height:void 0}),{refProxy:j,refElement:F}=_n(b),{box:k}=d||{},M=l.useCallback(y=>{if(!a&&!i)return;if(c.current){c.current=!1;return}const p=(g,v)=>a&&g.width!==v.width||i&&g.height!==v.height;y.forEach(g=>{const v=An(g,k);N(u=>p(u,v)?(h==null||h({width:v.width,height:v.height,entry:g}),v):u)})},[a,i,c,k]),w=l.useCallback(En(M,n,t,r),[M,n,t,r]);return l.useEffect(()=>{let y;return F?(y=new window.ResizeObserver(w),y.observe(F,d)):(S.width||S.height)&&(h==null||h({width:null,height:null,entry:null}),N({width:void 0,height:void 0})),()=>{var p,g,v;(p=y==null?void 0:y.disconnect)===null||p===void 0||p.call(y),(v=(g=w).cancel)===null||v===void 0||v.call(g)}},[w,F]),Object.assign({ref:j},S)}const he=()=>{const{ref:e,width:n}=Bn();return{ref:e,width:n}},xe=(...e)=>{const[n,t]=l.useState();return l.useEffect(()=>{const r=e.filter(a=>a.width!==void 0).map(a=>Number(a.width.toFixed(1)));if(r.length===e.length){const a=Math.max(...r);t(i=>i===void 0?a:i)}},[e]),n};function pe({columnItem:e,width:n=void 0,children:t=void 0}){return o.jsx("div",{ref:e.ref,children:o.jsx(m.Box,{sx:{width:n},children:t})})}const q=m.styled(m.Button)(()=>({whiteSpace:"nowrap",minWidth:"max-content"}));function On({items:e,onSelect:n,onClose:t=void 0}){const r=l.useCallback(a=>{n(a),t&&t()},[t,n]);return o.jsx(o.Fragment,{children:e.map(a=>o.jsx(m.MenuItem,{onClick:()=>r(a.key),children:a.text},a.key))})}function Ce({id:e="dropdown-button",startIcon:n=void 0,endIcon:t=void 0,text:r=void 0,variant:a="outlined",color:i=void 0,size:b="medium",disabled:d=!1,children:s}){const[c,h]=l.useState(null),S=!!c,N=l.useCallback(k=>{h(k.currentTarget)},[]),j=l.useCallback(()=>{h(null)},[]),F=l.cloneElement(l.Children.only(s),{onClose:j});return o.jsxs(o.Fragment,{children:[!r&&o.jsx(m.IconButton,{id:e,"data-testid":e,"aria-controls":S?`${e}-popover`:void 0,"aria-haspopup":"true","aria-expanded":S?"true":void 0,onClick:N,size:b,color:i,disabled:d,children:n}),r&&o.jsx(q,{id:e,"data-testid":e,"aria-controls":S?`${e}-popover`:void 0,"aria-haspopup":"true","aria-expanded":S?"true":void 0,variant:a,disableElevation:!0,onClick:N,startIcon:n,endIcon:t??o.jsx(ee.LineArrowDownIcon,{}),size:b,color:i,disabled:d,children:r}),o.jsx(m.Popover,{id:`${e}-popover`,"aria-labelledby":e,anchorEl:c,open:S,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:F})]})}const Pn=m.styled("div")(({top:e,left:n,width:t,height:r})=>({top:e,left:n,width:t,height:r,position:"absolute",zIndex:1})),Dn=m.styled("div")(({top:e,left:n,width:t,height:r,position:a,theme:i})=>({top:e,left:n,width:t,height:r,position:"absolute",zIndex:2,color:i.palette.primary.contrastText,backgroundColor:i.palette.primary.main,display:"flex",flexDirection:a==="left"||a==="right"?"column":"row",borderTopLeftRadius:a==="top"||a==="left"?0:8,borderTopRightRadius:a==="top"||a==="right"?0:8,borderBottomRightRadius:a==="bottom"||a==="right"?0:8,borderBottomLeftRadius:a==="bottom"||a==="left"?0:8})),Y=8;function Wn({id:e=void 0,position:n,parentWidth:t,parentHeight:r,maxLength:a,dropDownSize:i,autoHideTimeout:b=0,forceShow:d=!1,children:s=null}){const c=l.useMemo(()=>{switch(n){case"left":case"right":return Math.min(a,r);case"top":case"bottom":return Math.min(a,t);default:return a}},[a,r,t,n]),h=l.useMemo(()=>{switch(n){case"left":case"right":return(r-c)/2;case"top":return 0;case"bottom":return r-Y;default:return 0}},[c,r,n]),S=l.useMemo(()=>{switch(n){case"left":return 0;case"right":return t-Y;case"top":case"bottom":return(t-c)/2;default:return 0}},[c,t,n]),N=l.useMemo(()=>{switch(n){case"left":case"right":return Y;case"top":case"bottom":return c;default:return 0}},[c,n]),j=l.useMemo(()=>{switch(n){case"left":case"right":return c;case"top":case"bottom":return Y;default:return 0}},[c,n]),F=l.useMemo(()=>{switch(n){case"left":case"right":return(r-c)/2;case"top":return 0;case"bottom":return r-i;default:return 0}},[i,c,r,n]),k=l.useMemo(()=>{switch(n){case"left":return 0;case"right":return t-i;case"top":case"bottom":return(t-c)/2;default:return 0}},[i,c,t,n]),M=l.useMemo(()=>{switch(n){case"left":case"right":return i;case"top":case"bottom":return c;default:return 0}},[i,c,n]),w=l.useMemo(()=>{switch(n){case"left":case"right":return c;case"top":case"bottom":return i;default:return 0}},[i,c,n]),[y,p]=l.useState(!1),g=l.useCallback(u=>{u.buttons===0&&b&&p(!0)},[b]),v=l.useCallback(()=>{p(!1)},[]);return l.useEffect(()=>{let u;return y&&b&&(u=setTimeout(()=>p(!1),b)),()=>{u&&clearTimeout(u)}},[b,y]),o.jsxs(o.Fragment,{children:[o.jsx(Pn,{id:e,top:h,left:S,width:N,height:j,"aria-haspopup":"true",onMouseEnter:g}),(y||d===!0)&&o.jsx(Dn,{top:F,left:k,width:M,height:w,position:n,onMouseLeave:v,children:s})]})}function J({children:e,fullWidth:n=!0,spacing:t="4px",alignItems:r="center"}){return o.jsx(m.FormControl,{margin:"dense",fullWidth:n,variant:"standard",children:o.jsx(m.Stack,{direction:"row",spacing:t,alignItems:r,children:e})})}const Un=m.styled("input")(({variant:e,theme:n})=>({...n.typography[e]})),zn=m.styled("span")(({variant:e,theme:n})=>({...n.typography[e]}));function Gn({value:e,onChange:n,ariaLabel:t=void 0,variant:r="body1"}){const a=l.useRef(null),[i,b]=l.useState(e),d=l.useCallback(h=>b(h.target.value),[]),s=l.useCallback(h=>{(h.key==="Enter"||h.key==="Escape")&&(h.key==="Escape"&&(b(e),h.currentTarget.value=e),h.currentTarget.blur())},[e]),c=l.useCallback(h=>{n(h.target.value)},[n]);return l.useEffect(()=>{var h;(h=a.current)==null||h.focus()},[]),o.jsx(Un,{ref:a,variant:r??"body1",type:"text","aria-label":t,value:i,onChange:d,onKeyDown:s,onBlur:c})}function Kn({editMode:e,value:n,onValueChange:t,ariaLabel:r=void 0,variant:a="body1"}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(Gn,{ariaLabel:r,value:n,onChange:t,variant:a}),!e&&o.jsx(zn,{variant:a??"body1",children:n})]})}function ve({id:e=void 0,label:n=void 0,helperText:t="",value:r,onChange:a=void 0,onBlur:i=void 0,disabled:b=!1,error:d=!1,required:s=!1,margin:c="dense",size:h="small",fullWidth:S=!1,inputMode:N=void 0,pattern:j=void 0,startAdornment:F=void 0,endAdornment:k=void 0,sx:M=void 0,sxStartAdornment:w=void 0,sxEndAdornment:y=void 0}){const p=l.useCallback(T=>{a&&a(T.target.value)},[a]),g=l.useCallback(T=>{if(T.key==="Enter"&&!T.ctrlKey&&!T.altKey&&!T.shiftKey){T.preventDefault(),T.stopPropagation(),document.activeElement instanceof HTMLElement&&document.activeElement.blur();return}},[]),v=w??{marginBottom:1},u=y??{marginBottom:1};return o.jsx(m.TextField,{id:e,"aria-label":e,type:"text",label:n,helperText:t,margin:c,size:h,fullWidth:S,variant:"standard",value:r,onChange:p,onBlur:i,disabled:b,"aria-disabled":b,error:d,required:s,slotProps:{input:{startAdornment:F?o.jsx(m.InputAdornment,{position:"start",sx:{...v},children:F}):null,endAdornment:k?o.jsx(m.InputAdornment,{position:"end",sx:{...u},children:k}):null},htmlInput:{inputMode:N,pattern:j}},sx:M,onKeyDown:g})}function z({id:e,label:n=void 0,helperText:t="",value:r,onChange:a=void 0,onBlur:i=void 0,disabled:b=!1,required:d=!1,margin:s="dense",size:c="small",fullWidth:h=!1,inputMode:S=void 0,pattern:N=void 0,startAdornment:j=void 0,endAdornment:F=void 0,sx:k=void 0,sxStartAdornment:M=void 0,sxEndAdornment:w=void 0,error:y=void 0,onErrorChange:p=void 0,onValidate:g=void 0,numberType:v="int",minValue:u=void 0,maxValue:T=void 0}){const[L,B]=l.useState(r),[R,_]=l.useState(y!==void 0?y:!1);l.useEffect(()=>{B(f=>r!==f?r:f)},[r]),l.useEffect(()=>{_(f=>y!==void 0&&y!==f?y:f)},[y]);const D=l.useCallback(f=>{const I=Number.parseInt(f,f.startsWith("0x")?16:10);let x=Number.isNaN(I);return x||(x=u!==void 0&&I<u),x||(x=T!==void 0&&I>T),{val:f,err:x}},[T,u]),W=l.useCallback(f=>{let I=!1;if(f.endsWith(",")||f.endsWith("."))return I=!0,{val:f,err:I};const x=Number.parseFloat(f.replace(",","."));return I=Number.isNaN(x),I||(I=u!==void 0&&x<u),I||(I=T!==void 0&&x>T),{val:x.toString(),err:I}},[T,u]),U=l.useCallback(f=>v==="int"?D(f):W(f),[v,W,D]),O=l.useCallback((f,I)=>{let x=f,A=!1;return!d&&(x===void 0||x==="")?{val:x,err:A}:(v!==void 0&&({val:x,err:A}=U(f)),!A&&g&&({val:x,err:A}=g(x,I)),{val:x,err:A})},[g,U]),$=l.useCallback(f=>{const{val:I,err:x}=O(f,"change");(y===void 0||y===!1)&&_(x),B(x?f:I),!x&&a&&a(I)},[a,O]),C=l.useCallback(()=>{const{val:f,err:I}=O(L,"blur");(y===void 0||y===!1)&&_(I),!I&&i&&i(f)},[i,O,L]);return l.useEffect(()=>{p&&p(R)},[R,p]),o.jsx(ve,{id:e,label:n,helperText:t,value:L,onChange:$,onBlur:C,disabled:b,error:R,required:d,margin:s,size:c,fullWidth:h,inputMode:S,pattern:N,startAdornment:j,endAdornment:F,sx:k,sxStartAdornment:M,sxEndAdornment:w})}function qn({minValue:e,maxValue:n,onChange:t=void 0,onBlur:r=void 0,minError:a=void 0,onMinErrorChange:i=void 0,maxError:b=void 0,onMaxErrorChange:d=void 0,onMinValidate:s=void 0,onMaxValidate:c=void 0,minDisabled:h=!1,maxDisabled:S=!1,unit:N=void 0,lowerLimit:j=void 0,upperLimit:F=void 0}){const k=E.useLocalizedStrings(),M=Number.parseInt(e),w=Number.parseInt(n),[y,p]=l.useState(e.toString()),[g,v]=l.useState(n.toString()),[u,T]=l.useState(a===!0||Number.isNaN(M)||M<(j??0)||F&&M>F||!Number.isNaN(w)&&M>=w),[L,B]=l.useState(b===!0||Number.isNaN(w)||w<(j??0)||F&&w>F||!Number.isNaN(M)&&M>=w);l.useEffect(()=>{p($=>e.toString()!==$?e.toString():$)},[e]),l.useEffect(()=>{T($=>a!==void 0&&a!==$?a:$)},[a]),l.useEffect(()=>{v($=>n.toString()!==$?n.toString():$)},[n]),l.useEffect(()=>{B($=>b!==void 0&&b!==$?b:$)},[b]);const R=l.useCallback($=>{const C=Number.parseInt($,$.startsWith("0x")?16:10),f=Number.parseInt(g),I=Number.isNaN(C)||C<(j??0)||F&&C>F||!Number.isNaN(f)&&C>=f;return{val:$,err:I}},[g,j,F]),_=l.useCallback($=>{const C=Number.parseInt($,$.startsWith("0x")?16:10),f=Number.parseInt(y),I=Number.isNaN(C)||C<(j??0)||F&&C>F||!Number.isNaN(f)&&f>=C;return{val:$,err:I}},[y,j,F]),D=l.useCallback($=>{let{val:C,err:f}=R($);if(!f&&s&&({val:C,err:f}=s($,"change")),(a===void 0||a===!1)&&T(f),f)t&&t($,g);else{const I=Number.parseInt(C,C.startsWith("0x")?16:10).toString();p(I),t&&t(I,g)}},[R,s,a,t,g]),W=l.useCallback($=>{let{val:C,err:f}=R($);!f&&s&&({val:C,err:f}=s(C,"blur")),T(f),!f&&r&&r(C,g)},[R,s,r,g]),U=l.useCallback($=>{let{val:C,err:f}=_($);if(!f&&c&&({val:C,err:f}=c($,"change")),(b===void 0||b===!1)&&B(f),f)t&&t(y,$);else{const I=Number.parseInt(C,C.startsWith("0x")?16:10).toString();v(I),t&&t(y,I)}},[_,c,b,t,y]),O=l.useCallback($=>{let{val:C,err:f}=_($);!f&&c&&({val:C,err:f}=c(C,"blur")),B(f),!f&&r&&r(y,C)},[_,c,r,y]);return l.useEffect(()=>{i&&i(u),d&&d(L)},[L,u,d,i]),o.jsxs(o.Fragment,{children:[o.jsx(z,{id:"min-value",disabled:h,inputMode:"numeric",fullWidth:!0,value:y,onChange:D,onBlur:W,startAdornment:k.getString("LabelFrom"),endAdornment:N,numberType:"int",error:u,onErrorChange:T}),o.jsx(z,{id:"max-value",disabled:S,inputMode:"numeric",fullWidth:!0,value:g,onChange:U,onBlur:O,startAdornment:k.getString("LabelTo"),endAdornment:N,numberType:"int",error:L,onErrorChange:B})]})}function H({id:e=void 0,label:n,value:t,disabled:r=!1,size:a="small",sx:i=void 0}){return o.jsx(m.FormControlLabel,{id:e,"aria-label":e,value:t,disabled:r,"aria-disabled":r,control:o.jsx(m.Radio,{size:a}),label:n,componentsProps:{typography:{noWrap:!0}},sx:i})}function Se({children:e,id:n=void 0,value:t,onChange:r}){return o.jsx(m.RadioGroup,{id:n,"aria-label":n,value:t,onChange:(a,i)=>r(i),children:e})}const Xn=m.styled(m.Box,{shouldForwardProp:e=>e!=="collapsed"})(({collapsed:e,theme:n})=>({paddingTop:e?"4px":"8px",paddingLeft:"2px",paddingRight:"2px",paddingBottom:e?"0px":"2px",marginTop:"2px","&:hover, &:focus-within":{background:n.palette.action.hover}})),je=m.styled("span")(({theme:e})=>({color:e.palette.divider})),Yn=m.styled(je)(()=>({"&:hover":{cursor:"pointer"}})),Hn=m.styled(m.IconButton)(({theme:e})=>({color:e.palette.divider,padding:"0px"}));function Q({textAlign:e="left",text:n=void 0,summary:t=void 0,children:r=void 0,collapsible:a=!1,collapsed:i=!1,collapsedChange:b=void 0}){const d=E.useLanguage(),s=E.useLocalizedStrings(),[c,h]=l.useState(i);l.useEffect(()=>h(i),[i]);const S=l.useCallback(N=>{b?b(N):h(N)},[b]);return o.jsxs(Xn,{collapsed:c,children:[n&&o.jsx(m.Divider,{textAlign:e,variant:"fullWidth",children:a?o.jsxs(m.Stack,{direction:"row",spacing:1,alignItems:"center",children:[o.jsxs(Yn,{onClick:()=>S(!c),children:[n.toLocaleUpperCase(d),c&&t?` (${t})`:""]}),o.jsx(m.Tooltip,{title:c?s==null?void 0:s.getString("TooltipExpandSection",n):s==null?void 0:s.getString("TooltipCollapseSection",n),children:o.jsx(Hn,{onClick:()=>S(!c),children:c?o.jsx(ee.LineArrowDownIcon,{}):o.jsx(ee.LineArrowUpIcon,{})})})]}):o.jsx(je,{children:n.toLocaleUpperCase(d)})}),!c&&r]})}function ne({id:e,label:n,showLabel:t=!1,helperText:r="",options:a,value:i,onChange:b,disabled:d=!1,required:s=!1,margin:c="dense",size:h="small",fullWidth:S=!1,minWidth:N=void 0,prefixTextWithValue:j=!1}){const F=l.useCallback(p=>{typeof p.target.value=="string"?b(""):b(p.target.value)},[b]),k=l.useCallback(p=>p.map(g=>o.jsx(m.MenuItem,{"aria-label":`menu-item-${g.value}`,value:g.value,children:j?`${g.value} - ${g.displayText}`:g.displayText},g.value)),[j]),M=l.useCallback((p,g)=>{const v=[o.jsx(m.ListSubheader,{color:"primary",children:p},p)];return v.push(...k(g)),v},[k]),w=l.useCallback(p=>{const g=[];return p.forEach((v,u)=>{g.push(...M(u,v))}),g},[M]),y=l.useCallback(p=>{let g="";if(a instanceof Map)a.forEach((v,u)=>{if(g===""){const T=v.find(L=>L.value===p);T&&(g=j?`${T.value} - ${u} - ${T.displayText}`:`${u} - ${T.displayText}`)}});else{const v=a.find(u=>u.value===p);v&&(g=j?`${v.value} - ${v.displayText}`:v.displayText)}return g===""&&(g=s?`${n} *`:n),g},[n,a,j,s]);return o.jsxs(m.FormControl,{fullWidth:S,variant:"standard",sx:{minWidth:N},margin:c,size:h,children:[t&&o.jsx(m.InputLabel,{id:`${e}-label`,children:s?`${n} *`:n}),o.jsxs(m.Select,{labelId:`${e}-label`,"aria-label":e,id:e,value:i,renderValue:y,onChange:F,displayEmpty:!t,disabled:d,"aria-disabled":d,children:[a instanceof Map&&w(a),a instanceof Array&&k(a)]}),r&&o.jsx(m.FormHelperText,{children:r})]})}const Jn=m.styled(m.Box)(({height:e,width:n})=>({height:e,width:n,padding:"4px",overflow:"auto"}));function Qn({label:e,variant:n="h6"}){return o.jsx(m.Toolbar,{children:o.jsx(m.Typography,{sx:{flex:"1 1 100%"},variant:n,id:"tableTitle",component:"div",children:e})})}function Zn({data:e,dataKey:n,selectedKey:t=void 0,onClickRow:r=void 0,columns:a,label:i=void 0,labelVariant:b="h6",maxHeight:d=void 0,size:s="medium",stickyHeader:c=!1,hover:h=!1}){const S=l.useCallback(N=>{r&&r(N)},[r]);return o.jsxs(m.Box,{children:[i&&o.jsx(Qn,{label:i,variant:b}),o.jsx(m.TableContainer,{children:o.jsxs(m.Table,{"aria-labelledby":"tableTitle",size:s,stickyHeader:c,sx:{maxHeight:d},padding:"none",children:[o.jsx(m.TableHead,{children:o.jsx(m.TableRow,{children:a.map(N=>o.jsx(m.TableCell,{...N.headProps,children:N.headCell},N.key))})}),o.jsx(m.TableBody,{children:e.map(N=>{const j=n(N);return o.jsx(m.TableRow,{hover:h,selected:j===t,onClick:()=>S(N),children:a.map(F=>o.jsx(m.TableCell,{...F.dataProps,children:F.dataCell(N)},`${j}-${F.key}`))},j)})})]})})]})}const Vn=m.styled("div")(({theme:e})=>({borderBottom:"1px solid",borderColor:e.palette.divider})),et=m.styled(m.ToggleButtonGroup)(({theme:e})=>({[`& .${m.toggleButtonGroupClasses.grouped}`]:{margin:e.spacing(.5),padding:e.spacing(1.25),minWidth:24,color:e.palette.action.active,border:0,borderRadius:e.shape.borderRadius,[`&.${m.toggleButtonGroupClasses.disabled}`]:{border:0}}})),nt=m.styled(m.ButtonGroup)(({theme:e})=>({[`& .${m.buttonGroupClasses.grouped}`]:{margin:e.spacing(.5),padding:e.spacing(1.25),minWidth:24,color:e.palette.action.active,border:0,borderRadius:e.shape.borderRadius,[`&.${m.buttonGroupClasses.disabled}`]:{border:0}},[`& .${m.buttonGroupClasses.middleButton},& .${m.buttonGroupClasses.lastButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent"}}));function Fe({onClick:e,icon:n=void 0,text:t=void 0,size:r="small",variant:a=void 0,color:i="inherit",tooltip:b=void 0,ariaLabel:d=void 0,children:s=void 0,disabled:c=!1}){return s?o.jsx(Ce,{size:typeof r=="string"?r:"small",variant:a,color:i,startIcon:n,text:t,disabled:c,children:s}):t?o.jsxs(q,{size:typeof r=="string"?r:"small",variant:a,color:i,"aria-label":d,onClick:e,startIcon:n,disabled:c,children:[b&&o.jsx(m.Tooltip,{placement:"bottom-start",title:b,children:o.jsx("span",{children:t})}),!b&&t]}):o.jsxs(q,{size:typeof r=="string"?r:"small",variant:a,color:i,"aria-label":d,onClick:e,disabled:c,sx:{height:typeof r=="number"?`${r}px`:void 0,width:typeof r=="number"?`${r}px`:void 0},children:[b&&o.jsx(m.Tooltip,{placement:"bottom-start",title:b,children:o.jsx("span",{children:n})}),!b&&n]})}function tt({buttons:e,size:n="small",ariaLabel:t=void 0,orientation:r="horizontal"}){return o.jsx(nt,{size:n,"aria-label":t,orientation:r,children:e.map((a,i)=>o.jsx(Fe,{onClick:a.onClick,icon:a.icon,text:a.text,size:a.size,variant:a.variant,color:a.color,tooltip:a.tooltip,ariaLabel:a.ariaLabel,disabled:a.disabled,children:a.children},i))})}function rt({value:e,onChange:n,size:t="small",ariaLabel:r=void 0,exclusive:a=void 0,buttons:i,orientation:b="horizontal"}){return o.jsx(et,{size:t,value:e,onChange:(d,s)=>n(s),"aria-label":r,exclusive:a,orientation:b,children:i.map((d,s)=>o.jsxs(m.ToggleButton,{size:typeof t=="string"?t:"small",value:d.value,"aria-label":d.ariaLabel,sx:{height:typeof t=="number"?`${t}px`:void 0,width:typeof t=="number"?`${t}px`:void 0,padding:d.size==="small"||typeof t=="number"?1:void 0,margin:d.size==="small"||typeof t=="number"?0:void 0},disabled:d.disabled,children:[d.tooltip&&o.jsx(m.Tooltip,{placement:"bottom-start",title:d.tooltip,children:o.jsx("span",{children:d.icon})}),!d.tooltip&&d.icon]},s))})}function at({items:e,height:n=34,width:t=34,justifyContent:r="left",borderSize:a=1,padding:i=1,backgroundColor:b=void 0,orientation:d="horizontal"}){return o.jsx(m.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",justifyContent:r,border:s=>`${a}px solid ${s.palette.divider}`,flexWrap:"wrap",height:d==="horizontal"?`${n}px`:"100%",minHeight:d==="horizontal"?`${n}px`:void 0,width:d==="vertical"?`${t}px`:"100%",minWidth:d==="vertical"?`${t}px`:void 0,paddingLeft:d==="horizontal"?i:0,paddingRight:d==="horizontal"?i:0,paddingTop:d==="vertical"?i:0,paddingBottom:d==="vertical"?i:0,borderRadius:"0px",backgroundColor:b},children:e.map((s,c)=>s.label?o.jsx(m.Typography,{variant:s.label.variant,component:"div",children:s.label.text},c):s.toggleButtonGroup?o.jsx(rt,{value:s.toggleButtonGroup.value,onChange:s.toggleButtonGroup.onChange,ariaLabel:s.toggleButtonGroup.ariaLabel,exclusive:s.toggleButtonGroup.exclusive,buttons:s.toggleButtonGroup.buttons,orientation:d},c):s.button?o.jsx(Fe,{onClick:s.button.onClick,icon:s.button.icon,text:s.button.text,variant:s.button.variant,color:s.button.color,tooltip:s.button.tooltip,ariaLabel:s.button.ariaLabel,disabled:s.button.disabled},c):s.buttonGroup?o.jsx(tt,{ariaLabel:s.buttonGroup.ariaLabel,buttons:s.buttonGroup.buttons,orientation:d},c):s.other)})}function st({options:e,onSelect:n,children:t=void 0}){const[r,a]=l.useState(null),i=l.useCallback(s=>{e.length!==0&&(s.preventDefault(),a(r===null?{mouseX:s.clientX+2,mouseY:s.clientY-6}:null))},[r,e.length]),b=l.useCallback(()=>{a(null)},[]),d=l.useCallback(s=>{n(s),b()},[b,n]);return o.jsxs("div",{onContextMenu:i,style:{cursor:"context-menu"},children:[t,o.jsx(m.Menu,{open:r!==null,onClose:b,anchorReference:"anchorPosition",anchorPosition:r!==null?{top:r.mouseY,left:r.mouseX}:void 0,children:e.map(s=>o.jsxs(m.MenuItem,{onClick:()=>d(s.value),children:[s.icon&&o.jsx(m.ListItemIcon,{children:s.icon}),o.jsx(m.ListItemText,{children:s.displayText}),s.shortcut&&o.jsx(m.ListItemText,{sx:{pl:2,textAlign:"right"},children:s.shortcut})]},s.value))})]})}function ye({canIdentifier:e,canIdentifierType:n,onCanIdentifierChange:t,onErrorsChange:r=void 0,hideSection:a=!1,disabled:i=!1,collapsible:b=!1,collapsed:d=!1,collapsedChange:s=void 0}){const c=E.useLocalizedStrings(),h=E.useNumericRadix(),[S,N]=l.useState(!1);l.useEffect(()=>{r&&r(S)},[S,r]);const[j,F]=l.useState(n);l.useEffect(()=>{F(n)},[n]);const k=l.useCallback(p=>{F(p?"extended":"standard")},[]),M=l.useCallback(p=>{let g=p,v=!1;if(g.length>2&&g.toLowerCase().startsWith("0x")&&(g=g.substring(2),v=!0),g=g.toUpperCase(),j==="extended"){const u=parseInt(g,v?16:h);if(Number.isNaN(u)||u<0||u>536870911)return t(p,j),{val:p,err:!0};g=`${u.toString(h).toUpperCase()}`}else if(j==="standard"){const u=parseInt(g,v?16:h);if(Number.isNaN(u)||u<0||u>2047)return t(p,j),{val:p,err:!0};g=`${u.toString(h).toUpperCase()}`}return t(g,j),{val:p,err:!1}},[j,h,t]),w=l.useCallback(p=>{if(p!==j){let g=!1,v=e;if(p==="standard"){const u=parseInt(v,h);(Number.isNaN(u)||u<0||u>2047)&&(g=!0)}else if(p==="extended"){const u=parseInt(v,h);(Number.isNaN(u)||u<0||u>536870911)&&(g=!0)}t(v,p),N(g)}},[j,e,t,h]),y=l.useMemo(()=>o.jsxs(J,{spacing:4,children:[o.jsx(z,{id:"constant-id",fullWidth:!0,value:e,onBlur:M,error:S,onErrorChange:N,disabled:i}),o.jsx(re,{id:"id-type",label:c.getString("LabelUseExtendedIdentifier"),checked:j==="extended",onChange:p=>{k(p),w(p?"extended":"standard")},disabled:i})]}),[e,j,i,S,c,w,M]);return a?y:o.jsx(Q,{text:c.getString("LabelCanIdentifier"),summary:e,collapsible:b,collapsed:d,collapsedChange:s,children:y})}function lt({frame:e,onFrameChange:n,onErrorsChange:t=void 0,hideSection:r=!1,collapsible:a=!1,collapsed:i=!1,collapsedChange:b=void 0}){var S;const d=E.useNumericRadix(),s=l.useMemo(()=>{var N,j;return((j=(N=e.canFrameFlags)==null?void 0:N.flags)==null?void 0:j.includes(P.CanFrameFlag.CAN_FRAME_FLAG_EXT))===!0?"extended":"standard"},[(S=e.canFrameFlags)==null?void 0:S.flags]),c=l.useMemo(()=>`${(e.id??0).toString(d).toUpperCase()}`,[s,e.id,d]),h=l.useCallback((N,j)=>{var y;let F=e.id??0;F=parseInt(N,d);const k=(y=e.canFrameFlags)!=null&&y.flags?{flags:[...e.canFrameFlags.flags]}:{flags:[]},M=k.flags.indexOf(P.CanFrameFlag.CAN_FRAME_FLAG_STD);M!==-1&&k.flags.splice(M,1);const w=k.flags.indexOf(P.CanFrameFlag.CAN_FRAME_FLAG_EXT);if(w!==-1&&k.flags.splice(w,1),j==="extended"?k.flags.push(P.CanFrameFlag.CAN_FRAME_FLAG_EXT):j==="standard"&&k.flags.push(P.CanFrameFlag.CAN_FRAME_FLAG_STD),F!==e.id||!te(k,e.canFrameFlags)){const p={...e};p.id=F,p.canFrameFlags=k,n(p)}},[e,d,n]);return o.jsx(ye,{canIdentifier:c,canIdentifierType:s,onCanIdentifierChange:h,onErrorsChange:t,hideSection:r,collapsible:a,collapsed:i,collapsedChange:b})}function Ne({canIdentifier:e,identifierGeneratorType:n,minCanIdentifier:t,maxCanIdentifier:r,canIdentifierType:a,onChange:i,onErrorsChange:b=void 0,canIdentifierGeneratorSettingsError:d=void 0,disabled:s=!1,collapsible:c=!1,collapsed:h=!1,collapsedChange:S=void 0,showSelectMessageDialogChange:N,showSignalValuesTable:j}){const F=E.useLocalizedStrings(),k=E.useNumericRadix(),[M,w]=l.useState(!1),[y,p]=l.useState(!1),[g,v]=l.useState(!1),[u,T]=l.useState(a);l.useEffect(()=>{T(a)},[a]);const L=l.useCallback(C=>{T(C?"extended":"standard")},[]),B=l.useCallback(C=>{let f=C,I=!1;if(f.length>2&&f.toLowerCase().startsWith("0x")&&(f=f.substring(2),I=!0),f=f.toUpperCase(),u==="extended"){const x=parseInt(f,I?16:k);if(Number.isNaN(x)||x<0||x>536870911)return i(C,n,t,r,u),{val:C,err:!0};f=`${x.toString(k).toUpperCase()}`}else if(u==="standard"){const x=parseInt(f,I?16:k);if(Number.isNaN(x)||x<0||x>2047)return i(C,n,t,r,u),{val:C,err:!0};f=`${x.toString(k).toUpperCase()}`}return i(f,n,t,r,u),{val:C,err:!1}},[u,n,r,t,k,i]),R=l.useCallback((C,f,I)=>{let x=C,A=-1,Z=!1;if(x.length>2&&x.toLowerCase().startsWith("0x")&&(x=x.substring(2),Z=!0),x=x.toUpperCase(),f==="extended"){if(A=parseInt(x,Z?16:k),Number.isNaN(A)||A<0||A>536870911)return I(C),{val:C,err:!0,id:A};x=`${A.toString(k).toUpperCase()}`}else if(f==="standard"){if(A=parseInt(x,Z?16:k),Number.isNaN(A)||A<0||A>2047)return I(C),{val:C,err:!0,id:A};x=`${A.toString(k).toUpperCase()}`}return I(x),{val:x,err:!1,id:A}},[k]),_=l.useCallback(C=>{const f=R(C,u,x=>i(e,n,x,r,u)),I=R(r,u,()=>{});return!f.err&&!I.err&&(f.id>=I.id?(f.err=!0,p(!0)):p(!1)),{val:f.val,err:f.err}},[e,u,n,r,i,R]),D=l.useCallback(C=>{const f=R(C,u,x=>i(e,n,t,x,u)),I=R(t,u,()=>{});return!I.err&&!f.err&&(I.id>=f.id?(f.err=!0,v(!0)):v(!1)),{val:f.val,err:f.err}},[e,u,n,t,i,R]),W=l.useCallback(C=>{if(C!==u){let f=e;const I=R(t,C,()=>{}),x=R(r,C,()=>{});i(f,n,I.val,x.val,C)}},[u,e,R,t,r,i,n,k]),U=l.useCallback(C=>{let f=e;const I=R(t,u,()=>{}),x=R(r,u,()=>{});j(C==="constant"),i(f,C,I.val,x.val,u)},[u,e,R,t,r,i,n,k]);l.useEffect(()=>{b&&b(n==="constant"&&M||(n==="random"||n==="scan")&&(y||g)),d&&(d.current=n==="constant"&&M||(n==="random"||n==="scan")&&(y||g))},[M,d,n,g,y,b]);const O=he(),$=xe(O);return o.jsx(Q,{text:F.getString("LabelCanIdentifier"),summary:n==="constant"?e:n==="random"?`${F.getString("LabelRandom")} ${t}-${r}`:`${F.getString("LabelScan")} ${t}-${r}`,collapsible:c,collapsed:h,collapsedChange:S,children:o.jsxs(Se,{id:"identifier-radio-group",value:n,onChange:C=>{U(C)},children:[o.jsxs(J,{spacing:4,children:[o.jsx(H,{id:"constant-id-radio",value:"constant",label:F.getString("LabelConstantIdentifier"),sx:{marginLeft:"-11px !important"},disabled:s}),o.jsx(z,{id:"constant-id",fullWidth:!0,value:e,error:M,onErrorChange:w,disabled:s||n!=="constant",required:n==="constant",onBlur:B}),o.jsx(re,{id:"id-type",label:F.getString("LabelUseExtendedIdentifier"),checked:u==="extended",onChange:C=>{L(C),W(C?"extended":"standard")},disabled:s}),o.jsx(pe,{columnItem:O,width:$,children:o.jsx(q,{onClick:()=>N(!0),variant:"outlined",size:"large",children:F.getString("ButtonSelectMessage")})})]}),o.jsxs(J,{spacing:4,children:[o.jsx(H,{id:"random-identifier-radio",value:"random",label:F.getString("LabelRandomIdentifier"),sx:{marginLeft:"-11px !important"},disabled:s}),o.jsx(H,{id:"scan-identifier-radio",value:"scan",label:F.getString("LabelScanIdentifier"),disabled:s}),o.jsx(z,{id:"identifier-min",disabled:s||n!=="random"&&n!=="scan",required:n==="random"||n==="scan",fullWidth:!0,value:t??"",error:y,onErrorChange:p,startAdornment:F.getString("LabelFrom"),onBlur:_,sxStartAdornment:{marginBottom:.8}}),o.jsx(z,{id:"identifier-max",disabled:s||n!=="random"&&n!=="scan",required:n==="random"||n==="scan",fullWidth:!0,value:r??"",error:g,onErrorChange:v,startAdornment:F.getString("LabelTo"),onBlur:D,sxStartAdornment:{marginBottom:.8}})]})]})})}function ot({settings:e,onSettingsChange:n,onErrorsChange:t=void 0,canIdentifierGeneratorSettingsError:r=void 0,disabled:a=!1,collapsible:i=!1,collapsed:b=!1,collapsedChange:d=void 0,showSelectMessageDialogChange:s,showSignalValuesTable:c}){var w,y,p;const h=E.useNumericRadix(),S=l.useMemo(()=>{var g,v,u;return((u=(v=(g=e.frame)==null?void 0:g.canFrameFlags)==null?void 0:v.flags)==null?void 0:u.includes(P.CanFrameFlag.CAN_FRAME_FLAG_EXT))===!0?"extended":"standard"},[(y=(w=e.frame)==null?void 0:w.canFrameFlags)==null?void 0:y.flags]),N=l.useMemo(()=>{var v;return`${(((v=e.frame)==null?void 0:v.id)??0).toString(h).toUpperCase()}`},[h,(p=e.frame)==null?void 0:p.id]),j=l.useMemo(()=>`${(e.identifierMin??0).toString(h).toUpperCase()}`,[h,e.identifierMin]),F=l.useMemo(()=>`${(e.identifierMax??0).toString(h).toUpperCase()}`,[h,e.identifierMax]),k=l.useMemo(()=>e.randomIdentifier===!0?"random":e.scanIdentifier===!0?"scan":"constant",[e.randomIdentifier,e.scanIdentifier]),M=l.useCallback((g,v,u,T,L)=>{var $,C,f,I;const B=L,R=parseInt(g,h),_=(C=($=e.frame)==null?void 0:$.canFrameFlags)!=null&&C.flags?{flags:[...e.frame.canFrameFlags.flags]}:{flags:[]},D=_.flags.indexOf(P.CanFrameFlag.CAN_FRAME_FLAG_STD),W=parseInt(u,h),U=parseInt(T,h),O=_.flags.indexOf(P.CanFrameFlag.CAN_FRAME_FLAG_EXT);if(D!==-1&&_.flags.splice(D,1),O!==-1&&_.flags.splice(O,1),B==="extended"?_.flags.push(P.CanFrameFlag.CAN_FRAME_FLAG_EXT):B==="standard"&&_.flags.push(P.CanFrameFlag.CAN_FRAME_FLAG_STD),R!==((f=e.frame)==null?void 0:f.id)||!te(_,(I=e.frame)==null?void 0:I.canFrameFlags)||v!==k||W!==e.identifierMin||U!==e.identifierMax){const x={...e};x.frame=e.frame?{...e.frame}:P.WriteFrame.fromPartial({id:0,canFrameFlags:{flags:[P.CanFrameFlag.CAN_FRAME_FLAG_STD]},data:Array.from({length:8},()=>0)}),x.frame.id=R,x.frame.canFrameFlags=_,v==="constant"?(x.randomIdentifier=!1,x.scanIdentifier=!1):v==="random"?(x.randomIdentifier=!0,x.scanIdentifier=!1):v==="scan"&&(x.randomIdentifier=!1,x.scanIdentifier=!0),x.identifierMin=W,x.identifierMax=U,n(x)}},[k,h,n,e]);return o.jsx(Ne,{canIdentifier:N,identifierGeneratorType:k,minCanIdentifier:j,maxCanIdentifier:F,canIdentifierType:S,onChange:M,onErrorsChange:t,canIdentifierGeneratorSettingsError:r,disabled:a,collapsible:i,collapsed:b,collapsedChange:d,showSelectMessageDialogChange:s,showSignalValuesTable:c})}function it(e,n,t,r){const[a,i]=l.useState(""),[b,d]=l.useState([]);return l.useEffect(()=>{d(s=>{var h;const c=(h=t==null?void 0:t.sources)==null?void 0:h.filter(S=>{var j,F;const N=(F=(j=r==null?void 0:r.find(k=>{var M;return k.nodeId===((M=S.baseNode)==null?void 0:M.identifier)}))==null?void 0:j.errorStatus)==null?void 0:F.errors;return N===void 0||N===""?S.baseNode&&S.channelSettings&&S.channelSettings.canConfiguration&&(!n||S.channelSettings.canConfiguration.silentMode!==!0):!1}).map(S=>({value:S.channelSettings.channelNumber,displayText:S.baseNode.name,canFdMode:S.channelSettings.canConfiguration.canMode>0,identifier:S.baseNode.identifier}));return!c||te(s,c)?s:c})},[n,t==null?void 0:t.sources,r]),l.useEffect(()=>{const s=b.find(c=>c.identifier===e);i(s?c=>s.value===c?c:s.value:"")},[e,b]),{channelOptions:b,selectedChannelOption:a}}function ut({channelIdentifier:e,onChannelIdentifierChange:n,hideSilentChannels:t=!1,hideSectionControl:r=!1,disabled:a=!1,collapsible:i=!1,collapsed:b=!1,collapsedChange:d=void 0}){var F;const s=E.useMeasurementSetup(),c=E.useMeasurementStatus(),h=E.useLocalizedStrings(),{channelOptions:S,selectedChannelOption:N}=it(e,t===!0,s,c),j=l.useCallback(k=>{const M=S.find(p=>p.value===k),w=(M==null?void 0:M.identifier)??"",y=(M==null?void 0:M.canFdMode)===!0;n(w,y)},[S,n]);return r===!0?o.jsx(ne,{id:"channel",label:h.getString("LabelChannel"),fullWidth:!0,value:N,onChange:j,options:S,required:!0,disabled:a}):o.jsx(Q,{text:h.getString("LabelChannel"),summary:N===""||(F=S.find(k=>k.value===N))==null?void 0:F.displayText,collapsible:i,collapsed:b,collapsedChange:d,children:o.jsx(ne,{id:"channel",label:h.getString("LabelChannel"),fullWidth:!0,value:N,onChange:j,options:S,required:!0,disabled:a})})}const dt=m.styled(m.Box)(()=>({height:"100%",width:"100%",padding:"4px",overflow:"auto"}));exports.CanKingDataProvider=E.CanKingDataProvider;exports.DevicesContext=E.DevicesContext;exports.LocalizedStrings=E.LocalizedStrings;exports.LogMessagesContext=E.LogMessagesContext;exports.MeasurementSetupContext=E.MeasurementSetupContext;exports.MeasurementStatusContext=E.MeasurementStatusContext;exports.OnlineStatusContext=E.OnlineStatusContext;exports.RunningPeriodicTransmissionsContext=E.RunningPeriodicTransmissionsContext;exports.UserSettingsContext=E.UserSettingsContext;exports.WorkspacePanesContext=E.WorkspacePanesContext;exports.addEventListener=E.addEventListener;exports.removeEventListener=E.removeEventListener;exports.CanChannelSelectControl=ut;exports.CanIdentifierControl=ye;exports.CanIdentifierFrameControl=lt;exports.CanIdentifierGeneratorControl=Ne;exports.CanIdentifierGeneratorSettingsControl=ot;exports.CheckboxControl=re;exports.ColumnItemControl=pe;exports.ContextMenu=st;exports.DropdownButton=Ce;exports.DropdownButtonTextItems=On;exports.DropdownPanel=Wn;exports.FillBox=dt;exports.FormControlRow=J;exports.InlineEditor=Kn;exports.NumberRangeControl=qn;exports.OneLineButton=q;exports.RadioControl=H;exports.RadioGroupControl=Se;exports.SectionControl=Q;exports.SelectControl=ne;exports.SizedBox=Jn;exports.TableControl=Zn;exports.TabsPanel=Vn;exports.TextControl=ve;exports.ToolbarControl=at;exports.ValidateableTextControl=z;exports.useColumnItem=he;exports.useColumnItems=xe;
|