@kartverket/backstage-plugin-risk-scorecard 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/components/common/Input.esm.js +25 -32
  2. package/dist/components/common/Input.esm.js.map +1 -1
  3. package/dist/components/common/Markdown.esm.js +15 -2
  4. package/dist/components/common/Markdown.esm.js.map +1 -1
  5. package/dist/components/common/MarkdownInput.esm.js +19 -3
  6. package/dist/components/common/MarkdownInput.esm.js.map +1 -1
  7. package/dist/components/riScDialog/ConfigEncryptionDialog.esm.js +78 -37
  8. package/dist/components/riScDialog/ConfigEncryptionDialog.esm.js.map +1 -1
  9. package/dist/components/riScInfo/riScStatus/DifferenceText.esm.js +45 -81
  10. package/dist/components/riScInfo/riScStatus/DifferenceText.esm.js.map +1 -1
  11. package/dist/components/riScInfo/riScStatus/RiScDifferenceDialog.esm.js +4 -3
  12. package/dist/components/riScInfo/riScStatus/RiScDifferenceDialog.esm.js.map +1 -1
  13. package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js +31 -42
  14. package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js.map +1 -1
  15. package/dist/components/riScInfo/riScStatus/StatusIconWithText.esm.js +25 -0
  16. package/dist/components/riScInfo/riScStatus/StatusIconWithText.esm.js.map +1 -0
  17. package/dist/components/riScPlugin/RiScPlugin.esm.js +2 -2
  18. package/dist/components/riScPlugin/RiScPlugin.esm.js.map +1 -1
  19. package/dist/components/scenarioWizard/steps/ActionsStep.esm.js +3 -5
  20. package/dist/components/scenarioWizard/steps/ActionsStep.esm.js.map +1 -1
  21. package/dist/components/sopsConfigDialog/GcpCryptoKeyMenu.esm.js +19 -7
  22. package/dist/components/sopsConfigDialog/GcpCryptoKeyMenu.esm.js.map +1 -1
  23. package/dist/components/sopsConfigDialog/GcpCryptoKeyMenuItem.esm.js +36 -33
  24. package/dist/components/sopsConfigDialog/GcpCryptoKeyMenuItem.esm.js.map +1 -1
  25. package/dist/utils/style.esm.js +12 -1
  26. package/dist/utils/style.esm.js.map +1 -1
  27. package/dist/utils/types.esm.js +11 -1
  28. package/dist/utils/types.esm.js.map +1 -1
  29. package/package.json +1 -1
@@ -5,41 +5,34 @@ import FormLabel from '@mui/material/FormLabel';
5
5
  import TextField from '@mui/material/TextField';
6
6
  import { forwardRef } from 'react';
7
7
  import { formLabel, formHelperText } from './typography.esm.js';
8
+ import { formControlStyles, commonTextColor } from '../../utils/style.esm.js';
8
9
 
9
10
  const Input = forwardRef(
10
11
  ({ label, sublabel, error, helperText, required, ...props }, ref) => {
11
- return /* @__PURE__ */ jsxs(
12
- FormControl,
13
- {
14
- sx: { width: "100%", gap: "4px" },
15
- error,
16
- required,
17
- children: [
18
- label && /* @__PURE__ */ jsx(FormLabel, { required, sx: formLabel, children: label }),
19
- sublabel && /* @__PURE__ */ jsx(FormHelperText, { sx: formHelperText, children: sublabel }),
20
- /* @__PURE__ */ jsx(
21
- TextField,
22
- {
23
- id: "filled-multiline-static",
24
- error,
25
- multiline: true,
26
- fullWidth: true,
27
- variant: "outlined",
28
- inputRef: ref,
29
- InputProps: {
30
- sx: (theme) => ({
31
- "&.Mui-disabled": {
32
- color: theme.palette.mode === "dark" ? "#FFFFFF80" : "#757575"
33
- }
34
- })
35
- },
36
- ...props
37
- }
38
- ),
39
- helperText && /* @__PURE__ */ jsx(FormHelperText, { children: helperText })
40
- ]
41
- }
42
- );
12
+ return /* @__PURE__ */ jsxs(FormControl, { sx: formControlStyles, error, required, children: [
13
+ label && /* @__PURE__ */ jsx(FormLabel, { required, sx: formLabel, children: label }),
14
+ sublabel && /* @__PURE__ */ jsx(FormHelperText, { sx: formHelperText, children: sublabel }),
15
+ /* @__PURE__ */ jsx(
16
+ TextField,
17
+ {
18
+ id: "filled-multiline-static",
19
+ error,
20
+ multiline: true,
21
+ fullWidth: true,
22
+ variant: "outlined",
23
+ inputRef: ref,
24
+ InputProps: {
25
+ sx: (theme) => ({
26
+ "&.Mui-disabled": {
27
+ color: commonTextColor(theme, true)
28
+ }
29
+ })
30
+ },
31
+ ...props
32
+ }
33
+ ),
34
+ helperText && /* @__PURE__ */ jsx(FormHelperText, { children: helperText })
35
+ ] });
43
36
  }
44
37
  );
45
38
 
@@ -1 +1 @@
1
- {"version":3,"file":"Input.esm.js","sources":["../../../src/components/common/Input.tsx"],"sourcesContent":["import FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport { forwardRef } from 'react';\nimport { formHelperText, formLabel } from './typography';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n};\n\nexport const Input = forwardRef<HTMLInputElement, Props>(\n ({ label, sublabel, error, helperText, required, ...props }, ref) => {\n return (\n <FormControl\n sx={{ width: '100%', gap: '4px' }}\n error={error}\n required={required}\n >\n {label && (\n <FormLabel required={required} sx={formLabel}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <TextField\n id=\"filled-multiline-static\"\n error={error}\n multiline\n fullWidth\n variant=\"outlined\"\n inputRef={ref}\n InputProps={{\n sx: theme => ({\n '&.Mui-disabled': {\n color: theme.palette.mode === 'dark' ? '#FFFFFF80' : '#757575',\n },\n }),\n }}\n {...props}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;AAWO,MAAM,KAAQ,GAAA,UAAA;AAAA,EACnB,CAAC,EAAE,KAAA,EAAO,QAAU,EAAA,KAAA,EAAO,YAAY,QAAU,EAAA,GAAG,KAAM,EAAA,EAAG,GAAQ,KAAA;AACnE,IACE,uBAAA,IAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA,EAAE,KAAO,EAAA,MAAA,EAAQ,KAAK,KAAM,EAAA;AAAA,QAChC,KAAA;AAAA,QACA,QAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA,oBACE,GAAA,CAAA,SAAA,EAAA,EAAU,QAAoB,EAAA,EAAA,EAAI,WAChC,QACH,EAAA,KAAA,EAAA,CAAA;AAAA,UAED,QACC,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,EAAA,EAAI,gBAAiB,QAAS,EAAA,QAAA,EAAA,CAAA;AAAA,0BAEhD,GAAA;AAAA,YAAC,SAAA;AAAA,YAAA;AAAA,cACC,EAAG,EAAA,yBAAA;AAAA,cACH,KAAA;AAAA,cACA,SAAS,EAAA,IAAA;AAAA,cACT,SAAS,EAAA,IAAA;AAAA,cACT,OAAQ,EAAA,UAAA;AAAA,cACR,QAAU,EAAA,GAAA;AAAA,cACV,UAAY,EAAA;AAAA,gBACV,IAAI,CAAU,KAAA,MAAA;AAAA,kBACZ,gBAAkB,EAAA;AAAA,oBAChB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,SAAS,WAAc,GAAA;AAAA;AACvD,iBACF;AAAA,eACF;AAAA,cACC,GAAG;AAAA;AAAA,WACN;AAAA,UACC,UAAA,oBAAe,GAAA,CAAA,cAAA,EAAA,EAAgB,QAAW,EAAA,UAAA,EAAA;AAAA;AAAA;AAAA,KAC7C;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"Input.esm.js","sources":["../../../src/components/common/Input.tsx"],"sourcesContent":["import FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport { forwardRef } from 'react';\nimport { formHelperText, formLabel } from './typography';\nimport { commonTextColor, formControlStyles } from '../../utils/style';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n};\n\nexport const Input = forwardRef<HTMLInputElement, Props>(\n ({ label, sublabel, error, helperText, required, ...props }, ref) => {\n return (\n <FormControl sx={formControlStyles} error={error} required={required}>\n {label && (\n <FormLabel required={required} sx={formLabel}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <TextField\n id=\"filled-multiline-static\"\n error={error}\n multiline\n fullWidth\n variant=\"outlined\"\n inputRef={ref}\n InputProps={{\n sx: theme => ({\n '&.Mui-disabled': {\n color: commonTextColor(theme, true),\n },\n }),\n }}\n {...props}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAYO,MAAM,KAAQ,GAAA,UAAA;AAAA,EACnB,CAAC,EAAE,KAAA,EAAO,QAAU,EAAA,KAAA,EAAO,YAAY,QAAU,EAAA,GAAG,KAAM,EAAA,EAAG,GAAQ,KAAA;AACnE,IAAA,uBACG,IAAA,CAAA,WAAA,EAAA,EAAY,EAAI,EAAA,iBAAA,EAAmB,OAAc,QAC/C,EAAA,QAAA,EAAA;AAAA,MAAA,KAAA,oBACE,GAAA,CAAA,SAAA,EAAA,EAAU,QAAoB,EAAA,EAAA,EAAI,WAChC,QACH,EAAA,KAAA,EAAA,CAAA;AAAA,MAED,QACC,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,EAAA,EAAI,gBAAiB,QAAS,EAAA,QAAA,EAAA,CAAA;AAAA,sBAEhD,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,EAAG,EAAA,yBAAA;AAAA,UACH,KAAA;AAAA,UACA,SAAS,EAAA,IAAA;AAAA,UACT,SAAS,EAAA,IAAA;AAAA,UACT,OAAQ,EAAA,UAAA;AAAA,UACR,QAAU,EAAA,GAAA;AAAA,UACV,UAAY,EAAA;AAAA,YACV,IAAI,CAAU,KAAA,MAAA;AAAA,cACZ,gBAAkB,EAAA;AAAA,gBAChB,KAAA,EAAO,eAAgB,CAAA,KAAA,EAAO,IAAI;AAAA;AACpC,aACF;AAAA,WACF;AAAA,UACC,GAAG;AAAA;AAAA,OACN;AAAA,MACC,UAAA,oBAAe,GAAA,CAAA,cAAA,EAAA,EAAgB,QAAW,EAAA,UAAA,EAAA;AAAA,KAC7C,EAAA,CAAA;AAAA;AAGN;;;;"}
@@ -1,11 +1,24 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Typography from '@mui/material/Typography';
3
3
  import ReactMarkdown from 'react-markdown';
4
+ import { useTheme } from '@mui/material/styles';
4
5
  import 'github-markdown-css/github-markdown.css';
5
6
  import remarkBreaks from 'remark-breaks';
7
+ import { commonBackgroundColor, commonTextColor } from '../../utils/style.esm.js';
6
8
 
7
- function Markdown({ description }) {
8
- return /* @__PURE__ */ jsx(Typography, { className: "markdown-body", children: /* @__PURE__ */ jsx(ReactMarkdown, { remarkPlugins: [remarkBreaks], children: description }) });
9
+ function Markdown({ description, disabled = false }) {
10
+ const theme = useTheme();
11
+ return /* @__PURE__ */ jsx(
12
+ Typography,
13
+ {
14
+ className: "markdown-body",
15
+ sx: {
16
+ color: commonTextColor(theme, disabled),
17
+ backgroundColor: commonBackgroundColor(theme, disabled)
18
+ },
19
+ children: /* @__PURE__ */ jsx(ReactMarkdown, { remarkPlugins: [remarkBreaks], children: description })
20
+ }
21
+ );
9
22
  }
10
23
 
11
24
  export { Markdown };
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.esm.js","sources":["../../../src/components/common/Markdown.tsx"],"sourcesContent":["import Typography from '@mui/material/Typography';\nimport ReactMarkdown from 'react-markdown';\nimport 'github-markdown-css/github-markdown.css';\nimport remarkBreaks from 'remark-breaks';\n\ntype Props = {\n description: string;\n};\n\nexport function Markdown({ description }: Props) {\n return (\n <Typography className=\"markdown-body\">\n <ReactMarkdown remarkPlugins={[remarkBreaks]}>\n {description}\n </ReactMarkdown>\n </Typography>\n );\n}\n"],"names":[],"mappings":";;;;;;AASgB,SAAA,QAAA,CAAS,EAAE,WAAA,EAAsB,EAAA;AAC/C,EACE,uBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,eACpB,EAAA,QAAA,kBAAA,GAAA,CAAC,aAAc,EAAA,EAAA,aAAA,EAAe,CAAC,YAAY,CACxC,EAAA,QAAA,EAAA,WAAA,EACH,CACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Markdown.esm.js","sources":["../../../src/components/common/Markdown.tsx"],"sourcesContent":["import Typography from '@mui/material/Typography';\nimport ReactMarkdown from 'react-markdown';\nimport { useTheme } from '@mui/material/styles';\nimport 'github-markdown-css/github-markdown.css';\nimport remarkBreaks from 'remark-breaks';\nimport { commonTextColor, commonBackgroundColor } from '../../utils/style';\n\ntype Props = {\n description: string;\n disabled?: boolean;\n};\n\nexport function Markdown({ description, disabled = false }: Props) {\n const theme = useTheme();\n\n return (\n <Typography\n className=\"markdown-body\"\n sx={{\n color: commonTextColor(theme, disabled),\n backgroundColor: commonBackgroundColor(theme, disabled),\n }}\n >\n <ReactMarkdown remarkPlugins={[remarkBreaks]}>\n {description}\n </ReactMarkdown>\n </Typography>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAYO,SAAS,QAAS,CAAA,EAAE,WAAa,EAAA,QAAA,GAAW,OAAgB,EAAA;AACjE,EAAA,MAAM,QAAQ,QAAS,EAAA;AAEvB,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,SAAU,EAAA,eAAA;AAAA,MACV,EAAI,EAAA;AAAA,QACF,KAAA,EAAO,eAAgB,CAAA,KAAA,EAAO,QAAQ,CAAA;AAAA,QACtC,eAAA,EAAiB,qBAAsB,CAAA,KAAA,EAAO,QAAQ;AAAA,OACxD;AAAA,MAEA,8BAAC,aAAc,EAAA,EAAA,aAAA,EAAe,CAAC,YAAY,GACxC,QACH,EAAA,WAAA,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -5,12 +5,24 @@ import FormHelperText from '@mui/material/FormHelperText';
5
5
  import FormLabel from '@mui/material/FormLabel';
6
6
  import MDEditor from '@uiw/react-md-editor';
7
7
  import { formLabel, formHelperText } from './typography.esm.js';
8
+ import { useTheme } from '@mui/material/styles';
9
+ import { formControlStyles, commonBackgroundColor, commonTextColor } from '../../utils/style.esm.js';
8
10
 
9
11
  const MarkdownInput = forwardRef(
10
- ({ label, sublabel, error, helperText, minRows, value, onMarkdownChange }, ref) => {
12
+ ({
13
+ label,
14
+ sublabel,
15
+ error,
16
+ helperText,
17
+ minRows,
18
+ value,
19
+ onMarkdownChange,
20
+ disabled = false
21
+ }, ref) => {
11
22
  const [markdownContent, setMarkdownContent] = useState(
12
23
  value
13
24
  );
25
+ const theme = useTheme();
14
26
  useEffect(() => {
15
27
  setMarkdownContent(value);
16
28
  }, [value]);
@@ -18,7 +30,7 @@ const MarkdownInput = forwardRef(
18
30
  setMarkdownContent(newValue || "");
19
31
  onMarkdownChange?.(newValue || "");
20
32
  };
21
- return /* @__PURE__ */ jsxs(FormControl, { sx: { width: "100%", gap: "4px" }, error, children: [
33
+ return /* @__PURE__ */ jsxs(FormControl, { sx: formControlStyles, error, children: [
22
34
  label && /* @__PURE__ */ jsx(FormLabel, { sx: formLabel, children: label }),
23
35
  sublabel && /* @__PURE__ */ jsx(FormHelperText, { sx: formHelperText, children: sublabel }),
24
36
  /* @__PURE__ */ jsx(
@@ -28,7 +40,11 @@ const MarkdownInput = forwardRef(
28
40
  value: markdownContent,
29
41
  onChange: handleMarkdownChange,
30
42
  preview: "edit",
31
- height: minRows ? minRows * 24 : 64
43
+ height: minRows ? minRows * 24 : 64,
44
+ style: {
45
+ color: commonTextColor(theme, disabled),
46
+ backgroundColor: commonBackgroundColor(theme, disabled)
47
+ }
32
48
  }
33
49
  ),
34
50
  helperText && /* @__PURE__ */ jsx(FormHelperText, { children: helperText })
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownInput.esm.js","sources":["../../../src/components/common/MarkdownInput.tsx"],"sourcesContent":["import { forwardRef, useState, useEffect } from 'react';\nimport FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport MDEditor from '@uiw/react-md-editor';\nimport { formHelperText, formLabel } from './typography';\nimport { TextFieldProps } from '@material-ui/core';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n value?: string;\n onMarkdownChange?: (markdown: string) => void;\n minRows?: number;\n};\n\nexport const MarkdownInput = forwardRef<HTMLDivElement, Props>(\n (\n { label, sublabel, error, helperText, minRows, value, onMarkdownChange },\n ref,\n ) => {\n const [markdownContent, setMarkdownContent] = useState<string | undefined>(\n value,\n );\n\n useEffect(() => {\n setMarkdownContent(value);\n }, [value]);\n\n const handleMarkdownChange = (newValue: string | undefined) => {\n setMarkdownContent(newValue || '');\n onMarkdownChange?.(newValue || '');\n };\n\n return (\n <FormControl sx={{ width: '100%', gap: '4px' }} error={error}>\n {label && <FormLabel sx={formLabel}>{label}</FormLabel>}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <MDEditor\n ref={ref}\n value={markdownContent}\n onChange={handleMarkdownChange}\n preview=\"edit\"\n height={minRows ? minRows * 24 : 64}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,aAAgB,GAAA,UAAA;AAAA,EAC3B,CACE,EAAE,KAAA,EAAO,QAAU,EAAA,KAAA,EAAO,YAAY,OAAS,EAAA,KAAA,EAAO,gBAAiB,EAAA,EACvE,GACG,KAAA;AACH,IAAM,MAAA,CAAC,eAAiB,EAAA,kBAAkB,CAAI,GAAA,QAAA;AAAA,MAC5C;AAAA,KACF;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,kBAAA,CAAmB,KAAK,CAAA;AAAA,KAC1B,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,IAAM,MAAA,oBAAA,GAAuB,CAAC,QAAiC,KAAA;AAC7D,MAAA,kBAAA,CAAmB,YAAY,EAAE,CAAA;AACjC,MAAA,gBAAA,GAAmB,YAAY,EAAE,CAAA;AAAA,KACnC;AAEA,IACE,uBAAA,IAAA,CAAC,eAAY,EAAI,EAAA,EAAE,OAAO,MAAQ,EAAA,GAAA,EAAK,KAAM,EAAA,EAAG,KAC7C,EAAA,QAAA,EAAA;AAAA,MAAA,KAAA,oBAAU,GAAA,CAAA,SAAA,EAAA,EAAU,EAAI,EAAA,SAAA,EAAY,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,MAC1C,QACC,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,EAAA,EAAI,gBAAiB,QAAS,EAAA,QAAA,EAAA,CAAA;AAAA,sBAEhD,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,GAAA;AAAA,UACA,KAAO,EAAA,eAAA;AAAA,UACP,QAAU,EAAA,oBAAA;AAAA,UACV,OAAQ,EAAA,MAAA;AAAA,UACR,MAAA,EAAQ,OAAU,GAAA,OAAA,GAAU,EAAK,GAAA;AAAA;AAAA,OACnC;AAAA,MACC,UAAA,oBAAe,GAAA,CAAA,cAAA,EAAA,EAAgB,QAAW,EAAA,UAAA,EAAA;AAAA,KAC7C,EAAA,CAAA;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"MarkdownInput.esm.js","sources":["../../../src/components/common/MarkdownInput.tsx"],"sourcesContent":["import { forwardRef, useState, useEffect } from 'react';\nimport FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport MDEditor from '@uiw/react-md-editor';\nimport { formHelperText, formLabel } from './typography';\nimport { TextFieldProps } from '@material-ui/core';\nimport { useTheme } from '@mui/material/styles';\nimport {\n commonTextColor,\n commonBackgroundColor,\n formControlStyles,\n} from '../../utils/style';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n value?: string;\n onMarkdownChange?: (markdown: string) => void;\n minRows?: number;\n};\n\nexport const MarkdownInput = forwardRef<HTMLDivElement, Props>(\n (\n {\n label,\n sublabel,\n error,\n helperText,\n minRows,\n value,\n onMarkdownChange,\n disabled = false,\n },\n ref,\n ) => {\n const [markdownContent, setMarkdownContent] = useState<string | undefined>(\n value,\n );\n\n const theme = useTheme();\n\n useEffect(() => {\n setMarkdownContent(value);\n }, [value]);\n\n const handleMarkdownChange = (newValue: string | undefined) => {\n setMarkdownContent(newValue || '');\n onMarkdownChange?.(newValue || '');\n };\n\n return (\n <FormControl sx={formControlStyles} error={error}>\n {label && <FormLabel sx={formLabel}>{label}</FormLabel>}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <MDEditor\n ref={ref}\n value={markdownContent}\n onChange={handleMarkdownChange}\n preview=\"edit\"\n height={minRows ? minRows * 24 : 64}\n style={{\n color: commonTextColor(theme, disabled),\n backgroundColor: commonBackgroundColor(theme, disabled),\n }}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;AAqBO,MAAM,aAAgB,GAAA,UAAA;AAAA,EAC3B,CACE;AAAA,IACE,KAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,gBAAA;AAAA,IACA,QAAW,GAAA;AAAA,KAEb,GACG,KAAA;AACH,IAAM,MAAA,CAAC,eAAiB,EAAA,kBAAkB,CAAI,GAAA,QAAA;AAAA,MAC5C;AAAA,KACF;AAEA,IAAA,MAAM,QAAQ,QAAS,EAAA;AAEvB,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,kBAAA,CAAmB,KAAK,CAAA;AAAA,KAC1B,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,IAAM,MAAA,oBAAA,GAAuB,CAAC,QAAiC,KAAA;AAC7D,MAAA,kBAAA,CAAmB,YAAY,EAAE,CAAA;AACjC,MAAA,gBAAA,GAAmB,YAAY,EAAE,CAAA;AAAA,KACnC;AAEA,IAAA,uBACG,IAAA,CAAA,WAAA,EAAA,EAAY,EAAI,EAAA,iBAAA,EAAmB,KACjC,EAAA,QAAA,EAAA;AAAA,MAAA,KAAA,oBAAU,GAAA,CAAA,SAAA,EAAA,EAAU,EAAI,EAAA,SAAA,EAAY,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,MAC1C,QACC,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,EAAA,EAAI,gBAAiB,QAAS,EAAA,QAAA,EAAA,CAAA;AAAA,sBAEhD,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,GAAA;AAAA,UACA,KAAO,EAAA,eAAA;AAAA,UACP,QAAU,EAAA,oBAAA;AAAA,UACV,OAAQ,EAAA,MAAA;AAAA,UACR,MAAA,EAAQ,OAAU,GAAA,OAAA,GAAU,EAAK,GAAA,EAAA;AAAA,UACjC,KAAO,EAAA;AAAA,YACL,KAAA,EAAO,eAAgB,CAAA,KAAA,EAAO,QAAQ,CAAA;AAAA,YACtC,eAAA,EAAiB,qBAAsB,CAAA,KAAA,EAAO,QAAQ;AAAA;AACxD;AAAA,OACF;AAAA,MACC,UAAA,oBAAe,GAAA,CAAA,cAAA,EAAA,EAAgB,QAAW,EAAA,UAAA,EAAA;AAAA,KAC7C,EAAA,CAAA;AAAA;AAGN;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { Box, DialogContentText, Typography, Accordion, AccordionSummary, AccordionDetails, FormLabel, List, ListItem, ListItemText, ListItemSecondaryAction, IconButton, Link, TextField, Button } from '@mui/material';
2
+ import { Box, DialogContentText, Typography, Accordion, AccordionSummary, AccordionDetails, FormLabel, List, ListItem, ListItemText, ListItemSecondaryAction, IconButton, Link, Button, TextField } from '@mui/material';
3
3
  import { GcpCryptoKeyMenu } from '../sopsConfigDialog/GcpCryptoKeyMenu.esm.js';
4
4
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
5
  import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
@@ -49,6 +49,10 @@ function ConfigEncryptionDialog({
49
49
  }
50
50
  return gcpCryptoKeys[0];
51
51
  });
52
+ const [isAddPublicAgeKeyVisible, setIsAddPublicAgeKeyVisible] = useState(false);
53
+ function showAddPublicAgeKey() {
54
+ setIsAddPublicAgeKeyVisible(true);
55
+ }
52
56
  useEffect(() => {
53
57
  setValue("sopsConfig", {
54
58
  shamir_threshold: 2,
@@ -112,20 +116,31 @@ function ConfigEncryptionDialog({
112
116
  ),
113
117
  /* @__PURE__ */ jsx(AccordionDetails, { children: /* @__PURE__ */ jsxs(Box, { children: [
114
118
  publicAgeKeys.length > 0 && /* @__PURE__ */ jsx(FormLabel, { children: t("sopsConfigDialog.publicAgeKeysAlreadyPresent") }),
115
- /* @__PURE__ */ jsx(List, { children: publicAgeKeys.map((key) => /* @__PURE__ */ jsxs(ListItem, { dense: true, children: [
116
- /* @__PURE__ */ jsx(ListItemText, { children: key }),
117
- /* @__PURE__ */ jsx(ListItemSecondaryAction, { children: /* @__PURE__ */ jsx(
118
- IconButton,
119
- {
120
- onClick: () => {
121
- setPublicAgeKeys(
122
- publicAgeKeys.filter((k) => k !== key)
123
- );
124
- },
125
- children: /* @__PURE__ */ jsx(DeleteIcon, {})
126
- }
127
- ) })
128
- ] }, key)) }),
119
+ publicAgeKeys.length > 0 && /* @__PURE__ */ jsx(
120
+ Box,
121
+ {
122
+ sx: {
123
+ border: "1px solid",
124
+ borderColor: (theme) => theme.palette.mode === "dark" ? "white" : "grey.300",
125
+ borderRadius: "4px",
126
+ marginBottom: 2
127
+ },
128
+ children: /* @__PURE__ */ jsx(List, { children: publicAgeKeys.map((key) => /* @__PURE__ */ jsxs(ListItem, { dense: true, children: [
129
+ /* @__PURE__ */ jsx(ListItemText, { children: key }),
130
+ /* @__PURE__ */ jsx(ListItemSecondaryAction, { children: /* @__PURE__ */ jsx(
131
+ IconButton,
132
+ {
133
+ onClick: () => {
134
+ setPublicAgeKeys(
135
+ publicAgeKeys.filter((k) => k !== key)
136
+ );
137
+ },
138
+ children: /* @__PURE__ */ jsx(DeleteIcon, {})
139
+ }
140
+ ) })
141
+ ] }, key)) })
142
+ }
143
+ ),
129
144
  /* @__PURE__ */ jsxs(Typography, { children: [
130
145
  t("dictionary.click"),
131
146
  " ",
@@ -153,41 +168,67 @@ function ConfigEncryptionDialog({
153
168
  display: "flex",
154
169
  flexDirection: "column",
155
170
  alignItems: "space-between",
156
- gap: 2
171
+ gap: 2,
172
+ marginTop: 2
157
173
  },
158
174
  children: [
159
- /* @__PURE__ */ jsx(
160
- TextField,
161
- {
162
- label: t("sopsConfigDialog.publicAgeKey"),
163
- helperText: publicAgeKeyHelperText,
164
- error: publicAgeKeyError,
165
- onKeyDown: (e) => {
166
- if (e.key === "Enter") {
167
- handleAddPublicAgeKey();
168
- }
169
- },
170
- onFocus: () => {
171
- setPublicKeyTextFieldError(false);
172
- setPublicKeyTextFieldHelperText("");
173
- },
174
- value: newPublicAgeKey,
175
- onChange: (e) => setNewPublicAgeKey(e.target.value)
176
- }
177
- ),
178
- /* @__PURE__ */ jsx(
175
+ !isAddPublicAgeKeyVisible && /* @__PURE__ */ jsx(
179
176
  Button,
180
177
  {
181
178
  startIcon: /* @__PURE__ */ jsx(AddCircle, {}),
182
179
  variant: "text",
183
180
  color: "primary",
184
- onClick: handleAddPublicAgeKey,
181
+ onClick: showAddPublicAgeKey,
185
182
  sx: {
186
183
  maxWidth: 200,
187
184
  mt: 1
188
185
  },
189
186
  children: t("sopsConfigDialog.addPublicAgeKey")
190
187
  }
188
+ ),
189
+ isAddPublicAgeKeyVisible && /* @__PURE__ */ jsxs(
190
+ Box,
191
+ {
192
+ sx: {
193
+ display: "flex",
194
+ alignItems: "center",
195
+ gap: 1
196
+ },
197
+ children: [
198
+ /* @__PURE__ */ jsx(
199
+ TextField,
200
+ {
201
+ label: t("sopsConfigDialog.publicAgeKey"),
202
+ helperText: publicAgeKeyHelperText,
203
+ error: publicAgeKeyError,
204
+ onKeyDown: (e) => {
205
+ if (e.key === "Enter") {
206
+ handleAddPublicAgeKey();
207
+ }
208
+ },
209
+ onFocus: () => {
210
+ setPublicKeyTextFieldError(false);
211
+ setPublicKeyTextFieldHelperText("");
212
+ },
213
+ value: newPublicAgeKey,
214
+ onChange: (e) => setNewPublicAgeKey(e.target.value),
215
+ sx: { flex: 1 }
216
+ }
217
+ ),
218
+ /* @__PURE__ */ jsx(
219
+ Button,
220
+ {
221
+ variant: "contained",
222
+ color: "primary",
223
+ onClick: handleAddPublicAgeKey,
224
+ sx: {
225
+ maxWidth: 200
226
+ },
227
+ children: t("sopsConfigDialog.addPublicAgeKey")
228
+ }
229
+ )
230
+ ]
231
+ }
191
232
  )
192
233
  ]
193
234
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigEncryptionDialog.esm.js","sources":["../../../src/components/riScDialog/ConfigEncryptionDialog.tsx"],"sourcesContent":["import {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Box,\n Button,\n DialogContentText,\n FormLabel,\n IconButton,\n Link,\n List,\n ListItem,\n ListItemSecondaryAction,\n ListItemText,\n TextField,\n Typography,\n} from '@mui/material';\nimport { GcpCryptoKeyMenu } from '../sopsConfigDialog/GcpCryptoKeyMenu';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { AddCircle, ExpandMore } from '@mui/icons-material';\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport { GcpCryptoKeyObject, SopsConfigDTO } from '../../utils/DTOs';\nimport { useEffect, useState } from 'react';\nimport { RiScWithMetadata } from '../../utils/types';\nimport { UseFormRegister, UseFormSetValue } from 'react-hook-form';\nimport { RiScDialogStates } from './RiScDialog';\nimport { isPublicAgeKeyValid } from '../../utils/utilityfunctions';\nimport { FieldErrors } from 'react-hook-form/dist/types/errors';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport { URLS } from '../../urls';\n\ninterface ConfigEncryptionDialogProps {\n gcpCryptoKeys: GcpCryptoKeyObject[];\n sopsData?: SopsConfigDTO;\n setValue: UseFormSetValue<RiScWithMetadata>;\n register: UseFormRegister<RiScWithMetadata>;\n errors: FieldErrors<RiScWithMetadata>;\n state: RiScDialogStates;\n}\n\nfunction ConfigEncryptionDialog({\n gcpCryptoKeys,\n sopsData,\n setValue,\n register,\n errors,\n state,\n}: ConfigEncryptionDialogProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const [publicAgeKeyHelperText, setPublicKeyTextFieldHelperText] =\n useState('');\n const [publicAgeKeyError, setPublicKeyTextFieldError] = useState(false);\n const [newPublicAgeKey, setNewPublicAgeKey] = useState('');\n const [publicAgeKeys, setPublicAgeKeys] = useState<string[]>(() => {\n if (sopsData?.age) {\n return sopsData.age.map(age => age.recipient);\n }\n return [];\n });\n\n const [chosenGcpCryptoKey, setChosenGcpCryptoKey] =\n useState<GcpCryptoKeyObject>(() => {\n if (state === RiScDialogStates.EditEncryption && sopsData?.gcp_kms) {\n const gcpKms = sopsData.gcp_kms[0];\n if (gcpKms?.resource_id) {\n const resourceParts = gcpKms.resource_id.split('/');\n if (resourceParts.length === 8) {\n return {\n projectId: resourceParts[1],\n keyRing: resourceParts[5],\n keyName: resourceParts[7],\n locations: resourceParts[3],\n resourceId: gcpKms.resource_id,\n createdAt: gcpKms.created_at,\n hasEncryptDecryptAccess: true,\n };\n }\n }\n }\n return gcpCryptoKeys[0];\n });\n\n useEffect(() => {\n setValue('sopsConfig', {\n shamir_threshold: 2,\n gcp_kms: chosenGcpCryptoKey\n ? [\n {\n resource_id: chosenGcpCryptoKey.resourceId,\n created_at: chosenGcpCryptoKey.createdAt,\n },\n ]\n : [],\n age: publicAgeKeys.map(key => ({ recipient: key })),\n });\n }, [chosenGcpCryptoKey, publicAgeKeys, setValue]);\n\n // Require one key group to contain a GCP key\n register('sopsConfig.gcp_kms', {\n validate: gcpKeys => gcpKeys.length > 0,\n });\n\n function handleChangeGcpCryptoKey(newKey: GcpCryptoKeyObject) {\n setChosenGcpCryptoKey(newKey);\n }\n\n function handleAddPublicAgeKey() {\n if (isPublicAgeKeyValid(newPublicAgeKey)) {\n if (publicAgeKeys.includes(newPublicAgeKey)) {\n setPublicKeyTextFieldHelperText(\n t('sopsConfigDialog.publicKeyHelperTextKeyAlreadyExistInSopsConfig'),\n );\n setPublicKeyTextFieldError(true);\n } else {\n setPublicAgeKeys([...publicAgeKeys, newPublicAgeKey]);\n setNewPublicAgeKey('');\n }\n } else {\n setPublicKeyTextFieldHelperText(\n t('sopsConfigDialog.publicKeyHelperTextKeyNotValid'),\n );\n setPublicKeyTextFieldError(true);\n }\n }\n\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n <DialogContentText>\n {state === RiScDialogStates.Create\n ? t('sopsConfigDialog.description.new')\n : t('sopsConfigDialog.description.edit')}\n </DialogContentText>\n <Typography variant=\"subtitle2\">\n {t('sopsConfigDialog.selectKeysTitle')}\n </Typography>\n\n {chosenGcpCryptoKey !== undefined ? (\n <>\n {t('sopsConfigDialog.gcpCryptoKeyDescription')}\n <GcpCryptoKeyMenu\n chosenGcpCryptoKey={chosenGcpCryptoKey}\n onChange={handleChangeGcpCryptoKey}\n gcpCryptoKeys={\n gcpCryptoKeys.includes(chosenGcpCryptoKey)\n ? gcpCryptoKeys\n : [...gcpCryptoKeys, chosenGcpCryptoKey]\n }\n />\n </>\n ) : (\n <Typography variant=\"body1\">\n {t('sopsConfigDialog.gcpCryptoKeyNoSelectableKey')}\n </Typography>\n )}\n {errors.sopsConfig !== undefined && (\n <FormHelperText error={true}>\n {t('sopsConfigDialog.gcpCryptoKeyNonSelectedErrorMessage')}\n </FormHelperText>\n )}\n <Box>\n <Accordion elevation={1} defaultExpanded={publicAgeKeys.length > 0}>\n <AccordionSummary\n expandIcon={<ExpandMore />}\n aria-controls=\"panel1-content\"\n id=\"panel1-header\"\n >\n {t('sopsConfigDialog.publicAgeKeyQuestion')}\n </AccordionSummary>\n <AccordionDetails>\n <Box>\n {publicAgeKeys.length > 0 && (\n <FormLabel>\n {t('sopsConfigDialog.publicAgeKeysAlreadyPresent')}\n </FormLabel>\n )}\n <List>\n {publicAgeKeys.map(key => (\n <ListItem key={key} dense>\n <ListItemText>{key}</ListItemText>\n <ListItemSecondaryAction>\n <IconButton\n onClick={() => {\n setPublicAgeKeys(\n publicAgeKeys.filter(k => k !== key),\n );\n }}\n >\n <DeleteIcon />\n </IconButton>\n </ListItemSecondaryAction>\n </ListItem>\n ))}\n </List>\n <Typography>\n {t('dictionary.click')}{' '}\n <Link\n href={\n URLS.external.kartverket_atlassian_net__write_ros_locally\n }\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n color=\"primary\"\n underline=\"hover\"\n >\n {t('dictionary.here')}\n </Link>{' '}\n {t('sopsConfigDialog.writeLocalRiscSuffix')}\n </Typography>\n <Typography>\n {`${t('sopsConfigDialog.publicAgeKeyDescription')} (${t(\n 'dictionary.optional',\n )})`}\n </Typography>\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'space-between',\n gap: 2,\n }}\n >\n <TextField\n label={t('sopsConfigDialog.publicAgeKey')}\n helperText={publicAgeKeyHelperText}\n error={publicAgeKeyError}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n handleAddPublicAgeKey();\n }\n }}\n onFocus={() => {\n setPublicKeyTextFieldError(false);\n setPublicKeyTextFieldHelperText('');\n }}\n value={newPublicAgeKey}\n onChange={e => setNewPublicAgeKey(e.target.value)}\n />\n <Button\n startIcon={<AddCircle />}\n variant=\"text\"\n color=\"primary\"\n onClick={handleAddPublicAgeKey}\n sx={{\n maxWidth: 200,\n mt: 1,\n }}\n >\n {t('sopsConfigDialog.addPublicAgeKey')}\n </Button>\n </Box>\n </Box>\n </AccordionDetails>\n </Accordion>\n </Box>\n </Box>\n );\n}\n\nexport default ConfigEncryptionDialog;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyCA,SAAS,sBAAuB,CAAA;AAAA,EAC9B,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,oBACF,QAAU,EAAA,GAAA;AAAA,oBACV,EAAI,EAAA;AAAA,mBACN;AAAA,kBAEC,YAAE,kCAAkC;AAAA;AAAA;AACvC;AAAA;AAAA;AACF,OAAA,EACF,CACF,EAAA;AAAA,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ConfigEncryptionDialog.esm.js","sources":["../../../src/components/riScDialog/ConfigEncryptionDialog.tsx"],"sourcesContent":["import {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Box,\n Button,\n DialogContentText,\n FormLabel,\n IconButton,\n Link,\n List,\n ListItem,\n ListItemSecondaryAction,\n ListItemText,\n TextField,\n Typography,\n} from '@mui/material';\nimport { GcpCryptoKeyMenu } from '../sopsConfigDialog/GcpCryptoKeyMenu';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { AddCircle, ExpandMore } from '@mui/icons-material';\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport { GcpCryptoKeyObject, SopsConfigDTO } from '../../utils/DTOs';\nimport { useEffect, useState } from 'react';\nimport { RiScWithMetadata } from '../../utils/types';\nimport { UseFormRegister, UseFormSetValue } from 'react-hook-form';\nimport { RiScDialogStates } from './RiScDialog';\nimport { isPublicAgeKeyValid } from '../../utils/utilityfunctions';\nimport { FieldErrors } from 'react-hook-form/dist/types/errors';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport { URLS } from '../../urls';\n\ninterface ConfigEncryptionDialogProps {\n gcpCryptoKeys: GcpCryptoKeyObject[];\n sopsData?: SopsConfigDTO;\n setValue: UseFormSetValue<RiScWithMetadata>;\n register: UseFormRegister<RiScWithMetadata>;\n errors: FieldErrors<RiScWithMetadata>;\n state: RiScDialogStates;\n}\n\nfunction ConfigEncryptionDialog({\n gcpCryptoKeys,\n sopsData,\n setValue,\n register,\n errors,\n state,\n}: ConfigEncryptionDialogProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const [publicAgeKeyHelperText, setPublicKeyTextFieldHelperText] =\n useState('');\n const [publicAgeKeyError, setPublicKeyTextFieldError] = useState(false);\n const [newPublicAgeKey, setNewPublicAgeKey] = useState('');\n const [publicAgeKeys, setPublicAgeKeys] = useState<string[]>(() => {\n if (sopsData?.age) {\n return sopsData.age.map(age => age.recipient);\n }\n return [];\n });\n\n const [chosenGcpCryptoKey, setChosenGcpCryptoKey] =\n useState<GcpCryptoKeyObject>(() => {\n if (state === RiScDialogStates.EditEncryption && sopsData?.gcp_kms) {\n const gcpKms = sopsData.gcp_kms[0];\n if (gcpKms?.resource_id) {\n const resourceParts = gcpKms.resource_id.split('/');\n if (resourceParts.length === 8) {\n return {\n projectId: resourceParts[1],\n keyRing: resourceParts[5],\n keyName: resourceParts[7],\n locations: resourceParts[3],\n resourceId: gcpKms.resource_id,\n createdAt: gcpKms.created_at,\n hasEncryptDecryptAccess: true,\n };\n }\n }\n }\n return gcpCryptoKeys[0];\n });\n\n const [isAddPublicAgeKeyVisible, setIsAddPublicAgeKeyVisible] =\n useState(false);\n\n function showAddPublicAgeKey() {\n setIsAddPublicAgeKeyVisible(true);\n }\n\n useEffect(() => {\n setValue('sopsConfig', {\n shamir_threshold: 2,\n gcp_kms: chosenGcpCryptoKey\n ? [\n {\n resource_id: chosenGcpCryptoKey.resourceId,\n created_at: chosenGcpCryptoKey.createdAt,\n },\n ]\n : [],\n age: publicAgeKeys.map(key => ({ recipient: key })),\n });\n }, [chosenGcpCryptoKey, publicAgeKeys, setValue]);\n\n // Require one key group to contain a GCP key\n register('sopsConfig.gcp_kms', {\n validate: gcpKeys => gcpKeys.length > 0,\n });\n\n function handleChangeGcpCryptoKey(newKey: GcpCryptoKeyObject) {\n setChosenGcpCryptoKey(newKey);\n }\n\n function handleAddPublicAgeKey() {\n if (isPublicAgeKeyValid(newPublicAgeKey)) {\n if (publicAgeKeys.includes(newPublicAgeKey)) {\n setPublicKeyTextFieldHelperText(\n t('sopsConfigDialog.publicKeyHelperTextKeyAlreadyExistInSopsConfig'),\n );\n setPublicKeyTextFieldError(true);\n } else {\n setPublicAgeKeys([...publicAgeKeys, newPublicAgeKey]);\n setNewPublicAgeKey('');\n }\n } else {\n setPublicKeyTextFieldHelperText(\n t('sopsConfigDialog.publicKeyHelperTextKeyNotValid'),\n );\n setPublicKeyTextFieldError(true);\n }\n }\n\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n <DialogContentText>\n {state === RiScDialogStates.Create\n ? t('sopsConfigDialog.description.new')\n : t('sopsConfigDialog.description.edit')}\n </DialogContentText>\n <Typography variant=\"subtitle2\">\n {t('sopsConfigDialog.selectKeysTitle')}\n </Typography>\n\n {chosenGcpCryptoKey !== undefined ? (\n <>\n {t('sopsConfigDialog.gcpCryptoKeyDescription')}\n <GcpCryptoKeyMenu\n chosenGcpCryptoKey={chosenGcpCryptoKey}\n onChange={handleChangeGcpCryptoKey}\n gcpCryptoKeys={\n gcpCryptoKeys.includes(chosenGcpCryptoKey)\n ? gcpCryptoKeys\n : [...gcpCryptoKeys, chosenGcpCryptoKey]\n }\n />\n </>\n ) : (\n <Typography variant=\"body1\">\n {t('sopsConfigDialog.gcpCryptoKeyNoSelectableKey')}\n </Typography>\n )}\n {errors.sopsConfig !== undefined && (\n <FormHelperText error={true}>\n {t('sopsConfigDialog.gcpCryptoKeyNonSelectedErrorMessage')}\n </FormHelperText>\n )}\n <Box>\n <Accordion elevation={1} defaultExpanded={publicAgeKeys.length > 0}>\n <AccordionSummary\n expandIcon={<ExpandMore />}\n aria-controls=\"panel1-content\"\n id=\"panel1-header\"\n >\n {t('sopsConfigDialog.publicAgeKeyQuestion')}\n </AccordionSummary>\n <AccordionDetails>\n <Box>\n {publicAgeKeys.length > 0 && (\n <FormLabel>\n {t('sopsConfigDialog.publicAgeKeysAlreadyPresent')}\n </FormLabel>\n )}\n {publicAgeKeys.length > 0 && (\n <Box\n sx={{\n border: '1px solid',\n borderColor: theme =>\n theme.palette.mode === 'dark' ? 'white' : 'grey.300',\n borderRadius: '4px',\n marginBottom: 2,\n }}\n >\n <List>\n {publicAgeKeys.map(key => (\n <ListItem key={key} dense>\n <ListItemText>{key}</ListItemText>\n <ListItemSecondaryAction>\n <IconButton\n onClick={() => {\n setPublicAgeKeys(\n publicAgeKeys.filter(k => k !== key),\n );\n }}\n >\n <DeleteIcon />\n </IconButton>\n </ListItemSecondaryAction>\n </ListItem>\n ))}\n </List>\n </Box>\n )}\n <Typography>\n {t('dictionary.click')}{' '}\n <Link\n href={\n URLS.external.kartverket_atlassian_net__write_ros_locally\n }\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n color=\"primary\"\n underline=\"hover\"\n >\n {t('dictionary.here')}\n </Link>{' '}\n {t('sopsConfigDialog.writeLocalRiscSuffix')}\n </Typography>\n <Typography>\n {`${t('sopsConfigDialog.publicAgeKeyDescription')} (${t(\n 'dictionary.optional',\n )})`}\n </Typography>\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'space-between',\n gap: 2,\n marginTop: 2,\n }}\n >\n {!isAddPublicAgeKeyVisible && (\n <Button\n startIcon={<AddCircle />}\n variant=\"text\"\n color=\"primary\"\n onClick={showAddPublicAgeKey}\n sx={{\n maxWidth: 200,\n mt: 1,\n }}\n >\n {t('sopsConfigDialog.addPublicAgeKey')}\n </Button>\n )}\n {isAddPublicAgeKeyVisible && (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 1,\n }}\n >\n <TextField\n label={t('sopsConfigDialog.publicAgeKey')}\n helperText={publicAgeKeyHelperText}\n error={publicAgeKeyError}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n handleAddPublicAgeKey();\n }\n }}\n onFocus={() => {\n setPublicKeyTextFieldError(false);\n setPublicKeyTextFieldHelperText('');\n }}\n value={newPublicAgeKey}\n onChange={e => setNewPublicAgeKey(e.target.value)}\n sx={{ flex: 1 }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handleAddPublicAgeKey}\n sx={{\n maxWidth: 200,\n }}\n >\n {t('sopsConfigDialog.addPublicAgeKey')}\n </Button>\n </Box>\n )}\n </Box>\n </Box>\n </AccordionDetails>\n </Accordion>\n </Box>\n </Box>\n );\n}\n\nexport default ConfigEncryptionDialog;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyCA,SAAS,sBAAuB,CAAA;AAAA,EAC9B,aAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAgC,EAAA;AAC9B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAA,MAAM,CAAC,sBAAA,EAAwB,+BAA+B,CAAA,GAC5D,SAAS,EAAE,CAAA;AACb,EAAA,MAAM,CAAC,iBAAA,EAAmB,0BAA0B,CAAA,GAAI,SAAS,KAAK,CAAA;AACtE,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAS,EAAE,CAAA;AACzD,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAmB,MAAM;AACjE,IAAA,IAAI,UAAU,GAAK,EAAA;AACjB,MAAA,OAAO,QAAS,CAAA,GAAA,CAAI,GAAI,CAAA,CAAA,GAAA,KAAO,IAAI,SAAS,CAAA;AAAA;AAE9C,IAAA,OAAO,EAAC;AAAA,GACT,CAAA;AAED,EAAA,MAAM,CAAC,kBAAA,EAAoB,qBAAqB,CAAA,GAC9C,SAA6B,MAAM;AACjC,IAAA,IAAI,KAAU,KAAA,gBAAA,CAAiB,cAAkB,IAAA,QAAA,EAAU,OAAS,EAAA;AAClE,MAAM,MAAA,MAAA,GAAS,QAAS,CAAA,OAAA,CAAQ,CAAC,CAAA;AACjC,MAAA,IAAI,QAAQ,WAAa,EAAA;AACvB,QAAA,MAAM,aAAgB,GAAA,MAAA,CAAO,WAAY,CAAA,KAAA,C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,EAAA,WAAA;AAAA,wBACR,KAAM,EAAA,SAAA;AAAA,wBACN,OAAS,EAAA,qBAAA;AAAA,wBACT,EAAI,EAAA;AAAA,0BACF,QAAU,EAAA;AAAA,yBACZ;AAAA,wBAEC,YAAE,kCAAkC;AAAA;AAAA;AACvC;AAAA;AAAA;AACF;AAAA;AAAA;AAEJ,OAAA,EACF,CACF,EAAA;AAAA,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -8,34 +8,22 @@ import { pluginRiScTranslationRef } from '../../../utils/translations.esm.js';
8
8
  function DifferenceText({ differenceFetchState }) {
9
9
  const { t } = useTranslationRef(pluginRiScTranslationRef);
10
10
  return /* @__PURE__ */ jsxs(Fragment, { children: [
11
- /* @__PURE__ */ jsx(
12
- Typography,
13
- {
14
- sx: {
15
- fontWeight: 700,
16
- paddingBottom: "4px"
17
- },
18
- children: t("rosStatus.difference.differences.titleRemoved")
19
- }
20
- ),
21
- /* @__PURE__ */ jsxs(
22
- List,
23
- {
24
- sx: { paddingBottom: "40px", paddingTop: 0, listStyleType: "disc" },
25
- children: [
26
- differenceFetchState.differenceState.entriesOnLeft.length === 0 && /* @__PURE__ */ jsx(
27
- ListItem,
28
- {
29
- sx: {
30
- display: "list-item",
31
- marginLeft: "26px",
32
- paddingTop: "4px",
33
- paddingBottom: "4px"
34
- },
35
- children: /* @__PURE__ */ jsx(Typography, { children: t("rosStatus.difference.differences.noneRemoved") })
36
- }
37
- ),
38
- differenceFetchState.differenceState.entriesOnLeft.map((item) => /* @__PURE__ */ jsx(
11
+ differenceFetchState.differenceState.entriesOnLeft.length !== 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ /* @__PURE__ */ jsx(
13
+ Typography,
14
+ {
15
+ sx: {
16
+ fontWeight: 700,
17
+ paddingBottom: "4px"
18
+ },
19
+ children: t("rosStatus.difference.differences.titleRemoved")
20
+ }
21
+ ),
22
+ /* @__PURE__ */ jsx(
23
+ List,
24
+ {
25
+ sx: { paddingBottom: "40px", paddingTop: 0, listStyleType: "disc" },
26
+ children: differenceFetchState.differenceState.entriesOnLeft.map((item) => /* @__PURE__ */ jsx(
39
27
  ListItem,
40
28
  {
41
29
  sx: {
@@ -48,37 +36,25 @@ function DifferenceText({ differenceFetchState }) {
48
36
  },
49
37
  item
50
38
  ))
51
- ]
52
- }
53
- ),
54
- /* @__PURE__ */ jsx(
55
- Typography,
56
- {
57
- sx: {
58
- fontWeight: 700,
59
- paddingBottom: "4px"
60
- },
61
- children: t("rosStatus.difference.differences.titleExisting")
62
- }
63
- ),
64
- /* @__PURE__ */ jsxs(
65
- List,
66
- {
67
- sx: { paddingBottom: "40px", paddingTop: 0, listStyleType: "disc" },
68
- children: [
69
- differenceFetchState.differenceState.difference.length === 0 && /* @__PURE__ */ jsx(
70
- ListItem,
71
- {
72
- sx: {
73
- display: "list-item",
74
- marginLeft: "26px",
75
- paddingTop: "4px",
76
- paddingBottom: "4px"
77
- },
78
- children: /* @__PURE__ */ jsx(Typography, { children: t("rosStatus.difference.differences.noneExisting") })
79
- }
80
- ),
81
- differenceFetchState.differenceState.difference.map((item) => /* @__PURE__ */ jsx(
39
+ }
40
+ )
41
+ ] }),
42
+ differenceFetchState.differenceState.difference.length !== 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
43
+ /* @__PURE__ */ jsx(
44
+ Typography,
45
+ {
46
+ sx: {
47
+ fontWeight: 700,
48
+ paddingBottom: "4px"
49
+ },
50
+ children: t("rosStatus.difference.differences.titleExisting")
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(
54
+ List,
55
+ {
56
+ sx: { paddingBottom: "40px", paddingTop: 0, listStyleType: "disc" },
57
+ children: differenceFetchState.differenceState.difference.map((item) => /* @__PURE__ */ jsx(
82
58
  ListItem,
83
59
  {
84
60
  sx: {
@@ -91,33 +67,21 @@ function DifferenceText({ differenceFetchState }) {
91
67
  },
92
68
  item
93
69
  ))
94
- ]
95
- }
96
- ),
97
- /* @__PURE__ */ jsx(
98
- Typography,
99
- {
100
- sx: {
101
- fontWeight: 700,
102
- paddingBottom: "4px"
103
- },
104
- children: t("rosStatus.difference.differences.titleAdded")
105
- }
106
- ),
107
- /* @__PURE__ */ jsxs(List, { sx: { listStyleType: "disc", paddingTop: 0 }, children: [
108
- differenceFetchState.differenceState.entriesOnRight.length === 0 && /* @__PURE__ */ jsx(
109
- ListItem,
70
+ }
71
+ )
72
+ ] }),
73
+ differenceFetchState.differenceState.entriesOnRight.length !== 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
74
+ /* @__PURE__ */ jsx(
75
+ Typography,
110
76
  {
111
77
  sx: {
112
- display: "list-item",
113
- marginLeft: "26px",
114
- paddingTop: "4px",
78
+ fontWeight: 700,
115
79
  paddingBottom: "4px"
116
80
  },
117
- children: /* @__PURE__ */ jsx(Typography, { children: t("rosStatus.difference.differences.noneAdded") })
81
+ children: t("rosStatus.difference.differences.titleAdded")
118
82
  }
119
83
  ),
120
- differenceFetchState.differenceState.entriesOnRight.map((item) => /* @__PURE__ */ jsx(
84
+ /* @__PURE__ */ jsx(List, { sx: { listStyleType: "disc", paddingTop: 0 }, children: differenceFetchState.differenceState.entriesOnRight.map((item) => /* @__PURE__ */ jsx(
121
85
  ListItem,
122
86
  {
123
87
  sx: {
@@ -129,7 +93,7 @@ function DifferenceText({ differenceFetchState }) {
129
93
  children: /* @__PURE__ */ jsx(Typography, { children: item })
130
94
  },
131
95
  item
132
- ))
96
+ )) })
133
97
  ] })
134
98
  ] });
135
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DifferenceText.esm.js","sources":["../../../../src/components/riScInfo/riScStatus/DifferenceText.tsx"],"sourcesContent":["import { DifferenceFetchState } from '../../../utils/types';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport Typography from '@mui/material/Typography';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../../utils/translations';\n\ntype DifferenceTextProps = {\n differenceFetchState: DifferenceFetchState;\n};\n\nexport function DifferenceText({ differenceFetchState }: DifferenceTextProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n return (\n <>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleRemoved')}\n </Typography>\n <List\n sx={{ paddingBottom: '40px', paddingTop: 0, listStyleType: 'disc' }}\n >\n {differenceFetchState.differenceState.entriesOnLeft.length === 0 && (\n <ListItem\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>\n {t('rosStatus.difference.differences.noneRemoved')}\n </Typography>\n </ListItem>\n )}\n {differenceFetchState.differenceState.entriesOnLeft.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleExisting')}\n </Typography>\n <List\n sx={{ paddingBottom: '40px', paddingTop: 0, listStyleType: 'disc' }}\n >\n {differenceFetchState.differenceState.difference.length === 0 && (\n <ListItem\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>\n {t('rosStatus.difference.differences.noneExisting')}\n </Typography>\n </ListItem>\n )}\n {differenceFetchState.differenceState.difference.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleAdded')}\n </Typography>\n <List sx={{ listStyleType: 'disc', paddingTop: 0 }}>\n {differenceFetchState.differenceState.entriesOnRight.length === 0 && (\n <ListItem\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>\n {t('rosStatus.difference.differences.noneAdded')}\n </Typography>\n </ListItem>\n )}\n {differenceFetchState.differenceState.entriesOnRight.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAWgB,SAAA,cAAA,CAAe,EAAE,oBAAA,EAA6C,EAAA;AAC5E,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,UAAY,EAAA,GAAA;AAAA,UACZ,aAAe,EAAA;AAAA,SACjB;AAAA,QAEC,YAAE,+CAA+C;AAAA;AAAA,KACpD;AAAA,oBACA,IAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,IAAI,EAAE,aAAA,EAAe,QAAQ,UAAY,EAAA,CAAA,EAAG,eAAe,MAAO,EAAA;AAAA,QAEjE,QAAA,EAAA;AAAA,UAAqB,oBAAA,CAAA,eAAA,CAAgB,aAAc,CAAA,MAAA,KAAW,CAC7D,oBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,EAAI,EAAA;AAAA,gBACF,OAAS,EAAA,WAAA;AAAA,gBACT,UAAY,EAAA,MAAA;AAAA,gBACZ,UAAY,EAAA,KAAA;AAAA,gBACZ,aAAe,EAAA;AAAA,eACjB;AAAA,cAEA,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EACE,QAAE,EAAA,CAAA,CAAA,8CAA8C,CACnD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AAA,UAEA,QAAA,kBAAA,GAAA,CAAC,cAAY,QAAK,EAAA,IAAA,EAAA;AAAA,SAAA;AAAA,QARb;AAAA,OAUR;AAAA,KACH,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DifferenceText.esm.js","sources":["../../../../src/components/riScInfo/riScStatus/DifferenceText.tsx"],"sourcesContent":["import { DifferenceFetchState } from '../../../utils/types';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport Typography from '@mui/material/Typography';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../../utils/translations';\n\ntype DifferenceTextProps = {\n differenceFetchState: DifferenceFetchState;\n};\n\nexport function DifferenceText({ differenceFetchState }: DifferenceTextProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n return (\n <>\n {differenceFetchState.differenceState.entriesOnLeft.length !== 0 && (\n <>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleRemoved')}\n </Typography>\n <List\n sx={{ paddingBottom: '40px', paddingTop: 0, listStyleType: 'disc' }}\n >\n {differenceFetchState.differenceState.entriesOnLeft.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n </>\n )}\n {differenceFetchState.differenceState.difference.length !== 0 && (\n <>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleExisting')}\n </Typography>\n <List\n sx={{ paddingBottom: '40px', paddingTop: 0, listStyleType: 'disc' }}\n >\n {differenceFetchState.differenceState.difference.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n </>\n )}\n {differenceFetchState.differenceState.entriesOnRight.length !== 0 && (\n <>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleAdded')}\n </Typography>\n <List sx={{ listStyleType: 'disc', paddingTop: 0 }}>\n {differenceFetchState.differenceState.entriesOnRight.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n </>\n )}\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAWgB,SAAA,cAAA,CAAe,EAAE,oBAAA,EAA6C,EAAA;AAC5E,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IAAA,oBAAA,CAAqB,eAAgB,CAAA,aAAA,CAAc,MAAW,KAAA,CAAA,oBAE3D,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,UAAY,EAAA,GAAA;AAAA,YACZ,aAAe,EAAA;AAAA,WACjB;AAAA,UAEC,YAAE,+CAA+C;AAAA;AAAA,OACpD;AAAA,sBACA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,IAAI,EAAE,aAAA,EAAe,QAAQ,UAAY,EAAA,CAAA,EAAG,eAAe,MAAO,EAAA;AAAA,UAEjE,QAAqB,EAAA,oBAAA,CAAA,eAAA,CAAgB,aAAc,CAAA,GAAA,CAAI,CACtD,IAAA,qBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cAEC,EAAI,EAAA;AAAA,gBACF,OAAS,EAAA,WAAA;AAAA,gBACT,UAAY,EAAA,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