@eclass/ui-kit 1.54.23 → 1.56.0

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 (57) hide show
  1. package/dist/atoms/Icons/Base.d.ts +1 -1
  2. package/dist/atoms/Icons/Base.d.ts.map +1 -1
  3. package/dist/atoms/Label/Label.d.ts +4 -2
  4. package/dist/atoms/Label/Label.d.ts.map +1 -1
  5. package/dist/atoms/TinyAlert/TinyAlert.d.ts +3 -1
  6. package/dist/atoms/TinyAlert/TinyAlert.d.ts.map +1 -1
  7. package/dist/eclass-ui-kit.es.js +3754 -430
  8. package/dist/eclass-ui-kit.es.js.map +1 -1
  9. package/dist/eclass-ui-kit.umd.js +38 -36
  10. package/dist/eclass-ui-kit.umd.js.map +1 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/molecules/Buttons/Btn.d.ts +3 -1
  14. package/dist/molecules/Buttons/Btn.d.ts.map +1 -1
  15. package/dist/molecules/Buttons/BtnLink.d.ts +3 -1
  16. package/dist/molecules/Buttons/BtnLink.d.ts.map +1 -1
  17. package/dist/molecules/Buttons/BtnPrimary.d.ts +1 -1
  18. package/dist/molecules/Buttons/BtnPrimary.d.ts.map +1 -1
  19. package/dist/molecules/Buttons/BtnSecondary.d.ts +1 -1
  20. package/dist/molecules/Buttons/BtnSecondary.d.ts.map +1 -1
  21. package/dist/molecules/Buttons/BtnTertiary.d.ts +3 -1
  22. package/dist/molecules/Buttons/BtnTertiary.d.ts.map +1 -1
  23. package/dist/molecules/Tooltip/NewTooltip.d.ts +1 -1
  24. package/dist/molecules/Tooltip/NewTooltip.d.ts.map +1 -1
  25. package/dist/organisms/Alerts/Alert.d.ts +1 -1
  26. package/dist/organisms/Alerts/Alert.d.ts.map +1 -1
  27. package/dist/organisms/Alerts/FlashNotification.d.ts +1 -1
  28. package/dist/organisms/Alerts/FlashNotification.d.ts.map +1 -1
  29. package/dist/organisms/Alerts/types.d.ts +8 -1
  30. package/dist/organisms/Alerts/utils/handleTime.d.ts.map +1 -1
  31. package/dist/organisms/Alerts/utils/useFlashNotification.d.ts +1 -1
  32. package/dist/organisms/Alerts/utils/useFlashNotification.d.ts.map +1 -1
  33. package/dist/organisms/Calendar/Dropdown/CalendarDropdown/CalendarDropdownContainer.d.ts +1 -1
  34. package/dist/organisms/Calendar/Dropdown/CalendarDropdown/CalendarDropdownContainer.d.ts.map +1 -1
  35. package/dist/organisms/Calendar/Dropdown/CalendarDropdown.d.ts +1 -1
  36. package/dist/organisms/Calendar/Dropdown/CalendarDropdown.d.ts.map +1 -1
  37. package/dist/organisms/Calendar/Dropdown/types.d.ts +1 -0
  38. package/dist/organisms/Modals/Modal/Modal.d.ts +4 -0
  39. package/dist/organisms/Modals/Modal/Modal.d.ts.map +1 -1
  40. package/dist/organisms/Modals/Modal/ModalContentBase.d.ts +4 -0
  41. package/dist/organisms/Modals/Modal/ModalContentBase.d.ts.map +1 -0
  42. package/dist/organisms/Modals/Modal/useModalConfig.d.ts +16 -0
  43. package/dist/organisms/Modals/Modal/useModalConfig.d.ts.map +1 -0
  44. package/dist/organisms/Modals/ModalAlert/ModalAlert.d.ts.map +1 -1
  45. package/dist/organisms/Modals/ModalAlert/ModalAlertContent.d.ts +4 -0
  46. package/dist/organisms/Modals/ModalAlert/ModalAlertContent.d.ts.map +1 -0
  47. package/dist/organisms/Modals/ModalAlert/useModalAlertConfig.d.ts +10 -0
  48. package/dist/organisms/Modals/ModalAlert/useModalAlertConfig.d.ts.map +1 -0
  49. package/dist/organisms/Modals/ModalMultiple/ModalMultiple.d.ts +63 -0
  50. package/dist/organisms/Modals/ModalMultiple/ModalMultiple.d.ts.map +1 -0
  51. package/dist/organisms/Modals/ModalMultiple/useModalMultipleConfig.d.ts +18 -0
  52. package/dist/organisms/Modals/ModalMultiple/useModalMultipleConfig.d.ts.map +1 -0
  53. package/dist/organisms/Modals/index.d.ts +2 -0
  54. package/dist/organisms/Modals/index.d.ts.map +1 -1
  55. package/dist/organisms/Modals/types.d.ts +17 -0
  56. package/dist/tsconfig.types.tsbuildinfo +1 -1
  57. package/package.json +3 -1
@@ -1,5 +1,5 @@
1
- import { extendTheme, Box, CircularProgress, Icon, Button, useMediaQuery, Tooltip, Flex, Stack, Center, Image, Text, HStack, Heading, List, ListItem, Link, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader, ModalCloseButton, ModalBody, ModalFooter, ModalOverlay, useDisclosure, LinkBox, LinkOverlay, MenuButton, MenuGroup, Menu, MenuList } from "@chakra-ui/react";
2
- import * as React from "react";
1
+ import { extendTheme, Box, CircularProgress, Icon, Button, useMediaQuery, Tooltip, Flex, Stack, Center, Image, Text as Text$1, HStack, Heading, List, ListItem, Link, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader, ModalCloseButton, ModalBody, ModalFooter, ModalOverlay, useDisclosure, LinkBox, LinkOverlay, Portal, MenuButton, MenuGroup, Menu, MenuList } from "@chakra-ui/react";
2
+ import * as React$1 from "react";
3
3
  import React__default, { useEffect, useCallback, useState } from "react";
4
4
  const main = {
5
5
  deepSkyBlue: "#0189FF",
@@ -126,6 +126,10 @@ const theme = extendTheme({
126
126
  styles
127
127
  });
128
128
  const vars = (value) => `var(--chakra-${value})`;
129
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
130
+ function getDefaultExportFromCjs(x) {
131
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
132
+ }
129
133
  var jsxRuntime = { exports: {} };
130
134
  var reactJsxRuntime_production_min = {};
131
135
  /*
@@ -237,7 +241,8 @@ function Label({
237
241
  bg = vars("colors-icon-ripeMango"),
238
242
  color = vars("colors-neutral-darkCharcoal"),
239
243
  size = "md",
240
- m: m2 = "0"
244
+ m: m2 = "0",
245
+ sx
241
246
  }) {
242
247
  const config = {
243
248
  md: {
@@ -261,6 +266,7 @@ function Label({
261
266
  lineHeight: ".875rem",
262
267
  m: m2,
263
268
  p: config[size].p,
269
+ sx,
264
270
  children
265
271
  });
266
272
  }
@@ -335,7 +341,7 @@ var factoryWithThrowingShims = function() {
335
341
  propTypes.exports = factoryWithThrowingShims();
336
342
  }
337
343
  var PropTypes = propTypes.exports;
338
- var __extends = globalThis && globalThis.__extends || function() {
344
+ var __extends$1 = globalThis && globalThis.__extends || function() {
339
345
  var extendStatics = function(d2, b2) {
340
346
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
341
347
  d3.__proto__ = b3;
@@ -354,8 +360,8 @@ var __extends = globalThis && globalThis.__extends || function() {
354
360
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
355
361
  };
356
362
  }();
357
- var __assign$1 = globalThis && globalThis.__assign || function() {
358
- __assign$1 = Object.assign || function(t2) {
363
+ var __assign$2 = globalThis && globalThis.__assign || function() {
364
+ __assign$2 = Object.assign || function(t2) {
359
365
  for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
360
366
  s2 = arguments[i2];
361
367
  for (var p2 in s2)
@@ -364,7 +370,7 @@ var __assign$1 = globalThis && globalThis.__assign || function() {
364
370
  }
365
371
  return t2;
366
372
  };
367
- return __assign$1.apply(this, arguments);
373
+ return __assign$2.apply(this, arguments);
368
374
  };
369
375
  var __rest = globalThis && globalThis.__rest || function(s2, e2) {
370
376
  var t2 = {};
@@ -389,7 +395,7 @@ var createRipples = function(defaultProps) {
389
395
  }
390
396
  var _a;
391
397
  return _a = function(_super) {
392
- __extends(class_1, _super);
398
+ __extends$1(class_1, _super);
393
399
  function class_1(props) {
394
400
  var _this = _super.call(this, props) || this;
395
401
  _this.timer = 0;
@@ -403,7 +409,7 @@ var createRipples = function(defaultProps) {
403
409
  var size = Math.max(rect.width, rect.height);
404
410
  _this.setState(function(state) {
405
411
  return {
406
- rippleStyle: __assign$1({}, state.rippleStyle, {
412
+ rippleStyle: __assign$2({}, state.rippleStyle, {
407
413
  left,
408
414
  top,
409
415
  opacity: 1,
@@ -416,7 +422,7 @@ var createRipples = function(defaultProps) {
416
422
  _this.timer = setTimeout(function() {
417
423
  _this.setState(function(state) {
418
424
  return {
419
- rippleStyle: __assign$1({}, state.rippleStyle, { opacity: 0, transform: "scale(" + size / 9 + ")", transition: "all " + during + "ms" })
425
+ rippleStyle: __assign$2({}, state.rippleStyle, { opacity: 0, transform: "scale(" + size / 9 + ")", transition: "all " + during + "ms" })
420
426
  };
421
427
  });
422
428
  }, 50);
@@ -449,7 +455,7 @@ var createRipples = function(defaultProps) {
449
455
  var rippleStyle = this.state.rippleStyle;
450
456
  return React__default.createElement(
451
457
  "div",
452
- __assign$1({}, props, { className: ("react-ripples " + className).trim(), style: boxStyle, onClick: this.onClick }),
458
+ __assign$2({}, props, { className: ("react-ripples " + className).trim(), style: boxStyle, onClick: this.onClick }),
453
459
  children,
454
460
  React__default.createElement("s", { style: rippleStyle })
455
461
  );
@@ -460,11 +466,11 @@ var createRipples = function(defaultProps) {
460
466
  color: PropTypes.string,
461
467
  onClick: PropTypes.func,
462
468
  className: PropTypes.string
463
- }, _a.defaultProps = __assign$1({ during: 600, color: "rgba(0, 0, 0, .3)", className: "", onClick: function() {
469
+ }, _a.defaultProps = __assign$2({ during: 600, color: "rgba(0, 0, 0, .3)", className: "", onClick: function() {
464
470
  } }, defaultProps), _a;
465
471
  };
466
- var __assign = globalThis && globalThis.__assign || function() {
467
- __assign = Object.assign || function(t2) {
472
+ var __assign$1 = globalThis && globalThis.__assign || function() {
473
+ __assign$1 = Object.assign || function(t2) {
468
474
  for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
469
475
  s2 = arguments[i2];
470
476
  for (var p2 in s2)
@@ -473,11 +479,11 @@ var __assign = globalThis && globalThis.__assign || function() {
473
479
  }
474
480
  return t2;
475
481
  };
476
- return __assign.apply(this, arguments);
482
+ return __assign$1.apply(this, arguments);
477
483
  };
478
484
  var withAttrs = function(Component) {
479
485
  return function(props) {
480
- return React__default.createElement(Component, __assign({}, props));
486
+ return React__default.createElement(Component, __assign$1({}, props));
481
487
  };
482
488
  };
483
489
  var Ripples$1 = withAttrs(createRipples());
@@ -1312,7 +1318,7 @@ function DiagonalArrow(props) {
1312
1318
  });
1313
1319
  }
1314
1320
  DiagonalArrow.displayName = "Download";
1315
- var index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1321
+ var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1316
1322
  __proto__: null,
1317
1323
  AcademicRecord,
1318
1324
  AlertInfo,
@@ -1349,8 +1355,9 @@ var index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
1349
1355
  }, Symbol.toStringTag, { value: "Module" }));
1350
1356
  function TinyAlert({
1351
1357
  status,
1352
- text,
1353
- margin = "0"
1358
+ text: text2,
1359
+ margin = "0",
1360
+ sx
1354
1361
  }) {
1355
1362
  const alerts = {
1356
1363
  success: {
@@ -1417,6 +1424,7 @@ function TinyAlert({
1417
1424
  width: "fit-content",
1418
1425
  borderRadius: ".25rem",
1419
1426
  className: "TinyAlert-Box",
1427
+ sx,
1420
1428
  children: [alerts[status].icon && /* @__PURE__ */ jsx(Box, {
1421
1429
  lineHeight: 0,
1422
1430
  sx: {
@@ -1434,7 +1442,7 @@ function TinyAlert({
1434
1442
  fontFamily: "Roboto",
1435
1443
  lineHeight: ".875rem",
1436
1444
  margin: "0",
1437
- children: text != null ? text : alerts[status].text
1445
+ children: text2 != null ? text2 : alerts[status].text
1438
1446
  })]
1439
1447
  });
1440
1448
  }
@@ -1459,7 +1467,8 @@ function Btn({
1459
1467
  size = "regular",
1460
1468
  touchDark = false,
1461
1469
  type = "button",
1462
- tabIndex = 0
1470
+ tabIndex = 0,
1471
+ sx
1463
1472
  }) {
1464
1473
  var _a, _b, _c;
1465
1474
  let showChildren = children != null ? children : null;
@@ -1544,7 +1553,8 @@ function Btn({
1544
1553
  },
1545
1554
  span: {
1546
1555
  h: "1rem"
1547
- }
1556
+ },
1557
+ ...sx
1548
1558
  },
1549
1559
  children: showChildren
1550
1560
  })
@@ -1566,7 +1576,8 @@ function BtnPrimary({
1566
1576
  size = "regular",
1567
1577
  type = "button",
1568
1578
  tabIndex,
1569
- id
1579
+ id,
1580
+ sx
1570
1581
  }) {
1571
1582
  return /* @__PURE__ */ jsx(Btn, {
1572
1583
  ariaLabel,
@@ -1582,6 +1593,7 @@ function BtnPrimary({
1582
1593
  size,
1583
1594
  type,
1584
1595
  tabIndex,
1596
+ sx,
1585
1597
  children
1586
1598
  });
1587
1599
  }
@@ -1600,7 +1612,8 @@ function BtnSecondary({
1600
1612
  size = "regular",
1601
1613
  type = "button",
1602
1614
  tabIndex,
1603
- id
1615
+ id,
1616
+ sx
1604
1617
  }) {
1605
1618
  return /* @__PURE__ */ jsx(Btn, {
1606
1619
  ariaLabel,
@@ -1624,6 +1637,7 @@ function BtnSecondary({
1624
1637
  touchDark: true,
1625
1638
  type,
1626
1639
  tabIndex,
1640
+ sx,
1627
1641
  children
1628
1642
  });
1629
1643
  }
@@ -1643,7 +1657,8 @@ function BtnTertiary({
1643
1657
  role = "button",
1644
1658
  type = "button",
1645
1659
  tabIndex,
1646
- withoutColor = false
1660
+ withoutColor = false,
1661
+ sx
1647
1662
  }) {
1648
1663
  const gray = vars("colors-neutral-gray");
1649
1664
  const blue = vars("colors-main-deepSkyBlue");
@@ -1734,7 +1749,8 @@ function BtnTertiary({
1734
1749
  sx: {
1735
1750
  ">span": {
1736
1751
  mr: 0
1737
- }
1752
+ },
1753
+ ...sx
1738
1754
  },
1739
1755
  children
1740
1756
  });
@@ -1752,7 +1768,8 @@ function BtnLink({
1752
1768
  role = "link",
1753
1769
  tabIndex,
1754
1770
  target = "_blank",
1755
- textDecorationLine = true
1771
+ textDecorationLine = true,
1772
+ sx
1756
1773
  }) {
1757
1774
  const typeButton = {
1758
1775
  button: {
@@ -1790,6 +1807,7 @@ function BtnLink({
1790
1807
  cursor: "pointer"
1791
1808
  },
1792
1809
  ...typeButton[as],
1810
+ sx,
1793
1811
  children
1794
1812
  });
1795
1813
  }
@@ -2040,7 +2058,7 @@ function Header$1() {
2040
2058
  logoAlt,
2041
2059
  Profile: profile,
2042
2060
  soonCourse
2043
- } = React.useContext(CourseBoxContext);
2061
+ } = React$1.useContext(CourseBoxContext);
2044
2062
  return /* @__PURE__ */ jsxs(Box, {
2045
2063
  as: "header",
2046
2064
  height: "8.75rem",
@@ -2119,7 +2137,7 @@ function DateStatus({
2119
2137
  if (date == null || date.length === 0) {
2120
2138
  return null;
2121
2139
  }
2122
- return /* @__PURE__ */ jsx(Text, {
2140
+ return /* @__PURE__ */ jsx(Text$1, {
2123
2141
  fontSize: ".75rem",
2124
2142
  color: vars("colors-neutral-darkCharcoal"),
2125
2143
  m: "0",
@@ -2160,7 +2178,7 @@ function CourseStatus({
2160
2178
  children: [/* @__PURE__ */ jsx(IconSelection, {
2161
2179
  type: progress.icon,
2162
2180
  progressValue: progress.progress
2163
- }), /* @__PURE__ */ jsx(Text, {
2181
+ }), /* @__PURE__ */ jsx(Text$1, {
2164
2182
  m: "0",
2165
2183
  ml: ".625rem",
2166
2184
  fontSize: ".875rem",
@@ -2182,7 +2200,7 @@ function Section() {
2182
2200
  information,
2183
2201
  progress,
2184
2202
  status
2185
- } = React.useContext(CourseBoxContext);
2203
+ } = React$1.useContext(CourseBoxContext);
2186
2204
  if (progress == null) {
2187
2205
  return null;
2188
2206
  }
@@ -2243,7 +2261,7 @@ function Section() {
2243
2261
  fontWeight: "500",
2244
2262
  fontSize: ".75rem",
2245
2263
  children: item.text
2246
- }) : /* @__PURE__ */ jsx(Text, {
2264
+ }) : /* @__PURE__ */ jsx(Text$1, {
2247
2265
  m: "0",
2248
2266
  color: vars("colors-neutral-gray"),
2249
2267
  fontSize: ".75rem",
@@ -3199,8 +3217,8 @@ function PaymentModal({
3199
3217
  backdropBlur: "2px"
3200
3218
  });
3201
3219
  }
3202
- const [overlay2, setOverlay] = React.useState(/* @__PURE__ */ jsx(OverlayTwo, {}));
3203
- React.useEffect(() => {
3220
+ const [overlay2, setOverlay] = React$1.useState(/* @__PURE__ */ jsx(OverlayTwo, {}));
3221
+ React$1.useEffect(() => {
3204
3222
  if (showOverlay) {
3205
3223
  setOverlay(/* @__PURE__ */ jsx(OverlayTwo, {}));
3206
3224
  }
@@ -3234,7 +3252,7 @@ function PaymentModal({
3234
3252
  _active: cssButton
3235
3253
  }), /* @__PURE__ */ jsx(ModalBody, {
3236
3254
  p: "1rem 2rem 2rem 2rem",
3237
- children: /* @__PURE__ */ jsx(Text, {
3255
+ children: /* @__PURE__ */ jsx(Text$1, {
3238
3256
  align: "center",
3239
3257
  children: modalPaymentText.body
3240
3258
  })
@@ -3267,13 +3285,13 @@ function Footer({
3267
3285
  action,
3268
3286
  Profile: Profile2,
3269
3287
  hasFinanzeFreezed
3270
- } = React.useContext(CourseBoxContext);
3288
+ } = React$1.useContext(CourseBoxContext);
3271
3289
  const {
3272
3290
  isOpen,
3273
3291
  onOpen,
3274
3292
  onClose
3275
3293
  } = useDisclosure();
3276
- const [overlay2, setOverlay] = React.useState(false);
3294
+ const [overlay2, setOverlay] = React$1.useState(false);
3277
3295
  const cssButton = {
3278
3296
  backgroundColor: "transparent"
3279
3297
  };
@@ -3306,7 +3324,7 @@ function Footer({
3306
3324
  onClick: () => handleClick(),
3307
3325
  fontSize: "1rem !important",
3308
3326
  children: action.text
3309
- }) : /* @__PURE__ */ jsx(Text, {
3327
+ }) : /* @__PURE__ */ jsx(Text$1, {
3310
3328
  color: vars("colors-main-deepSkyBlue"),
3311
3329
  fontWeight: "500",
3312
3330
  mr: action.hasIcon ? "1.5rem" : "0",
@@ -3317,7 +3335,7 @@ function Footer({
3317
3335
  }), action.hasIcon && /* @__PURE__ */ jsx(ArrowRight, {
3318
3336
  color: vars("colors-main-deepSkyBlue")
3319
3337
  })]
3320
- }) : /* @__PURE__ */ jsx(Text, {
3338
+ }) : /* @__PURE__ */ jsx(Text$1, {
3321
3339
  fontWeight: "500",
3322
3340
  lineHeight: "1.172rem",
3323
3341
  color: vars("colors-neutral-spanishGrey"),
@@ -3353,7 +3371,7 @@ function useEnterNavigate() {
3353
3371
  };
3354
3372
  }, []);
3355
3373
  }
3356
- const CourseBoxContext = React.createContext({});
3374
+ const CourseBoxContext = React$1.createContext({});
3357
3375
  function WithRipples$1({
3358
3376
  enabled,
3359
3377
  children
@@ -3559,220 +3577,3355 @@ function CourseList({
3559
3577
  });
3560
3578
  }
3561
3579
  CourseList.displayName = "CourseList";
3562
- const alertStates = {
3563
- success: {
3564
- icon: /* @__PURE__ */ jsx(SuccessWhite, {}),
3565
- bg: vars("colors-alert-ice"),
3566
- id: "success"
3567
- },
3568
- error: {
3569
- icon: /* @__PURE__ */ jsx(ErrorWhite, {}),
3570
- bg: vars("colors-alert-veryLightPinkThree"),
3571
- id: "error"
3572
- },
3573
- info: {
3574
- icon: /* @__PURE__ */ jsx(InfoWhite, {}),
3575
- bg: vars("colors-alert-veryLightBlue"),
3576
- id: "info"
3577
- },
3578
- warning: {
3579
- icon: /* @__PURE__ */ jsx(WarningWhite, {}),
3580
- bg: vars("colors-alert-pale"),
3581
- id: "warning"
3582
- }
3583
- };
3584
- const alertColorStates = {
3585
- success: {
3586
- icon: /* @__PURE__ */ jsx(SuccessColor, {}),
3587
- bg: vars("colors-alert-ice"),
3588
- id: "success"
3589
- },
3590
- error: {
3591
- icon: /* @__PURE__ */ jsx(ErrorColor, {}),
3592
- bg: vars("colors-alert-veryLightPinkThree"),
3593
- id: "error"
3594
- },
3595
- info: {
3596
- icon: /* @__PURE__ */ jsx(InfoColor, {}),
3597
- bg: vars("colors-alert-veryLightBlue"),
3598
- id: "info"
3599
- },
3600
- warning: {
3601
- icon: /* @__PURE__ */ jsx(WarningColor, {}),
3602
- bg: vars("colors-alert-pale"),
3603
- id: "warning"
3604
- }
3605
- };
3606
- function Alert({
3607
- children,
3608
- canDismiss = false,
3609
- buttonText,
3610
- buttonIcon,
3611
- buttonLink = false,
3612
- fullWidth = false,
3613
- isFlash = false,
3614
- onClick,
3615
- state,
3616
- m: m2,
3617
- endTextLink,
3618
- onClickLink
3619
- }) {
3620
- const [isMobile] = useMediaQuery("(max-width: 425px)");
3621
- const handleClick = () => {
3622
- if (onClick) {
3623
- onClick();
3580
+ /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
3581
+ const {
3582
+ entries,
3583
+ setPrototypeOf,
3584
+ isFrozen,
3585
+ getPrototypeOf,
3586
+ getOwnPropertyDescriptor
3587
+ } = Object;
3588
+ let {
3589
+ freeze,
3590
+ seal,
3591
+ create
3592
+ } = Object;
3593
+ let {
3594
+ apply,
3595
+ construct
3596
+ } = typeof Reflect !== "undefined" && Reflect;
3597
+ if (!freeze) {
3598
+ freeze = function freeze2(x) {
3599
+ return x;
3600
+ };
3601
+ }
3602
+ if (!seal) {
3603
+ seal = function seal2(x) {
3604
+ return x;
3605
+ };
3606
+ }
3607
+ if (!apply) {
3608
+ apply = function apply2(func, thisArg) {
3609
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
3610
+ args[_key - 2] = arguments[_key];
3624
3611
  }
3612
+ return func.apply(thisArg, args);
3625
3613
  };
3626
- let buttonType;
3627
- if (buttonText) {
3628
- buttonType = buttonLink ? "link" : "normal";
3614
+ }
3615
+ if (!construct) {
3616
+ construct = function construct2(Func) {
3617
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
3618
+ args[_key2 - 1] = arguments[_key2];
3619
+ }
3620
+ return new Func(...args);
3621
+ };
3622
+ }
3623
+ const arrayForEach = unapply(Array.prototype.forEach);
3624
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
3625
+ const arrayPop = unapply(Array.prototype.pop);
3626
+ const arrayPush = unapply(Array.prototype.push);
3627
+ const arraySplice = unapply(Array.prototype.splice);
3628
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
3629
+ const stringToString = unapply(String.prototype.toString);
3630
+ const stringMatch = unapply(String.prototype.match);
3631
+ const stringReplace = unapply(String.prototype.replace);
3632
+ const stringIndexOf = unapply(String.prototype.indexOf);
3633
+ const stringTrim = unapply(String.prototype.trim);
3634
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
3635
+ const regExpTest = unapply(RegExp.prototype.test);
3636
+ const typeErrorCreate = unconstruct(TypeError);
3637
+ function unapply(func) {
3638
+ return function(thisArg) {
3639
+ if (thisArg instanceof RegExp) {
3640
+ thisArg.lastIndex = 0;
3641
+ }
3642
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
3643
+ args[_key3 - 1] = arguments[_key3];
3644
+ }
3645
+ return apply(func, thisArg, args);
3646
+ };
3647
+ }
3648
+ function unconstruct(Func) {
3649
+ return function() {
3650
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
3651
+ args[_key4] = arguments[_key4];
3652
+ }
3653
+ return construct(Func, args);
3654
+ };
3655
+ }
3656
+ function addToSet(set, array) {
3657
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
3658
+ if (setPrototypeOf) {
3659
+ setPrototypeOf(set, null);
3629
3660
  }
3630
- return /* @__PURE__ */ jsxs(Box, {
3631
- className: isFlash ? "flashNotification" : "e_alert",
3632
- alignItems: !isMobile ? "center" : "unset",
3633
- backgroundColor: alertStates[state].bg,
3634
- borderRadius: "8px",
3635
- display: "flex",
3636
- flexFlow: isMobile ? "column" : "row",
3637
- gap: !isFlash ? "16px" : "",
3638
- justifyContent: !isMobile ? "space-between" : "",
3639
- margin: m2,
3640
- width: fullWidth ? "100%" : "fit-content",
3641
- maxWidth: fullWidth ? "none" : "796px",
3642
- p: "1rem",
3643
- pr: canDismiss ? "1.75rem" : "1rem",
3644
- position: "relative",
3645
- children: [/* @__PURE__ */ jsxs(Box, {
3646
- display: "flex",
3647
- gap: "10px",
3648
- className: "alertContent",
3649
- sx: {
3650
- ".linkButton": {
3651
- fontSize: "16px"
3652
- },
3653
- a: {
3654
- fontWeight: "500",
3655
- color: vars("colors-main-deepSkyBlue"),
3656
- textDecoration: "underline"
3657
- },
3658
- "a:hover": {
3659
- color: vars("colors-neutral-darkCharcoal")
3660
- }
3661
- },
3662
- children: [/* @__PURE__ */ jsx(Box, {
3663
- className: "iconContainer",
3664
- sx: {
3665
- svg: {
3666
- width: "auto"
3667
- }
3668
- },
3669
- children: alertStates[state].icon
3670
- }), /* @__PURE__ */ jsxs(Box, {
3671
- display: "flex",
3672
- alignItems: "center",
3673
- children: [/* @__PURE__ */ jsxs(Box, {
3674
- alignSelf: "center",
3675
- as: "p",
3676
- color: vars("colors-neutral-darkCharcoal"),
3677
- fontFamily: "Roboto",
3678
- fontSize: "16px",
3679
- fontWeight: "400",
3680
- lineHeight: "28px",
3681
- mb: "0",
3682
- children: [children, endTextLink && onClickLink && /* @__PURE__ */ jsx(BtnLink, {
3683
- onClick: onClickLink,
3684
- children: endTextLink
3685
- })]
3686
- }), buttonType === "link" && /* @__PURE__ */ jsx(BtnLink, {
3687
- onClick: handleClick,
3688
- children: buttonText
3689
- })]
3690
- })]
3691
- }), buttonType === "normal" && /* @__PURE__ */ jsx(BtnPrimary, {
3692
- isFullWidth: !!isMobile,
3693
- leftIcon: buttonIcon,
3694
- onClick: handleClick,
3695
- children: buttonText
3696
- }), canDismiss && /* @__PURE__ */ jsx(Box, {
3697
- "data-testid": "closeButton",
3698
- cursor: "pointer",
3699
- marginLeft: "12px",
3700
- sx: {
3701
- svg: {
3702
- position: "absolute",
3703
- top: "16px",
3704
- right: "12px"
3661
+ let l2 = array.length;
3662
+ while (l2--) {
3663
+ let element = array[l2];
3664
+ if (typeof element === "string") {
3665
+ const lcElement = transformCaseFunc(element);
3666
+ if (lcElement !== element) {
3667
+ if (!isFrozen(array)) {
3668
+ array[l2] = lcElement;
3705
3669
  }
3706
- },
3707
- onClick,
3708
- children: /* @__PURE__ */ jsx(Close, {})
3709
- })]
3710
- });
3670
+ element = lcElement;
3671
+ }
3672
+ }
3673
+ set[element] = true;
3674
+ }
3675
+ return set;
3711
3676
  }
3712
- let e = { data: "" }, t = (t2) => "object" == typeof window ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e, l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, a = /\/\*[^]*?\*\/| +/g, n$1 = /\n+/g, o = (e2, t2) => {
3713
- let r = "", l2 = "", a2 = "";
3714
- for (let n2 in e2) {
3715
- let c2 = e2[n2];
3716
- "@" == n2[0] ? "i" == n2[1] ? r = n2 + " " + c2 + ";" : l2 += "f" == n2[1] ? o(c2, n2) : n2 + "{" + o(c2, "k" == n2[1] ? "" : t2) + "}" : "object" == typeof c2 ? l2 += o(c2, t2 ? t2.replace(/([^,])+/g, (e3) => n2.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t3) => /&/.test(t3) ? t3.replace(/&/g, e3) : e3 ? e3 + " " + t3 : t3)) : n2) : null != c2 && (n2 = /^--/.test(n2) ? n2 : n2.replace(/[A-Z]/g, "-$&").toLowerCase(), a2 += o.p ? o.p(n2, c2) : n2 + ":" + c2 + ";");
3677
+ function cleanArray(array) {
3678
+ for (let index2 = 0; index2 < array.length; index2++) {
3679
+ const isPropertyExist = objectHasOwnProperty(array, index2);
3680
+ if (!isPropertyExist) {
3681
+ array[index2] = null;
3682
+ }
3717
3683
  }
3718
- return r + (t2 && a2 ? t2 + "{" + a2 + "}" : a2) + l2;
3719
- }, c = {}, s = (e2) => {
3720
- if ("object" == typeof e2) {
3721
- let t2 = "";
3722
- for (let r in e2)
3723
- t2 += r + s(e2[r]);
3724
- return t2;
3684
+ return array;
3685
+ }
3686
+ function clone(object) {
3687
+ const newObject = create(null);
3688
+ for (const [property, value] of entries(object)) {
3689
+ const isPropertyExist = objectHasOwnProperty(object, property);
3690
+ if (isPropertyExist) {
3691
+ if (Array.isArray(value)) {
3692
+ newObject[property] = cleanArray(value);
3693
+ } else if (value && typeof value === "object" && value.constructor === Object) {
3694
+ newObject[property] = clone(value);
3695
+ } else {
3696
+ newObject[property] = value;
3697
+ }
3698
+ }
3725
3699
  }
3726
- return e2;
3727
- }, i = (e2, t2, r, i2, p2) => {
3728
- let u2 = s(e2), d2 = c[u2] || (c[u2] = ((e3) => {
3729
- let t3 = 0, r2 = 11;
3730
- for (; t3 < e3.length; )
3731
- r2 = 101 * r2 + e3.charCodeAt(t3++) >>> 0;
3732
- return "go" + r2;
3733
- })(u2));
3734
- if (!c[d2]) {
3735
- let t3 = u2 !== e2 ? e2 : ((e3) => {
3736
- let t4, r2, o2 = [{}];
3737
- for (; t4 = l.exec(e3.replace(a, "")); )
3738
- t4[4] ? o2.shift() : t4[3] ? (r2 = t4[3].replace(n$1, " ").trim(), o2.unshift(o2[0][r2] = o2[0][r2] || {})) : o2[0][t4[1]] = t4[2].replace(n$1, " ").trim();
3739
- return o2[0];
3740
- })(e2);
3741
- c[d2] = o(p2 ? { ["@keyframes " + d2]: t3 } : t3, r ? "" : "." + d2);
3700
+ return newObject;
3701
+ }
3702
+ function lookupGetter(object, prop) {
3703
+ while (object !== null) {
3704
+ const desc = getOwnPropertyDescriptor(object, prop);
3705
+ if (desc) {
3706
+ if (desc.get) {
3707
+ return unapply(desc.get);
3708
+ }
3709
+ if (typeof desc.value === "function") {
3710
+ return unapply(desc.value);
3711
+ }
3712
+ }
3713
+ object = getPrototypeOf(object);
3742
3714
  }
3743
- let f2 = r && c.g ? c.g : null;
3744
- return r && (c.g = c[d2]), ((e3, t3, r2, l2) => {
3745
- l2 ? t3.data = t3.data.replace(l2, e3) : -1 === t3.data.indexOf(e3) && (t3.data = r2 ? e3 + t3.data : t3.data + e3);
3746
- })(c[d2], t2, i2, f2), d2;
3747
- }, p = (e2, t2, r) => e2.reduce((e3, l2, a2) => {
3748
- let n2 = t2[a2];
3749
- if (n2 && n2.call) {
3750
- let e4 = n2(r), t3 = e4 && e4.props && e4.props.className || /^go/.test(e4) && e4;
3751
- n2 = t3 ? "." + t3 : e4 && "object" == typeof e4 ? e4.props ? "" : o(e4, "") : false === e4 ? "" : e4;
3715
+ function fallbackValue() {
3716
+ return null;
3752
3717
  }
3753
- return e3 + l2 + (null == n2 ? "" : n2);
3754
- }, "");
3755
- function u$1(e2) {
3756
- let r = this || {}, l2 = e2.call ? e2(r.p) : e2;
3757
- return i(l2.unshift ? l2.raw ? p(l2, [].slice.call(arguments, 1), r.p) : l2.reduce((e3, t2) => Object.assign(e3, t2 && t2.call ? t2(r.p) : t2), {}) : l2, t(r.target), r.g, r.o, r.k);
3718
+ return fallbackValue;
3758
3719
  }
3759
- let d, f, g;
3760
- u$1.bind({ g: 1 });
3761
- let h$1 = u$1.bind({ k: 1 });
3762
- function m(e2, t2, r, l2) {
3763
- o.p = t2, d = e2, f = r, g = l2;
3764
- }
3765
- function j(e2, t2) {
3766
- let r = this || {};
3767
- return function() {
3768
- let l2 = arguments;
3769
- function a2(n2, o2) {
3770
- let c2 = Object.assign({}, n2), s2 = c2.className || a2.className;
3771
- r.p = Object.assign({ theme: f && f() }, c2), r.o = / *go\d+/.test(s2), c2.className = u$1.apply(r, l2) + (s2 ? " " + s2 : ""), t2 && (c2.ref = o2);
3772
- let i2 = e2;
3773
- return e2[0] && (i2 = c2.as || e2, delete c2.as), g && i2[0] && g(c2), d(i2, c2);
3774
- }
3775
- return t2 ? t2(a2) : a2;
3720
+ const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
3721
+ const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
3722
+ const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
3723
+ const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
3724
+ const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
3725
+ const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
3726
+ const text = freeze(["#text"]);
3727
+ const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
3728
+ const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
3729
+ const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
3730
+ const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
3731
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
3732
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
3733
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
3734
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
3735
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
3736
+ const IS_ALLOWED_URI = seal(
3737
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
3738
+ );
3739
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
3740
+ const ATTR_WHITESPACE = seal(
3741
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
3742
+ );
3743
+ const DOCTYPE_NAME = seal(/^html$/i);
3744
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
3745
+ var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
3746
+ __proto__: null,
3747
+ ARIA_ATTR,
3748
+ ATTR_WHITESPACE,
3749
+ CUSTOM_ELEMENT,
3750
+ DATA_ATTR,
3751
+ DOCTYPE_NAME,
3752
+ ERB_EXPR,
3753
+ IS_ALLOWED_URI,
3754
+ IS_SCRIPT_OR_DATA,
3755
+ MUSTACHE_EXPR,
3756
+ TMPLIT_EXPR
3757
+ });
3758
+ const NODE_TYPE = {
3759
+ element: 1,
3760
+ attribute: 2,
3761
+ text: 3,
3762
+ cdataSection: 4,
3763
+ entityReference: 5,
3764
+ entityNode: 6,
3765
+ progressingInstruction: 7,
3766
+ comment: 8,
3767
+ document: 9,
3768
+ documentType: 10,
3769
+ documentFragment: 11,
3770
+ notation: 12
3771
+ };
3772
+ const getGlobal = function getGlobal2() {
3773
+ return typeof window === "undefined" ? null : window;
3774
+ };
3775
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
3776
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
3777
+ return null;
3778
+ }
3779
+ let suffix = null;
3780
+ const ATTR_NAME = "data-tt-policy-suffix";
3781
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
3782
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
3783
+ }
3784
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
3785
+ try {
3786
+ return trustedTypes.createPolicy(policyName, {
3787
+ createHTML(html2) {
3788
+ return html2;
3789
+ },
3790
+ createScriptURL(scriptUrl) {
3791
+ return scriptUrl;
3792
+ }
3793
+ });
3794
+ } catch (_2) {
3795
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
3796
+ return null;
3797
+ }
3798
+ };
3799
+ const _createHooksMap = function _createHooksMap2() {
3800
+ return {
3801
+ afterSanitizeAttributes: [],
3802
+ afterSanitizeElements: [],
3803
+ afterSanitizeShadowDOM: [],
3804
+ beforeSanitizeAttributes: [],
3805
+ beforeSanitizeElements: [],
3806
+ beforeSanitizeShadowDOM: [],
3807
+ uponSanitizeAttribute: [],
3808
+ uponSanitizeElement: [],
3809
+ uponSanitizeShadowNode: []
3810
+ };
3811
+ };
3812
+ function createDOMPurify() {
3813
+ let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
3814
+ const DOMPurify = (root) => createDOMPurify(root);
3815
+ DOMPurify.version = "3.3.1";
3816
+ DOMPurify.removed = [];
3817
+ if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
3818
+ DOMPurify.isSupported = false;
3819
+ return DOMPurify;
3820
+ }
3821
+ let {
3822
+ document: document2
3823
+ } = window2;
3824
+ const originalDocument = document2;
3825
+ const currentScript = originalDocument.currentScript;
3826
+ const {
3827
+ DocumentFragment,
3828
+ HTMLTemplateElement,
3829
+ Node: Node2,
3830
+ Element: Element2,
3831
+ NodeFilter,
3832
+ NamedNodeMap = window2.NamedNodeMap || window2.MozNamedAttrMap,
3833
+ HTMLFormElement,
3834
+ DOMParser: DOMParser2,
3835
+ trustedTypes
3836
+ } = window2;
3837
+ const ElementPrototype = Element2.prototype;
3838
+ const cloneNode2 = lookupGetter(ElementPrototype, "cloneNode");
3839
+ const remove = lookupGetter(ElementPrototype, "remove");
3840
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
3841
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
3842
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
3843
+ if (typeof HTMLTemplateElement === "function") {
3844
+ const template2 = document2.createElement("template");
3845
+ if (template2.content && template2.content.ownerDocument) {
3846
+ document2 = template2.content.ownerDocument;
3847
+ }
3848
+ }
3849
+ let trustedTypesPolicy;
3850
+ let emptyHTML = "";
3851
+ const {
3852
+ implementation,
3853
+ createNodeIterator,
3854
+ createDocumentFragment,
3855
+ getElementsByTagName
3856
+ } = document2;
3857
+ const {
3858
+ importNode
3859
+ } = originalDocument;
3860
+ let hooks = _createHooksMap();
3861
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
3862
+ const {
3863
+ MUSTACHE_EXPR: MUSTACHE_EXPR2,
3864
+ ERB_EXPR: ERB_EXPR2,
3865
+ TMPLIT_EXPR: TMPLIT_EXPR2,
3866
+ DATA_ATTR: DATA_ATTR2,
3867
+ ARIA_ATTR: ARIA_ATTR2,
3868
+ IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2,
3869
+ ATTR_WHITESPACE: ATTR_WHITESPACE2,
3870
+ CUSTOM_ELEMENT: CUSTOM_ELEMENT2
3871
+ } = EXPRESSIONS;
3872
+ let {
3873
+ IS_ALLOWED_URI: IS_ALLOWED_URI$1
3874
+ } = EXPRESSIONS;
3875
+ let ALLOWED_TAGS = null;
3876
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
3877
+ let ALLOWED_ATTR = null;
3878
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
3879
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
3880
+ tagNameCheck: {
3881
+ writable: true,
3882
+ configurable: false,
3883
+ enumerable: true,
3884
+ value: null
3885
+ },
3886
+ attributeNameCheck: {
3887
+ writable: true,
3888
+ configurable: false,
3889
+ enumerable: true,
3890
+ value: null
3891
+ },
3892
+ allowCustomizedBuiltInElements: {
3893
+ writable: true,
3894
+ configurable: false,
3895
+ enumerable: true,
3896
+ value: false
3897
+ }
3898
+ }));
3899
+ let FORBID_TAGS = null;
3900
+ let FORBID_ATTR = null;
3901
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
3902
+ tagCheck: {
3903
+ writable: true,
3904
+ configurable: false,
3905
+ enumerable: true,
3906
+ value: null
3907
+ },
3908
+ attributeCheck: {
3909
+ writable: true,
3910
+ configurable: false,
3911
+ enumerable: true,
3912
+ value: null
3913
+ }
3914
+ }));
3915
+ let ALLOW_ARIA_ATTR = true;
3916
+ let ALLOW_DATA_ATTR = true;
3917
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
3918
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
3919
+ let SAFE_FOR_TEMPLATES = false;
3920
+ let SAFE_FOR_XML = true;
3921
+ let WHOLE_DOCUMENT = false;
3922
+ let SET_CONFIG = false;
3923
+ let FORCE_BODY = false;
3924
+ let RETURN_DOM = false;
3925
+ let RETURN_DOM_FRAGMENT = false;
3926
+ let RETURN_TRUSTED_TYPE = false;
3927
+ let SANITIZE_DOM = true;
3928
+ let SANITIZE_NAMED_PROPS = false;
3929
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
3930
+ let KEEP_CONTENT = true;
3931
+ let IN_PLACE = false;
3932
+ let USE_PROFILES = {};
3933
+ let FORBID_CONTENTS = null;
3934
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
3935
+ let DATA_URI_TAGS = null;
3936
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
3937
+ let URI_SAFE_ATTRIBUTES = null;
3938
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
3939
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
3940
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
3941
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
3942
+ let NAMESPACE = HTML_NAMESPACE;
3943
+ let IS_EMPTY_INPUT = false;
3944
+ let ALLOWED_NAMESPACES = null;
3945
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
3946
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
3947
+ let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
3948
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
3949
+ let PARSER_MEDIA_TYPE = null;
3950
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
3951
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
3952
+ let transformCaseFunc = null;
3953
+ let CONFIG = null;
3954
+ const formElement = document2.createElement("form");
3955
+ const isRegexOrFunction = function isRegexOrFunction2(testValue) {
3956
+ return testValue instanceof RegExp || testValue instanceof Function;
3957
+ };
3958
+ const _parseConfig = function _parseConfig2() {
3959
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3960
+ if (CONFIG && CONFIG === cfg) {
3961
+ return;
3962
+ }
3963
+ if (!cfg || typeof cfg !== "object") {
3964
+ cfg = {};
3965
+ }
3966
+ cfg = clone(cfg);
3967
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
3968
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
3969
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
3970
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
3971
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
3972
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
3973
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
3974
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
3975
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
3976
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
3977
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
3978
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
3979
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
3980
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
3981
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
3982
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
3983
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
3984
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
3985
+ RETURN_DOM = cfg.RETURN_DOM || false;
3986
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
3987
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
3988
+ FORCE_BODY = cfg.FORCE_BODY || false;
3989
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
3990
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
3991
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
3992
+ IN_PLACE = cfg.IN_PLACE || false;
3993
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
3994
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
3995
+ MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
3996
+ HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
3997
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
3998
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
3999
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
4000
+ }
4001
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
4002
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
4003
+ }
4004
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
4005
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
4006
+ }
4007
+ if (SAFE_FOR_TEMPLATES) {
4008
+ ALLOW_DATA_ATTR = false;
4009
+ }
4010
+ if (RETURN_DOM_FRAGMENT) {
4011
+ RETURN_DOM = true;
4012
+ }
4013
+ if (USE_PROFILES) {
4014
+ ALLOWED_TAGS = addToSet({}, text);
4015
+ ALLOWED_ATTR = [];
4016
+ if (USE_PROFILES.html === true) {
4017
+ addToSet(ALLOWED_TAGS, html$1);
4018
+ addToSet(ALLOWED_ATTR, html);
4019
+ }
4020
+ if (USE_PROFILES.svg === true) {
4021
+ addToSet(ALLOWED_TAGS, svg$1);
4022
+ addToSet(ALLOWED_ATTR, svg);
4023
+ addToSet(ALLOWED_ATTR, xml);
4024
+ }
4025
+ if (USE_PROFILES.svgFilters === true) {
4026
+ addToSet(ALLOWED_TAGS, svgFilters);
4027
+ addToSet(ALLOWED_ATTR, svg);
4028
+ addToSet(ALLOWED_ATTR, xml);
4029
+ }
4030
+ if (USE_PROFILES.mathMl === true) {
4031
+ addToSet(ALLOWED_TAGS, mathMl$1);
4032
+ addToSet(ALLOWED_ATTR, mathMl);
4033
+ addToSet(ALLOWED_ATTR, xml);
4034
+ }
4035
+ }
4036
+ if (cfg.ADD_TAGS) {
4037
+ if (typeof cfg.ADD_TAGS === "function") {
4038
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
4039
+ } else {
4040
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
4041
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
4042
+ }
4043
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
4044
+ }
4045
+ }
4046
+ if (cfg.ADD_ATTR) {
4047
+ if (typeof cfg.ADD_ATTR === "function") {
4048
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
4049
+ } else {
4050
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
4051
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
4052
+ }
4053
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
4054
+ }
4055
+ }
4056
+ if (cfg.ADD_URI_SAFE_ATTR) {
4057
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
4058
+ }
4059
+ if (cfg.FORBID_CONTENTS) {
4060
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
4061
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
4062
+ }
4063
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
4064
+ }
4065
+ if (cfg.ADD_FORBID_CONTENTS) {
4066
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
4067
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
4068
+ }
4069
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
4070
+ }
4071
+ if (KEEP_CONTENT) {
4072
+ ALLOWED_TAGS["#text"] = true;
4073
+ }
4074
+ if (WHOLE_DOCUMENT) {
4075
+ addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
4076
+ }
4077
+ if (ALLOWED_TAGS.table) {
4078
+ addToSet(ALLOWED_TAGS, ["tbody"]);
4079
+ delete FORBID_TAGS.tbody;
4080
+ }
4081
+ if (cfg.TRUSTED_TYPES_POLICY) {
4082
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
4083
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
4084
+ }
4085
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
4086
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
4087
+ }
4088
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
4089
+ emptyHTML = trustedTypesPolicy.createHTML("");
4090
+ } else {
4091
+ if (trustedTypesPolicy === void 0) {
4092
+ trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
4093
+ }
4094
+ if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
4095
+ emptyHTML = trustedTypesPolicy.createHTML("");
4096
+ }
4097
+ }
4098
+ if (freeze) {
4099
+ freeze(cfg);
4100
+ }
4101
+ CONFIG = cfg;
4102
+ };
4103
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
4104
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
4105
+ const _checkValidNamespace = function _checkValidNamespace2(element) {
4106
+ let parent = getParentNode(element);
4107
+ if (!parent || !parent.tagName) {
4108
+ parent = {
4109
+ namespaceURI: NAMESPACE,
4110
+ tagName: "template"
4111
+ };
4112
+ }
4113
+ const tagName = stringToLowerCase(element.tagName);
4114
+ const parentTagName = stringToLowerCase(parent.tagName);
4115
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
4116
+ return false;
4117
+ }
4118
+ if (element.namespaceURI === SVG_NAMESPACE) {
4119
+ if (parent.namespaceURI === HTML_NAMESPACE) {
4120
+ return tagName === "svg";
4121
+ }
4122
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
4123
+ return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
4124
+ }
4125
+ return Boolean(ALL_SVG_TAGS[tagName]);
4126
+ }
4127
+ if (element.namespaceURI === MATHML_NAMESPACE) {
4128
+ if (parent.namespaceURI === HTML_NAMESPACE) {
4129
+ return tagName === "math";
4130
+ }
4131
+ if (parent.namespaceURI === SVG_NAMESPACE) {
4132
+ return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
4133
+ }
4134
+ return Boolean(ALL_MATHML_TAGS[tagName]);
4135
+ }
4136
+ if (element.namespaceURI === HTML_NAMESPACE) {
4137
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
4138
+ return false;
4139
+ }
4140
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
4141
+ return false;
4142
+ }
4143
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
4144
+ }
4145
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
4146
+ return true;
4147
+ }
4148
+ return false;
4149
+ };
4150
+ const _forceRemove = function _forceRemove2(node2) {
4151
+ arrayPush(DOMPurify.removed, {
4152
+ element: node2
4153
+ });
4154
+ try {
4155
+ getParentNode(node2).removeChild(node2);
4156
+ } catch (_2) {
4157
+ remove(node2);
4158
+ }
4159
+ };
4160
+ const _removeAttribute = function _removeAttribute2(name, element) {
4161
+ try {
4162
+ arrayPush(DOMPurify.removed, {
4163
+ attribute: element.getAttributeNode(name),
4164
+ from: element
4165
+ });
4166
+ } catch (_2) {
4167
+ arrayPush(DOMPurify.removed, {
4168
+ attribute: null,
4169
+ from: element
4170
+ });
4171
+ }
4172
+ element.removeAttribute(name);
4173
+ if (name === "is") {
4174
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
4175
+ try {
4176
+ _forceRemove(element);
4177
+ } catch (_2) {
4178
+ }
4179
+ } else {
4180
+ try {
4181
+ element.setAttribute(name, "");
4182
+ } catch (_2) {
4183
+ }
4184
+ }
4185
+ }
4186
+ };
4187
+ const _initDocument = function _initDocument2(dirty) {
4188
+ let doc = null;
4189
+ let leadingWhitespace = null;
4190
+ if (FORCE_BODY) {
4191
+ dirty = "<remove></remove>" + dirty;
4192
+ } else {
4193
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
4194
+ leadingWhitespace = matches && matches[0];
4195
+ }
4196
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
4197
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
4198
+ }
4199
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
4200
+ if (NAMESPACE === HTML_NAMESPACE) {
4201
+ try {
4202
+ doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
4203
+ } catch (_2) {
4204
+ }
4205
+ }
4206
+ if (!doc || !doc.documentElement) {
4207
+ doc = implementation.createDocument(NAMESPACE, "template", null);
4208
+ try {
4209
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
4210
+ } catch (_2) {
4211
+ }
4212
+ }
4213
+ const body = doc.body || doc.documentElement;
4214
+ if (dirty && leadingWhitespace) {
4215
+ body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
4216
+ }
4217
+ if (NAMESPACE === HTML_NAMESPACE) {
4218
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
4219
+ }
4220
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
4221
+ };
4222
+ const _createNodeIterator = function _createNodeIterator2(root) {
4223
+ return createNodeIterator.call(
4224
+ root.ownerDocument || root,
4225
+ root,
4226
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
4227
+ null
4228
+ );
4229
+ };
4230
+ const _isClobbered = function _isClobbered2(element) {
4231
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
4232
+ };
4233
+ const _isNode = function _isNode2(value) {
4234
+ return typeof Node2 === "function" && value instanceof Node2;
4235
+ };
4236
+ function _executeHooks(hooks2, currentNode, data) {
4237
+ arrayForEach(hooks2, (hook) => {
4238
+ hook.call(DOMPurify, currentNode, data, CONFIG);
4239
+ });
4240
+ }
4241
+ const _sanitizeElements = function _sanitizeElements2(currentNode) {
4242
+ let content = null;
4243
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
4244
+ if (_isClobbered(currentNode)) {
4245
+ _forceRemove(currentNode);
4246
+ return true;
4247
+ }
4248
+ const tagName = transformCaseFunc(currentNode.nodeName);
4249
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
4250
+ tagName,
4251
+ allowedTags: ALLOWED_TAGS
4252
+ });
4253
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
4254
+ _forceRemove(currentNode);
4255
+ return true;
4256
+ }
4257
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
4258
+ _forceRemove(currentNode);
4259
+ return true;
4260
+ }
4261
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
4262
+ _forceRemove(currentNode);
4263
+ return true;
4264
+ }
4265
+ if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
4266
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
4267
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
4268
+ return false;
4269
+ }
4270
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
4271
+ return false;
4272
+ }
4273
+ }
4274
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
4275
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
4276
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
4277
+ if (childNodes && parentNode) {
4278
+ const childCount = childNodes.length;
4279
+ for (let i2 = childCount - 1; i2 >= 0; --i2) {
4280
+ const childClone = cloneNode2(childNodes[i2], true);
4281
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
4282
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
4283
+ }
4284
+ }
4285
+ }
4286
+ _forceRemove(currentNode);
4287
+ return true;
4288
+ }
4289
+ if (currentNode instanceof Element2 && !_checkValidNamespace(currentNode)) {
4290
+ _forceRemove(currentNode);
4291
+ return true;
4292
+ }
4293
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
4294
+ _forceRemove(currentNode);
4295
+ return true;
4296
+ }
4297
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
4298
+ content = currentNode.textContent;
4299
+ arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
4300
+ content = stringReplace(content, expr, " ");
4301
+ });
4302
+ if (currentNode.textContent !== content) {
4303
+ arrayPush(DOMPurify.removed, {
4304
+ element: currentNode.cloneNode()
4305
+ });
4306
+ currentNode.textContent = content;
4307
+ }
4308
+ }
4309
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
4310
+ return false;
4311
+ };
4312
+ const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
4313
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
4314
+ return false;
4315
+ }
4316
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName))
4317
+ ;
4318
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName))
4319
+ ;
4320
+ else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag))
4321
+ ;
4322
+ else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
4323
+ if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)))
4324
+ ;
4325
+ else {
4326
+ return false;
4327
+ }
4328
+ } else if (URI_SAFE_ATTRIBUTES[lcName])
4329
+ ;
4330
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE2, "")))
4331
+ ;
4332
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag])
4333
+ ;
4334
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value, ATTR_WHITESPACE2, "")))
4335
+ ;
4336
+ else if (value) {
4337
+ return false;
4338
+ } else
4339
+ ;
4340
+ return true;
4341
+ };
4342
+ const _isBasicCustomElement = function _isBasicCustomElement2(tagName) {
4343
+ return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2);
4344
+ };
4345
+ const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
4346
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
4347
+ const {
4348
+ attributes
4349
+ } = currentNode;
4350
+ if (!attributes || _isClobbered(currentNode)) {
4351
+ return;
4352
+ }
4353
+ const hookEvent = {
4354
+ attrName: "",
4355
+ attrValue: "",
4356
+ keepAttr: true,
4357
+ allowedAttributes: ALLOWED_ATTR,
4358
+ forceKeepAttr: void 0
4359
+ };
4360
+ let l2 = attributes.length;
4361
+ while (l2--) {
4362
+ const attr = attributes[l2];
4363
+ const {
4364
+ name,
4365
+ namespaceURI,
4366
+ value: attrValue
4367
+ } = attr;
4368
+ const lcName = transformCaseFunc(name);
4369
+ const initValue = attrValue;
4370
+ let value = name === "value" ? initValue : stringTrim(initValue);
4371
+ hookEvent.attrName = lcName;
4372
+ hookEvent.attrValue = value;
4373
+ hookEvent.keepAttr = true;
4374
+ hookEvent.forceKeepAttr = void 0;
4375
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
4376
+ value = hookEvent.attrValue;
4377
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
4378
+ _removeAttribute(name, currentNode);
4379
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
4380
+ }
4381
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
4382
+ _removeAttribute(name, currentNode);
4383
+ continue;
4384
+ }
4385
+ if (lcName === "attributename" && stringMatch(value, "href")) {
4386
+ _removeAttribute(name, currentNode);
4387
+ continue;
4388
+ }
4389
+ if (hookEvent.forceKeepAttr) {
4390
+ continue;
4391
+ }
4392
+ if (!hookEvent.keepAttr) {
4393
+ _removeAttribute(name, currentNode);
4394
+ continue;
4395
+ }
4396
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
4397
+ _removeAttribute(name, currentNode);
4398
+ continue;
4399
+ }
4400
+ if (SAFE_FOR_TEMPLATES) {
4401
+ arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
4402
+ value = stringReplace(value, expr, " ");
4403
+ });
4404
+ }
4405
+ const lcTag = transformCaseFunc(currentNode.nodeName);
4406
+ if (!_isValidAttribute(lcTag, lcName, value)) {
4407
+ _removeAttribute(name, currentNode);
4408
+ continue;
4409
+ }
4410
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
4411
+ if (namespaceURI)
4412
+ ;
4413
+ else {
4414
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
4415
+ case "TrustedHTML": {
4416
+ value = trustedTypesPolicy.createHTML(value);
4417
+ break;
4418
+ }
4419
+ case "TrustedScriptURL": {
4420
+ value = trustedTypesPolicy.createScriptURL(value);
4421
+ break;
4422
+ }
4423
+ }
4424
+ }
4425
+ }
4426
+ if (value !== initValue) {
4427
+ try {
4428
+ if (namespaceURI) {
4429
+ currentNode.setAttributeNS(namespaceURI, name, value);
4430
+ } else {
4431
+ currentNode.setAttribute(name, value);
4432
+ }
4433
+ if (_isClobbered(currentNode)) {
4434
+ _forceRemove(currentNode);
4435
+ } else {
4436
+ arrayPop(DOMPurify.removed);
4437
+ }
4438
+ } catch (_2) {
4439
+ _removeAttribute(name, currentNode);
4440
+ }
4441
+ }
4442
+ }
4443
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
4444
+ };
4445
+ const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
4446
+ let shadowNode = null;
4447
+ const shadowIterator = _createNodeIterator(fragment);
4448
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
4449
+ while (shadowNode = shadowIterator.nextNode()) {
4450
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
4451
+ _sanitizeElements(shadowNode);
4452
+ _sanitizeAttributes(shadowNode);
4453
+ if (shadowNode.content instanceof DocumentFragment) {
4454
+ _sanitizeShadowDOM2(shadowNode.content);
4455
+ }
4456
+ }
4457
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
4458
+ };
4459
+ DOMPurify.sanitize = function(dirty) {
4460
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4461
+ let body = null;
4462
+ let importedNode = null;
4463
+ let currentNode = null;
4464
+ let returnNode = null;
4465
+ IS_EMPTY_INPUT = !dirty;
4466
+ if (IS_EMPTY_INPUT) {
4467
+ dirty = "<!-->";
4468
+ }
4469
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
4470
+ if (typeof dirty.toString === "function") {
4471
+ dirty = dirty.toString();
4472
+ if (typeof dirty !== "string") {
4473
+ throw typeErrorCreate("dirty is not a string, aborting");
4474
+ }
4475
+ } else {
4476
+ throw typeErrorCreate("toString is not a function");
4477
+ }
4478
+ }
4479
+ if (!DOMPurify.isSupported) {
4480
+ return dirty;
4481
+ }
4482
+ if (!SET_CONFIG) {
4483
+ _parseConfig(cfg);
4484
+ }
4485
+ DOMPurify.removed = [];
4486
+ if (typeof dirty === "string") {
4487
+ IN_PLACE = false;
4488
+ }
4489
+ if (IN_PLACE) {
4490
+ if (dirty.nodeName) {
4491
+ const tagName = transformCaseFunc(dirty.nodeName);
4492
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
4493
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
4494
+ }
4495
+ }
4496
+ } else if (dirty instanceof Node2) {
4497
+ body = _initDocument("<!---->");
4498
+ importedNode = body.ownerDocument.importNode(dirty, true);
4499
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
4500
+ body = importedNode;
4501
+ } else if (importedNode.nodeName === "HTML") {
4502
+ body = importedNode;
4503
+ } else {
4504
+ body.appendChild(importedNode);
4505
+ }
4506
+ } else {
4507
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) {
4508
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
4509
+ }
4510
+ body = _initDocument(dirty);
4511
+ if (!body) {
4512
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
4513
+ }
4514
+ }
4515
+ if (body && FORCE_BODY) {
4516
+ _forceRemove(body.firstChild);
4517
+ }
4518
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
4519
+ while (currentNode = nodeIterator.nextNode()) {
4520
+ _sanitizeElements(currentNode);
4521
+ _sanitizeAttributes(currentNode);
4522
+ if (currentNode.content instanceof DocumentFragment) {
4523
+ _sanitizeShadowDOM(currentNode.content);
4524
+ }
4525
+ }
4526
+ if (IN_PLACE) {
4527
+ return dirty;
4528
+ }
4529
+ if (RETURN_DOM) {
4530
+ if (RETURN_DOM_FRAGMENT) {
4531
+ returnNode = createDocumentFragment.call(body.ownerDocument);
4532
+ while (body.firstChild) {
4533
+ returnNode.appendChild(body.firstChild);
4534
+ }
4535
+ } else {
4536
+ returnNode = body;
4537
+ }
4538
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
4539
+ returnNode = importNode.call(originalDocument, returnNode, true);
4540
+ }
4541
+ return returnNode;
4542
+ }
4543
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
4544
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
4545
+ serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
4546
+ }
4547
+ if (SAFE_FOR_TEMPLATES) {
4548
+ arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
4549
+ serializedHTML = stringReplace(serializedHTML, expr, " ");
4550
+ });
4551
+ }
4552
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
4553
+ };
4554
+ DOMPurify.setConfig = function() {
4555
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
4556
+ _parseConfig(cfg);
4557
+ SET_CONFIG = true;
4558
+ };
4559
+ DOMPurify.clearConfig = function() {
4560
+ CONFIG = null;
4561
+ SET_CONFIG = false;
4562
+ };
4563
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
4564
+ if (!CONFIG) {
4565
+ _parseConfig({});
4566
+ }
4567
+ const lcTag = transformCaseFunc(tag);
4568
+ const lcName = transformCaseFunc(attr);
4569
+ return _isValidAttribute(lcTag, lcName, value);
4570
+ };
4571
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
4572
+ if (typeof hookFunction !== "function") {
4573
+ return;
4574
+ }
4575
+ arrayPush(hooks[entryPoint], hookFunction);
4576
+ };
4577
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
4578
+ if (hookFunction !== void 0) {
4579
+ const index2 = arrayLastIndexOf(hooks[entryPoint], hookFunction);
4580
+ return index2 === -1 ? void 0 : arraySplice(hooks[entryPoint], index2, 1)[0];
4581
+ }
4582
+ return arrayPop(hooks[entryPoint]);
4583
+ };
4584
+ DOMPurify.removeHooks = function(entryPoint) {
4585
+ hooks[entryPoint] = [];
4586
+ };
4587
+ DOMPurify.removeAllHooks = function() {
4588
+ hooks = _createHooksMap();
4589
+ };
4590
+ return DOMPurify;
4591
+ }
4592
+ var purify = createDOMPurify();
4593
+ var lib$3 = {};
4594
+ var htmlToDom = {};
4595
+ var domparser$1 = {};
4596
+ var utilities$2 = {};
4597
+ var lib$2 = {};
4598
+ var lib$1 = {};
4599
+ (function(exports) {
4600
+ Object.defineProperty(exports, "__esModule", { value: true });
4601
+ exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
4602
+ var ElementType;
4603
+ (function(ElementType2) {
4604
+ ElementType2["Root"] = "root";
4605
+ ElementType2["Text"] = "text";
4606
+ ElementType2["Directive"] = "directive";
4607
+ ElementType2["Comment"] = "comment";
4608
+ ElementType2["Script"] = "script";
4609
+ ElementType2["Style"] = "style";
4610
+ ElementType2["Tag"] = "tag";
4611
+ ElementType2["CDATA"] = "cdata";
4612
+ ElementType2["Doctype"] = "doctype";
4613
+ })(ElementType = exports.ElementType || (exports.ElementType = {}));
4614
+ function isTag2(elem) {
4615
+ return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
4616
+ }
4617
+ exports.isTag = isTag2;
4618
+ exports.Root = ElementType.Root;
4619
+ exports.Text = ElementType.Text;
4620
+ exports.Directive = ElementType.Directive;
4621
+ exports.Comment = ElementType.Comment;
4622
+ exports.Script = ElementType.Script;
4623
+ exports.Style = ElementType.Style;
4624
+ exports.Tag = ElementType.Tag;
4625
+ exports.CDATA = ElementType.CDATA;
4626
+ exports.Doctype = ElementType.Doctype;
4627
+ })(lib$1);
4628
+ var node = {};
4629
+ var __extends = commonjsGlobal && commonjsGlobal.__extends || function() {
4630
+ var extendStatics = function(d2, b2) {
4631
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
4632
+ d3.__proto__ = b3;
4633
+ } || function(d3, b3) {
4634
+ for (var p2 in b3)
4635
+ if (Object.prototype.hasOwnProperty.call(b3, p2))
4636
+ d3[p2] = b3[p2];
4637
+ };
4638
+ return extendStatics(d2, b2);
4639
+ };
4640
+ return function(d2, b2) {
4641
+ if (typeof b2 !== "function" && b2 !== null)
4642
+ throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
4643
+ extendStatics(d2, b2);
4644
+ function __() {
4645
+ this.constructor = d2;
4646
+ }
4647
+ d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
4648
+ };
4649
+ }();
4650
+ var __assign = commonjsGlobal && commonjsGlobal.__assign || function() {
4651
+ __assign = Object.assign || function(t2) {
4652
+ for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
4653
+ s2 = arguments[i2];
4654
+ for (var p2 in s2)
4655
+ if (Object.prototype.hasOwnProperty.call(s2, p2))
4656
+ t2[p2] = s2[p2];
4657
+ }
4658
+ return t2;
4659
+ };
4660
+ return __assign.apply(this, arguments);
4661
+ };
4662
+ Object.defineProperty(node, "__esModule", { value: true });
4663
+ node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.CDATA = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
4664
+ var domelementtype_1 = lib$1;
4665
+ var Node = function() {
4666
+ function Node2() {
4667
+ this.parent = null;
4668
+ this.prev = null;
4669
+ this.next = null;
4670
+ this.startIndex = null;
4671
+ this.endIndex = null;
4672
+ }
4673
+ Object.defineProperty(Node2.prototype, "parentNode", {
4674
+ get: function() {
4675
+ return this.parent;
4676
+ },
4677
+ set: function(parent) {
4678
+ this.parent = parent;
4679
+ },
4680
+ enumerable: false,
4681
+ configurable: true
4682
+ });
4683
+ Object.defineProperty(Node2.prototype, "previousSibling", {
4684
+ get: function() {
4685
+ return this.prev;
4686
+ },
4687
+ set: function(prev) {
4688
+ this.prev = prev;
4689
+ },
4690
+ enumerable: false,
4691
+ configurable: true
4692
+ });
4693
+ Object.defineProperty(Node2.prototype, "nextSibling", {
4694
+ get: function() {
4695
+ return this.next;
4696
+ },
4697
+ set: function(next) {
4698
+ this.next = next;
4699
+ },
4700
+ enumerable: false,
4701
+ configurable: true
4702
+ });
4703
+ Node2.prototype.cloneNode = function(recursive) {
4704
+ if (recursive === void 0) {
4705
+ recursive = false;
4706
+ }
4707
+ return cloneNode(this, recursive);
4708
+ };
4709
+ return Node2;
4710
+ }();
4711
+ node.Node = Node;
4712
+ var DataNode = function(_super) {
4713
+ __extends(DataNode2, _super);
4714
+ function DataNode2(data) {
4715
+ var _this = _super.call(this) || this;
4716
+ _this.data = data;
4717
+ return _this;
4718
+ }
4719
+ Object.defineProperty(DataNode2.prototype, "nodeValue", {
4720
+ get: function() {
4721
+ return this.data;
4722
+ },
4723
+ set: function(data) {
4724
+ this.data = data;
4725
+ },
4726
+ enumerable: false,
4727
+ configurable: true
4728
+ });
4729
+ return DataNode2;
4730
+ }(Node);
4731
+ node.DataNode = DataNode;
4732
+ var Text = function(_super) {
4733
+ __extends(Text2, _super);
4734
+ function Text2() {
4735
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4736
+ _this.type = domelementtype_1.ElementType.Text;
4737
+ return _this;
4738
+ }
4739
+ Object.defineProperty(Text2.prototype, "nodeType", {
4740
+ get: function() {
4741
+ return 3;
4742
+ },
4743
+ enumerable: false,
4744
+ configurable: true
4745
+ });
4746
+ return Text2;
4747
+ }(DataNode);
4748
+ node.Text = Text;
4749
+ var Comment = function(_super) {
4750
+ __extends(Comment2, _super);
4751
+ function Comment2() {
4752
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4753
+ _this.type = domelementtype_1.ElementType.Comment;
4754
+ return _this;
4755
+ }
4756
+ Object.defineProperty(Comment2.prototype, "nodeType", {
4757
+ get: function() {
4758
+ return 8;
4759
+ },
4760
+ enumerable: false,
4761
+ configurable: true
4762
+ });
4763
+ return Comment2;
4764
+ }(DataNode);
4765
+ node.Comment = Comment;
4766
+ var ProcessingInstruction = function(_super) {
4767
+ __extends(ProcessingInstruction2, _super);
4768
+ function ProcessingInstruction2(name, data) {
4769
+ var _this = _super.call(this, data) || this;
4770
+ _this.name = name;
4771
+ _this.type = domelementtype_1.ElementType.Directive;
4772
+ return _this;
4773
+ }
4774
+ Object.defineProperty(ProcessingInstruction2.prototype, "nodeType", {
4775
+ get: function() {
4776
+ return 1;
4777
+ },
4778
+ enumerable: false,
4779
+ configurable: true
4780
+ });
4781
+ return ProcessingInstruction2;
4782
+ }(DataNode);
4783
+ node.ProcessingInstruction = ProcessingInstruction;
4784
+ var NodeWithChildren = function(_super) {
4785
+ __extends(NodeWithChildren2, _super);
4786
+ function NodeWithChildren2(children) {
4787
+ var _this = _super.call(this) || this;
4788
+ _this.children = children;
4789
+ return _this;
4790
+ }
4791
+ Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
4792
+ get: function() {
4793
+ var _a;
4794
+ return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
4795
+ },
4796
+ enumerable: false,
4797
+ configurable: true
4798
+ });
4799
+ Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
4800
+ get: function() {
4801
+ return this.children.length > 0 ? this.children[this.children.length - 1] : null;
4802
+ },
4803
+ enumerable: false,
4804
+ configurable: true
4805
+ });
4806
+ Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
4807
+ get: function() {
4808
+ return this.children;
4809
+ },
4810
+ set: function(children) {
4811
+ this.children = children;
4812
+ },
4813
+ enumerable: false,
4814
+ configurable: true
4815
+ });
4816
+ return NodeWithChildren2;
4817
+ }(Node);
4818
+ node.NodeWithChildren = NodeWithChildren;
4819
+ var CDATA = function(_super) {
4820
+ __extends(CDATA2, _super);
4821
+ function CDATA2() {
4822
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4823
+ _this.type = domelementtype_1.ElementType.CDATA;
4824
+ return _this;
4825
+ }
4826
+ Object.defineProperty(CDATA2.prototype, "nodeType", {
4827
+ get: function() {
4828
+ return 4;
4829
+ },
4830
+ enumerable: false,
4831
+ configurable: true
4832
+ });
4833
+ return CDATA2;
4834
+ }(NodeWithChildren);
4835
+ node.CDATA = CDATA;
4836
+ var Document = function(_super) {
4837
+ __extends(Document2, _super);
4838
+ function Document2() {
4839
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4840
+ _this.type = domelementtype_1.ElementType.Root;
4841
+ return _this;
4842
+ }
4843
+ Object.defineProperty(Document2.prototype, "nodeType", {
4844
+ get: function() {
4845
+ return 9;
4846
+ },
4847
+ enumerable: false,
4848
+ configurable: true
4849
+ });
4850
+ return Document2;
4851
+ }(NodeWithChildren);
4852
+ node.Document = Document;
4853
+ var Element = function(_super) {
4854
+ __extends(Element2, _super);
4855
+ function Element2(name, attribs, children, type) {
4856
+ if (children === void 0) {
4857
+ children = [];
4858
+ }
4859
+ if (type === void 0) {
4860
+ type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
4861
+ }
4862
+ var _this = _super.call(this, children) || this;
4863
+ _this.name = name;
4864
+ _this.attribs = attribs;
4865
+ _this.type = type;
4866
+ return _this;
4867
+ }
4868
+ Object.defineProperty(Element2.prototype, "nodeType", {
4869
+ get: function() {
4870
+ return 1;
4871
+ },
4872
+ enumerable: false,
4873
+ configurable: true
4874
+ });
4875
+ Object.defineProperty(Element2.prototype, "tagName", {
4876
+ get: function() {
4877
+ return this.name;
4878
+ },
4879
+ set: function(name) {
4880
+ this.name = name;
4881
+ },
4882
+ enumerable: false,
4883
+ configurable: true
4884
+ });
4885
+ Object.defineProperty(Element2.prototype, "attributes", {
4886
+ get: function() {
4887
+ var _this = this;
4888
+ return Object.keys(this.attribs).map(function(name) {
4889
+ var _a, _b;
4890
+ return {
4891
+ name,
4892
+ value: _this.attribs[name],
4893
+ namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
4894
+ prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
4895
+ };
4896
+ });
4897
+ },
4898
+ enumerable: false,
4899
+ configurable: true
4900
+ });
4901
+ return Element2;
4902
+ }(NodeWithChildren);
4903
+ node.Element = Element;
4904
+ function isTag(node2) {
4905
+ return (0, domelementtype_1.isTag)(node2);
4906
+ }
4907
+ node.isTag = isTag;
4908
+ function isCDATA(node2) {
4909
+ return node2.type === domelementtype_1.ElementType.CDATA;
4910
+ }
4911
+ node.isCDATA = isCDATA;
4912
+ function isText(node2) {
4913
+ return node2.type === domelementtype_1.ElementType.Text;
4914
+ }
4915
+ node.isText = isText;
4916
+ function isComment(node2) {
4917
+ return node2.type === domelementtype_1.ElementType.Comment;
4918
+ }
4919
+ node.isComment = isComment;
4920
+ function isDirective(node2) {
4921
+ return node2.type === domelementtype_1.ElementType.Directive;
4922
+ }
4923
+ node.isDirective = isDirective;
4924
+ function isDocument(node2) {
4925
+ return node2.type === domelementtype_1.ElementType.Root;
4926
+ }
4927
+ node.isDocument = isDocument;
4928
+ function hasChildren(node2) {
4929
+ return Object.prototype.hasOwnProperty.call(node2, "children");
4930
+ }
4931
+ node.hasChildren = hasChildren;
4932
+ function cloneNode(node2, recursive) {
4933
+ if (recursive === void 0) {
4934
+ recursive = false;
4935
+ }
4936
+ var result;
4937
+ if (isText(node2)) {
4938
+ result = new Text(node2.data);
4939
+ } else if (isComment(node2)) {
4940
+ result = new Comment(node2.data);
4941
+ } else if (isTag(node2)) {
4942
+ var children = recursive ? cloneChildren(node2.children) : [];
4943
+ var clone_1 = new Element(node2.name, __assign({}, node2.attribs), children);
4944
+ children.forEach(function(child) {
4945
+ return child.parent = clone_1;
4946
+ });
4947
+ if (node2.namespace != null) {
4948
+ clone_1.namespace = node2.namespace;
4949
+ }
4950
+ if (node2["x-attribsNamespace"]) {
4951
+ clone_1["x-attribsNamespace"] = __assign({}, node2["x-attribsNamespace"]);
4952
+ }
4953
+ if (node2["x-attribsPrefix"]) {
4954
+ clone_1["x-attribsPrefix"] = __assign({}, node2["x-attribsPrefix"]);
4955
+ }
4956
+ result = clone_1;
4957
+ } else if (isCDATA(node2)) {
4958
+ var children = recursive ? cloneChildren(node2.children) : [];
4959
+ var clone_2 = new CDATA(children);
4960
+ children.forEach(function(child) {
4961
+ return child.parent = clone_2;
4962
+ });
4963
+ result = clone_2;
4964
+ } else if (isDocument(node2)) {
4965
+ var children = recursive ? cloneChildren(node2.children) : [];
4966
+ var clone_3 = new Document(children);
4967
+ children.forEach(function(child) {
4968
+ return child.parent = clone_3;
4969
+ });
4970
+ if (node2["x-mode"]) {
4971
+ clone_3["x-mode"] = node2["x-mode"];
4972
+ }
4973
+ result = clone_3;
4974
+ } else if (isDirective(node2)) {
4975
+ var instruction = new ProcessingInstruction(node2.name, node2.data);
4976
+ if (node2["x-name"] != null) {
4977
+ instruction["x-name"] = node2["x-name"];
4978
+ instruction["x-publicId"] = node2["x-publicId"];
4979
+ instruction["x-systemId"] = node2["x-systemId"];
4980
+ }
4981
+ result = instruction;
4982
+ } else {
4983
+ throw new Error("Not implemented yet: ".concat(node2.type));
4984
+ }
4985
+ result.startIndex = node2.startIndex;
4986
+ result.endIndex = node2.endIndex;
4987
+ if (node2.sourceCodeLocation != null) {
4988
+ result.sourceCodeLocation = node2.sourceCodeLocation;
4989
+ }
4990
+ return result;
4991
+ }
4992
+ node.cloneNode = cloneNode;
4993
+ function cloneChildren(childs) {
4994
+ var children = childs.map(function(child) {
4995
+ return cloneNode(child, true);
4996
+ });
4997
+ for (var i2 = 1; i2 < children.length; i2++) {
4998
+ children[i2].prev = children[i2 - 1];
4999
+ children[i2 - 1].next = children[i2];
5000
+ }
5001
+ return children;
5002
+ }
5003
+ (function(exports) {
5004
+ var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m2, k, k2) {
5005
+ if (k2 === void 0)
5006
+ k2 = k;
5007
+ var desc = Object.getOwnPropertyDescriptor(m2, k);
5008
+ if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
5009
+ desc = { enumerable: true, get: function() {
5010
+ return m2[k];
5011
+ } };
5012
+ }
5013
+ Object.defineProperty(o2, k2, desc);
5014
+ } : function(o2, m2, k, k2) {
5015
+ if (k2 === void 0)
5016
+ k2 = k;
5017
+ o2[k2] = m2[k];
5018
+ });
5019
+ var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m2, exports2) {
5020
+ for (var p2 in m2)
5021
+ if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2))
5022
+ __createBinding(exports2, m2, p2);
5023
+ };
5024
+ Object.defineProperty(exports, "__esModule", { value: true });
5025
+ exports.DomHandler = void 0;
5026
+ var domelementtype_12 = lib$1;
5027
+ var node_js_1 = node;
5028
+ __exportStar(node, exports);
5029
+ var defaultOpts = {
5030
+ withStartIndices: false,
5031
+ withEndIndices: false,
5032
+ xmlMode: false
5033
+ };
5034
+ var DomHandler = function() {
5035
+ function DomHandler2(callback, options, elementCB) {
5036
+ this.dom = [];
5037
+ this.root = new node_js_1.Document(this.dom);
5038
+ this.done = false;
5039
+ this.tagStack = [this.root];
5040
+ this.lastNode = null;
5041
+ this.parser = null;
5042
+ if (typeof options === "function") {
5043
+ elementCB = options;
5044
+ options = defaultOpts;
5045
+ }
5046
+ if (typeof callback === "object") {
5047
+ options = callback;
5048
+ callback = void 0;
5049
+ }
5050
+ this.callback = callback !== null && callback !== void 0 ? callback : null;
5051
+ this.options = options !== null && options !== void 0 ? options : defaultOpts;
5052
+ this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
5053
+ }
5054
+ DomHandler2.prototype.onparserinit = function(parser) {
5055
+ this.parser = parser;
5056
+ };
5057
+ DomHandler2.prototype.onreset = function() {
5058
+ this.dom = [];
5059
+ this.root = new node_js_1.Document(this.dom);
5060
+ this.done = false;
5061
+ this.tagStack = [this.root];
5062
+ this.lastNode = null;
5063
+ this.parser = null;
5064
+ };
5065
+ DomHandler2.prototype.onend = function() {
5066
+ if (this.done)
5067
+ return;
5068
+ this.done = true;
5069
+ this.parser = null;
5070
+ this.handleCallback(null);
5071
+ };
5072
+ DomHandler2.prototype.onerror = function(error) {
5073
+ this.handleCallback(error);
5074
+ };
5075
+ DomHandler2.prototype.onclosetag = function() {
5076
+ this.lastNode = null;
5077
+ var elem = this.tagStack.pop();
5078
+ if (this.options.withEndIndices) {
5079
+ elem.endIndex = this.parser.endIndex;
5080
+ }
5081
+ if (this.elementCB)
5082
+ this.elementCB(elem);
5083
+ };
5084
+ DomHandler2.prototype.onopentag = function(name, attribs) {
5085
+ var type = this.options.xmlMode ? domelementtype_12.ElementType.Tag : void 0;
5086
+ var element = new node_js_1.Element(name, attribs, void 0, type);
5087
+ this.addNode(element);
5088
+ this.tagStack.push(element);
5089
+ };
5090
+ DomHandler2.prototype.ontext = function(data) {
5091
+ var lastNode = this.lastNode;
5092
+ if (lastNode && lastNode.type === domelementtype_12.ElementType.Text) {
5093
+ lastNode.data += data;
5094
+ if (this.options.withEndIndices) {
5095
+ lastNode.endIndex = this.parser.endIndex;
5096
+ }
5097
+ } else {
5098
+ var node2 = new node_js_1.Text(data);
5099
+ this.addNode(node2);
5100
+ this.lastNode = node2;
5101
+ }
5102
+ };
5103
+ DomHandler2.prototype.oncomment = function(data) {
5104
+ if (this.lastNode && this.lastNode.type === domelementtype_12.ElementType.Comment) {
5105
+ this.lastNode.data += data;
5106
+ return;
5107
+ }
5108
+ var node2 = new node_js_1.Comment(data);
5109
+ this.addNode(node2);
5110
+ this.lastNode = node2;
5111
+ };
5112
+ DomHandler2.prototype.oncommentend = function() {
5113
+ this.lastNode = null;
5114
+ };
5115
+ DomHandler2.prototype.oncdatastart = function() {
5116
+ var text2 = new node_js_1.Text("");
5117
+ var node2 = new node_js_1.CDATA([text2]);
5118
+ this.addNode(node2);
5119
+ text2.parent = node2;
5120
+ this.lastNode = text2;
5121
+ };
5122
+ DomHandler2.prototype.oncdataend = function() {
5123
+ this.lastNode = null;
5124
+ };
5125
+ DomHandler2.prototype.onprocessinginstruction = function(name, data) {
5126
+ var node2 = new node_js_1.ProcessingInstruction(name, data);
5127
+ this.addNode(node2);
5128
+ };
5129
+ DomHandler2.prototype.handleCallback = function(error) {
5130
+ if (typeof this.callback === "function") {
5131
+ this.callback(error, this.dom);
5132
+ } else if (error) {
5133
+ throw error;
5134
+ }
5135
+ };
5136
+ DomHandler2.prototype.addNode = function(node2) {
5137
+ var parent = this.tagStack[this.tagStack.length - 1];
5138
+ var previousSibling = parent.children[parent.children.length - 1];
5139
+ if (this.options.withStartIndices) {
5140
+ node2.startIndex = this.parser.startIndex;
5141
+ }
5142
+ if (this.options.withEndIndices) {
5143
+ node2.endIndex = this.parser.endIndex;
5144
+ }
5145
+ parent.children.push(node2);
5146
+ if (previousSibling) {
5147
+ node2.prev = previousSibling;
5148
+ previousSibling.next = node2;
5149
+ }
5150
+ node2.parent = parent;
5151
+ this.lastNode = null;
5152
+ };
5153
+ return DomHandler2;
5154
+ }();
5155
+ exports.DomHandler = DomHandler;
5156
+ exports.default = DomHandler;
5157
+ })(lib$2);
5158
+ var constants = {};
5159
+ (function(exports) {
5160
+ Object.defineProperty(exports, "__esModule", { value: true });
5161
+ exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = exports.CARRIAGE_RETURN_PLACEHOLDER = exports.CARRIAGE_RETURN_REGEX = exports.CARRIAGE_RETURN = exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES = void 0;
5162
+ exports.CASE_SENSITIVE_TAG_NAMES = [
5163
+ "animateMotion",
5164
+ "animateTransform",
5165
+ "clipPath",
5166
+ "feBlend",
5167
+ "feColorMatrix",
5168
+ "feComponentTransfer",
5169
+ "feComposite",
5170
+ "feConvolveMatrix",
5171
+ "feDiffuseLighting",
5172
+ "feDisplacementMap",
5173
+ "feDropShadow",
5174
+ "feFlood",
5175
+ "feFuncA",
5176
+ "feFuncB",
5177
+ "feFuncG",
5178
+ "feFuncR",
5179
+ "feGaussianBlur",
5180
+ "feImage",
5181
+ "feMerge",
5182
+ "feMergeNode",
5183
+ "feMorphology",
5184
+ "feOffset",
5185
+ "fePointLight",
5186
+ "feSpecularLighting",
5187
+ "feSpotLight",
5188
+ "feTile",
5189
+ "feTurbulence",
5190
+ "foreignObject",
5191
+ "linearGradient",
5192
+ "radialGradient",
5193
+ "textPath"
5194
+ ];
5195
+ exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES.reduce(function(accumulator, tagName) {
5196
+ accumulator[tagName.toLowerCase()] = tagName;
5197
+ return accumulator;
5198
+ }, {});
5199
+ exports.CARRIAGE_RETURN = "\r";
5200
+ exports.CARRIAGE_RETURN_REGEX = new RegExp(exports.CARRIAGE_RETURN, "g");
5201
+ exports.CARRIAGE_RETURN_PLACEHOLDER = "__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(), "__");
5202
+ exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = new RegExp(exports.CARRIAGE_RETURN_PLACEHOLDER, "g");
5203
+ })(constants);
5204
+ Object.defineProperty(utilities$2, "__esModule", { value: true });
5205
+ utilities$2.formatAttributes = formatAttributes;
5206
+ utilities$2.escapeSpecialCharacters = escapeSpecialCharacters;
5207
+ utilities$2.revertEscapedCharacters = revertEscapedCharacters;
5208
+ utilities$2.formatDOM = formatDOM;
5209
+ var domhandler_1 = lib$2;
5210
+ var constants_1 = constants;
5211
+ function getCaseSensitiveTagName(tagName) {
5212
+ return constants_1.CASE_SENSITIVE_TAG_NAMES_MAP[tagName];
5213
+ }
5214
+ function formatAttributes(attributes) {
5215
+ var map = {};
5216
+ var index2 = 0;
5217
+ var attributesLength = attributes.length;
5218
+ for (; index2 < attributesLength; index2++) {
5219
+ var attribute = attributes[index2];
5220
+ map[attribute.name] = attribute.value;
5221
+ }
5222
+ return map;
5223
+ }
5224
+ function formatTagName(tagName) {
5225
+ tagName = tagName.toLowerCase();
5226
+ var caseSensitiveTagName = getCaseSensitiveTagName(tagName);
5227
+ if (caseSensitiveTagName) {
5228
+ return caseSensitiveTagName;
5229
+ }
5230
+ return tagName;
5231
+ }
5232
+ function escapeSpecialCharacters(html2) {
5233
+ return html2.replace(constants_1.CARRIAGE_RETURN_REGEX, constants_1.CARRIAGE_RETURN_PLACEHOLDER);
5234
+ }
5235
+ function revertEscapedCharacters(text2) {
5236
+ return text2.replace(constants_1.CARRIAGE_RETURN_PLACEHOLDER_REGEX, constants_1.CARRIAGE_RETURN);
5237
+ }
5238
+ function formatDOM(nodes, parent, directive) {
5239
+ if (parent === void 0) {
5240
+ parent = null;
5241
+ }
5242
+ var domNodes = [];
5243
+ var current;
5244
+ var index2 = 0;
5245
+ var nodesLength = nodes.length;
5246
+ for (; index2 < nodesLength; index2++) {
5247
+ var node2 = nodes[index2];
5248
+ switch (node2.nodeType) {
5249
+ case 1: {
5250
+ var tagName = formatTagName(node2.nodeName);
5251
+ current = new domhandler_1.Element(tagName, formatAttributes(node2.attributes));
5252
+ current.children = formatDOM(
5253
+ tagName === "template" ? node2.content.childNodes : node2.childNodes,
5254
+ current
5255
+ );
5256
+ break;
5257
+ }
5258
+ case 3:
5259
+ current = new domhandler_1.Text(revertEscapedCharacters(node2.nodeValue));
5260
+ break;
5261
+ case 8:
5262
+ current = new domhandler_1.Comment(node2.nodeValue);
5263
+ break;
5264
+ default:
5265
+ continue;
5266
+ }
5267
+ var prev = domNodes[index2 - 1] || null;
5268
+ if (prev) {
5269
+ prev.next = current;
5270
+ }
5271
+ current.parent = parent;
5272
+ current.prev = prev;
5273
+ current.next = null;
5274
+ domNodes.push(current);
5275
+ }
5276
+ if (directive) {
5277
+ current = new domhandler_1.ProcessingInstruction(directive.substring(0, directive.indexOf(" ")).toLowerCase(), directive);
5278
+ current.next = domNodes[0] || null;
5279
+ current.parent = parent;
5280
+ domNodes.unshift(current);
5281
+ if (domNodes[1]) {
5282
+ domNodes[1].prev = domNodes[0];
5283
+ }
5284
+ }
5285
+ return domNodes;
5286
+ }
5287
+ Object.defineProperty(domparser$1, "__esModule", { value: true });
5288
+ domparser$1.default = domparser;
5289
+ var utilities_1$4 = utilities$2;
5290
+ var HTML = "html";
5291
+ var HEAD = "head";
5292
+ var BODY = "body";
5293
+ var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/;
5294
+ var HEAD_TAG_REGEX = /<head[^]*>/i;
5295
+ var BODY_TAG_REGEX = /<body[^]*>/i;
5296
+ var parseFromDocument = function(html2, tagName) {
5297
+ throw new Error("This browser does not support `document.implementation.createHTMLDocument`");
5298
+ };
5299
+ var parseFromString = function(html2, tagName) {
5300
+ throw new Error("This browser does not support `DOMParser.prototype.parseFromString`");
5301
+ };
5302
+ var DOMParser = typeof window === "object" && window.DOMParser;
5303
+ if (typeof DOMParser === "function") {
5304
+ var domParser_1 = new DOMParser();
5305
+ var mimeType_1 = "text/html";
5306
+ parseFromString = function(html2, tagName) {
5307
+ if (tagName) {
5308
+ html2 = "<".concat(tagName, ">").concat(html2, "</").concat(tagName, ">");
5309
+ }
5310
+ return domParser_1.parseFromString(html2, mimeType_1);
5311
+ };
5312
+ parseFromDocument = parseFromString;
5313
+ }
5314
+ if (typeof document === "object" && document.implementation) {
5315
+ var htmlDocument_1 = document.implementation.createHTMLDocument();
5316
+ parseFromDocument = function(html2, tagName) {
5317
+ if (tagName) {
5318
+ var element = htmlDocument_1.documentElement.querySelector(tagName);
5319
+ if (element) {
5320
+ element.innerHTML = html2;
5321
+ }
5322
+ return htmlDocument_1;
5323
+ }
5324
+ htmlDocument_1.documentElement.innerHTML = html2;
5325
+ return htmlDocument_1;
5326
+ };
5327
+ }
5328
+ var template = typeof document === "object" && document.createElement("template");
5329
+ var parseFromTemplate;
5330
+ if (template && template.content) {
5331
+ parseFromTemplate = function(html2) {
5332
+ template.innerHTML = html2;
5333
+ return template.content.childNodes;
5334
+ };
5335
+ }
5336
+ function domparser(html2) {
5337
+ var _a, _b;
5338
+ html2 = (0, utilities_1$4.escapeSpecialCharacters)(html2);
5339
+ var match = html2.match(FIRST_TAG_REGEX);
5340
+ var firstTagName = match && match[1] ? match[1].toLowerCase() : "";
5341
+ switch (firstTagName) {
5342
+ case HTML: {
5343
+ var doc = parseFromString(html2);
5344
+ if (!HEAD_TAG_REGEX.test(html2)) {
5345
+ var element = doc.querySelector(HEAD);
5346
+ (_a = element === null || element === void 0 ? void 0 : element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
5347
+ }
5348
+ if (!BODY_TAG_REGEX.test(html2)) {
5349
+ var element = doc.querySelector(BODY);
5350
+ (_b = element === null || element === void 0 ? void 0 : element.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(element);
5351
+ }
5352
+ return doc.querySelectorAll(HTML);
5353
+ }
5354
+ case HEAD:
5355
+ case BODY: {
5356
+ var elements = parseFromDocument(html2).querySelectorAll(firstTagName);
5357
+ if (BODY_TAG_REGEX.test(html2) && HEAD_TAG_REGEX.test(html2)) {
5358
+ return elements[0].parentNode.childNodes;
5359
+ }
5360
+ return elements;
5361
+ }
5362
+ default: {
5363
+ if (parseFromTemplate) {
5364
+ return parseFromTemplate(html2);
5365
+ }
5366
+ var element = parseFromDocument(html2, BODY).querySelector(BODY);
5367
+ return element.childNodes;
5368
+ }
5369
+ }
5370
+ }
5371
+ var __importDefault$3 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
5372
+ return mod && mod.__esModule ? mod : { "default": mod };
5373
+ };
5374
+ Object.defineProperty(htmlToDom, "__esModule", { value: true });
5375
+ htmlToDom.default = HTMLDOMParser;
5376
+ var domparser_1 = __importDefault$3(domparser$1);
5377
+ var utilities_1$3 = utilities$2;
5378
+ var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/;
5379
+ function HTMLDOMParser(html2) {
5380
+ if (typeof html2 !== "string") {
5381
+ throw new TypeError("First argument must be a string");
5382
+ }
5383
+ if (!html2) {
5384
+ return [];
5385
+ }
5386
+ var match = html2.match(DIRECTIVE_REGEX);
5387
+ var directive = match ? match[1] : void 0;
5388
+ return (0, utilities_1$3.formatDOM)((0, domparser_1.default)(html2), null, directive);
5389
+ }
5390
+ var attributesToProps$1 = {};
5391
+ var lib = {};
5392
+ var possibleStandardNamesOptimized$1 = {};
5393
+ var SAME$1 = 0;
5394
+ possibleStandardNamesOptimized$1.SAME = SAME$1;
5395
+ var CAMELCASE$1 = 1;
5396
+ possibleStandardNamesOptimized$1.CAMELCASE = CAMELCASE$1;
5397
+ possibleStandardNamesOptimized$1.possibleStandardNames = {
5398
+ accept: 0,
5399
+ acceptCharset: 1,
5400
+ "accept-charset": "acceptCharset",
5401
+ accessKey: 1,
5402
+ action: 0,
5403
+ allowFullScreen: 1,
5404
+ alt: 0,
5405
+ as: 0,
5406
+ async: 0,
5407
+ autoCapitalize: 1,
5408
+ autoComplete: 1,
5409
+ autoCorrect: 1,
5410
+ autoFocus: 1,
5411
+ autoPlay: 1,
5412
+ autoSave: 1,
5413
+ capture: 0,
5414
+ cellPadding: 1,
5415
+ cellSpacing: 1,
5416
+ challenge: 0,
5417
+ charSet: 1,
5418
+ checked: 0,
5419
+ children: 0,
5420
+ cite: 0,
5421
+ class: "className",
5422
+ classID: 1,
5423
+ className: 1,
5424
+ cols: 0,
5425
+ colSpan: 1,
5426
+ content: 0,
5427
+ contentEditable: 1,
5428
+ contextMenu: 1,
5429
+ controls: 0,
5430
+ controlsList: 1,
5431
+ coords: 0,
5432
+ crossOrigin: 1,
5433
+ dangerouslySetInnerHTML: 1,
5434
+ data: 0,
5435
+ dateTime: 1,
5436
+ default: 0,
5437
+ defaultChecked: 1,
5438
+ defaultValue: 1,
5439
+ defer: 0,
5440
+ dir: 0,
5441
+ disabled: 0,
5442
+ disablePictureInPicture: 1,
5443
+ disableRemotePlayback: 1,
5444
+ download: 0,
5445
+ draggable: 0,
5446
+ encType: 1,
5447
+ enterKeyHint: 1,
5448
+ for: "htmlFor",
5449
+ form: 0,
5450
+ formMethod: 1,
5451
+ formAction: 1,
5452
+ formEncType: 1,
5453
+ formNoValidate: 1,
5454
+ formTarget: 1,
5455
+ frameBorder: 1,
5456
+ headers: 0,
5457
+ height: 0,
5458
+ hidden: 0,
5459
+ high: 0,
5460
+ href: 0,
5461
+ hrefLang: 1,
5462
+ htmlFor: 1,
5463
+ httpEquiv: 1,
5464
+ "http-equiv": "httpEquiv",
5465
+ icon: 0,
5466
+ id: 0,
5467
+ innerHTML: 1,
5468
+ inputMode: 1,
5469
+ integrity: 0,
5470
+ is: 0,
5471
+ itemID: 1,
5472
+ itemProp: 1,
5473
+ itemRef: 1,
5474
+ itemScope: 1,
5475
+ itemType: 1,
5476
+ keyParams: 1,
5477
+ keyType: 1,
5478
+ kind: 0,
5479
+ label: 0,
5480
+ lang: 0,
5481
+ list: 0,
5482
+ loop: 0,
5483
+ low: 0,
5484
+ manifest: 0,
5485
+ marginWidth: 1,
5486
+ marginHeight: 1,
5487
+ max: 0,
5488
+ maxLength: 1,
5489
+ media: 0,
5490
+ mediaGroup: 1,
5491
+ method: 0,
5492
+ min: 0,
5493
+ minLength: 1,
5494
+ multiple: 0,
5495
+ muted: 0,
5496
+ name: 0,
5497
+ noModule: 1,
5498
+ nonce: 0,
5499
+ noValidate: 1,
5500
+ open: 0,
5501
+ optimum: 0,
5502
+ pattern: 0,
5503
+ placeholder: 0,
5504
+ playsInline: 1,
5505
+ poster: 0,
5506
+ preload: 0,
5507
+ profile: 0,
5508
+ radioGroup: 1,
5509
+ readOnly: 1,
5510
+ referrerPolicy: 1,
5511
+ rel: 0,
5512
+ required: 0,
5513
+ reversed: 0,
5514
+ role: 0,
5515
+ rows: 0,
5516
+ rowSpan: 1,
5517
+ sandbox: 0,
5518
+ scope: 0,
5519
+ scoped: 0,
5520
+ scrolling: 0,
5521
+ seamless: 0,
5522
+ selected: 0,
5523
+ shape: 0,
5524
+ size: 0,
5525
+ sizes: 0,
5526
+ span: 0,
5527
+ spellCheck: 1,
5528
+ src: 0,
5529
+ srcDoc: 1,
5530
+ srcLang: 1,
5531
+ srcSet: 1,
5532
+ start: 0,
5533
+ step: 0,
5534
+ style: 0,
5535
+ summary: 0,
5536
+ tabIndex: 1,
5537
+ target: 0,
5538
+ title: 0,
5539
+ type: 0,
5540
+ useMap: 1,
5541
+ value: 0,
5542
+ width: 0,
5543
+ wmode: 0,
5544
+ wrap: 0,
5545
+ about: 0,
5546
+ accentHeight: 1,
5547
+ "accent-height": "accentHeight",
5548
+ accumulate: 0,
5549
+ additive: 0,
5550
+ alignmentBaseline: 1,
5551
+ "alignment-baseline": "alignmentBaseline",
5552
+ allowReorder: 1,
5553
+ alphabetic: 0,
5554
+ amplitude: 0,
5555
+ arabicForm: 1,
5556
+ "arabic-form": "arabicForm",
5557
+ ascent: 0,
5558
+ attributeName: 1,
5559
+ attributeType: 1,
5560
+ autoReverse: 1,
5561
+ azimuth: 0,
5562
+ baseFrequency: 1,
5563
+ baselineShift: 1,
5564
+ "baseline-shift": "baselineShift",
5565
+ baseProfile: 1,
5566
+ bbox: 0,
5567
+ begin: 0,
5568
+ bias: 0,
5569
+ by: 0,
5570
+ calcMode: 1,
5571
+ capHeight: 1,
5572
+ "cap-height": "capHeight",
5573
+ clip: 0,
5574
+ clipPath: 1,
5575
+ "clip-path": "clipPath",
5576
+ clipPathUnits: 1,
5577
+ clipRule: 1,
5578
+ "clip-rule": "clipRule",
5579
+ color: 0,
5580
+ colorInterpolation: 1,
5581
+ "color-interpolation": "colorInterpolation",
5582
+ colorInterpolationFilters: 1,
5583
+ "color-interpolation-filters": "colorInterpolationFilters",
5584
+ colorProfile: 1,
5585
+ "color-profile": "colorProfile",
5586
+ colorRendering: 1,
5587
+ "color-rendering": "colorRendering",
5588
+ contentScriptType: 1,
5589
+ contentStyleType: 1,
5590
+ cursor: 0,
5591
+ cx: 0,
5592
+ cy: 0,
5593
+ d: 0,
5594
+ datatype: 0,
5595
+ decelerate: 0,
5596
+ descent: 0,
5597
+ diffuseConstant: 1,
5598
+ direction: 0,
5599
+ display: 0,
5600
+ divisor: 0,
5601
+ dominantBaseline: 1,
5602
+ "dominant-baseline": "dominantBaseline",
5603
+ dur: 0,
5604
+ dx: 0,
5605
+ dy: 0,
5606
+ edgeMode: 1,
5607
+ elevation: 0,
5608
+ enableBackground: 1,
5609
+ "enable-background": "enableBackground",
5610
+ end: 0,
5611
+ exponent: 0,
5612
+ externalResourcesRequired: 1,
5613
+ fill: 0,
5614
+ fillOpacity: 1,
5615
+ "fill-opacity": "fillOpacity",
5616
+ fillRule: 1,
5617
+ "fill-rule": "fillRule",
5618
+ filter: 0,
5619
+ filterRes: 1,
5620
+ filterUnits: 1,
5621
+ floodOpacity: 1,
5622
+ "flood-opacity": "floodOpacity",
5623
+ floodColor: 1,
5624
+ "flood-color": "floodColor",
5625
+ focusable: 0,
5626
+ fontFamily: 1,
5627
+ "font-family": "fontFamily",
5628
+ fontSize: 1,
5629
+ "font-size": "fontSize",
5630
+ fontSizeAdjust: 1,
5631
+ "font-size-adjust": "fontSizeAdjust",
5632
+ fontStretch: 1,
5633
+ "font-stretch": "fontStretch",
5634
+ fontStyle: 1,
5635
+ "font-style": "fontStyle",
5636
+ fontVariant: 1,
5637
+ "font-variant": "fontVariant",
5638
+ fontWeight: 1,
5639
+ "font-weight": "fontWeight",
5640
+ format: 0,
5641
+ from: 0,
5642
+ fx: 0,
5643
+ fy: 0,
5644
+ g1: 0,
5645
+ g2: 0,
5646
+ glyphName: 1,
5647
+ "glyph-name": "glyphName",
5648
+ glyphOrientationHorizontal: 1,
5649
+ "glyph-orientation-horizontal": "glyphOrientationHorizontal",
5650
+ glyphOrientationVertical: 1,
5651
+ "glyph-orientation-vertical": "glyphOrientationVertical",
5652
+ glyphRef: 1,
5653
+ gradientTransform: 1,
5654
+ gradientUnits: 1,
5655
+ hanging: 0,
5656
+ horizAdvX: 1,
5657
+ "horiz-adv-x": "horizAdvX",
5658
+ horizOriginX: 1,
5659
+ "horiz-origin-x": "horizOriginX",
5660
+ ideographic: 0,
5661
+ imageRendering: 1,
5662
+ "image-rendering": "imageRendering",
5663
+ in2: 0,
5664
+ in: 0,
5665
+ inlist: 0,
5666
+ intercept: 0,
5667
+ k1: 0,
5668
+ k2: 0,
5669
+ k3: 0,
5670
+ k4: 0,
5671
+ k: 0,
5672
+ kernelMatrix: 1,
5673
+ kernelUnitLength: 1,
5674
+ kerning: 0,
5675
+ keyPoints: 1,
5676
+ keySplines: 1,
5677
+ keyTimes: 1,
5678
+ lengthAdjust: 1,
5679
+ letterSpacing: 1,
5680
+ "letter-spacing": "letterSpacing",
5681
+ lightingColor: 1,
5682
+ "lighting-color": "lightingColor",
5683
+ limitingConeAngle: 1,
5684
+ local: 0,
5685
+ markerEnd: 1,
5686
+ "marker-end": "markerEnd",
5687
+ markerHeight: 1,
5688
+ markerMid: 1,
5689
+ "marker-mid": "markerMid",
5690
+ markerStart: 1,
5691
+ "marker-start": "markerStart",
5692
+ markerUnits: 1,
5693
+ markerWidth: 1,
5694
+ mask: 0,
5695
+ maskContentUnits: 1,
5696
+ maskUnits: 1,
5697
+ mathematical: 0,
5698
+ mode: 0,
5699
+ numOctaves: 1,
5700
+ offset: 0,
5701
+ opacity: 0,
5702
+ operator: 0,
5703
+ order: 0,
5704
+ orient: 0,
5705
+ orientation: 0,
5706
+ origin: 0,
5707
+ overflow: 0,
5708
+ overlinePosition: 1,
5709
+ "overline-position": "overlinePosition",
5710
+ overlineThickness: 1,
5711
+ "overline-thickness": "overlineThickness",
5712
+ paintOrder: 1,
5713
+ "paint-order": "paintOrder",
5714
+ panose1: 0,
5715
+ "panose-1": "panose1",
5716
+ pathLength: 1,
5717
+ patternContentUnits: 1,
5718
+ patternTransform: 1,
5719
+ patternUnits: 1,
5720
+ pointerEvents: 1,
5721
+ "pointer-events": "pointerEvents",
5722
+ points: 0,
5723
+ pointsAtX: 1,
5724
+ pointsAtY: 1,
5725
+ pointsAtZ: 1,
5726
+ prefix: 0,
5727
+ preserveAlpha: 1,
5728
+ preserveAspectRatio: 1,
5729
+ primitiveUnits: 1,
5730
+ property: 0,
5731
+ r: 0,
5732
+ radius: 0,
5733
+ refX: 1,
5734
+ refY: 1,
5735
+ renderingIntent: 1,
5736
+ "rendering-intent": "renderingIntent",
5737
+ repeatCount: 1,
5738
+ repeatDur: 1,
5739
+ requiredExtensions: 1,
5740
+ requiredFeatures: 1,
5741
+ resource: 0,
5742
+ restart: 0,
5743
+ result: 0,
5744
+ results: 0,
5745
+ rotate: 0,
5746
+ rx: 0,
5747
+ ry: 0,
5748
+ scale: 0,
5749
+ security: 0,
5750
+ seed: 0,
5751
+ shapeRendering: 1,
5752
+ "shape-rendering": "shapeRendering",
5753
+ slope: 0,
5754
+ spacing: 0,
5755
+ specularConstant: 1,
5756
+ specularExponent: 1,
5757
+ speed: 0,
5758
+ spreadMethod: 1,
5759
+ startOffset: 1,
5760
+ stdDeviation: 1,
5761
+ stemh: 0,
5762
+ stemv: 0,
5763
+ stitchTiles: 1,
5764
+ stopColor: 1,
5765
+ "stop-color": "stopColor",
5766
+ stopOpacity: 1,
5767
+ "stop-opacity": "stopOpacity",
5768
+ strikethroughPosition: 1,
5769
+ "strikethrough-position": "strikethroughPosition",
5770
+ strikethroughThickness: 1,
5771
+ "strikethrough-thickness": "strikethroughThickness",
5772
+ string: 0,
5773
+ stroke: 0,
5774
+ strokeDasharray: 1,
5775
+ "stroke-dasharray": "strokeDasharray",
5776
+ strokeDashoffset: 1,
5777
+ "stroke-dashoffset": "strokeDashoffset",
5778
+ strokeLinecap: 1,
5779
+ "stroke-linecap": "strokeLinecap",
5780
+ strokeLinejoin: 1,
5781
+ "stroke-linejoin": "strokeLinejoin",
5782
+ strokeMiterlimit: 1,
5783
+ "stroke-miterlimit": "strokeMiterlimit",
5784
+ strokeWidth: 1,
5785
+ "stroke-width": "strokeWidth",
5786
+ strokeOpacity: 1,
5787
+ "stroke-opacity": "strokeOpacity",
5788
+ suppressContentEditableWarning: 1,
5789
+ suppressHydrationWarning: 1,
5790
+ surfaceScale: 1,
5791
+ systemLanguage: 1,
5792
+ tableValues: 1,
5793
+ targetX: 1,
5794
+ targetY: 1,
5795
+ textAnchor: 1,
5796
+ "text-anchor": "textAnchor",
5797
+ textDecoration: 1,
5798
+ "text-decoration": "textDecoration",
5799
+ textLength: 1,
5800
+ textRendering: 1,
5801
+ "text-rendering": "textRendering",
5802
+ to: 0,
5803
+ transform: 0,
5804
+ typeof: 0,
5805
+ u1: 0,
5806
+ u2: 0,
5807
+ underlinePosition: 1,
5808
+ "underline-position": "underlinePosition",
5809
+ underlineThickness: 1,
5810
+ "underline-thickness": "underlineThickness",
5811
+ unicode: 0,
5812
+ unicodeBidi: 1,
5813
+ "unicode-bidi": "unicodeBidi",
5814
+ unicodeRange: 1,
5815
+ "unicode-range": "unicodeRange",
5816
+ unitsPerEm: 1,
5817
+ "units-per-em": "unitsPerEm",
5818
+ unselectable: 0,
5819
+ vAlphabetic: 1,
5820
+ "v-alphabetic": "vAlphabetic",
5821
+ values: 0,
5822
+ vectorEffect: 1,
5823
+ "vector-effect": "vectorEffect",
5824
+ version: 0,
5825
+ vertAdvY: 1,
5826
+ "vert-adv-y": "vertAdvY",
5827
+ vertOriginX: 1,
5828
+ "vert-origin-x": "vertOriginX",
5829
+ vertOriginY: 1,
5830
+ "vert-origin-y": "vertOriginY",
5831
+ vHanging: 1,
5832
+ "v-hanging": "vHanging",
5833
+ vIdeographic: 1,
5834
+ "v-ideographic": "vIdeographic",
5835
+ viewBox: 1,
5836
+ viewTarget: 1,
5837
+ visibility: 0,
5838
+ vMathematical: 1,
5839
+ "v-mathematical": "vMathematical",
5840
+ vocab: 0,
5841
+ widths: 0,
5842
+ wordSpacing: 1,
5843
+ "word-spacing": "wordSpacing",
5844
+ writingMode: 1,
5845
+ "writing-mode": "writingMode",
5846
+ x1: 0,
5847
+ x2: 0,
5848
+ x: 0,
5849
+ xChannelSelector: 1,
5850
+ xHeight: 1,
5851
+ "x-height": "xHeight",
5852
+ xlinkActuate: 1,
5853
+ "xlink:actuate": "xlinkActuate",
5854
+ xlinkArcrole: 1,
5855
+ "xlink:arcrole": "xlinkArcrole",
5856
+ xlinkHref: 1,
5857
+ "xlink:href": "xlinkHref",
5858
+ xlinkRole: 1,
5859
+ "xlink:role": "xlinkRole",
5860
+ xlinkShow: 1,
5861
+ "xlink:show": "xlinkShow",
5862
+ xlinkTitle: 1,
5863
+ "xlink:title": "xlinkTitle",
5864
+ xlinkType: 1,
5865
+ "xlink:type": "xlinkType",
5866
+ xmlBase: 1,
5867
+ "xml:base": "xmlBase",
5868
+ xmlLang: 1,
5869
+ "xml:lang": "xmlLang",
5870
+ xmlns: 0,
5871
+ "xml:space": "xmlSpace",
5872
+ xmlnsXlink: 1,
5873
+ "xmlns:xlink": "xmlnsXlink",
5874
+ xmlSpace: 1,
5875
+ y1: 0,
5876
+ y2: 0,
5877
+ y: 0,
5878
+ yChannelSelector: 1,
5879
+ z: 0,
5880
+ zoomAndPan: 1
5881
+ };
5882
+ const RESERVED = 0;
5883
+ const STRING = 1;
5884
+ const BOOLEANISH_STRING = 2;
5885
+ const BOOLEAN = 3;
5886
+ const OVERLOADED_BOOLEAN = 4;
5887
+ const NUMERIC = 5;
5888
+ const POSITIVE_NUMERIC = 6;
5889
+ function getPropertyInfo(name) {
5890
+ return properties.hasOwnProperty(name) ? properties[name] : null;
5891
+ }
5892
+ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
5893
+ this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
5894
+ this.attributeName = attributeName;
5895
+ this.attributeNamespace = attributeNamespace;
5896
+ this.mustUseProperty = mustUseProperty;
5897
+ this.propertyName = name;
5898
+ this.type = type;
5899
+ this.sanitizeURL = sanitizeURL;
5900
+ this.removeEmptyString = removeEmptyString;
5901
+ }
5902
+ const properties = {};
5903
+ const reservedProps = [
5904
+ "children",
5905
+ "dangerouslySetInnerHTML",
5906
+ "defaultValue",
5907
+ "defaultChecked",
5908
+ "innerHTML",
5909
+ "suppressContentEditableWarning",
5910
+ "suppressHydrationWarning",
5911
+ "style"
5912
+ ];
5913
+ reservedProps.forEach((name) => {
5914
+ properties[name] = new PropertyInfoRecord(
5915
+ name,
5916
+ RESERVED,
5917
+ false,
5918
+ name,
5919
+ null,
5920
+ false,
5921
+ false
5922
+ );
5923
+ });
5924
+ [
5925
+ ["acceptCharset", "accept-charset"],
5926
+ ["className", "class"],
5927
+ ["htmlFor", "for"],
5928
+ ["httpEquiv", "http-equiv"]
5929
+ ].forEach(([name, attributeName]) => {
5930
+ properties[name] = new PropertyInfoRecord(
5931
+ name,
5932
+ STRING,
5933
+ false,
5934
+ attributeName,
5935
+ null,
5936
+ false,
5937
+ false
5938
+ );
5939
+ });
5940
+ ["contentEditable", "draggable", "spellCheck", "value"].forEach((name) => {
5941
+ properties[name] = new PropertyInfoRecord(
5942
+ name,
5943
+ BOOLEANISH_STRING,
5944
+ false,
5945
+ name.toLowerCase(),
5946
+ null,
5947
+ false,
5948
+ false
5949
+ );
5950
+ });
5951
+ [
5952
+ "autoReverse",
5953
+ "externalResourcesRequired",
5954
+ "focusable",
5955
+ "preserveAlpha"
5956
+ ].forEach((name) => {
5957
+ properties[name] = new PropertyInfoRecord(
5958
+ name,
5959
+ BOOLEANISH_STRING,
5960
+ false,
5961
+ name,
5962
+ null,
5963
+ false,
5964
+ false
5965
+ );
5966
+ });
5967
+ [
5968
+ "allowFullScreen",
5969
+ "async",
5970
+ "autoFocus",
5971
+ "autoPlay",
5972
+ "controls",
5973
+ "default",
5974
+ "defer",
5975
+ "disabled",
5976
+ "disablePictureInPicture",
5977
+ "disableRemotePlayback",
5978
+ "formNoValidate",
5979
+ "hidden",
5980
+ "loop",
5981
+ "noModule",
5982
+ "noValidate",
5983
+ "open",
5984
+ "playsInline",
5985
+ "readOnly",
5986
+ "required",
5987
+ "reversed",
5988
+ "scoped",
5989
+ "seamless",
5990
+ "itemScope"
5991
+ ].forEach((name) => {
5992
+ properties[name] = new PropertyInfoRecord(
5993
+ name,
5994
+ BOOLEAN,
5995
+ false,
5996
+ name.toLowerCase(),
5997
+ null,
5998
+ false,
5999
+ false
6000
+ );
6001
+ });
6002
+ [
6003
+ "checked",
6004
+ "multiple",
6005
+ "muted",
6006
+ "selected"
6007
+ ].forEach((name) => {
6008
+ properties[name] = new PropertyInfoRecord(
6009
+ name,
6010
+ BOOLEAN,
6011
+ true,
6012
+ name,
6013
+ null,
6014
+ false,
6015
+ false
6016
+ );
6017
+ });
6018
+ [
6019
+ "capture",
6020
+ "download"
6021
+ ].forEach((name) => {
6022
+ properties[name] = new PropertyInfoRecord(
6023
+ name,
6024
+ OVERLOADED_BOOLEAN,
6025
+ false,
6026
+ name,
6027
+ null,
6028
+ false,
6029
+ false
6030
+ );
6031
+ });
6032
+ [
6033
+ "cols",
6034
+ "rows",
6035
+ "size",
6036
+ "span"
6037
+ ].forEach((name) => {
6038
+ properties[name] = new PropertyInfoRecord(
6039
+ name,
6040
+ POSITIVE_NUMERIC,
6041
+ false,
6042
+ name,
6043
+ null,
6044
+ false,
6045
+ false
6046
+ );
6047
+ });
6048
+ ["rowSpan", "start"].forEach((name) => {
6049
+ properties[name] = new PropertyInfoRecord(
6050
+ name,
6051
+ NUMERIC,
6052
+ false,
6053
+ name.toLowerCase(),
6054
+ null,
6055
+ false,
6056
+ false
6057
+ );
6058
+ });
6059
+ const CAMELIZE = /[\-\:]([a-z])/g;
6060
+ const capitalize$1 = (token) => token[1].toUpperCase();
6061
+ [
6062
+ "accent-height",
6063
+ "alignment-baseline",
6064
+ "arabic-form",
6065
+ "baseline-shift",
6066
+ "cap-height",
6067
+ "clip-path",
6068
+ "clip-rule",
6069
+ "color-interpolation",
6070
+ "color-interpolation-filters",
6071
+ "color-profile",
6072
+ "color-rendering",
6073
+ "dominant-baseline",
6074
+ "enable-background",
6075
+ "fill-opacity",
6076
+ "fill-rule",
6077
+ "flood-color",
6078
+ "flood-opacity",
6079
+ "font-family",
6080
+ "font-size",
6081
+ "font-size-adjust",
6082
+ "font-stretch",
6083
+ "font-style",
6084
+ "font-variant",
6085
+ "font-weight",
6086
+ "glyph-name",
6087
+ "glyph-orientation-horizontal",
6088
+ "glyph-orientation-vertical",
6089
+ "horiz-adv-x",
6090
+ "horiz-origin-x",
6091
+ "image-rendering",
6092
+ "letter-spacing",
6093
+ "lighting-color",
6094
+ "marker-end",
6095
+ "marker-mid",
6096
+ "marker-start",
6097
+ "overline-position",
6098
+ "overline-thickness",
6099
+ "paint-order",
6100
+ "panose-1",
6101
+ "pointer-events",
6102
+ "rendering-intent",
6103
+ "shape-rendering",
6104
+ "stop-color",
6105
+ "stop-opacity",
6106
+ "strikethrough-position",
6107
+ "strikethrough-thickness",
6108
+ "stroke-dasharray",
6109
+ "stroke-dashoffset",
6110
+ "stroke-linecap",
6111
+ "stroke-linejoin",
6112
+ "stroke-miterlimit",
6113
+ "stroke-opacity",
6114
+ "stroke-width",
6115
+ "text-anchor",
6116
+ "text-decoration",
6117
+ "text-rendering",
6118
+ "underline-position",
6119
+ "underline-thickness",
6120
+ "unicode-bidi",
6121
+ "unicode-range",
6122
+ "units-per-em",
6123
+ "v-alphabetic",
6124
+ "v-hanging",
6125
+ "v-ideographic",
6126
+ "v-mathematical",
6127
+ "vector-effect",
6128
+ "vert-adv-y",
6129
+ "vert-origin-x",
6130
+ "vert-origin-y",
6131
+ "word-spacing",
6132
+ "writing-mode",
6133
+ "xmlns:xlink",
6134
+ "x-height"
6135
+ ].forEach((attributeName) => {
6136
+ const name = attributeName.replace(CAMELIZE, capitalize$1);
6137
+ properties[name] = new PropertyInfoRecord(
6138
+ name,
6139
+ STRING,
6140
+ false,
6141
+ attributeName,
6142
+ null,
6143
+ false,
6144
+ false
6145
+ );
6146
+ });
6147
+ [
6148
+ "xlink:actuate",
6149
+ "xlink:arcrole",
6150
+ "xlink:role",
6151
+ "xlink:show",
6152
+ "xlink:title",
6153
+ "xlink:type"
6154
+ ].forEach((attributeName) => {
6155
+ const name = attributeName.replace(CAMELIZE, capitalize$1);
6156
+ properties[name] = new PropertyInfoRecord(
6157
+ name,
6158
+ STRING,
6159
+ false,
6160
+ attributeName,
6161
+ "http://www.w3.org/1999/xlink",
6162
+ false,
6163
+ false
6164
+ );
6165
+ });
6166
+ [
6167
+ "xml:base",
6168
+ "xml:lang",
6169
+ "xml:space"
6170
+ ].forEach((attributeName) => {
6171
+ const name = attributeName.replace(CAMELIZE, capitalize$1);
6172
+ properties[name] = new PropertyInfoRecord(
6173
+ name,
6174
+ STRING,
6175
+ false,
6176
+ attributeName,
6177
+ "http://www.w3.org/XML/1998/namespace",
6178
+ false,
6179
+ false
6180
+ );
6181
+ });
6182
+ ["tabIndex", "crossOrigin"].forEach((attributeName) => {
6183
+ properties[attributeName] = new PropertyInfoRecord(
6184
+ attributeName,
6185
+ STRING,
6186
+ false,
6187
+ attributeName.toLowerCase(),
6188
+ null,
6189
+ false,
6190
+ false
6191
+ );
6192
+ });
6193
+ const xlinkHref = "xlinkHref";
6194
+ properties[xlinkHref] = new PropertyInfoRecord(
6195
+ "xlinkHref",
6196
+ STRING,
6197
+ false,
6198
+ "xlink:href",
6199
+ "http://www.w3.org/1999/xlink",
6200
+ true,
6201
+ false
6202
+ );
6203
+ ["src", "href", "action", "formAction"].forEach((attributeName) => {
6204
+ properties[attributeName] = new PropertyInfoRecord(
6205
+ attributeName,
6206
+ STRING,
6207
+ false,
6208
+ attributeName.toLowerCase(),
6209
+ null,
6210
+ true,
6211
+ true
6212
+ );
6213
+ });
6214
+ const {
6215
+ CAMELCASE,
6216
+ SAME,
6217
+ possibleStandardNames: possibleStandardNamesOptimized
6218
+ } = possibleStandardNamesOptimized$1;
6219
+ const ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
6220
+ const ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
6221
+ const isCustomAttribute = RegExp.prototype.test.bind(
6222
+ new RegExp("^(data|aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$")
6223
+ );
6224
+ const possibleStandardNames = Object.keys(
6225
+ possibleStandardNamesOptimized
6226
+ ).reduce((accumulator, standardName) => {
6227
+ const propName = possibleStandardNamesOptimized[standardName];
6228
+ if (propName === SAME) {
6229
+ accumulator[standardName] = standardName;
6230
+ } else if (propName === CAMELCASE) {
6231
+ accumulator[standardName.toLowerCase()] = standardName;
6232
+ } else {
6233
+ accumulator[standardName] = propName;
6234
+ }
6235
+ return accumulator;
6236
+ }, {});
6237
+ lib.BOOLEAN = BOOLEAN;
6238
+ lib.BOOLEANISH_STRING = BOOLEANISH_STRING;
6239
+ lib.NUMERIC = NUMERIC;
6240
+ lib.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
6241
+ lib.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
6242
+ lib.RESERVED = RESERVED;
6243
+ lib.STRING = STRING;
6244
+ lib.getPropertyInfo = getPropertyInfo;
6245
+ lib.isCustomAttribute = isCustomAttribute;
6246
+ lib.possibleStandardNames = possibleStandardNames;
6247
+ var utilities$1 = {};
6248
+ var cjs$2 = {};
6249
+ var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
6250
+ var NEWLINE_REGEX = /\n/g;
6251
+ var WHITESPACE_REGEX = /^\s*/;
6252
+ var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
6253
+ var COLON_REGEX = /^:\s*/;
6254
+ var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
6255
+ var SEMICOLON_REGEX = /^[;\s]*/;
6256
+ var TRIM_REGEX = /^\s+|\s+$/g;
6257
+ var NEWLINE = "\n";
6258
+ var FORWARD_SLASH = "/";
6259
+ var ASTERISK = "*";
6260
+ var EMPTY_STRING = "";
6261
+ var TYPE_COMMENT = "comment";
6262
+ var TYPE_DECLARATION = "declaration";
6263
+ function index(style, options) {
6264
+ if (typeof style !== "string") {
6265
+ throw new TypeError("First argument must be a string");
6266
+ }
6267
+ if (!style)
6268
+ return [];
6269
+ options = options || {};
6270
+ var lineno = 1;
6271
+ var column = 1;
6272
+ function updatePosition(str) {
6273
+ var lines = str.match(NEWLINE_REGEX);
6274
+ if (lines)
6275
+ lineno += lines.length;
6276
+ var i2 = str.lastIndexOf(NEWLINE);
6277
+ column = ~i2 ? str.length - i2 : column + str.length;
6278
+ }
6279
+ function position() {
6280
+ var start = { line: lineno, column };
6281
+ return function(node2) {
6282
+ node2.position = new Position(start);
6283
+ whitespace();
6284
+ return node2;
6285
+ };
6286
+ }
6287
+ function Position(start) {
6288
+ this.start = start;
6289
+ this.end = { line: lineno, column };
6290
+ this.source = options.source;
6291
+ }
6292
+ Position.prototype.content = style;
6293
+ function error(msg) {
6294
+ var err = new Error(
6295
+ options.source + ":" + lineno + ":" + column + ": " + msg
6296
+ );
6297
+ err.reason = msg;
6298
+ err.filename = options.source;
6299
+ err.line = lineno;
6300
+ err.column = column;
6301
+ err.source = style;
6302
+ if (options.silent)
6303
+ ;
6304
+ else {
6305
+ throw err;
6306
+ }
6307
+ }
6308
+ function match(re2) {
6309
+ var m2 = re2.exec(style);
6310
+ if (!m2)
6311
+ return;
6312
+ var str = m2[0];
6313
+ updatePosition(str);
6314
+ style = style.slice(str.length);
6315
+ return m2;
6316
+ }
6317
+ function whitespace() {
6318
+ match(WHITESPACE_REGEX);
6319
+ }
6320
+ function comments(rules) {
6321
+ var c2;
6322
+ rules = rules || [];
6323
+ while (c2 = comment()) {
6324
+ if (c2 !== false) {
6325
+ rules.push(c2);
6326
+ }
6327
+ }
6328
+ return rules;
6329
+ }
6330
+ function comment() {
6331
+ var pos = position();
6332
+ if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1))
6333
+ return;
6334
+ var i2 = 2;
6335
+ while (EMPTY_STRING != style.charAt(i2) && (ASTERISK != style.charAt(i2) || FORWARD_SLASH != style.charAt(i2 + 1))) {
6336
+ ++i2;
6337
+ }
6338
+ i2 += 2;
6339
+ if (EMPTY_STRING === style.charAt(i2 - 1)) {
6340
+ return error("End of comment missing");
6341
+ }
6342
+ var str = style.slice(2, i2 - 2);
6343
+ column += 2;
6344
+ updatePosition(str);
6345
+ style = style.slice(i2);
6346
+ column += 2;
6347
+ return pos({
6348
+ type: TYPE_COMMENT,
6349
+ comment: str
6350
+ });
6351
+ }
6352
+ function declaration() {
6353
+ var pos = position();
6354
+ var prop = match(PROPERTY_REGEX);
6355
+ if (!prop)
6356
+ return;
6357
+ comment();
6358
+ if (!match(COLON_REGEX))
6359
+ return error("property missing ':'");
6360
+ var val = match(VALUE_REGEX);
6361
+ var ret = pos({
6362
+ type: TYPE_DECLARATION,
6363
+ property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
6364
+ value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
6365
+ });
6366
+ match(SEMICOLON_REGEX);
6367
+ return ret;
6368
+ }
6369
+ function declarations() {
6370
+ var decls = [];
6371
+ comments(decls);
6372
+ var decl;
6373
+ while (decl = declaration()) {
6374
+ if (decl !== false) {
6375
+ decls.push(decl);
6376
+ comments(decls);
6377
+ }
6378
+ }
6379
+ return decls;
6380
+ }
6381
+ whitespace();
6382
+ return declarations();
6383
+ }
6384
+ function trim(str) {
6385
+ return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
6386
+ }
6387
+ var cjs$1 = index;
6388
+ var __importDefault$2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
6389
+ return mod && mod.__esModule ? mod : { "default": mod };
6390
+ };
6391
+ Object.defineProperty(cjs$2, "__esModule", { value: true });
6392
+ cjs$2.default = StyleToObject;
6393
+ const inline_style_parser_1 = __importDefault$2(cjs$1);
6394
+ function StyleToObject(style, iterator) {
6395
+ let styleObject = null;
6396
+ if (!style || typeof style !== "string") {
6397
+ return styleObject;
6398
+ }
6399
+ const declarations = (0, inline_style_parser_1.default)(style);
6400
+ const hasIterator = typeof iterator === "function";
6401
+ declarations.forEach((declaration) => {
6402
+ if (declaration.type !== "declaration") {
6403
+ return;
6404
+ }
6405
+ const { property, value } = declaration;
6406
+ if (hasIterator) {
6407
+ iterator(property, value, declaration);
6408
+ } else if (value) {
6409
+ styleObject = styleObject || {};
6410
+ styleObject[property] = value;
6411
+ }
6412
+ });
6413
+ return styleObject;
6414
+ }
6415
+ var utilities = {};
6416
+ Object.defineProperty(utilities, "__esModule", { value: true });
6417
+ utilities.camelCase = void 0;
6418
+ var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
6419
+ var HYPHEN_REGEX = /-([a-z])/g;
6420
+ var NO_HYPHEN_REGEX = /^[^-]+$/;
6421
+ var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
6422
+ var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
6423
+ var skipCamelCase = function(property) {
6424
+ return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
6425
+ };
6426
+ var capitalize = function(match, character) {
6427
+ return character.toUpperCase();
6428
+ };
6429
+ var trimHyphen = function(match, prefix) {
6430
+ return "".concat(prefix, "-");
6431
+ };
6432
+ var camelCase = function(property, options) {
6433
+ if (options === void 0) {
6434
+ options = {};
6435
+ }
6436
+ if (skipCamelCase(property)) {
6437
+ return property;
6438
+ }
6439
+ property = property.toLowerCase();
6440
+ if (options.reactCompat) {
6441
+ property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
6442
+ } else {
6443
+ property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
6444
+ }
6445
+ return property.replace(HYPHEN_REGEX, capitalize);
6446
+ };
6447
+ utilities.camelCase = camelCase;
6448
+ var __importDefault$1 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
6449
+ return mod && mod.__esModule ? mod : { "default": mod };
6450
+ };
6451
+ var style_to_object_1 = __importDefault$1(cjs$2);
6452
+ var utilities_1$2 = utilities;
6453
+ function StyleToJS(style, options) {
6454
+ var output = {};
6455
+ if (!style || typeof style !== "string") {
6456
+ return output;
6457
+ }
6458
+ (0, style_to_object_1.default)(style, function(property, value) {
6459
+ if (property && value) {
6460
+ output[(0, utilities_1$2.camelCase)(property, options)] = value;
6461
+ }
6462
+ });
6463
+ return output;
6464
+ }
6465
+ StyleToJS.default = StyleToJS;
6466
+ var cjs = StyleToJS;
6467
+ (function(exports) {
6468
+ var __importDefault2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
6469
+ return mod && mod.__esModule ? mod : { "default": mod };
6470
+ };
6471
+ Object.defineProperty(exports, "__esModule", { value: true });
6472
+ exports.returnFirstArg = exports.canTextBeChildOfNode = exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = exports.PRESERVE_CUSTOM_ATTRIBUTES = void 0;
6473
+ exports.isCustomComponent = isCustomComponent;
6474
+ exports.setStyleProp = setStyleProp;
6475
+ var react_12 = React__default;
6476
+ var style_to_js_1 = __importDefault2(cjs);
6477
+ var RESERVED_SVG_MATHML_ELEMENTS = /* @__PURE__ */ new Set([
6478
+ "annotation-xml",
6479
+ "color-profile",
6480
+ "font-face",
6481
+ "font-face-src",
6482
+ "font-face-uri",
6483
+ "font-face-format",
6484
+ "font-face-name",
6485
+ "missing-glyph"
6486
+ ]);
6487
+ function isCustomComponent(tagName, props) {
6488
+ if (!tagName.includes("-")) {
6489
+ return Boolean(props && typeof props.is === "string");
6490
+ }
6491
+ if (RESERVED_SVG_MATHML_ELEMENTS.has(tagName)) {
6492
+ return false;
6493
+ }
6494
+ return true;
6495
+ }
6496
+ var styleOptions = {
6497
+ reactCompat: true
6498
+ };
6499
+ function setStyleProp(style, props) {
6500
+ if (typeof style !== "string") {
6501
+ return;
6502
+ }
6503
+ if (!style.trim()) {
6504
+ props.style = {};
6505
+ return;
6506
+ }
6507
+ try {
6508
+ props.style = (0, style_to_js_1.default)(style, styleOptions);
6509
+ } catch (error) {
6510
+ props.style = {};
6511
+ }
6512
+ }
6513
+ exports.PRESERVE_CUSTOM_ATTRIBUTES = Number(react_12.version.split(".")[0]) >= 16;
6514
+ exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = /* @__PURE__ */ new Set([
6515
+ "tr",
6516
+ "tbody",
6517
+ "thead",
6518
+ "tfoot",
6519
+ "colgroup",
6520
+ "table",
6521
+ "head",
6522
+ "html",
6523
+ "frameset"
6524
+ ]);
6525
+ var canTextBeChildOfNode = function(node2) {
6526
+ return !exports.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node2.name);
6527
+ };
6528
+ exports.canTextBeChildOfNode = canTextBeChildOfNode;
6529
+ var returnFirstArg = function(arg) {
6530
+ return arg;
6531
+ };
6532
+ exports.returnFirstArg = returnFirstArg;
6533
+ })(utilities$1);
6534
+ Object.defineProperty(attributesToProps$1, "__esModule", { value: true });
6535
+ attributesToProps$1.default = attributesToProps;
6536
+ var react_property_1 = lib;
6537
+ var utilities_1$1 = utilities$1;
6538
+ var UNCONTROLLED_COMPONENT_ATTRIBUTES = ["checked", "value"];
6539
+ var UNCONTROLLED_COMPONENT_NAMES = ["input", "select", "textarea"];
6540
+ var valueOnlyInputs = {
6541
+ reset: true,
6542
+ submit: true
6543
+ };
6544
+ function attributesToProps(attributes, nodeName) {
6545
+ if (attributes === void 0) {
6546
+ attributes = {};
6547
+ }
6548
+ var props = {};
6549
+ var isInputValueOnly = Boolean(attributes.type && valueOnlyInputs[attributes.type]);
6550
+ for (var attributeName in attributes) {
6551
+ var attributeValue = attributes[attributeName];
6552
+ if ((0, react_property_1.isCustomAttribute)(attributeName)) {
6553
+ props[attributeName] = attributeValue;
6554
+ continue;
6555
+ }
6556
+ var attributeNameLowerCased = attributeName.toLowerCase();
6557
+ var propName = getPropName(attributeNameLowerCased);
6558
+ if (propName) {
6559
+ var propertyInfo = (0, react_property_1.getPropertyInfo)(propName);
6560
+ if (UNCONTROLLED_COMPONENT_ATTRIBUTES.includes(propName) && UNCONTROLLED_COMPONENT_NAMES.includes(nodeName) && !isInputValueOnly) {
6561
+ propName = getPropName("default" + attributeNameLowerCased);
6562
+ }
6563
+ props[propName] = attributeValue;
6564
+ switch (propertyInfo && propertyInfo.type) {
6565
+ case react_property_1.BOOLEAN:
6566
+ props[propName] = true;
6567
+ break;
6568
+ case react_property_1.OVERLOADED_BOOLEAN:
6569
+ if (attributeValue === "") {
6570
+ props[propName] = true;
6571
+ }
6572
+ break;
6573
+ }
6574
+ continue;
6575
+ }
6576
+ if (utilities_1$1.PRESERVE_CUSTOM_ATTRIBUTES) {
6577
+ props[attributeName] = attributeValue;
6578
+ }
6579
+ }
6580
+ (0, utilities_1$1.setStyleProp)(attributes.style, props);
6581
+ return props;
6582
+ }
6583
+ function getPropName(attributeName) {
6584
+ return react_property_1.possibleStandardNames[attributeName];
6585
+ }
6586
+ var domToReact$1 = {};
6587
+ var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
6588
+ return mod && mod.__esModule ? mod : { "default": mod };
6589
+ };
6590
+ Object.defineProperty(domToReact$1, "__esModule", { value: true });
6591
+ domToReact$1.default = domToReact;
6592
+ var react_1 = React__default;
6593
+ var attributes_to_props_1 = __importDefault(attributesToProps$1);
6594
+ var utilities_1 = utilities$1;
6595
+ var React = {
6596
+ cloneElement: react_1.cloneElement,
6597
+ createElement: react_1.createElement,
6598
+ isValidElement: react_1.isValidElement
6599
+ };
6600
+ function domToReact(nodes, options) {
6601
+ if (options === void 0) {
6602
+ options = {};
6603
+ }
6604
+ var reactElements = [];
6605
+ var hasReplace = typeof options.replace === "function";
6606
+ var transform = options.transform || utilities_1.returnFirstArg;
6607
+ var _a = options.library || React, cloneElement = _a.cloneElement, createElement = _a.createElement, isValidElement = _a.isValidElement;
6608
+ var nodesLength = nodes.length;
6609
+ for (var index2 = 0; index2 < nodesLength; index2++) {
6610
+ var node2 = nodes[index2];
6611
+ if (hasReplace) {
6612
+ var replaceElement = options.replace(node2, index2);
6613
+ if (isValidElement(replaceElement)) {
6614
+ if (nodesLength > 1) {
6615
+ replaceElement = cloneElement(replaceElement, {
6616
+ key: replaceElement.key || index2
6617
+ });
6618
+ }
6619
+ reactElements.push(transform(replaceElement, node2, index2));
6620
+ continue;
6621
+ }
6622
+ }
6623
+ if (node2.type === "text") {
6624
+ var isWhitespace = !node2.data.trim().length;
6625
+ if (isWhitespace && node2.parent && !(0, utilities_1.canTextBeChildOfNode)(node2.parent)) {
6626
+ continue;
6627
+ }
6628
+ if (options.trim && isWhitespace) {
6629
+ continue;
6630
+ }
6631
+ reactElements.push(transform(node2.data, node2, index2));
6632
+ continue;
6633
+ }
6634
+ var element = node2;
6635
+ var props = {};
6636
+ if (skipAttributesToProps(element)) {
6637
+ (0, utilities_1.setStyleProp)(element.attribs.style, element.attribs);
6638
+ props = element.attribs;
6639
+ } else if (element.attribs) {
6640
+ props = (0, attributes_to_props_1.default)(element.attribs, element.name);
6641
+ }
6642
+ var children = void 0;
6643
+ switch (node2.type) {
6644
+ case "script":
6645
+ case "style":
6646
+ if (node2.children[0]) {
6647
+ props.dangerouslySetInnerHTML = {
6648
+ __html: node2.children[0].data
6649
+ };
6650
+ }
6651
+ break;
6652
+ case "tag":
6653
+ if (node2.name === "textarea" && node2.children[0]) {
6654
+ props.defaultValue = node2.children[0].data;
6655
+ } else if (node2.children && node2.children.length) {
6656
+ children = domToReact(node2.children, options);
6657
+ }
6658
+ break;
6659
+ default:
6660
+ continue;
6661
+ }
6662
+ if (nodesLength > 1) {
6663
+ props.key = index2;
6664
+ }
6665
+ reactElements.push(transform(createElement(node2.name, props, children), node2, index2));
6666
+ }
6667
+ return reactElements.length === 1 ? reactElements[0] : reactElements;
6668
+ }
6669
+ function skipAttributesToProps(node2) {
6670
+ return utilities_1.PRESERVE_CUSTOM_ATTRIBUTES && node2.type === "tag" && (0, utilities_1.isCustomComponent)(node2.name, node2.attribs);
6671
+ }
6672
+ (function(exports) {
6673
+ var __importDefault2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
6674
+ return mod && mod.__esModule ? mod : { "default": mod };
6675
+ };
6676
+ Object.defineProperty(exports, "__esModule", { value: true });
6677
+ exports.htmlToDOM = exports.domToReact = exports.attributesToProps = exports.Text = exports.ProcessingInstruction = exports.Element = exports.Comment = void 0;
6678
+ exports.default = HTMLReactParser2;
6679
+ var html_dom_parser_1 = __importDefault2(htmlToDom);
6680
+ exports.htmlToDOM = html_dom_parser_1.default;
6681
+ var attributes_to_props_12 = __importDefault2(attributesToProps$1);
6682
+ exports.attributesToProps = attributes_to_props_12.default;
6683
+ var dom_to_react_1 = __importDefault2(domToReact$1);
6684
+ exports.domToReact = dom_to_react_1.default;
6685
+ var domhandler_12 = lib$2;
6686
+ Object.defineProperty(exports, "Comment", { enumerable: true, get: function() {
6687
+ return domhandler_12.Comment;
6688
+ } });
6689
+ Object.defineProperty(exports, "Element", { enumerable: true, get: function() {
6690
+ return domhandler_12.Element;
6691
+ } });
6692
+ Object.defineProperty(exports, "ProcessingInstruction", { enumerable: true, get: function() {
6693
+ return domhandler_12.ProcessingInstruction;
6694
+ } });
6695
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function() {
6696
+ return domhandler_12.Text;
6697
+ } });
6698
+ var domParserOptions = { lowerCaseAttributeNames: false };
6699
+ function HTMLReactParser2(html2, options) {
6700
+ if (typeof html2 !== "string") {
6701
+ throw new TypeError("First argument must be a string");
6702
+ }
6703
+ if (!html2) {
6704
+ return [];
6705
+ }
6706
+ return (0, dom_to_react_1.default)((0, html_dom_parser_1.default)(html2, (options === null || options === void 0 ? void 0 : options.htmlparser2) || domParserOptions), options);
6707
+ }
6708
+ })(lib$3);
6709
+ var HTMLReactParser = /* @__PURE__ */ getDefaultExportFromCjs(lib$3);
6710
+ var ReactParser = HTMLReactParser.default || HTMLReactParser;
6711
+ const alertStates = {
6712
+ success: {
6713
+ icon: /* @__PURE__ */ jsx(SuccessWhite, {}),
6714
+ bg: vars("colors-alert-ice"),
6715
+ id: "success"
6716
+ },
6717
+ error: {
6718
+ icon: /* @__PURE__ */ jsx(ErrorWhite, {}),
6719
+ bg: vars("colors-alert-veryLightPinkThree"),
6720
+ id: "error"
6721
+ },
6722
+ info: {
6723
+ icon: /* @__PURE__ */ jsx(InfoWhite, {}),
6724
+ bg: vars("colors-alert-veryLightBlue"),
6725
+ id: "info"
6726
+ },
6727
+ warning: {
6728
+ icon: /* @__PURE__ */ jsx(WarningWhite, {}),
6729
+ bg: vars("colors-alert-pale"),
6730
+ id: "warning"
6731
+ }
6732
+ };
6733
+ const alertColorStates = {
6734
+ success: {
6735
+ icon: /* @__PURE__ */ jsx(SuccessColor, {}),
6736
+ bg: vars("colors-alert-ice"),
6737
+ id: "success"
6738
+ },
6739
+ error: {
6740
+ icon: /* @__PURE__ */ jsx(ErrorColor, {}),
6741
+ bg: vars("colors-alert-veryLightPinkThree"),
6742
+ id: "error"
6743
+ },
6744
+ info: {
6745
+ icon: /* @__PURE__ */ jsx(InfoColor, {}),
6746
+ bg: vars("colors-alert-veryLightBlue"),
6747
+ id: "info"
6748
+ },
6749
+ warning: {
6750
+ icon: /* @__PURE__ */ jsx(WarningColor, {}),
6751
+ bg: vars("colors-alert-pale"),
6752
+ id: "warning"
6753
+ }
6754
+ };
6755
+ function Alert({
6756
+ children,
6757
+ canDismiss = false,
6758
+ buttonText,
6759
+ buttonIcon,
6760
+ buttonLink = false,
6761
+ fullWidth = false,
6762
+ maxContent = false,
6763
+ isFlash = false,
6764
+ onClick,
6765
+ state,
6766
+ m: m2,
6767
+ endTextLink,
6768
+ onClickLink,
6769
+ sx,
6770
+ width
6771
+ }) {
6772
+ const [isMobile] = useMediaQuery("(max-width: 425px)");
6773
+ const handleClick = () => {
6774
+ onClick == null ? void 0 : onClick();
6775
+ };
6776
+ let buttonType;
6777
+ if (buttonText) {
6778
+ buttonType = buttonLink ? "link" : "normal";
6779
+ }
6780
+ const content = typeof children === "string" ? ReactParser(purify.sanitize(children)) : children;
6781
+ return /* @__PURE__ */ jsxs(Box, {
6782
+ className: isFlash ? "flashNotification" : "e_alert",
6783
+ alignItems: !isMobile ? "center" : "unset",
6784
+ backgroundColor: alertStates[state].bg,
6785
+ borderRadius: "8px",
6786
+ display: "flex",
6787
+ flexFlow: isMobile ? "column" : "row",
6788
+ gap: !isFlash ? "16px" : void 0,
6789
+ justifyContent: !isMobile ? "space-between" : void 0,
6790
+ margin: m2,
6791
+ mx: isFlash ? "auto" : void 0,
6792
+ width: width != null ? width : maxContent ? "max-content" : fullWidth ? "100%" : "fit-content",
6793
+ maxWidth: fullWidth ? "none" : (width != null ? width : maxContent) ? "none" : "796px",
6794
+ p: "1rem",
6795
+ pr: canDismiss ? "1.75rem" : "1rem",
6796
+ position: "relative",
6797
+ sx,
6798
+ children: [/* @__PURE__ */ jsxs(Box, {
6799
+ display: "flex",
6800
+ gap: "10px",
6801
+ className: "alertContent",
6802
+ sx: {
6803
+ ".linkButton": {
6804
+ fontSize: "16px"
6805
+ },
6806
+ a: {
6807
+ fontWeight: "500",
6808
+ color: vars("colors-main-deepSkyBlue"),
6809
+ textDecoration: "underline"
6810
+ },
6811
+ "a:hover": {
6812
+ color: vars("colors-neutral-darkCharcoal")
6813
+ }
6814
+ },
6815
+ children: [/* @__PURE__ */ jsx(Box, {
6816
+ className: "iconContainer",
6817
+ sx: {
6818
+ svg: {
6819
+ width: "auto"
6820
+ }
6821
+ },
6822
+ children: alertStates[state].icon
6823
+ }), /* @__PURE__ */ jsxs(Box, {
6824
+ display: "flex",
6825
+ alignItems: "center",
6826
+ children: [/* @__PURE__ */ jsxs(Box, {
6827
+ alignSelf: "center",
6828
+ as: "p",
6829
+ color: vars("colors-neutral-darkCharcoal"),
6830
+ fontFamily: "Roboto",
6831
+ fontSize: "16px",
6832
+ fontWeight: "400",
6833
+ lineHeight: "28px",
6834
+ mb: "0",
6835
+ children: [content, endTextLink && onClickLink && /* @__PURE__ */ jsx(BtnLink, {
6836
+ onClick: onClickLink,
6837
+ children: endTextLink
6838
+ })]
6839
+ }), buttonType === "link" && /* @__PURE__ */ jsx(BtnLink, {
6840
+ onClick: handleClick,
6841
+ children: buttonText
6842
+ })]
6843
+ })]
6844
+ }), buttonType === "normal" && /* @__PURE__ */ jsx(BtnPrimary, {
6845
+ isFullWidth: !!isMobile,
6846
+ leftIcon: buttonIcon,
6847
+ onClick: handleClick,
6848
+ children: buttonText
6849
+ }), canDismiss && /* @__PURE__ */ jsx(Box, {
6850
+ "data-testid": "closeButton",
6851
+ cursor: "pointer",
6852
+ marginLeft: "12px",
6853
+ sx: {
6854
+ svg: {
6855
+ position: "absolute",
6856
+ top: "16px",
6857
+ right: "12px"
6858
+ }
6859
+ },
6860
+ onClick,
6861
+ children: /* @__PURE__ */ jsx(Close, {})
6862
+ })]
6863
+ });
6864
+ }
6865
+ let e = { data: "" }, t = (t2) => "object" == typeof window ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e, l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, a = /\/\*[^]*?\*\/| +/g, n$1 = /\n+/g, o = (e2, t2) => {
6866
+ let r = "", l2 = "", a2 = "";
6867
+ for (let n2 in e2) {
6868
+ let c2 = e2[n2];
6869
+ "@" == n2[0] ? "i" == n2[1] ? r = n2 + " " + c2 + ";" : l2 += "f" == n2[1] ? o(c2, n2) : n2 + "{" + o(c2, "k" == n2[1] ? "" : t2) + "}" : "object" == typeof c2 ? l2 += o(c2, t2 ? t2.replace(/([^,])+/g, (e3) => n2.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t3) => /&/.test(t3) ? t3.replace(/&/g, e3) : e3 ? e3 + " " + t3 : t3)) : n2) : null != c2 && (n2 = /^--/.test(n2) ? n2 : n2.replace(/[A-Z]/g, "-$&").toLowerCase(), a2 += o.p ? o.p(n2, c2) : n2 + ":" + c2 + ";");
6870
+ }
6871
+ return r + (t2 && a2 ? t2 + "{" + a2 + "}" : a2) + l2;
6872
+ }, c = {}, s = (e2) => {
6873
+ if ("object" == typeof e2) {
6874
+ let t2 = "";
6875
+ for (let r in e2)
6876
+ t2 += r + s(e2[r]);
6877
+ return t2;
6878
+ }
6879
+ return e2;
6880
+ }, i = (e2, t2, r, i2, p2) => {
6881
+ let u2 = s(e2), d2 = c[u2] || (c[u2] = ((e3) => {
6882
+ let t3 = 0, r2 = 11;
6883
+ for (; t3 < e3.length; )
6884
+ r2 = 101 * r2 + e3.charCodeAt(t3++) >>> 0;
6885
+ return "go" + r2;
6886
+ })(u2));
6887
+ if (!c[d2]) {
6888
+ let t3 = u2 !== e2 ? e2 : ((e3) => {
6889
+ let t4, r2, o2 = [{}];
6890
+ for (; t4 = l.exec(e3.replace(a, "")); )
6891
+ t4[4] ? o2.shift() : t4[3] ? (r2 = t4[3].replace(n$1, " ").trim(), o2.unshift(o2[0][r2] = o2[0][r2] || {})) : o2[0][t4[1]] = t4[2].replace(n$1, " ").trim();
6892
+ return o2[0];
6893
+ })(e2);
6894
+ c[d2] = o(p2 ? { ["@keyframes " + d2]: t3 } : t3, r ? "" : "." + d2);
6895
+ }
6896
+ let f2 = r && c.g ? c.g : null;
6897
+ return r && (c.g = c[d2]), ((e3, t3, r2, l2) => {
6898
+ l2 ? t3.data = t3.data.replace(l2, e3) : -1 === t3.data.indexOf(e3) && (t3.data = r2 ? e3 + t3.data : t3.data + e3);
6899
+ })(c[d2], t2, i2, f2), d2;
6900
+ }, p = (e2, t2, r) => e2.reduce((e3, l2, a2) => {
6901
+ let n2 = t2[a2];
6902
+ if (n2 && n2.call) {
6903
+ let e4 = n2(r), t3 = e4 && e4.props && e4.props.className || /^go/.test(e4) && e4;
6904
+ n2 = t3 ? "." + t3 : e4 && "object" == typeof e4 ? e4.props ? "" : o(e4, "") : false === e4 ? "" : e4;
6905
+ }
6906
+ return e3 + l2 + (null == n2 ? "" : n2);
6907
+ }, "");
6908
+ function u$1(e2) {
6909
+ let r = this || {}, l2 = e2.call ? e2(r.p) : e2;
6910
+ return i(l2.unshift ? l2.raw ? p(l2, [].slice.call(arguments, 1), r.p) : l2.reduce((e3, t2) => Object.assign(e3, t2 && t2.call ? t2(r.p) : t2), {}) : l2, t(r.target), r.g, r.o, r.k);
6911
+ }
6912
+ let d, f, g;
6913
+ u$1.bind({ g: 1 });
6914
+ let h$1 = u$1.bind({ k: 1 });
6915
+ function m(e2, t2, r, l2) {
6916
+ o.p = t2, d = e2, f = r, g = l2;
6917
+ }
6918
+ function j(e2, t2) {
6919
+ let r = this || {};
6920
+ return function() {
6921
+ let l2 = arguments;
6922
+ function a2(n2, o2) {
6923
+ let c2 = Object.assign({}, n2), s2 = c2.className || a2.className;
6924
+ r.p = Object.assign({ theme: f && f() }, c2), r.o = / *go\d+/.test(s2), c2.className = u$1.apply(r, l2) + (s2 ? " " + s2 : ""), t2 && (c2.ref = o2);
6925
+ let i2 = e2;
6926
+ return e2[0] && (i2 = c2.as || e2, delete c2.as), g && i2[0] && g(c2), d(i2, c2);
6927
+ }
6928
+ return t2 ? t2(a2) : a2;
3776
6929
  };
3777
6930
  }
3778
6931
  var W = (e2) => typeof e2 == "function", T = (e2, t2) => W(e2) ? e2(t2) : e2;
@@ -4038,7 +7191,7 @@ to {
4038
7191
  forwards;
4039
7192
  `, M = ({ toast: e2 }) => {
4040
7193
  let { icon: t2, type: o2, iconTheme: s2 } = e2;
4041
- return t2 !== void 0 ? typeof t2 == "string" ? React.createElement(fe, null, t2) : t2 : o2 === "blank" ? null : React.createElement(le, null, React.createElement(V, { ...s2 }), o2 !== "loading" && React.createElement(ue, null, o2 === "error" ? React.createElement(_, { ...s2 }) : React.createElement(w, { ...s2 })));
7194
+ return t2 !== void 0 ? typeof t2 == "string" ? React$1.createElement(fe, null, t2) : t2 : o2 === "blank" ? null : React$1.createElement(le, null, React$1.createElement(V, { ...s2 }), o2 !== "loading" && React$1.createElement(ue, null, o2 === "error" ? React$1.createElement(_, { ...s2 }) : React$1.createElement(w, { ...s2 })));
4042
7195
  };
4043
7196
  var ye = (e2) => `
4044
7197
  0% {transform: translate3d(0,${e2 * -200}%,0) scale(.6); opacity:.5;}
@@ -4068,13 +7221,13 @@ var ye = (e2) => `
4068
7221
  `, Ae = (e2, t2) => {
4069
7222
  let s2 = e2.includes("top") ? 1 : -1, [a2, r] = b() ? [he, xe] : [ye(s2), ge(s2)];
4070
7223
  return { animation: t2 ? `${h$1(a2)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${h$1(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
4071
- }, F = React.memo(({ toast: e2, position: t2, style: o2, children: s2 }) => {
4072
- let a2 = e2.height ? Ae(e2.position || t2 || "top-center", e2.visible) : { opacity: 0 }, r = React.createElement(M, { toast: e2 }), c2 = React.createElement(Se, { ...e2.ariaProps }, T(e2.message, e2));
4073
- return React.createElement(be, { className: e2.className, style: { ...a2, ...o2, ...e2.style } }, typeof s2 == "function" ? s2({ icon: r, message: c2 }) : React.createElement(React.Fragment, null, r, c2));
7224
+ }, F = React$1.memo(({ toast: e2, position: t2, style: o2, children: s2 }) => {
7225
+ let a2 = e2.height ? Ae(e2.position || t2 || "top-center", e2.visible) : { opacity: 0 }, r = React$1.createElement(M, { toast: e2 }), c2 = React$1.createElement(Se, { ...e2.ariaProps }, T(e2.message, e2));
7226
+ return React$1.createElement(be, { className: e2.className, style: { ...a2, ...o2, ...e2.style } }, typeof s2 == "function" ? s2({ icon: r, message: c2 }) : React$1.createElement(React$1.Fragment, null, r, c2));
4074
7227
  });
4075
- m(React.createElement);
7228
+ m(React$1.createElement);
4076
7229
  var Ee = ({ id: e2, className: t2, style: o2, onHeightUpdate: s2, children: a2 }) => {
4077
- let r = React.useCallback((c2) => {
7230
+ let r = React$1.useCallback((c2) => {
4078
7231
  if (c2) {
4079
7232
  let i2 = () => {
4080
7233
  let d2 = c2.getBoundingClientRect().height;
@@ -4083,7 +7236,7 @@ var Ee = ({ id: e2, className: t2, style: o2, onHeightUpdate: s2, children: a2 }
4083
7236
  i2(), new MutationObserver(i2).observe(c2, { subtree: true, childList: true, characterData: true });
4084
7237
  }
4085
7238
  }, [e2, s2]);
4086
- return React.createElement("div", { ref: r, className: t2, style: o2 }, a2);
7239
+ return React$1.createElement("div", { ref: r, className: t2, style: o2 }, a2);
4087
7240
  }, Re = (e2, t2) => {
4088
7241
  let o2 = e2.includes("top"), s2 = o2 ? { top: 0 } : { bottom: 0 }, a2 = e2.includes("center") ? { justifyContent: "center" } : e2.includes("right") ? { justifyContent: "flex-end" } : {};
4089
7242
  return { left: 0, right: 0, display: "flex", position: "absolute", transition: b() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t2 * (o2 ? 1 : -1)}px)`, ...s2, ...a2 };
@@ -4094,28 +7247,26 @@ var Ee = ({ id: e2, className: t2, style: o2, onHeightUpdate: s2, children: a2 }
4094
7247
  }
4095
7248
  `, O = 16, Ie = ({ reverseOrder: e2, position: t2 = "top-center", toastOptions: o2, gutter: s2, children: a2, containerStyle: r, containerClassName: c2 }) => {
4096
7249
  let { toasts: i2, handlers: d2 } = D(o2);
4097
- return React.createElement("div", { style: { position: "fixed", zIndex: 9999, top: O, left: O, right: O, bottom: O, pointerEvents: "none", ...r }, className: c2, onMouseEnter: d2.startPause, onMouseLeave: d2.endPause }, i2.map((p2) => {
7250
+ return React$1.createElement("div", { style: { position: "fixed", zIndex: 9999, top: O, left: O, right: O, bottom: O, pointerEvents: "none", ...r }, className: c2, onMouseEnter: d2.startPause, onMouseLeave: d2.endPause }, i2.map((p2) => {
4098
7251
  let g2 = p2.position || t2, E = d2.calculateOffset(p2, { reverseOrder: e2, gutter: s2, defaultPosition: t2 }), x = Re(g2, E);
4099
- return React.createElement(Ee, { id: p2.id, key: p2.id, onHeightUpdate: d2.updateHeight, className: p2.visible ? ve : "", style: x }, p2.type === "custom" ? T(p2.message, p2) : a2 ? a2(p2) : React.createElement(F, { toast: p2, position: g2 }));
7252
+ return React$1.createElement(Ee, { id: p2.id, key: p2.id, onHeightUpdate: d2.updateHeight, className: p2.visible ? ve : "", style: x }, p2.type === "custom" ? T(p2.message, p2) : a2 ? a2(p2) : React$1.createElement(F, { toast: p2, position: g2 }));
4100
7253
  }));
4101
7254
  };
4102
7255
  const handleTime = (message) => {
4103
- function countWords(input) {
4104
- var _a, _b;
4105
- const wordCount = (_b = (_a = input.match(/(\w+)/g)) == null ? void 0 : _a.length) != null ? _b : 0;
4106
- return wordCount;
4107
- }
4108
- let time = 3e3;
4109
- if (message && countWords(message) > 5) {
4110
- time = 6e3;
4111
- }
4112
- return time;
7256
+ if (!message)
7257
+ return 3e3;
7258
+ const words = message.trim().split(/\s+/).length;
7259
+ const wordsPerMinute = 150;
7260
+ const baseMinutes = words / wordsPerMinute;
7261
+ const totalMs = Math.round(baseMinutes * 60 * 1e3);
7262
+ return Math.max(3e3, totalMs);
4113
7263
  };
4114
7264
  function FlashNotification({
4115
7265
  message,
4116
7266
  state,
4117
7267
  show,
4118
- m: m2
7268
+ m: m2,
7269
+ width
4119
7270
  }) {
4120
7271
  const showToast = useCallback(() => {
4121
7272
  n((t2) => /* @__PURE__ */ jsx(Alert, {
@@ -4123,19 +7274,22 @@ function FlashNotification({
4123
7274
  state,
4124
7275
  canDismiss: true,
4125
7276
  onClick: () => n.dismiss(t2.id),
7277
+ width,
7278
+ m: m2,
4126
7279
  children: message
4127
7280
  }), {
4128
- duration: handleTime(message),
7281
+ duration: state === "success" ? handleTime(message) : Infinity,
4129
7282
  id: alertStates[state].id
4130
7283
  });
4131
- }, [message, state]);
7284
+ }, [message, state, width, m2]);
4132
7285
  useEffect(() => {
4133
7286
  if (show) {
4134
7287
  showToast();
4135
7288
  }
4136
7289
  }, [show, showToast]);
4137
- return /* @__PURE__ */ jsx(Box, {
7290
+ return /* @__PURE__ */ jsx(Portal, {
4138
7291
  children: /* @__PURE__ */ jsx(Ie, {
7292
+ position: "top-center",
4139
7293
  toastOptions: {
4140
7294
  className: "toastContainer",
4141
7295
  style: {
@@ -4146,16 +7300,22 @@ function FlashNotification({
4146
7300
  })
4147
7301
  });
4148
7302
  }
4149
- const useFlashNotification = ({ state, message }) => {
7303
+ const useFlashNotification = ({
7304
+ state,
7305
+ message,
7306
+ maxContent,
7307
+ width
7308
+ }) => {
4150
7309
  const [show, setShow] = useState(false);
4151
7310
  useEffect(() => {
4152
7311
  if (show) {
7312
+ const duration = state === "success" ? handleTime(message) : 1e3;
4153
7313
  const timeOut = setTimeout(() => {
4154
7314
  setShow(false);
4155
- }, handleTime(message));
7315
+ }, duration);
4156
7316
  return () => clearTimeout(timeOut);
4157
7317
  }
4158
- }, [message, show]);
7318
+ }, [message, show, state]);
4159
7319
  const active = () => {
4160
7320
  if (!show) {
4161
7321
  setShow(true);
@@ -4166,11 +7326,115 @@ const useFlashNotification = ({ state, message }) => {
4166
7326
  active,
4167
7327
  config: {
4168
7328
  state,
4169
- message
7329
+ message,
7330
+ maxContent,
7331
+ width
7332
+ }
7333
+ };
7334
+ };
7335
+ const ModalContentBase = ({
7336
+ children,
7337
+ closeOnOverlayClick,
7338
+ fixedSubtitle,
7339
+ title,
7340
+ withoutMargin
7341
+ }) => {
7342
+ const [isDesktop] = useMediaQuery(`(min-width: ${uiKitModalIsDesktop}px)`);
7343
+ const py = "32px";
7344
+ const px = "24px";
7345
+ return /* @__PURE__ */ jsxs(Fragment, {
7346
+ children: [/* @__PURE__ */ jsx(ModalHeader, {
7347
+ bg: vars("colors-main-deepSkyBlue"),
7348
+ borderTopRadius: isDesktop ? "8px" : 0,
7349
+ color: vars("colors-neutral-white"),
7350
+ fontFamily: "Roboto",
7351
+ fontSize: isDesktop ? "20px" : "18px",
7352
+ fontWeight: 700,
7353
+ lineHeight: 1,
7354
+ mb: withoutMargin ? 0 : "32px",
7355
+ paddingY: px,
7356
+ textAlign: "center",
7357
+ children: title
7358
+ }), closeOnOverlayClick && /* @__PURE__ */ jsx(ModalCloseButton, {
7359
+ background: "transparent!important",
7360
+ border: "none",
7361
+ color: vars("colors-neutral-white"),
7362
+ h: "12px",
7363
+ p: "22px",
7364
+ right: 0,
7365
+ top: 0,
7366
+ w: "12px",
7367
+ _focus: {
7368
+ boxShadow: "none"
7369
+ },
7370
+ _focusVisible: {
7371
+ boxShadow: `inset 0 0 0 2px ${vars("colors-alert-deepSkyBlue")}, inset 0 0 0 4px ${vars("colors-neutral-white")}`
7372
+ }
7373
+ }), (fixedSubtitle == null ? void 0 : fixedSubtitle.trim()) && /* @__PURE__ */ jsx(Box, {
7374
+ as: "p",
7375
+ fontSize: "14px",
7376
+ lineHeight: "19px",
7377
+ mb: py,
7378
+ textAlign: "center",
7379
+ px,
7380
+ children: fixedSubtitle
7381
+ }), children]
7382
+ });
7383
+ };
7384
+ const useModalConfig = ({
7385
+ closeOnOverlayClick,
7386
+ scrollBehavior,
7387
+ fixedButtons,
7388
+ withoutMargin
7389
+ }) => {
7390
+ const [isDesktop] = useMediaQuery(`(min-width: ${uiKitModalIsDesktop}px)`);
7391
+ const isInsideScroll = scrollBehavior === "inside";
7392
+ const shouldForceInsideScroll = fixedButtons;
7393
+ const isInside = isInsideScroll || shouldForceInsideScroll;
7394
+ return {
7395
+ closeOnOverlayClick,
7396
+ closeOnEsc: closeOnOverlayClick,
7397
+ scrollBehavior: isInside ? "inside" : "outside",
7398
+ contentProps: {
7399
+ maxH: isInside ? "100dvh" : "auto",
7400
+ minH: isDesktop ? "300px" : "100dvh",
7401
+ padding: 0,
7402
+ width: "100%",
7403
+ animation: "none",
7404
+ sx: {
7405
+ bgColor: vars("colors-neutral-white"),
7406
+ borderRadius: isDesktop ? "8px" : 0,
7407
+ mt: isDesktop ? "48px" : 0,
7408
+ mb: isDesktop ? "48px" : 0,
7409
+ marginX: isDesktop ? "auto" : 0,
7410
+ maxH: isInside ? "calc(100dvh - 96px)" : "auto",
7411
+ maxWidth: isDesktop ? "690px" : "100%",
7412
+ ...fixedButtons && {
7413
+ ".uikit-modalContent": {
7414
+ pb: 0
7415
+ },
7416
+ ".uikit-modalButtons": {
7417
+ ...ModalPadding
7418
+ }
7419
+ },
7420
+ ...withoutMargin && {
7421
+ ".uikit-modalContent": {
7422
+ pt: 0,
7423
+ px: 0
7424
+ },
7425
+ ".uikit-modalButtons": {
7426
+ px: ModalPadding.px
7427
+ }
7428
+ }
7429
+ }
4170
7430
  }
4171
7431
  };
4172
7432
  };
4173
7433
  const uiKitModalIsDesktop = 641;
7434
+ const ModalPadding = {
7435
+ py: "32px",
7436
+ px: "24px"
7437
+ };
4174
7438
  const Modal = ({
4175
7439
  children,
4176
7440
  closeOnOverlayClick = true,
@@ -4183,89 +7447,33 @@ const Modal = ({
4183
7447
  fixedButtons = false,
4184
7448
  autoFocus = false
4185
7449
  }) => {
4186
- const py = "32px";
4187
- const px = "24px";
4188
- const [isDesktop] = useMediaQuery(`(min-width: ${uiKitModalIsDesktop}px)`);
4189
7450
  const isInside = scrollBehavior === "inside" || fixedButtons;
4190
- return /* @__PURE__ */ jsx(Fragment, {
4191
- children: /* @__PURE__ */ jsxs(Modal$1, {
4192
- closeOnOverlayClick,
4193
- closeOnEsc: closeOnOverlayClick,
4194
- isOpen,
4195
- motionPreset: "scale",
4196
- onClose,
4197
- scrollBehavior: isInside ? "inside" : "outside",
4198
- autoFocus,
4199
- children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent$1, {
4200
- maxH: isInside ? "100dvh" : "auto",
4201
- minH: isDesktop ? "300px" : "100dvh",
4202
- padding: 0,
4203
- width: "100%",
4204
- sx: {
4205
- bgColor: vars("colors-neutral-white"),
4206
- borderRadius: isDesktop ? "8px" : 0,
4207
- mt: isDesktop ? "48px" : 0,
4208
- mb: isDesktop ? "48px" : 0,
4209
- marginX: isDesktop ? "auto" : 0,
4210
- maxH: isInside ? "calc(100dvh - 96px)" : "auto",
4211
- maxWidth: isDesktop ? "690px" : "100%",
4212
- ...fixedButtons && {
4213
- ".uikit-modalContent": {
4214
- pb: 0
4215
- },
4216
- ".uikit-modalButtons": {
4217
- py,
4218
- px
4219
- }
4220
- },
4221
- ...withoutMargin && {
4222
- ".uikit-modalContent": {
4223
- pt: 0,
4224
- px: 0
4225
- },
4226
- ".uikit-modalButtons": {
4227
- px
4228
- }
4229
- }
4230
- },
4231
- children: [/* @__PURE__ */ jsx(ModalHeader, {
4232
- bg: vars("colors-main-deepSkyBlue"),
4233
- borderTopRadius: isDesktop ? "8px" : 0,
4234
- color: vars("colors-neutral-white"),
4235
- fontFamily: "Roboto",
4236
- fontSize: isDesktop ? "20px" : "18px",
4237
- fontWeight: 700,
4238
- lineHeight: 1,
4239
- mb: withoutMargin ? 0 : "32px",
4240
- paddingY: px,
4241
- textAlign: "center",
4242
- children: title
4243
- }), closeOnOverlayClick && /* @__PURE__ */ jsx(ModalCloseButton, {
4244
- background: "transparent!important",
4245
- border: "none",
4246
- color: vars("colors-neutral-white"),
4247
- h: "12px",
4248
- p: "22px",
4249
- right: 0,
4250
- top: 0,
4251
- w: "12px",
4252
- _focus: {
4253
- boxShadow: "none"
4254
- },
4255
- _focusVisible: {
4256
- boxShadow: `inset 0 0 0 2px ${vars("colors-alert-deepSkyBlue")}, inset 0 0 0 4px ${vars("colors-neutral-white")}`
4257
- }
4258
- }), (fixedSubtitle == null ? void 0 : fixedSubtitle.trim()) && /* @__PURE__ */ jsx(Box, {
4259
- as: "p",
4260
- fontSize: "14px",
4261
- lineHeight: "19px",
4262
- mb: py,
4263
- textAlign: "center",
4264
- px,
4265
- children: fixedSubtitle
4266
- }), children]
4267
- })]
4268
- })
7451
+ const modalConfig = useModalConfig({
7452
+ closeOnOverlayClick,
7453
+ scrollBehavior,
7454
+ fixedButtons,
7455
+ withoutMargin
7456
+ });
7457
+ return /* @__PURE__ */ jsxs(Modal$1, {
7458
+ closeOnOverlayClick: modalConfig.closeOnOverlayClick,
7459
+ closeOnEsc: modalConfig.closeOnEsc,
7460
+ isOpen,
7461
+ motionPreset: "scale",
7462
+ onClose,
7463
+ scrollBehavior: isInside ? "inside" : "outside",
7464
+ autoFocus,
7465
+ blockScrollOnMount: false,
7466
+ children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsx(ModalContent$1, {
7467
+ ...modalConfig.contentProps,
7468
+ children: /* @__PURE__ */ jsx(ModalContentBase, {
7469
+ fixedButtons,
7470
+ withoutMargin,
7471
+ title,
7472
+ closeOnOverlayClick,
7473
+ fixedSubtitle,
7474
+ children
7475
+ })
7476
+ })]
4269
7477
  });
4270
7478
  };
4271
7479
  const StyledModalFooter = ModalFooter;
@@ -4347,6 +7555,60 @@ const Loading$1 = ({
4347
7555
  })]
4348
7556
  });
4349
7557
  };
7558
+ const ModalAlertContent = ({
7559
+ type,
7560
+ title,
7561
+ description,
7562
+ status,
7563
+ children
7564
+ }) => {
7565
+ const [isDesktop] = useMediaQuery("(min-width: 641px)");
7566
+ return /* @__PURE__ */ jsxs(Fragment, {
7567
+ children: [/* @__PURE__ */ jsxs(ModalBody, {
7568
+ p: "32px",
7569
+ display: "flex",
7570
+ flexDirection: "column",
7571
+ alignItems: "center",
7572
+ textAlign: "center",
7573
+ gap: "16px",
7574
+ fontFamily: "Roboto",
7575
+ children: [type === "loading" ? /* @__PURE__ */ jsx(Loading$1, {}) : /* @__PURE__ */ jsx(Box, {
7576
+ display: "flex",
7577
+ justifyContent: "center",
7578
+ children: alertColorStates[status != null ? status : "info"].icon
7579
+ }), title && /* @__PURE__ */ jsx(Box, {
7580
+ as: "p",
7581
+ fontWeight: "700",
7582
+ fontSize: isDesktop ? "20px" : "18px",
7583
+ lineHeight: "24px",
7584
+ mb: 0,
7585
+ children: title
7586
+ }), description && /* @__PURE__ */ jsx(Box, {
7587
+ as: "p",
7588
+ fontSize: "16px",
7589
+ lineHeight: "24px",
7590
+ mb: 0,
7591
+ children: description
7592
+ })]
7593
+ }), type !== "loading" && children ? children : /* @__PURE__ */ jsx(Fragment, {})]
7594
+ });
7595
+ };
7596
+ const useModalAlertConfig = () => {
7597
+ const [isDesktop] = useMediaQuery(`(min-width: ${uiKitModalIsDesktop}px)`);
7598
+ return {
7599
+ closeOnOverlayClick: false,
7600
+ closeOnEsc: false,
7601
+ scrollBehavior: "outside",
7602
+ contentProps: {
7603
+ borderRadius: "8px",
7604
+ p: 0,
7605
+ m: "10vh auto 0",
7606
+ sx: {
7607
+ maxWidth: isDesktop ? "589px" : "343px"
7608
+ }
7609
+ }
7610
+ };
7611
+ };
4350
7612
  const ModalAlertNew = ({
4351
7613
  autoFocus = false,
4352
7614
  type,
@@ -4357,7 +7619,7 @@ const ModalAlertNew = ({
4357
7619
  description,
4358
7620
  status
4359
7621
  }) => {
4360
- const [isDesktop] = useMediaQuery("(min-width: 641px)");
7622
+ const modalConfig = useModalAlertConfig();
4361
7623
  return /* @__PURE__ */ jsx(Fragment, {
4362
7624
  children: /* @__PURE__ */ jsxs(Modal$1, {
4363
7625
  closeOnOverlayClick: false,
@@ -4366,40 +7628,15 @@ const ModalAlertNew = ({
4366
7628
  onClose,
4367
7629
  closeOnEsc: type !== "loading",
4368
7630
  autoFocus,
4369
- children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent$1, {
4370
- borderRadius: "8px",
4371
- p: 0,
4372
- m: "10vh auto 0",
4373
- sx: {
4374
- maxWidth: isDesktop ? "589px" : "343px"
4375
- },
4376
- children: [/* @__PURE__ */ jsxs(ModalBody, {
4377
- p: "32px",
4378
- display: "flex",
4379
- flexDirection: "column",
4380
- alignItems: "center",
4381
- textAlign: "center",
4382
- gap: "16px",
4383
- fontFamily: "Roboto",
4384
- children: [type === "loading" ? /* @__PURE__ */ jsx(Loading$1, {}) : /* @__PURE__ */ jsx(Box, {
4385
- display: "flex",
4386
- justifyContent: "center",
4387
- children: alertColorStates[status != null ? status : "info"].icon
4388
- }), title && /* @__PURE__ */ jsx(Box, {
4389
- as: "p",
4390
- fontWeight: "700",
4391
- fontSize: isDesktop ? "20px" : "18px",
4392
- lineHeight: "24px",
4393
- mb: 0,
4394
- children: title
4395
- }), description && /* @__PURE__ */ jsx(Box, {
4396
- as: "p",
4397
- fontSize: "16px",
4398
- lineHeight: "24px",
4399
- mb: 0,
4400
- children: description
4401
- })]
4402
- }), type !== "loading" && children ? children : /* @__PURE__ */ jsx(Fragment, {})]
7631
+ children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsx(ModalContent$1, {
7632
+ ...modalConfig.contentProps,
7633
+ children: /* @__PURE__ */ jsx(ModalAlertContent, {
7634
+ type,
7635
+ title,
7636
+ description,
7637
+ status,
7638
+ children
7639
+ })
4403
7640
  })]
4404
7641
  })
4405
7642
  });
@@ -4430,6 +7667,90 @@ const ModalAlertButtons = ({
4430
7667
  children
4431
7668
  });
4432
7669
  };
7670
+ const useModalMultipleConfig = ({
7671
+ type,
7672
+ closeOnOverlayClick,
7673
+ scrollBehavior,
7674
+ fixedButtons,
7675
+ withoutMargin
7676
+ }) => {
7677
+ const modalConfig = useModalConfig({
7678
+ closeOnOverlayClick,
7679
+ scrollBehavior,
7680
+ fixedButtons,
7681
+ withoutMargin
7682
+ });
7683
+ const modalAlertConfig = useModalAlertConfig();
7684
+ switch (type) {
7685
+ case "modal":
7686
+ return modalConfig;
7687
+ case "modalAlert":
7688
+ case "modalLoading":
7689
+ return modalAlertConfig;
7690
+ }
7691
+ };
7692
+ const ModalMultiple = (props) => {
7693
+ const {
7694
+ type,
7695
+ isOpen,
7696
+ onClose,
7697
+ autoFocus = false,
7698
+ children,
7699
+ title,
7700
+ closeOnOverlayClick = true,
7701
+ fixedSubtitle,
7702
+ withoutMargin = false,
7703
+ scrollBehavior = "outside",
7704
+ fixedButtons = false
7705
+ } = props;
7706
+ const modalConfig = useModalMultipleConfig({
7707
+ type,
7708
+ closeOnOverlayClick,
7709
+ scrollBehavior,
7710
+ fixedButtons,
7711
+ withoutMargin
7712
+ });
7713
+ const renderContent = () => {
7714
+ switch (type) {
7715
+ case "modal":
7716
+ return /* @__PURE__ */ jsx(ModalContentBase, {
7717
+ fixedButtons,
7718
+ withoutMargin,
7719
+ title,
7720
+ closeOnOverlayClick,
7721
+ fixedSubtitle,
7722
+ children
7723
+ });
7724
+ case "modalAlert":
7725
+ case "modalLoading": {
7726
+ const {
7727
+ description,
7728
+ status
7729
+ } = props;
7730
+ return /* @__PURE__ */ jsx(ModalAlertContent, {
7731
+ type: type === "modalAlert" ? "info" : "loading",
7732
+ title,
7733
+ description,
7734
+ status,
7735
+ children
7736
+ });
7737
+ }
7738
+ }
7739
+ };
7740
+ return /* @__PURE__ */ jsxs(Modal$1, {
7741
+ isOpen,
7742
+ onClose,
7743
+ motionPreset: "scale",
7744
+ autoFocus,
7745
+ closeOnOverlayClick: modalConfig.closeOnOverlayClick,
7746
+ closeOnEsc: modalConfig.closeOnEsc,
7747
+ scrollBehavior: modalConfig.scrollBehavior,
7748
+ children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsx(ModalContent$1, {
7749
+ ...modalConfig.contentProps,
7750
+ children: renderContent()
7751
+ })]
7752
+ });
7753
+ };
4433
7754
  function ModalAlert({
4434
7755
  showModal,
4435
7756
  typeAlert,
@@ -4609,7 +7930,7 @@ const LargeBox = ({
4609
7930
  color: "#555555",
4610
7931
  gap: "16px",
4611
7932
  display: "grid",
4612
- children: [/* @__PURE__ */ jsx(Text, {
7933
+ children: [/* @__PURE__ */ jsx(Text$1, {
4613
7934
  fontWeight: "700",
4614
7935
  m: "0px",
4615
7936
  p: "0px",
@@ -4620,19 +7941,19 @@ const LargeBox = ({
4620
7941
  gap: "4px",
4621
7942
  children: [/* @__PURE__ */ jsx(Calendar, {
4622
7943
  color: vars("colors-main-ziggurat")
4623
- }), /* @__PURE__ */ jsx(Text, {
7944
+ }), /* @__PURE__ */ jsx(Text$1, {
4624
7945
  fontWeight: "400",
4625
7946
  m: "0px",
4626
7947
  p: "0px",
4627
7948
  children: startDate
4628
- }), /* @__PURE__ */ jsx(Text, {
7949
+ }), /* @__PURE__ */ jsx(Text$1, {
4629
7950
  color: vars("borders-light"),
4630
7951
  m: "0px",
4631
7952
  p: "0px",
4632
7953
  children: "|"
4633
7954
  }), /* @__PURE__ */ jsx(Clock, {
4634
7955
  color: vars("colors-main-ziggurat")
4635
- }), /* @__PURE__ */ jsx(Text, {
7956
+ }), /* @__PURE__ */ jsx(Text$1, {
4636
7957
  m: "0px",
4637
7958
  p: "0px",
4638
7959
  children: startTime
@@ -4713,7 +8034,7 @@ const SmallBox = ({
4713
8034
  lineHeight: "21px",
4714
8035
  display: "grid",
4715
8036
  gap: "8px",
4716
- children: [/* @__PURE__ */ jsx(Text, {
8037
+ children: [/* @__PURE__ */ jsx(Text$1, {
4717
8038
  fontWeight: "700",
4718
8039
  m: "0px",
4719
8040
  children: eventTitle
@@ -4721,14 +8042,14 @@ const SmallBox = ({
4721
8042
  display: "flex",
4722
8043
  alignItems: "center",
4723
8044
  gap: "4px",
4724
- children: [/* @__PURE__ */ jsx(Calendar, {}), /* @__PURE__ */ jsx(Text, {
8045
+ children: [/* @__PURE__ */ jsx(Calendar, {}), /* @__PURE__ */ jsx(Text$1, {
4725
8046
  fontWeight: "400",
4726
8047
  m: "0px",
4727
8048
  children: startDate
4728
- }), /* @__PURE__ */ jsx(Text, {
8049
+ }), /* @__PURE__ */ jsx(Text$1, {
4729
8050
  m: "0px",
4730
8051
  children: "|"
4731
- }), /* @__PURE__ */ jsx(Clock, {}), /* @__PURE__ */ jsx(Text, {
8052
+ }), /* @__PURE__ */ jsx(Clock, {}), /* @__PURE__ */ jsx(Text$1, {
4732
8053
  m: "0px",
4733
8054
  children: startTime
4734
8055
  })]
@@ -5901,7 +9222,7 @@ const Resources = ({
5901
9222
  gap: "8px",
5902
9223
  padding: "1rem",
5903
9224
  children: [/* @__PURE__ */ jsx(Box, {
5904
- children: /* @__PURE__ */ jsx(Text, {
9225
+ children: /* @__PURE__ */ jsx(Text$1, {
5905
9226
  fontFamily: "Roboto",
5906
9227
  fontWeight: "700",
5907
9228
  lineHeight: "21px",
@@ -5911,7 +9232,7 @@ const Resources = ({
5911
9232
  children: resourceTitle
5912
9233
  })
5913
9234
  }), /* @__PURE__ */ jsx(Box, {
5914
- children: /* @__PURE__ */ jsx(Text, {
9235
+ children: /* @__PURE__ */ jsx(Text$1, {
5915
9236
  fontFamily: "Roboto",
5916
9237
  fontWeight: "400",
5917
9238
  lineHeight: "14px",
@@ -5924,7 +9245,7 @@ const Resources = ({
5924
9245
  display: "flex",
5925
9246
  alignItems: "center",
5926
9247
  justifyContent: "center",
5927
- children: /* @__PURE__ */ jsxs(Text, {
9248
+ children: /* @__PURE__ */ jsxs(Text$1, {
5928
9249
  fontFamily: "Roboto",
5929
9250
  fontWeight: "500",
5930
9251
  fontSize: "14px",
@@ -6249,7 +9570,7 @@ const useParseEvents = (events, now) => {
6249
9570
  };
6250
9571
  };
6251
9572
  const GoToCalendar = ({
6252
- text,
9573
+ text: text2,
6253
9574
  onlyToCalendar,
6254
9575
  onClick
6255
9576
  }) => {
@@ -6283,12 +9604,12 @@ const GoToCalendar = ({
6283
9604
  children: /* @__PURE__ */ jsx(NavBarButton, {
6284
9605
  as: "div",
6285
9606
  type: "calendar",
6286
- buttonName: text.toUpperCase()
9607
+ buttonName: text2.toUpperCase()
6287
9608
  })
6288
9609
  });
6289
9610
  };
6290
9611
  const Header = ({
6291
- text,
9612
+ text: text2,
6292
9613
  isMobile
6293
9614
  }) => {
6294
9615
  var _a, _b;
@@ -6305,7 +9626,7 @@ const Header = ({
6305
9626
  width: isMobile ? "100vw" : "100%",
6306
9627
  top: 0,
6307
9628
  zIndex: "1",
6308
- children: text != null ? text : "Pr\xF3ximas fechas importantes de tus cursos"
9629
+ children: text2 != null ? text2 : "Pr\xF3ximas fechas importantes de tus cursos"
6309
9630
  });
6310
9631
  };
6311
9632
  const NoEventsIcon = () => /* @__PURE__ */ jsxs("svg", {
@@ -6446,7 +9767,7 @@ const NoEventsIcon = () => /* @__PURE__ */ jsxs("svg", {
6446
9767
  })]
6447
9768
  });
6448
9769
  const Empty = ({
6449
- text
9770
+ text: text2
6450
9771
  }) => {
6451
9772
  return /* @__PURE__ */ jsxs(Box, {
6452
9773
  alignItems: "center",
@@ -6458,7 +9779,7 @@ const Empty = ({
6458
9779
  fontSize: "20px",
6459
9780
  fontWeight: "700",
6460
9781
  color: vars("colors-neutral-darkCharcoal") || "#2F2F2F",
6461
- children: text != null ? text : "A\xFAn no tienes eventos en tu calendario"
9782
+ children: text2 != null ? text2 : "A\xFAn no tienes eventos en tu calendario"
6462
9783
  })]
6463
9784
  });
6464
9785
  };
@@ -6468,7 +9789,7 @@ const EventsGroup = ({
6468
9789
  hasMoreNext,
6469
9790
  title,
6470
9791
  redirect,
6471
- text,
9792
+ text: text2,
6472
9793
  textSeeMore,
6473
9794
  textLinkMore
6474
9795
  }) => {
@@ -6512,7 +9833,7 @@ const EventsGroup = ({
6512
9833
  date: event.formatedDate.date,
6513
9834
  time: event.formatedDate.time,
6514
9835
  color: event.course_id && (colors2 == null ? void 0 : colors2[event.course_id]) ? colors2[event.course_id] : "#82504A",
6515
- text,
9836
+ text: text2,
6516
9837
  type: event.type,
6517
9838
  hasNotification: event.isNew,
6518
9839
  showCourse: true
@@ -6542,7 +9863,7 @@ const Events = ({
6542
9863
  hasMoreNext,
6543
9864
  isMobile,
6544
9865
  redirecToCalendar,
6545
- text
9866
+ text: text2
6546
9867
  }) => {
6547
9868
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
6548
9869
  const {
@@ -6575,27 +9896,27 @@ const Events = ({
6575
9896
  onClick: redirecToCalendar,
6576
9897
  m: "72px 0 0 16px",
6577
9898
  id: "RedirectButton",
6578
- children: (_b = text == null ? void 0 : text.buttonCalendar) != null ? _b : "Ir a Mi Calendario"
9899
+ children: (_b = text2 == null ? void 0 : text2.buttonCalendar) != null ? _b : "Ir a Mi Calendario"
6579
9900
  })
6580
9901
  }), /* @__PURE__ */ jsx(EventsGroup, {
6581
9902
  colors: colors2,
6582
9903
  events: today,
6583
- text: (_c = text == null ? void 0 : text.course) != null ? _c : "",
6584
- title: (_e = (_d = text == null ? void 0 : text.events) == null ? void 0 : _d.today) != null ? _e : "Hoy"
9904
+ text: (_c = text2 == null ? void 0 : text2.course) != null ? _c : "",
9905
+ title: (_e = (_d = text2 == null ? void 0 : text2.events) == null ? void 0 : _d.today) != null ? _e : "Hoy"
6585
9906
  }), /* @__PURE__ */ jsx(EventsGroup, {
6586
9907
  colors: colors2,
6587
9908
  events: tomorrow,
6588
- text: (_f = text == null ? void 0 : text.course) != null ? _f : "",
6589
- title: (_h = (_g = text == null ? void 0 : text.events) == null ? void 0 : _g.tomorrow) != null ? _h : "Ma\xF1ana"
9909
+ text: (_f = text2 == null ? void 0 : text2.course) != null ? _f : "",
9910
+ title: (_h = (_g = text2 == null ? void 0 : text2.events) == null ? void 0 : _g.tomorrow) != null ? _h : "Ma\xF1ana"
6590
9911
  }), /* @__PURE__ */ jsx(EventsGroup, {
6591
9912
  colors: colors2,
6592
9913
  events: next,
6593
9914
  hasMoreNext,
6594
9915
  redirect: redirecToCalendar,
6595
- textSeeMore: (_i = text == null ? void 0 : text.seeMore.see) != null ? _i : "Ver m\xE1s fechas en",
6596
- textLinkMore: (_j = text == null ? void 0 : text.seeMore.link) != null ? _j : "Mi calendario",
6597
- text: (_k = text == null ? void 0 : text.course) != null ? _k : "",
6598
- title: (_m = (_l = text == null ? void 0 : text.events) == null ? void 0 : _l.next) != null ? _m : "Pr\xF3ximos"
9916
+ textSeeMore: (_i = text2 == null ? void 0 : text2.seeMore.see) != null ? _i : "Ver m\xE1s fechas en",
9917
+ textLinkMore: (_j = text2 == null ? void 0 : text2.seeMore.link) != null ? _j : "Mi calendario",
9918
+ text: (_k = text2 == null ? void 0 : text2.course) != null ? _k : "",
9919
+ title: (_m = (_l = text2 == null ? void 0 : text2.events) == null ? void 0 : _l.next) != null ? _m : "Pr\xF3ximos"
6599
9920
  })]
6600
9921
  });
6601
9922
  };
@@ -6607,7 +9928,8 @@ const CalendarDropdownContainer = ({
6607
9928
  now,
6608
9929
  onlyToCalendar,
6609
9930
  redirectToCalendar,
6610
- text
9931
+ text: text2,
9932
+ alert = false
6611
9933
  }) => {
6612
9934
  var _a, _b, _c, _d, _e, _f, _g;
6613
9935
  const [isMobile] = useMediaQuery("(max-width: 577px)");
@@ -6718,26 +10040,26 @@ const CalendarDropdownContainer = ({
6718
10040
  onClose,
6719
10041
  children: /* @__PURE__ */ jsxs(Fragment, {
6720
10042
  children: [/* @__PURE__ */ jsx(GoToCalendar, {
6721
- text: (_c = text == null ? void 0 : text.tooltip) != null ? _c : "Calendario",
10043
+ text: (_c = text2 == null ? void 0 : text2.tooltip) != null ? _c : "Calendario",
6722
10044
  onlyToCalendar,
6723
10045
  onClick: redirectToCalendar
6724
10046
  }), !onlyToCalendar && /* @__PURE__ */ jsxs(MenuList, {
6725
10047
  children: [/* @__PURE__ */ jsx(Header, {
6726
10048
  isMobile,
6727
- text: (_d = text == null ? void 0 : text.header) != null ? _d : "Pr\xF3ximas fechas importantes de tus cursos"
10049
+ text: (_d = text2 == null ? void 0 : text2.header) != null ? _d : "Pr\xF3ximas fechas importantes de tus cursos"
6728
10050
  }), /* @__PURE__ */ jsx(Box, {
6729
10051
  bg: (_e = vars("colors-neutral-white")) != null ? _e : "#FFF",
6730
10052
  children: loading ? /* @__PURE__ */ jsx(Loading, {
6731
- text: (_f = text == null ? void 0 : text.loading) != null ? _f : "Cargando"
10053
+ text: (_f = text2 == null ? void 0 : text2.loading) != null ? _f : "Cargando"
6732
10054
  }) : events.length === 0 || empty ? /* @__PURE__ */ jsx(Empty, {
6733
- text: (_g = text == null ? void 0 : text.empty) != null ? _g : "A\xFAn no tienes eventos en tu calendario"
10055
+ text: (_g = text2 == null ? void 0 : text2.empty) != null ? _g : "A\xFAn no tienes eventos en tu calendario"
6734
10056
  }) : /* @__PURE__ */ jsx(Events, {
6735
10057
  colors: courseColors,
6736
10058
  events: all,
6737
10059
  hasMoreNext,
6738
10060
  isMobile,
6739
10061
  redirecToCalendar: redirectToCalendar,
6740
- text
10062
+ text: text2
6741
10063
  })
6742
10064
  })]
6743
10065
  })]
@@ -6746,10 +10068,10 @@ const CalendarDropdownContainer = ({
6746
10068
  });
6747
10069
  };
6748
10070
  const Loading = ({
6749
- text
10071
+ text: text2
6750
10072
  }) => {
6751
10073
  return /* @__PURE__ */ jsx("div", {
6752
- children: text != null ? text : "Loading..."
10074
+ children: text2 != null ? text2 : "Loading..."
6753
10075
  });
6754
10076
  };
6755
10077
  const CalendarDropdown = ({
@@ -6760,7 +10082,8 @@ const CalendarDropdown = ({
6760
10082
  now,
6761
10083
  onlyToCalendar = false,
6762
10084
  redirectToCalendar,
6763
- text
10085
+ text: text2,
10086
+ alert = false
6764
10087
  }) => {
6765
10088
  const date = new Date(now);
6766
10089
  const isoDate = date.toISOString();
@@ -6772,7 +10095,8 @@ const CalendarDropdown = ({
6772
10095
  now: isoDate,
6773
10096
  onlyToCalendar,
6774
10097
  redirectToCalendar,
6775
- text
10098
+ text: text2,
10099
+ alert
6776
10100
  });
6777
10101
  };
6778
10102
  const NotificationIcon = () => /* @__PURE__ */ jsx("svg", {
@@ -6798,7 +10122,7 @@ const EventsList = ({
6798
10122
  showCourse,
6799
10123
  showUnit,
6800
10124
  time,
6801
- text,
10125
+ text: text2,
6802
10126
  type,
6803
10127
  unitName
6804
10128
  }) => {
@@ -6874,7 +10198,7 @@ const EventsList = ({
6874
10198
  as: "span",
6875
10199
  sx: detailTextStyle,
6876
10200
  children: [/* @__PURE__ */ jsx("strong", {
6877
- children: text ? `${text}:` : "Curso:"
10201
+ children: text2 ? `${text2}:` : "Curso:"
6878
10202
  }), " ", courseName]
6879
10203
  }), showUnit && !initOrEnd && /* @__PURE__ */ jsx(Box, {
6880
10204
  display: "flex",
@@ -6889,5 +10213,5 @@ const EventsList = ({
6889
10213
  })]
6890
10214
  });
6891
10215
  };
6892
- export { Alert, Btn, BtnLink, BtnPrimary, BtnSecondary, BtnTertiary, CalendarDropdown, CourseList, CourseStatus, Eventos, EventsList, FlashNotification, index as Icons, Label, Modal, ModalAlert, ModalAlertButtons, ModalAlertNew, ModalButtons, ModalContent, NavBarButton, NewTooltip, Progress, Resources, Ripples, TinyAlert, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
10216
+ export { Alert, Btn, BtnLink, BtnPrimary, BtnSecondary, BtnTertiary, CalendarDropdown, CourseList, CourseStatus, Eventos, EventsList, FlashNotification, index$1 as Icons, Label, Modal, ModalAlert, ModalAlertButtons, ModalAlertNew, ModalButtons, ModalContent, ModalMultiple, NavBarButton, NewTooltip, Progress, Resources, Ripples, TinyAlert, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
6893
10217
  //# sourceMappingURL=eclass-ui-kit.es.js.map