@novu/js 2.3.1 → 2.4.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.
@@ -1,4 +1,5 @@
1
- import { Novu, isSameFilter } from '../chunk-QIWP6QB5.mjs';
1
+ import { Novu, isSameFilter } from '../chunk-VCUP7D3X.mjs';
2
+ import { parseMarkdownIntoTokens } from '../chunk-GPV65U5R.mjs';
2
3
  import { __privateAdd, __privateSet, __privateMethod, __privateGet, __spreadProps, __spreadValues, __objRest, __async } from '../chunk-STZMOEWR.mjs';
3
4
  import { delegateEvents, createComponent, mergeProps, render, Portal, spread, template, insert, memo, effect, className, use, addEventListener, setAttribute, Dynamic, isServer } from 'solid-js/web';
4
5
  import { createSignal, createContext, useContext, onMount, onCleanup, For, createMemo, createEffect, splitProps, Show, Switch as Switch$1, Match, createResource, createComputed, batch } from 'solid-js';
@@ -247,7 +248,7 @@ function formatToRelativeTime({
247
248
  } else if (diffInSeconds < SECONDS.inMonth) {
248
249
  return formatter.format(Math.floor(-diffInSeconds / SECONDS.inDay), "day");
249
250
  } else {
250
- return new Intl.DateTimeFormat(locale, { month: "short", day: "numeric" }).format(toDate);
251
+ return new Intl.DateTimeFormat(locale, { month: "short", day: "numeric" }).format(fromDate);
251
252
  }
252
253
  }
253
254
  var twMerge = extendTailwindMerge({
@@ -1042,7 +1043,7 @@ var ExternalElementRenderer = (props) => {
1042
1043
  return _el$;
1043
1044
  })();
1044
1045
  };
1045
- var _tmpl$2 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M17.117 4.358l-1.159-1.4A1.21 1.21 0 0015 2.5H5c-.392 0-.733.175-.967.458l-1.15 1.4A1.632 1.632 0 002.5 5.417v10.416c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V5.417c0-.4-.142-.775-.383-1.059zM5.2 4.167h9.6l.675.808H4.533l.667-.808zM4.167 15.833V6.667h11.666v9.166H4.167zm7.041-7.5H8.792v2.5H6.667L10 14.167l3.333-3.334h-2.125v-2.5z">`);
1046
+ var _tmpl$2 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.25 15V6.875L15 4.375H5L3.75 6.877V15c0 .345.28.625.625.625h11.25c.345 0 .625-.28.625-.625zM5 8.125h10v6.25H5v-6.25zm.772-2.5h8.455l.625 1.25H5.148l.625-1.25zm6.103 3.75h-3.75v1.25h3.75v-1.25z">`);
1046
1047
  var Archive = (props) => {
1047
1048
  return (() => {
1048
1049
  var _el$ = _tmpl$2();
@@ -1178,7 +1179,7 @@ var Unarchive = (props) => {
1178
1179
  return _el$;
1179
1180
  })();
1180
1181
  };
1181
- var _tmpl$19 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M18.334 5.817v7.516c0 .917-.75 1.667-1.667 1.667H5l-3.333 3.333v-15c0-.916.75-1.666 1.667-1.666h8.416c-.05.266-.083.55-.083.833 0 .283.033.567.083.833H3.334v10h13.333v-6.75a4.127 4.127 0 001.667-.766zm-5-3.317c0 1.383 1.116 2.5 2.5 2.5 1.383 0 2.5-1.117 2.5-2.5S17.217 0 15.834 0a2.497 2.497 0 00-2.5 2.5z">`);
1182
+ var _tmpl$19 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 15v1.25H4.996a.625.625 0 01-.621-.62V4.37c0-.342.28-.62.624-.62H12.5l3.125 3.125v4.375h-1.25V7.5h-2.5V5h-6.25v10H10zm1.54-.335l2.21 2.21 3.094-3.093-.884-.884-2.21 2.21-1.326-1.326-.884.883z">`);
1182
1183
  var Unread = (props) => {
1183
1184
  return (() => {
1184
1185
  var _el$ = _tmpl$19();
@@ -1186,17 +1187,13 @@ var Unread = (props) => {
1186
1187
  return _el$;
1187
1188
  })();
1188
1189
  };
1189
- var _tmpl$20 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 fill=none viewBox="0 0 16 16"><path fill=currentColor d="M8 11.333c.733 0 1.333-.6 1.333-1.333S8.733 8.667 8 8.667s-1.333.6-1.333 1.333.6 1.333 1.333 1.333zm4-6h-.667V4a3.335 3.335 0 00-6.666 0v1.333H4c-.733 0-1.333.6-1.333 1.334v6.666c0 .734.6 1.334 1.333 1.334h8c.733 0 1.333-.6 1.333-1.334V6.667c0-.734-.6-1.334-1.333-1.334zM5.933 4c0-1.14.927-2.067 2.067-2.067 1.14 0 2.067.927 2.067 2.067v1.333H5.933V4zM12 13.333H4V6.667h8v6.666z">`);
1190
- var Lock = () => {
1191
- return _tmpl$20();
1192
- };
1193
1190
 
1194
1191
  // src/ui/components/elements/Bell/DefaultBellContainer.tsx
1195
- var _tmpl$21 = /* @__PURE__ */ template(`<span>`);
1192
+ var _tmpl$20 = /* @__PURE__ */ template(`<span>`);
1196
1193
  var BellContainer = (props) => {
1197
1194
  const style = useStyle();
1198
1195
  return (() => {
1199
- var _el$ = _tmpl$21();
1196
+ var _el$ = _tmpl$20();
1200
1197
  insert(_el$, createComponent(BellIcon, {
1201
1198
  get ["class"]() {
1202
1199
  return style("bellIcon");
@@ -1207,7 +1204,7 @@ var BellContainer = (props) => {
1207
1204
  return props.unreadCount > 0;
1208
1205
  },
1209
1206
  get children() {
1210
- var _el$2 = _tmpl$21();
1207
+ var _el$2 = _tmpl$20();
1211
1208
  effect(() => className(_el$2, style("bellDot", "nt-absolute nt-top-2 nt-right-2 nt-block nt-size-2 nt-transform nt-translate-x-1/2 -nt-translate-y-1/2 nt-bg-primary nt-rounded-full nt-border nt-border-background")));
1212
1209
  return _el$2;
1213
1210
  }
@@ -1240,7 +1237,7 @@ var Bell = (props) => {
1240
1237
  }
1241
1238
  });
1242
1239
  };
1243
- var _tmpl$22 = /* @__PURE__ */ template(`<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu`);
1240
+ var _tmpl$21 = /* @__PURE__ */ template(`<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu`);
1244
1241
  var Footer = () => {
1245
1242
  const {
1246
1243
  hideBranding
@@ -1250,13 +1247,13 @@ var Footer = () => {
1250
1247
  return !hideBranding();
1251
1248
  },
1252
1249
  get children() {
1253
- var _el$ = _tmpl$22(), _el$2 = _el$.firstChild;
1250
+ var _el$ = _tmpl$21(), _el$2 = _el$.firstChild;
1254
1251
  insert(_el$, createComponent(Novu2, {}), _el$2);
1255
1252
  return _el$;
1256
1253
  }
1257
1254
  });
1258
1255
  };
1259
- var _tmpl$23 = /* @__PURE__ */ template(`<button>`);
1256
+ var _tmpl$22 = /* @__PURE__ */ template(`<button>`);
1260
1257
  var buttonVariants = cva("nt-inline-flex nt-gap-4 nt-items-center nt-justify-center nt-whitespace-nowrap nt-rounded-lg nt-text-sm nt-font-medium nt-ring-offset-background nt-transition-colors focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary nt-focus-visible:nt-ring-offset-2 disabled:nt-pointer-events-none disabled:nt-opacity-50", {
1261
1258
  variants: {
1262
1259
  variant: {
@@ -1283,7 +1280,7 @@ var Button = (props) => {
1283
1280
  const [local, rest] = splitProps(props, ["class", "appearanceKey"]);
1284
1281
  const style = useStyle();
1285
1282
  return (() => {
1286
- var _el$ = _tmpl$23();
1283
+ var _el$ = _tmpl$22();
1287
1284
  spread(_el$, mergeProps({
1288
1285
  get ["data-variant"]() {
1289
1286
  return props.variant;
@@ -1301,7 +1298,7 @@ var Button = (props) => {
1301
1298
  return _el$;
1302
1299
  })();
1303
1300
  };
1304
- var _tmpl$24 = /* @__PURE__ */ template(`<button>`);
1301
+ var _tmpl$23 = /* @__PURE__ */ template(`<button>`);
1305
1302
  var PopoverClose = (props) => {
1306
1303
  const {
1307
1304
  onClose
@@ -1322,7 +1319,7 @@ var PopoverClose = (props) => {
1322
1319
  }, rest));
1323
1320
  }
1324
1321
  return (() => {
1325
- var _el$ = _tmpl$24();
1322
+ var _el$ = _tmpl$23();
1326
1323
  _el$.$$click = handleClick;
1327
1324
  spread(_el$, rest, false, false);
1328
1325
  return _el$;
@@ -1515,7 +1512,7 @@ var PopoverContent = (props) => {
1515
1512
  }
1516
1513
  });
1517
1514
  };
1518
- var _tmpl$25 = /* @__PURE__ */ template(`<button>`);
1515
+ var _tmpl$24 = /* @__PURE__ */ template(`<button>`);
1519
1516
  var PopoverTrigger = (props) => {
1520
1517
  const {
1521
1518
  setReference,
@@ -1539,7 +1536,7 @@ var PopoverTrigger = (props) => {
1539
1536
  }, rest));
1540
1537
  }
1541
1538
  return (() => {
1542
- var _el$ = _tmpl$25();
1539
+ var _el$ = _tmpl$24();
1543
1540
  _el$.$$click = handleClick;
1544
1541
  use(setReference, _el$);
1545
1542
  spread(_el$, mergeProps({
@@ -1639,14 +1636,14 @@ var Dropdown = {
1639
1636
  */
1640
1637
  Item: DropdownItem
1641
1638
  };
1642
- var _tmpl$26 = /* @__PURE__ */ template(`<div role=tablist>`);
1643
- var _tmpl$27 = /* @__PURE__ */ template(`<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">`);
1639
+ var _tmpl$25 = /* @__PURE__ */ template(`<div role=tablist>`);
1640
+ var _tmpl$26 = /* @__PURE__ */ template(`<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">`);
1644
1641
  var tabsListVariants = () => "nt-flex nt-gap-6 nt-px-6 nt-py-1 nt-overflow-hidden";
1645
1642
  var TabsList = (props) => {
1646
1643
  const [local, rest] = splitProps(props, ["class", "appearanceKey", "ref", "children"]);
1647
1644
  const style = useStyle();
1648
1645
  return [(() => {
1649
- var _el$ = _tmpl$26();
1646
+ var _el$ = _tmpl$25();
1650
1647
  var _ref$ = local.ref;
1651
1648
  typeof _ref$ === "function" ? use(_ref$, _el$) : local.ref = _el$;
1652
1649
  spread(_el$, mergeProps({
@@ -1656,7 +1653,7 @@ var TabsList = (props) => {
1656
1653
  }, rest), false, true);
1657
1654
  insert(_el$, () => local.children);
1658
1655
  return _el$;
1659
- })(), _tmpl$27()];
1656
+ })(), _tmpl$26()];
1660
1657
  };
1661
1658
  var useKeyboardNavigation = ({
1662
1659
  activeTab,
@@ -1707,7 +1704,7 @@ var useKeyboardNavigation = ({
1707
1704
  };
1708
1705
 
1709
1706
  // src/ui/components/primitives/Tabs/TabsRoot.tsx
1710
- var _tmpl$28 = /* @__PURE__ */ template(`<div>`);
1707
+ var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
1711
1708
  var TabsContext = createContext(void 0);
1712
1709
  var useTabsContext = () => {
1713
1710
  const context = useContext(TabsContext);
@@ -1746,7 +1743,7 @@ var TabsRoot = (props) => {
1746
1743
  setVisibleTabs
1747
1744
  },
1748
1745
  get children() {
1749
- var _el$ = _tmpl$28();
1746
+ var _el$ = _tmpl$27();
1750
1747
  use(setTabsContainer, _el$);
1751
1748
  spread(_el$, mergeProps({
1752
1749
  get ["class"]() {
@@ -1760,7 +1757,7 @@ var TabsRoot = (props) => {
1760
1757
  };
1761
1758
 
1762
1759
  // src/ui/components/primitives/Tabs/TabsContent.tsx
1763
- var _tmpl$29 = /* @__PURE__ */ template(`<div role=tabpanel>`);
1760
+ var _tmpl$28 = /* @__PURE__ */ template(`<div role=tabpanel>`);
1764
1761
  var TabsContent = (props) => {
1765
1762
  const [local, rest] = splitProps(props, ["value", "class", "appearanceKey", "children"]);
1766
1763
  const style = useStyle();
@@ -1772,7 +1769,7 @@ var TabsContent = (props) => {
1772
1769
  return activeTab() === local.value;
1773
1770
  },
1774
1771
  get children() {
1775
- var _el$ = _tmpl$29();
1772
+ var _el$ = _tmpl$28();
1776
1773
  spread(_el$, mergeProps({
1777
1774
  get ["class"]() {
1778
1775
  return memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tabsContent", activeTab() === local.value ? "nt-block" : "nt-hidden");
@@ -1859,7 +1856,7 @@ var inboxFilterLocalizationKeys = {
1859
1856
  unread: "inbox.filters.labels.unread",
1860
1857
  archived: "inbox.filters.labels.archived"
1861
1858
  };
1862
- var _tmpl$30 = /* @__PURE__ */ template(`<span><span></span><span>`);
1859
+ var _tmpl$29 = /* @__PURE__ */ template(`<span><span></span><span>`);
1863
1860
  var _tmpl$210 = /* @__PURE__ */ template(`<span>`);
1864
1861
  var cases = [{
1865
1862
  status: "unreadRead" /* UNREAD_READ */,
@@ -1904,7 +1901,7 @@ var StatusItem = (props) => {
1904
1901
  },
1905
1902
  get children() {
1906
1903
  return [(() => {
1907
- var _el$ = _tmpl$30(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
1904
+ var _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
1908
1905
  insert(_el$2, () => props.icon());
1909
1906
  insert(_el$3, () => t(props.localizationKey));
1910
1907
  effect((_p$) => {
@@ -1937,7 +1934,7 @@ var StatusItem = (props) => {
1937
1934
  };
1938
1935
 
1939
1936
  // src/ui/components/elements/InboxStatus/InboxStatusDropdown.tsx
1940
- var _tmpl$31 = /* @__PURE__ */ template(`<span>`);
1937
+ var _tmpl$30 = /* @__PURE__ */ template(`<span>`);
1941
1938
  var StatusDropdown = () => {
1942
1939
  const style = useStyle();
1943
1940
  const {
@@ -1962,7 +1959,7 @@ var StatusDropdown = () => {
1962
1959
  }, triggerProps, {
1963
1960
  get children() {
1964
1961
  return [(() => {
1965
- var _el$ = _tmpl$31();
1962
+ var _el$ = _tmpl$30();
1966
1963
  insert(_el$, () => t(inboxFilterLocalizationKeys[status()]));
1967
1964
  effect((_p$) => {
1968
1965
  var _v$ = inboxFilterLocalizationKeys[status()], _v$2 = style("inboxStatus__title", "nt-text-xl nt-font-semibold");
@@ -1975,7 +1972,7 @@ var StatusDropdown = () => {
1975
1972
  });
1976
1973
  return _el$;
1977
1974
  })(), (() => {
1978
- var _el$2 = _tmpl$31();
1975
+ var _el$2 = _tmpl$30();
1979
1976
  insert(_el$2, createComponent(ArrowDropDown, {}));
1980
1977
  effect(() => className(_el$2, style("inboxStatus__dropdownItemRight__icon", "nt-text-foreground-alpha-600")));
1981
1978
  return _el$2;
@@ -2103,7 +2100,7 @@ var useArchiveAllRead = (props) => {
2103
2100
  };
2104
2101
 
2105
2102
  // src/ui/components/elements/Header/MoreActionsOptions.tsx
2106
- var _tmpl$32 = /* @__PURE__ */ template(`<span>`);
2103
+ var _tmpl$31 = /* @__PURE__ */ template(`<span>`);
2107
2104
  var MoreActionsOptions = () => {
2108
2105
  const {
2109
2106
  filter
@@ -2151,12 +2148,12 @@ var ActionsItem = (props) => {
2151
2148
  },
2152
2149
  get children() {
2153
2150
  return [(() => {
2154
- var _el$ = _tmpl$32();
2151
+ var _el$ = _tmpl$31();
2155
2152
  insert(_el$, () => props.icon());
2156
2153
  effect(() => className(_el$, style("moreActions__dropdownItemLeft__icon", "nt-text-foreground-alpha-600")));
2157
2154
  return _el$;
2158
2155
  })(), (() => {
2159
- var _el$2 = _tmpl$32();
2156
+ var _el$2 = _tmpl$31();
2160
2157
  insert(_el$2, () => t(props.localizationKey));
2161
2158
  effect((_p$) => {
2162
2159
  var _v$ = props.localizationKey, _v$2 = style("moreActions__dropdownItemLabel");
@@ -2215,11 +2212,11 @@ var MoreActionsDropdown = () => {
2215
2212
  };
2216
2213
 
2217
2214
  // src/ui/components/elements/Header/ActionsContainer.tsx
2218
- var _tmpl$33 = /* @__PURE__ */ template(`<div>`);
2215
+ var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
2219
2216
  var ActionsContainer = (props) => {
2220
2217
  const style = useStyle();
2221
2218
  return (() => {
2222
- var _el$ = _tmpl$33();
2219
+ var _el$ = _tmpl$32();
2223
2220
  insert(_el$, createComponent(MoreActionsDropdown, {}), null);
2224
2221
  insert(_el$, createComponent(Show, {
2225
2222
  get when() {
@@ -2243,11 +2240,11 @@ var ActionsContainer = (props) => {
2243
2240
  };
2244
2241
 
2245
2242
  // src/ui/components/elements/Header/Header.tsx
2246
- var _tmpl$34 = /* @__PURE__ */ template(`<div>`);
2243
+ var _tmpl$33 = /* @__PURE__ */ template(`<div>`);
2247
2244
  var Header = (props) => {
2248
2245
  const style = useStyle();
2249
2246
  return (() => {
2250
- var _el$ = _tmpl$34();
2247
+ var _el$ = _tmpl$33();
2251
2248
  insert(_el$, createComponent(StatusDropdown, {}), null);
2252
2249
  insert(_el$, createComponent(ActionsContainer, {
2253
2250
  get showPreferences() {
@@ -2258,7 +2255,7 @@ var Header = (props) => {
2258
2255
  return _el$;
2259
2256
  })();
2260
2257
  };
2261
- var _tmpl$35 = /* @__PURE__ */ template(`<div><div data-localization=preferences.title>`);
2258
+ var _tmpl$34 = /* @__PURE__ */ template(`<div><div data-localization=preferences.title>`);
2262
2259
  var _tmpl$211 = /* @__PURE__ */ template(`<button>`);
2263
2260
  var PreferencesHeader = (props) => {
2264
2261
  const style = useStyle();
@@ -2266,7 +2263,7 @@ var PreferencesHeader = (props) => {
2266
2263
  t
2267
2264
  } = useLocalization();
2268
2265
  return (() => {
2269
- var _el$ = _tmpl$35(), _el$2 = _el$.firstChild;
2266
+ var _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
2270
2267
  insert(_el$, createComponent(Show, {
2271
2268
  get when() {
2272
2269
  return props.navigateToNotifications;
@@ -2293,7 +2290,7 @@ var PreferencesHeader = (props) => {
2293
2290
  })();
2294
2291
  };
2295
2292
  delegateEvents(["click"]);
2296
- var _tmpl$36 = /* @__PURE__ */ template(`<div>`);
2293
+ var _tmpl$35 = /* @__PURE__ */ template(`<div>`);
2297
2294
  var Root = (props) => {
2298
2295
  const [_, rest] = splitProps(props, ["class"]);
2299
2296
  const {
@@ -2309,7 +2306,7 @@ var Root = (props) => {
2309
2306
  },
2310
2307
  children: new Comment(" Powered by Novu - https://novu.co ")
2311
2308
  }), (() => {
2312
- var _el$ = _tmpl$36();
2309
+ var _el$ = _tmpl$35();
2313
2310
  spread(_el$, mergeProps({
2314
2311
  get id() {
2315
2312
  return `novu-root-${id()}`;
@@ -2321,191 +2318,24 @@ var Root = (props) => {
2321
2318
  return _el$;
2322
2319
  })()];
2323
2320
  };
2324
- var TooltipContext = createContext(void 0);
2325
- function TooltipRoot(props) {
2326
- const [reference, setReference] = createSignal(null);
2327
- const [floating, setFloating] = createSignal(null);
2328
- const position = useFloating(reference, floating, {
2329
- placement: props.placement || "top",
2330
- whileElementsMounted: autoUpdate,
2331
- middleware: [offset(10), flip({
2332
- fallbackPlacements: props.fallbackPlacements || ["bottom"]
2333
- }), shift()]
2334
- });
2335
- const [isOpen, setIsOpen] = useUncontrolledState({
2336
- value: props.open,
2337
- fallbackValue: false
2338
- });
2339
- return createComponent(TooltipContext.Provider, {
2340
- value: {
2341
- reference,
2342
- setReference,
2343
- floating,
2344
- setFloating,
2345
- open: isOpen,
2346
- setOpen: setIsOpen,
2347
- floatingStyles: () => {
2348
- var _a, _b;
2349
- return {
2350
- position: position.strategy,
2351
- top: `${(_a = position.y) != null ? _a : 0}px`,
2352
- left: `${(_b = position.x) != null ? _b : 0}px`
2353
- };
2354
- }
2355
- },
2356
- get children() {
2357
- return props.children;
2358
- }
2359
- });
2360
- }
2361
- function useTooltip() {
2362
- const context = useContext(TooltipContext);
2363
- if (!context) {
2364
- throw new Error("useTooltip must be used within Tooltip.Root component");
2365
- }
2366
- return context;
2367
- }
2368
-
2369
- // src/ui/components/primitives/Tooltip/TooltipContent.tsx
2370
- var _tmpl$37 = /* @__PURE__ */ template(`<div>`);
2371
- var tooltipContentVariants = () => "nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs";
2372
- var TooltipContentBody = (props) => {
2373
- const {
2374
- open,
2375
- setFloating,
2376
- floating,
2377
- floatingStyles
2378
- } = useTooltip();
2379
- const {
2380
- setActive,
2381
- removeActive
2382
- } = useFocusManager();
2383
- const [local, rest] = splitProps(props, ["class", "appearanceKey", "style"]);
2384
- const style = useStyle();
2385
- onMount(() => {
2386
- const floatingEl = floating();
2387
- setActive(floatingEl);
2388
- onCleanup(() => {
2389
- removeActive(floatingEl);
2390
- });
2391
- });
2392
- return (() => {
2393
- var _el$ = _tmpl$37();
2394
- use(setFloating, _el$);
2395
- spread(_el$, mergeProps({
2396
- get ["class"]() {
2397
- return memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tooltipContent", tooltipContentVariants());
2398
- },
2399
- get style() {
2400
- return __spreadProps(__spreadValues({}, floatingStyles()), {
2401
- "z-index": 99999
2402
- });
2403
- },
2404
- get ["data-open"]() {
2405
- return open();
2406
- }
2407
- }, rest), false, false);
2408
- return _el$;
2409
- })();
2410
- };
2411
- var TooltipContent = (props) => {
2412
- const {
2413
- open
2414
- } = useTooltip();
2415
- return createComponent(Show, {
2416
- get when() {
2417
- return open();
2418
- },
2419
- get children() {
2420
- return createComponent(Portal, {
2421
- get children() {
2422
- return createComponent(Root, {
2423
- get children() {
2424
- return createComponent(TooltipContentBody, props);
2425
- }
2426
- });
2427
- }
2428
- });
2429
- }
2430
- });
2431
- };
2432
- var _tmpl$38 = /* @__PURE__ */ template(`<button>`);
2433
- var TooltipTrigger = (props) => {
2434
- const {
2435
- setReference,
2436
- setOpen
2437
- } = useTooltip();
2438
- const style = useStyle();
2439
- const [local, rest] = splitProps(props, ["appearanceKey", "asChild", "onClick"]);
2440
- if (local.asChild) {
2441
- return createComponent(Dynamic, mergeProps({
2442
- get component() {
2443
- return local.asChild;
2444
- },
2445
- ref: setReference,
2446
- onMouseEnter: () => {
2447
- setOpen(true);
2448
- },
2449
- onMouseLeave: () => {
2450
- setOpen(false);
2451
- }
2452
- }, rest));
2453
- }
2454
- return (() => {
2455
- var _el$ = _tmpl$38();
2456
- _el$.addEventListener("mouseleave", () => {
2457
- setOpen(false);
2458
- });
2459
- _el$.addEventListener("mouseenter", () => {
2460
- setOpen(true);
2461
- });
2462
- use(setReference, _el$);
2463
- spread(_el$, mergeProps({
2464
- get ["class"]() {
2465
- return style(local.appearanceKey || "tooltipTrigger");
2466
- }
2467
- }, rest), false, true);
2468
- insert(_el$, () => props.children);
2469
- return _el$;
2470
- })();
2471
- };
2472
-
2473
- // src/ui/components/primitives/Tooltip/index.ts
2474
- var Tooltip = {
2475
- Root: TooltipRoot,
2476
- /**
2477
- * Tooltip.Trigger renders a `button` and has no default styling.
2478
- */
2479
- Trigger: TooltipTrigger,
2480
- /**
2481
- * Tooltip.Content renders a `div` and has popover specific styling.
2482
- */
2483
- Content: TooltipContent
2484
- };
2485
- var _tmpl$39 = /* @__PURE__ */ template(`<label><input type=checkbox class="nt-peer nt-sr-only"><div>`);
2321
+ var _tmpl$36 = /* @__PURE__ */ template(`<label><input type=checkbox class="nt-peer nt-sr-only"><div>`);
2486
2322
  var Switch = (props) => {
2487
2323
  const style = useStyle();
2488
2324
  return (() => {
2489
- var _el$ = _tmpl$39(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2325
+ var _el$ = _tmpl$36(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2490
2326
  _el$2.addEventListener("change", (e) => {
2491
2327
  props.onChange(e.target.checked);
2492
2328
  });
2493
2329
  effect((_p$) => {
2494
- var _v$ = style("channelSwitch", `nt-relative nt-inline-flex nt-cursor-pointer nt-items-center data-[disabled=true]:nt-cursor-not-allowed`), _v$2 = props.disabled, _v$3 = props.disabled, _v$4 = style("channelSwitchThumb", `nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200 data-[disabled=true]:nt-opacity-40`), _v$5 = props.disabled, _v$6 = props.checked;
2330
+ var _v$ = style("channelSwitch", `nt-relative nt-inline-flex nt-cursor-pointer nt-items-center`), _v$2 = style("channelSwitchThumb", `nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200`), _v$3 = props.checked;
2495
2331
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
2496
- _v$2 !== _p$.t && setAttribute(_el$, "data-disabled", _p$.t = _v$2);
2497
- _v$3 !== _p$.a && (_el$2.disabled = _p$.a = _v$3);
2498
- _v$4 !== _p$.o && className(_el$3, _p$.o = _v$4);
2499
- _v$5 !== _p$.i && setAttribute(_el$3, "data-disabled", _p$.i = _v$5);
2500
- _v$6 !== _p$.n && setAttribute(_el$3, "data-checked", _p$.n = _v$6);
2332
+ _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
2333
+ _v$3 !== _p$.a && setAttribute(_el$3, "data-checked", _p$.a = _v$3);
2501
2334
  return _p$;
2502
2335
  }, {
2503
2336
  e: void 0,
2504
2337
  t: void 0,
2505
- a: void 0,
2506
- o: void 0,
2507
- i: void 0,
2508
- n: void 0
2338
+ a: void 0
2509
2339
  });
2510
2340
  effect(() => _el$2.checked = props.checked);
2511
2341
  return _el$;
@@ -2513,13 +2343,10 @@ var Switch = (props) => {
2513
2343
  };
2514
2344
 
2515
2345
  // src/ui/components/elements/Preferences/ChannelRow.tsx
2516
- var _tmpl$40 = /* @__PURE__ */ template(`<div><div><div></div><span></span></div><div>`);
2346
+ var _tmpl$37 = /* @__PURE__ */ template(`<div><div><div></div><span></span></div><div>`);
2517
2347
  var ChannelRow = (props) => {
2518
2348
  const style = useStyle();
2519
2349
  const updatePreference = (enabled) => __async(void 0, null, function* () {
2520
- if (props.isCritical) {
2521
- return;
2522
- }
2523
2350
  props.onChange({
2524
2351
  channel: props.channel,
2525
2352
  enabled,
@@ -2530,7 +2357,7 @@ var ChannelRow = (props) => {
2530
2357
  updatePreference(checked);
2531
2358
  };
2532
2359
  return (() => {
2533
- var _el$ = _tmpl$40(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
2360
+ var _el$ = _tmpl$37(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
2534
2361
  insert(_el$3, createComponent(ChannelIcon, {
2535
2362
  get channel() {
2536
2363
  return props.channel;
@@ -2541,25 +2368,20 @@ var ChannelRow = (props) => {
2541
2368
  get checked() {
2542
2369
  return props.enabled;
2543
2370
  },
2544
- onChange: (checked) => onChange(checked),
2545
- get disabled() {
2546
- return props.isCritical;
2547
- }
2371
+ onChange: (checked) => onChange(checked)
2548
2372
  }));
2549
2373
  effect((_p$) => {
2550
- var _v$ = style("channelContainer", "nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"), _v$2 = props.isCritical, _v$3 = style("channelLabelContainer", "nt-flex nt-items-center nt-gap-2"), _v$4 = style("channelLabel", "nt-text-base nt-font-semibold"), _v$5 = style("channelSwitchContainer", "nt-flex nt-items-center");
2374
+ var _v$ = style("channelContainer", "nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"), _v$2 = style("channelLabelContainer", "nt-flex nt-items-center nt-gap-2"), _v$3 = style("channelLabel", "nt-text-base nt-font-semibold"), _v$4 = style("channelSwitchContainer", "nt-flex nt-items-center");
2551
2375
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
2552
- _v$2 !== _p$.t && setAttribute(_el$, "data-disabled", _p$.t = _v$2);
2553
- _v$3 !== _p$.a && className(_el$2, _p$.a = _v$3);
2554
- _v$4 !== _p$.o && className(_el$4, _p$.o = _v$4);
2555
- _v$5 !== _p$.i && className(_el$5, _p$.i = _v$5);
2376
+ _v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
2377
+ _v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
2378
+ _v$4 !== _p$.o && className(_el$5, _p$.o = _v$4);
2556
2379
  return _p$;
2557
2380
  }, {
2558
2381
  e: void 0,
2559
2382
  t: void 0,
2560
2383
  a: void 0,
2561
- o: void 0,
2562
- i: void 0
2384
+ o: void 0
2563
2385
  });
2564
2386
  return _el$;
2565
2387
  })();
@@ -2596,11 +2418,11 @@ var getLabel = (channel) => {
2596
2418
  return "";
2597
2419
  }
2598
2420
  };
2599
- var _tmpl$41 = /* @__PURE__ */ template(`<div>`);
2421
+ var _tmpl$38 = /* @__PURE__ */ template(`<div>`);
2600
2422
  var SkeletonText = (props) => {
2601
2423
  const style = useStyle();
2602
2424
  return (() => {
2603
- var _el$ = _tmpl$41();
2425
+ var _el$ = _tmpl$38();
2604
2426
  effect(() => className(_el$, style(props.appearanceKey, cn("nt-w-full nt-h-3 nt-rounded nt-bg-foreground-alpha-100", props.class))));
2605
2427
  return _el$;
2606
2428
  })();
@@ -2608,14 +2430,14 @@ var SkeletonText = (props) => {
2608
2430
  var SkeletonAvatar = (props) => {
2609
2431
  const style = useStyle();
2610
2432
  return (() => {
2611
- var _el$2 = _tmpl$41();
2433
+ var _el$2 = _tmpl$38();
2612
2434
  effect(() => className(_el$2, style(props.appearanceKey, cn("nt-size-8 nt-rounded-lg nt-bg-foreground-alpha-100", props.class))));
2613
2435
  return _el$2;
2614
2436
  })();
2615
2437
  };
2616
2438
 
2617
2439
  // src/ui/components/elements/Preferences/LoadingScreen.tsx
2618
- var _tmpl$42 = /* @__PURE__ */ template(`<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>`);
2440
+ var _tmpl$39 = /* @__PURE__ */ template(`<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>`);
2619
2441
  var LoadingScreen = () => {
2620
2442
  return createComponent(For, {
2621
2443
  get each() {
@@ -2629,7 +2451,7 @@ var LoadingScreen = () => {
2629
2451
  var LoadingSkeleton = () => {
2630
2452
  const style = useStyle();
2631
2453
  return (() => {
2632
- var _el$ = _tmpl$42(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2454
+ var _el$ = _tmpl$39(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2633
2455
  insert(_el$2, createComponent(SkeletonText, {
2634
2456
  appearanceKey: "skeletonText",
2635
2457
  "class": "nt-w-1/3"
@@ -2645,10 +2467,9 @@ var LoadingSkeleton = () => {
2645
2467
  };
2646
2468
 
2647
2469
  // src/ui/components/elements/Preferences/Preferences.tsx
2648
- var _tmpl$43 = /* @__PURE__ */ template(`<div>`);
2470
+ var _tmpl$40 = /* @__PURE__ */ template(`<div>`);
2649
2471
  var _tmpl$212 = /* @__PURE__ */ template(`<span>`);
2650
- var _tmpl$310 = /* @__PURE__ */ template(`<span data-localization=preferences.workflow.disabled.notice>`);
2651
- var _tmpl$44 = /* @__PURE__ */ template(`<div><div><div><div></div></div><span>`);
2472
+ var _tmpl$310 = /* @__PURE__ */ template(`<div><div><div><div></div></div><span>`);
2652
2473
  var Preferences = () => {
2653
2474
  var _a;
2654
2475
  const style = useStyle();
@@ -2695,7 +2516,7 @@ var Preferences = () => {
2695
2516
  });
2696
2517
  };
2697
2518
  return (() => {
2698
- var _el$ = _tmpl$43();
2519
+ var _el$ = _tmpl$40();
2699
2520
  insert(_el$, createComponent(Show, {
2700
2521
  get when() {
2701
2522
  return loading();
@@ -2743,10 +2564,6 @@ var Preferences = () => {
2743
2564
  },
2744
2565
  get onChange() {
2745
2566
  return optimisticUpdate(preference());
2746
- },
2747
- get isCritical() {
2748
- var _a2;
2749
- return (_a2 = preference().workflow) == null ? void 0 : _a2.critical;
2750
2567
  }
2751
2568
  });
2752
2569
  }
@@ -2777,7 +2594,7 @@ var ChannelsLabel = (props) => {
2777
2594
  return channels.map((c, index) => [c, memo(() => index < channels.length - 1 && ", ")]);
2778
2595
  };
2779
2596
  return (() => {
2780
- var _el$3 = _tmpl$43();
2597
+ var _el$3 = _tmpl$40();
2781
2598
  insert(_el$3, channelNames);
2782
2599
  effect(() => className(_el$3, style("channelDescription", "nt-text-sm nt-text-foreground-alpha-600 nt-text-start")));
2783
2600
  return _el$3;
@@ -2795,37 +2612,9 @@ var PreferencesRow = (props) => {
2795
2612
  return channels().length > 0;
2796
2613
  },
2797
2614
  get children() {
2798
- var _el$4 = _tmpl$44(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling;
2615
+ var _el$4 = _tmpl$310(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling;
2799
2616
  _el$5.$$click = () => setIsOpen((prev) => !prev);
2800
- insert(_el$7, createComponent(Show, {
2801
- get when() {
2802
- return props.isCritical;
2803
- },
2804
- get children() {
2805
- return createComponent(Tooltip.Root, {
2806
- get children() {
2807
- return [createComponent(Tooltip.Trigger, {
2808
- asChild: (childProps) => (() => {
2809
- var _el$11 = _tmpl$212();
2810
- spread(_el$11, mergeProps({
2811
- get ["class"]() {
2812
- return style("workflowLabelDisabled__icon", "nt-text-foreground-alpha-600");
2813
- }
2814
- }, childProps), false, true);
2815
- insert(_el$11, createComponent(Lock, {}));
2816
- return _el$11;
2817
- })()
2818
- }), createComponent(Tooltip.Content, {
2819
- "data-localization": "preferences.workflow.disabled.tooltip",
2820
- get children() {
2821
- return t("preferences.workflow.disabled.tooltip");
2822
- }
2823
- })];
2824
- }
2825
- });
2826
- }
2827
- }), null);
2828
- insert(_el$7, () => t(props.localizationKey), null);
2617
+ insert(_el$7, () => t(props.localizationKey));
2829
2618
  insert(_el$6, createComponent(ChannelsLabel, {
2830
2619
  get channels() {
2831
2620
  return props.channels;
@@ -2859,18 +2648,7 @@ var PreferencesRow = (props) => {
2859
2648
  return style("channelsContainerCollapsible", "nt-grid nt-self-stretch");
2860
2649
  },
2861
2650
  get children() {
2862
- var _el$9 = _tmpl$43();
2863
- insert(_el$9, createComponent(Show, {
2864
- get when() {
2865
- return props.isCritical;
2866
- },
2867
- get children() {
2868
- var _el$10 = _tmpl$310();
2869
- insert(_el$10, () => t("preferences.workflow.disabled.notice"));
2870
- effect(() => className(_el$10, style("workflowContainerDisabledNotice", "nt-text-sm nt-text-foreground-alpha-600 nt-text-start")));
2871
- return _el$10;
2872
- }
2873
- }), null);
2651
+ var _el$9 = _tmpl$40();
2874
2652
  insert(_el$9, createComponent(For, {
2875
2653
  get each() {
2876
2654
  return channels();
@@ -2885,12 +2663,9 @@ var PreferencesRow = (props) => {
2885
2663
  },
2886
2664
  get onChange() {
2887
2665
  return props.onChange;
2888
- },
2889
- get isCritical() {
2890
- return props.isCritical;
2891
2666
  }
2892
2667
  })
2893
- }), null);
2668
+ }));
2894
2669
  effect(() => className(_el$9, style("channelsContainer", "nt-overflow-hidden nt-flex-col nt-gap-1")));
2895
2670
  return _el$9;
2896
2671
  }
@@ -2900,20 +2675,16 @@ var PreferencesRow = (props) => {
2900
2675
  }
2901
2676
  }), null);
2902
2677
  effect((_p$) => {
2903
- var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50`), _v$2 = props.isCritical, _v$3 = isOpen(), _v$4 = style("workflowLabelContainer", "nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"), _v$5 = props.isCritical, _v$6 = isOpen(), _v$7 = style("workflowLabel", "nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"), _v$8 = props.isCritical, _v$9 = props.localizationKey, _v$10 = isOpen(), _v$11 = style("workflowContainerRight__icon", `nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180`), _v$12 = props.isCritical, _v$13 = isOpen();
2678
+ var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50`), _v$2 = isOpen(), _v$3 = style("workflowLabelContainer", "nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"), _v$4 = isOpen(), _v$5 = style("workflowLabel", "nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"), _v$6 = props.localizationKey, _v$7 = isOpen(), _v$8 = style("workflowContainerRight__icon", `nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180`), _v$9 = isOpen();
2904
2679
  _v$ !== _p$.e && className(_el$4, _p$.e = _v$);
2905
- _v$2 !== _p$.t && setAttribute(_el$4, "data-disabled", _p$.t = _v$2);
2906
- _v$3 !== _p$.a && setAttribute(_el$4, "data-open", _p$.a = _v$3);
2907
- _v$4 !== _p$.o && className(_el$5, _p$.o = _v$4);
2908
- _v$5 !== _p$.i && setAttribute(_el$5, "data-disabled", _p$.i = _v$5);
2909
- _v$6 !== _p$.n && setAttribute(_el$5, "data-open", _p$.n = _v$6);
2910
- _v$7 !== _p$.s && className(_el$7, _p$.s = _v$7);
2911
- _v$8 !== _p$.h && setAttribute(_el$7, "data-disabled", _p$.h = _v$8);
2912
- _v$9 !== _p$.r && setAttribute(_el$7, "data-localization", _p$.r = _v$9);
2913
- _v$10 !== _p$.d && setAttribute(_el$7, "data-open", _p$.d = _v$10);
2914
- _v$11 !== _p$.l && className(_el$8, _p$.l = _v$11);
2915
- _v$12 !== _p$.u && setAttribute(_el$8, "data-disabled", _p$.u = _v$12);
2916
- _v$13 !== _p$.c && setAttribute(_el$8, "data-open", _p$.c = _v$13);
2680
+ _v$2 !== _p$.t && setAttribute(_el$4, "data-open", _p$.t = _v$2);
2681
+ _v$3 !== _p$.a && className(_el$5, _p$.a = _v$3);
2682
+ _v$4 !== _p$.o && setAttribute(_el$5, "data-open", _p$.o = _v$4);
2683
+ _v$5 !== _p$.i && className(_el$7, _p$.i = _v$5);
2684
+ _v$6 !== _p$.n && setAttribute(_el$7, "data-localization", _p$.n = _v$6);
2685
+ _v$7 !== _p$.s && setAttribute(_el$7, "data-open", _p$.s = _v$7);
2686
+ _v$8 !== _p$.h && className(_el$8, _p$.h = _v$8);
2687
+ _v$9 !== _p$.r && setAttribute(_el$8, "data-open", _p$.r = _v$9);
2917
2688
  return _p$;
2918
2689
  }, {
2919
2690
  e: void 0,
@@ -2924,53 +2695,19 @@ var PreferencesRow = (props) => {
2924
2695
  n: void 0,
2925
2696
  s: void 0,
2926
2697
  h: void 0,
2927
- r: void 0,
2928
- d: void 0,
2929
- l: void 0,
2930
- u: void 0,
2931
- c: void 0
2698
+ r: void 0
2932
2699
  });
2933
2700
  return _el$4;
2934
2701
  }
2935
2702
  });
2936
2703
  };
2937
2704
  delegateEvents(["click"]);
2938
- var _tmpl$45 = /* @__PURE__ */ template(`<strong>`);
2705
+ var _tmpl$41 = /* @__PURE__ */ template(`<strong>`);
2939
2706
  var _tmpl$213 = /* @__PURE__ */ template(`<p>`);
2940
- var parseMarkdownIntoTokens = (text) => {
2941
- const tokens = [];
2942
- let buffer = "";
2943
- let inBold = false;
2944
- for (let i = 0; i < text.length; i += 1) {
2945
- if (text[i] === "\\" && text[i + 1] === "*") {
2946
- buffer += "*";
2947
- i += 1;
2948
- } else if (text[i] === "*" && text[i + 1] === "*") {
2949
- if (buffer) {
2950
- tokens.push({
2951
- type: inBold ? "bold" : "text",
2952
- content: buffer
2953
- });
2954
- buffer = "";
2955
- }
2956
- inBold = !inBold;
2957
- i += 1;
2958
- } else {
2959
- buffer += text[i];
2960
- }
2961
- }
2962
- if (buffer) {
2963
- tokens.push({
2964
- type: inBold ? "bold" : "text",
2965
- content: buffer
2966
- });
2967
- }
2968
- return tokens;
2969
- };
2970
2707
  var Bold = (props) => {
2971
2708
  const style = useStyle();
2972
2709
  return (() => {
2973
- var _el$ = _tmpl$45();
2710
+ var _el$ = _tmpl$41();
2974
2711
  insert(_el$, () => props.children);
2975
2712
  effect(() => className(_el$, style(props.appearanceKey || "strong", "nt-font-semibold")));
2976
2713
  return _el$;
@@ -3014,9 +2751,170 @@ var Markdown = (props) => {
3014
2751
  })();
3015
2752
  };
3016
2753
  var Markdown_default = Markdown;
2754
+ var TooltipContext = createContext(void 0);
2755
+ function TooltipRoot(props) {
2756
+ const [reference, setReference] = createSignal(null);
2757
+ const [floating, setFloating] = createSignal(null);
2758
+ const position = useFloating(reference, floating, {
2759
+ placement: props.placement || "top",
2760
+ whileElementsMounted: autoUpdate,
2761
+ middleware: [offset(10), flip({
2762
+ fallbackPlacements: props.fallbackPlacements || ["bottom"]
2763
+ }), shift()]
2764
+ });
2765
+ const [isOpen, setIsOpen] = useUncontrolledState({
2766
+ value: props.open,
2767
+ fallbackValue: false
2768
+ });
2769
+ return createComponent(TooltipContext.Provider, {
2770
+ value: {
2771
+ reference,
2772
+ setReference,
2773
+ floating,
2774
+ setFloating,
2775
+ open: isOpen,
2776
+ setOpen: setIsOpen,
2777
+ floatingStyles: () => {
2778
+ var _a, _b;
2779
+ return {
2780
+ position: position.strategy,
2781
+ top: `${(_a = position.y) != null ? _a : 0}px`,
2782
+ left: `${(_b = position.x) != null ? _b : 0}px`
2783
+ };
2784
+ }
2785
+ },
2786
+ get children() {
2787
+ return props.children;
2788
+ }
2789
+ });
2790
+ }
2791
+ function useTooltip() {
2792
+ const context = useContext(TooltipContext);
2793
+ if (!context) {
2794
+ throw new Error("useTooltip must be used within Tooltip.Root component");
2795
+ }
2796
+ return context;
2797
+ }
2798
+
2799
+ // src/ui/components/primitives/Tooltip/TooltipContent.tsx
2800
+ var _tmpl$42 = /* @__PURE__ */ template(`<div>`);
2801
+ var tooltipContentVariants = () => "nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs";
2802
+ var TooltipContentBody = (props) => {
2803
+ const {
2804
+ open,
2805
+ setFloating,
2806
+ floating,
2807
+ floatingStyles
2808
+ } = useTooltip();
2809
+ const {
2810
+ setActive,
2811
+ removeActive
2812
+ } = useFocusManager();
2813
+ const [local, rest] = splitProps(props, ["class", "appearanceKey", "style"]);
2814
+ const style = useStyle();
2815
+ onMount(() => {
2816
+ const floatingEl = floating();
2817
+ setActive(floatingEl);
2818
+ onCleanup(() => {
2819
+ removeActive(floatingEl);
2820
+ });
2821
+ });
2822
+ return (() => {
2823
+ var _el$ = _tmpl$42();
2824
+ use(setFloating, _el$);
2825
+ spread(_el$, mergeProps({
2826
+ get ["class"]() {
2827
+ return memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tooltipContent", tooltipContentVariants());
2828
+ },
2829
+ get style() {
2830
+ return __spreadProps(__spreadValues({}, floatingStyles()), {
2831
+ "z-index": 99999
2832
+ });
2833
+ },
2834
+ get ["data-open"]() {
2835
+ return open();
2836
+ }
2837
+ }, rest), false, false);
2838
+ return _el$;
2839
+ })();
2840
+ };
2841
+ var TooltipContent = (props) => {
2842
+ const {
2843
+ open
2844
+ } = useTooltip();
2845
+ return createComponent(Show, {
2846
+ get when() {
2847
+ return open();
2848
+ },
2849
+ get children() {
2850
+ return createComponent(Portal, {
2851
+ get children() {
2852
+ return createComponent(Root, {
2853
+ get children() {
2854
+ return createComponent(TooltipContentBody, props);
2855
+ }
2856
+ });
2857
+ }
2858
+ });
2859
+ }
2860
+ });
2861
+ };
2862
+ var _tmpl$43 = /* @__PURE__ */ template(`<button>`);
2863
+ var TooltipTrigger = (props) => {
2864
+ const {
2865
+ setReference,
2866
+ setOpen
2867
+ } = useTooltip();
2868
+ const style = useStyle();
2869
+ const [local, rest] = splitProps(props, ["appearanceKey", "asChild", "onClick"]);
2870
+ if (local.asChild) {
2871
+ return createComponent(Dynamic, mergeProps({
2872
+ get component() {
2873
+ return local.asChild;
2874
+ },
2875
+ ref: setReference,
2876
+ onMouseEnter: () => {
2877
+ setOpen(true);
2878
+ },
2879
+ onMouseLeave: () => {
2880
+ setOpen(false);
2881
+ }
2882
+ }, rest));
2883
+ }
2884
+ return (() => {
2885
+ var _el$ = _tmpl$43();
2886
+ _el$.addEventListener("mouseleave", () => {
2887
+ setOpen(false);
2888
+ });
2889
+ _el$.addEventListener("mouseenter", () => {
2890
+ setOpen(true);
2891
+ });
2892
+ use(setReference, _el$);
2893
+ spread(_el$, mergeProps({
2894
+ get ["class"]() {
2895
+ return style(local.appearanceKey || "tooltipTrigger");
2896
+ }
2897
+ }, rest), false, true);
2898
+ insert(_el$, () => props.children);
2899
+ return _el$;
2900
+ })();
2901
+ };
2902
+
2903
+ // src/ui/components/primitives/Tooltip/index.ts
2904
+ var Tooltip = {
2905
+ Root: TooltipRoot,
2906
+ /**
2907
+ * Tooltip.Trigger renders a `button` and has no default styling.
2908
+ */
2909
+ Trigger: TooltipTrigger,
2910
+ /**
2911
+ * Tooltip.Content renders a `div` and has popover specific styling.
2912
+ */
2913
+ Content: TooltipContent
2914
+ };
3017
2915
 
3018
2916
  // src/ui/components/Notification/DefaultNotification.tsx
3019
- var _tmpl$46 = /* @__PURE__ */ template(`<span>`);
2917
+ var _tmpl$44 = /* @__PURE__ */ template(`<span>`);
3020
2918
  var _tmpl$214 = /* @__PURE__ */ template(`<img>`);
3021
2919
  var _tmpl$311 = /* @__PURE__ */ template(`<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>`);
3022
2920
  var DefaultNotification = (props) => {
@@ -3074,7 +2972,7 @@ var DefaultNotification = (props) => {
3074
2972
  return !props.notification.isRead;
3075
2973
  },
3076
2974
  get children() {
3077
- var _el$2 = _tmpl$46();
2975
+ var _el$2 = _tmpl$44();
3078
2976
  effect(() => className(_el$2, style("notificationDot", "nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border nt-border-neutral-alpha-200")));
3079
2977
  return _el$2;
3080
2978
  }
@@ -3120,7 +3018,7 @@ var DefaultNotification = (props) => {
3120
3018
  e.stopPropagation();
3121
3019
  props.notification.read();
3122
3020
  },
3123
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3021
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3124
3022
  get children() {
3125
3023
  return createComponent(ReadAll, {});
3126
3024
  }
@@ -3147,7 +3045,7 @@ var DefaultNotification = (props) => {
3147
3045
  e.stopPropagation();
3148
3046
  props.notification.unread();
3149
3047
  },
3150
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3048
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3151
3049
  get children() {
3152
3050
  return createComponent(Unread, {});
3153
3051
  }
@@ -3181,7 +3079,7 @@ var DefaultNotification = (props) => {
3181
3079
  e.stopPropagation();
3182
3080
  props.notification.archive();
3183
3081
  },
3184
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3082
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3185
3083
  get children() {
3186
3084
  return createComponent(Archive, {});
3187
3085
  }
@@ -3208,7 +3106,7 @@ var DefaultNotification = (props) => {
3208
3106
  e.stopPropagation();
3209
3107
  props.notification.unarchive();
3210
3108
  },
3211
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3109
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3212
3110
  get children() {
3213
3111
  return createComponent(Unarchive, {});
3214
3112
  }
@@ -3278,7 +3176,7 @@ var DefaultNotification = (props) => {
3278
3176
  var _a;
3279
3177
  var _v$3 = style("notification", cn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2", {
3280
3178
  "nt-cursor-pointer": !props.notification.isRead || !!((_a = props.notification.redirect) == null ? void 0 : _a.url)
3281
- })), _v$4 = style("notificationBody", "nt-overflow-hidden nt-w-full"), _v$5 = style("notificationDate", "nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"), _v$6 = style("notificationDefaultActions", `nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
3179
+ })), _v$4 = style("notificationBody", "nt-overflow-hidden nt-w-full"), _v$5 = style("notificationDate", "nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"), _v$6 = style("notificationDefaultActions", `nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg nt-backdrop-blur-md nt-p-0.5`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
3282
3180
  _v$3 !== _p$.e && className(_el$, _p$.e = _v$3);
3283
3181
  _v$4 !== _p$.t && className(_el$4, _p$.t = _v$4);
3284
3182
  _v$5 !== _p$.a && className(_el$6, _p$.a = _v$5);
@@ -3326,10 +3224,10 @@ var Notification = (props) => {
3326
3224
  }
3327
3225
  });
3328
3226
  };
3329
- var _tmpl$47 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">`);
3227
+ var _tmpl$45 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">`);
3330
3228
  function EmptyIcon(props) {
3331
3229
  return (() => {
3332
- var _el$ = _tmpl$47();
3230
+ var _el$ = _tmpl$45();
3333
3231
  spread(_el$, props, true, true);
3334
3232
  return _el$;
3335
3233
  })();
@@ -3360,10 +3258,10 @@ var NewMessagesCta = (props) => {
3360
3258
  }
3361
3259
  });
3362
3260
  };
3363
- var _tmpl$48 = /* @__PURE__ */ template(`<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">`);
3261
+ var _tmpl$46 = /* @__PURE__ */ template(`<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">`);
3364
3262
  var NotificationSkeleton = () => {
3365
3263
  return (() => {
3366
- var _el$ = _tmpl$48(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
3264
+ var _el$ = _tmpl$46(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
3367
3265
  insert(_el$, createComponent(SkeletonAvatar, {
3368
3266
  appearanceKey: "skeletonAvatar"
3369
3267
  }), _el$2);
@@ -3400,7 +3298,7 @@ var NotificationListSkeleton = (props) => {
3400
3298
  };
3401
3299
 
3402
3300
  // src/ui/components/Notification/NotificationList.tsx
3403
- var _tmpl$49 = /* @__PURE__ */ template(`<div><p data-localization=notifications.emptyNotice>`);
3301
+ var _tmpl$47 = /* @__PURE__ */ template(`<div><p data-localization=notifications.emptyNotice>`);
3404
3302
  var _tmpl$215 = /* @__PURE__ */ template(`<div>`);
3405
3303
  var _tmpl$312 = /* @__PURE__ */ template(`<div><div>`);
3406
3304
  var EmptyNotificationList = () => {
@@ -3409,7 +3307,7 @@ var EmptyNotificationList = () => {
3409
3307
  t
3410
3308
  } = useLocalization();
3411
3309
  return (() => {
3412
- var _el$ = _tmpl$49(), _el$2 = _el$.firstChild;
3310
+ var _el$ = _tmpl$47(), _el$2 = _el$.firstChild;
3413
3311
  insert(_el$, createComponent(EmptyIcon, {
3414
3312
  get ["class"]() {
3415
3313
  return style("notificationListEmptyNoticeIcon");
@@ -3556,13 +3454,13 @@ var NotificationList = (props) => {
3556
3454
  return _el$3;
3557
3455
  })();
3558
3456
  };
3559
- var _tmpl$50 = /* @__PURE__ */ template(`<span>`);
3457
+ var _tmpl$48 = /* @__PURE__ */ template(`<span>`);
3560
3458
  var getDisplayCount = (count) => count >= 100 ? "99+" : count;
3561
3459
  var InboxTabUnreadNotificationsCount = (props) => {
3562
3460
  const style = useStyle();
3563
3461
  const displayCount = createMemo(() => getDisplayCount(props.count));
3564
3462
  return (() => {
3565
- var _el$ = _tmpl$50();
3463
+ var _el$ = _tmpl$48();
3566
3464
  insert(_el$, displayCount);
3567
3465
  effect(() => className(_el$, style("notificationsTabsTriggerCount", "nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm")));
3568
3466
  return _el$;
@@ -3587,7 +3485,7 @@ var InboxTab = (props) => {
3587
3485
  },
3588
3486
  get children() {
3589
3487
  return [(() => {
3590
- var _el$2 = _tmpl$50();
3488
+ var _el$2 = _tmpl$48();
3591
3489
  insert(_el$2, () => props.label);
3592
3490
  effect(() => className(_el$2, style("notificationsTabsTriggerLabel", "nt-text-sm nt-font-medium")));
3593
3491
  return _el$2;
@@ -3622,7 +3520,7 @@ var InboxDropdownTab = (props) => {
3622
3520
  },
3623
3521
  get children() {
3624
3522
  return [(() => {
3625
- var _el$3 = _tmpl$50();
3523
+ var _el$3 = _tmpl$48();
3626
3524
  insert(_el$3, () => props.label);
3627
3525
  effect(() => className(_el$3, style("moreTabs__dropdownItemLabel", "nt-mr-auto")));
3628
3526
  return _el$3;
@@ -3822,7 +3720,7 @@ var InboxTabs = (props) => {
3822
3720
  };
3823
3721
 
3824
3722
  // src/ui/components/Inbox.tsx
3825
- var _tmpl$51 = /* @__PURE__ */ template(`<div>`);
3723
+ var _tmpl$49 = /* @__PURE__ */ template(`<div>`);
3826
3724
  var InboxPage = /* @__PURE__ */ function(InboxPage2) {
3827
3725
  InboxPage2["Notifications"] = "notifications";
3828
3726
  InboxPage2["Preferences"] = "preferences";
@@ -3844,7 +3742,7 @@ var InboxContent = (props) => {
3844
3742
  };
3845
3743
  });
3846
3744
  return (() => {
3847
- var _el$ = _tmpl$51();
3745
+ var _el$ = _tmpl$49();
3848
3746
  insert(_el$, createComponent(Switch$1, {
3849
3747
  get children() {
3850
3748
  return [createComponent(Match, {
@@ -4091,7 +3989,7 @@ var Renderer = (props) => {
4091
3989
  }
4092
3990
  });
4093
3991
  };
4094
- var version = "2.3.1";
3992
+ var version = "2.4.0";
4095
3993
  var cssHref = `https://cdn.jsdelivr.net/npm/@novu/js@${version}/dist/index.css`;
4096
3994
  var _dispose, _rootElement, _mountedElements, _setMountedElements, _appearance, _setAppearance, _localization, _setLocalization, _options, _setOptions, _tabs, _setTabs, _routerPush, _setRouterPush, _preferencesFilter, _setPreferencesFilter, _predefinedNovu, _NovuUI_instances, mountComponentRenderer_fn, updateComponentProps_fn;
4097
3995
  var NovuUI = class {