{"version":3,"file":"ChartError.cjs","names":["_react","require","_Button","_createOdysseyStyledComponent","_i18n","_Warning","_Typography","_jsxRuntime","OuterContainer","createOdysseyStyledComponent","tag","odysseyDesignTokens","alignItems","display","flexDirection","gap","Spacing5","height","justifyContent","textAlign","TextGroup","Spacing2","maxWidth","TypographyLineLengthMax","marginBlock","ChartError","onRetry","t","useTranslation","jsxs","children","jsx","WarningIcon","role","Heading5","Paragraph","Button","label","onClick","variant","MemoizedChartError","exports","memo","displayName"],"sources":["../../../../src/charts/components/ChartError.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo } from \"react\";\n\nimport { Button } from \"../../Buttons/Button.js\";\nimport { createOdysseyStyledComponent } from \"../../createOdysseyStyledComponent.js\";\nimport { useTranslation } from \"../../i18n.generated/i18n.js\";\nimport { WarningIcon } from \"../../icons.generated/Warning.js\";\nimport { Heading5, Paragraph } from \"../../Typography.js\";\n\n/** The props for a chart error state. */\nexport type ChartErrorProps = {\n  /**\n   * The chart calls this function when a user clicks the retry button in the error state. The error state shows no retry button when the caller omits this property.\n   */\n  onRetry?: () => void;\n};\n\n// The parent is a single-row grid that stretches this component to the chart's full height. Centering here, rather than in the parent, keeps the centering rule next to the content it centers.\nconst OuterContainer = createOdysseyStyledComponent({ tag: \"div\" })(\n  ({ odysseyDesignTokens }) => ({\n    alignItems: \"center\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    gap: odysseyDesignTokens.Spacing5,\n    height: \"100%\",\n    justifyContent: \"center\",\n    textAlign: \"center\",\n  }),\n);\n\n// `Heading4` renders an `h4` and `Paragraph` renders a `p`, and each carries its own block margins. Those margins would add to the gap below and throw off the measured spacing, so this resets them. The selector names both elements rather than every child, so a later child keeps its own margins.\nconst TextGroup = createOdysseyStyledComponent({ tag: \"div\" })(\n  ({ odysseyDesignTokens }) => ({\n    display: \"flex\",\n    flexDirection: \"column\",\n    gap: odysseyDesignTokens.Spacing2,\n    maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n\n    \"& > h4, & > p\": {\n      marginBlock: 0,\n    },\n  }),\n);\n\n/**\n * Renders the error state for a chart. A chart shows this component in place of its plot when the chart fails to load its data.\n */\nconst ChartError = ({ onRetry }: ChartErrorProps) => {\n  const { t } = useTranslation();\n\n  return (\n    <OuterContainer>\n      <WarningIcon />\n      <TextGroup role=\"alert\">\n        <Heading5>{t(\"chart.error.heading\")}</Heading5>\n        <Paragraph>{t(\"chart.error.text\")}</Paragraph>\n      </TextGroup>\n      {onRetry && (\n        <Button\n          label={t(\"chart.error.retry\")}\n          onClick={onRetry}\n          variant=\"secondary\"\n        />\n      )}\n    </OuterContainer>\n  );\n};\n\nconst MemoizedChartError = memo(ChartError);\nMemoizedChartError.displayName = \"ChartError\";\n\nexport { MemoizedChartError as ChartError };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAlB1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAmBA,MAAMO,cAAc,GAAG,IAAAC,0DAA4B,EAAC;EAAEC,GAAG,EAAE;AAAM,CAAC,CAAC,CACjE,CAAC;EAAEC;AAAoB,CAAC,MAAM;EAC5BC,UAAU,EAAE,QAAQ;EACpBC,OAA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