@novu/js 3.8.1 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,7 +129,7 @@ function checkNotificationMatchesFilter(notification, filter) {
129
129
 
130
130
  // src/api/http-client.ts
131
131
  var DEFAULT_API_VERSION = "v1";
132
- var DEFAULT_USER_AGENT = `${"@novu/js"}@${"3.8.1"}`;
132
+ var DEFAULT_USER_AGENT = `${"@novu/js"}@${"3.8.2"}`;
133
133
  var HttpClient = class {
134
134
  constructor(options = {}) {
135
135
  // Environment variable for local development that overrides the default API endpoint without affecting the Inbox DX
@@ -350,7 +350,7 @@ var InboxService = class {
350
350
  });
351
351
  }
352
352
  archiveAllRead({ tags, data }) {
353
- return chunk7B52C2XE_js.__privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/archive/read`, {
353
+ return chunk7B52C2XE_js.__privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/read-archive`, {
354
354
  tags,
355
355
  data: data ? JSON.stringify(data) : void 0
356
356
  });
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJOKRZMGH_js = require('./chunk-JOKRZMGH.js');
3
+ var chunkKOX7YLPE_js = require('./chunk-KOX7YLPE.js');
4
4
  require('./chunk-ZB7IPCHY.js');
5
5
  require('./chunk-7B52C2XE.js');
6
6
 
@@ -8,37 +8,37 @@ require('./chunk-7B52C2XE.js');
8
8
 
9
9
  Object.defineProperty(exports, "ChannelType", {
10
10
  enumerable: true,
11
- get: function () { return chunkJOKRZMGH_js.ChannelType; }
11
+ get: function () { return chunkKOX7YLPE_js.ChannelType; }
12
12
  });
13
13
  Object.defineProperty(exports, "NotificationStatus", {
14
14
  enumerable: true,
15
- get: function () { return chunkJOKRZMGH_js.NotificationStatus; }
15
+ get: function () { return chunkKOX7YLPE_js.NotificationStatus; }
16
16
  });
17
17
  Object.defineProperty(exports, "Novu", {
18
18
  enumerable: true,
19
- get: function () { return chunkJOKRZMGH_js.Novu; }
19
+ get: function () { return chunkKOX7YLPE_js.Novu; }
20
20
  });
21
21
  Object.defineProperty(exports, "PreferenceLevel", {
22
22
  enumerable: true,
23
- get: function () { return chunkJOKRZMGH_js.PreferenceLevel; }
23
+ get: function () { return chunkKOX7YLPE_js.PreferenceLevel; }
24
24
  });
25
25
  Object.defineProperty(exports, "WebSocketEvent", {
26
26
  enumerable: true,
27
- get: function () { return chunkJOKRZMGH_js.WebSocketEvent; }
27
+ get: function () { return chunkKOX7YLPE_js.WebSocketEvent; }
28
28
  });
29
29
  Object.defineProperty(exports, "areTagsEqual", {
30
30
  enumerable: true,
31
- get: function () { return chunkJOKRZMGH_js.areTagsEqual; }
31
+ get: function () { return chunkKOX7YLPE_js.areTagsEqual; }
32
32
  });
33
33
  Object.defineProperty(exports, "checkNotificationDataFilter", {
34
34
  enumerable: true,
35
- get: function () { return chunkJOKRZMGH_js.checkNotificationDataFilter; }
35
+ get: function () { return chunkKOX7YLPE_js.checkNotificationDataFilter; }
36
36
  });
37
37
  Object.defineProperty(exports, "checkNotificationMatchesFilter", {
38
38
  enumerable: true,
39
- get: function () { return chunkJOKRZMGH_js.checkNotificationMatchesFilter; }
39
+ get: function () { return chunkKOX7YLPE_js.checkNotificationMatchesFilter; }
40
40
  });
41
41
  Object.defineProperty(exports, "isSameFilter", {
42
42
  enumerable: true,
43
- get: function () { return chunkJOKRZMGH_js.isSameFilter; }
43
+ get: function () { return chunkKOX7YLPE_js.isSameFilter; }
44
44
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJOKRZMGH_js = require('../chunk-JOKRZMGH.js');
3
+ var chunkKOX7YLPE_js = require('../chunk-KOX7YLPE.js');
4
4
  var chunkZB7IPCHY_js = require('../chunk-ZB7IPCHY.js');
5
5
  var chunk7B52C2XE_js = require('../chunk-7B52C2XE.js');
6
6
  var web = require('solid-js/web');
@@ -17,7 +17,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
17
 
18
18
  var clsx__default = /*#__PURE__*/_interopDefault(clsx);
19
19
 
20
- // _j9cq3718i:/home/runner/work/novu/novu/packages/js/src/ui/index.directcss
20
+ // _17wpg8v60:/home/runner/_work/novu/novu/packages/js/src/ui/index.directcss
21
21
  var ui_default = `.novu{scrollbar-color:var(--nv-color-secondary-foreground-alpha-300) #0000;:where(*),:where(*) :after,:where(*) :before,:where(*):after,:where(*):before{border:0 solid #e5e7eb;box-sizing:border-box}:where(html,:host){line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;tab-size:4;-webkit-tap-highlight-color:transparent}:where(body){line-height:inherit;margin:0}:where(hr){border-top-width:1px;color:inherit;height:0}:where(abbr:where([title])){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(a){color:inherit;text-decoration:inherit}:where(b,strong){font-weight:bolder}:where(code,kbd,samp,pre){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}:where(small){font-size:80%}:where(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:initial}:where(sub){bottom:-.25em}:where(sup){top:-.5em}:where(table){border-collapse:collapse;border-color:inherit;text-indent:0}:where(button,input,optgroup,select,textarea){color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}:where(button,select){text-transform:none}:where(button,input:where([type=button]),input:where([type=reset]),input:where([type=submit])){-webkit-appearance:button;background-color:initial;background-image:none}:where(:-moz-focusring){outline:auto}:where(:-moz-ui-invalid){box-shadow:none}:where(progress){vertical-align:initial}:where(*)::-webkit-inner-spin-button,:where(*)::-webkit-outer-spin-button{height:auto}:where([type=search]){-webkit-appearance:textfield;outline-offset:-2px}:where(*)::-webkit-search-decoration{-webkit-appearance:none}:where(*)::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(summary){display:list-item}:where(blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre){margin:0}:where(fieldset){margin:0;padding:0}:where(legend){padding:0}:where(ol,ul,menu){list-style:none;margin:0;padding:0}:where(dialog){padding:0}:where(textarea){resize:vertical}:where(input)::placeholder,:where(textarea)::placeholder{color:#9ca3af;opacity:1}:where(button,[role=button]){cursor:pointer}:where(:disabled){cursor:default}:where(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(img,video){height:auto;max-width:100%}:where([hidden]){display:none}:where(*),:where(*) :after,:where(*) :before,:where(*):after,:where(*):before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:where(*) ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::-webkit-scrollbar{height:.5rem;width:.5rem}::-webkit-scrollbar-thumb{background-clip:"padding-box";background-color:var(--nv-color-secondary-foreground-alpha-300);border-radius:.25rem}::-webkit-scrollbar-corner,::-webkit-scrollbar-track{background-color:initial}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}}.nt-sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.\\!nt-pointer-events-auto{pointer-events:auto!important}.nt-invisible{visibility:hidden}.nt-absolute{position:absolute}.nt-relative{position:relative}.nt-inset-0{inset:0}.nt-inset-2{inset:.5rem}.nt-left-0\\.5{left:.125rem}.nt-right-0{right:0}.nt-right-3{right:.75rem}.nt-top-0{top:0}.nt-top-0\\.5{top:.125rem}.nt-top-3{top:.75rem}.nt-z-10{z-index:10}.nt-z-\\[-1\\]{z-index:-1}.nt-mx-auto{margin-left:auto;margin-right:auto}.nt--mt-\\[50px\\]{margin-top:-50px}.nt-mb-1{margin-bottom:.25rem}.nt-mb-2{margin-bottom:.5rem}.nt-mb-4{margin-bottom:1rem}.nt-mb-\\[0\\.625rem\\]{margin-bottom:.625rem}.nt-ml-1{margin-left:.25rem}.nt-ml-2{margin-left:.5rem}.nt-ml-auto{margin-left:auto}.nt-mr-2{margin-right:.5rem}.nt-mr-auto{margin-right:auto}.nt-mt-1{margin-top:.25rem}.nt-mt-auto{margin-top:auto}.nt-block{display:block}.nt-flex{display:flex}.nt-inline-flex{display:inline-flex}.nt-grid{display:grid}.nt-hidden{display:none}.nt-aspect-square{aspect-ratio:1/1}.nt-size-1\\.5{height:.375rem;width:.375rem}.nt-size-2{height:.5rem;width:.5rem}.nt-size-2\\.5{height:.625rem;width:.625rem}.nt-size-3{height:.75rem;width:.75rem}.nt-size-3\\.5{height:.875rem;width:.875rem}.nt-size-4{height:1rem;width:1rem}.nt-size-5{height:1.25rem;width:1.25rem}.nt-size-8{height:2rem;width:2rem}.nt-size-fit{height:fit-content;width:fit-content}.nt-size-full{height:100%;width:100%}.nt-h-2{height:.5rem}.nt-h-3{height:.75rem}.nt-h-4{height:1rem}.nt-h-5{height:1.25rem}.nt-h-7{height:1.75rem}.nt-h-8{height:2rem}.nt-h-9{height:2.25rem}.nt-h-\\[600px\\]{height:600px}.nt-h-fit{height:fit-content}.nt-h-full{height:100%}.nt-min-h-0{min-height:0}.nt-w-1\\/3{width:33.333333%}.nt-w-2\\/3{width:66.666667%}.nt-w-5{width:1.25rem}.nt-w-7{width:1.75rem}.nt-w-8{width:2rem}.nt-w-\\[260px\\]{width:260px}.nt-w-\\[400px\\]{width:400px}.nt-w-\\[60px\\]{width:60px}.nt-w-\\[calc\\(2ch\\+2rem\\)\\]{width:calc(2ch + 2rem)}.nt-w-fit{width:fit-content}.nt-w-full{width:100%}.nt-w-max{width:max-content}.nt-min-w-52{min-width:13rem}.nt-flex-1{flex:1 1 0%}.nt-shrink-0{flex-shrink:0}.nt-translate-x-1\\/2{--tw-translate-x:50%}.nt-transform,.nt-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.nt-cursor-default{cursor:default}.nt-cursor-not-allowed{cursor:not-allowed}.nt-cursor-pointer{cursor:pointer}.nt-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.nt-flex-row{flex-direction:row}.nt-flex-col{flex-direction:column}.nt-flex-wrap{flex-wrap:wrap}.nt-flex-nowrap{flex-wrap:nowrap}.nt-items-start{align-items:flex-start}.nt-items-center{align-items:center}.nt-justify-end{justify-content:flex-end}.nt-justify-center{justify-content:center}.nt-justify-between{justify-content:space-between}.nt-gap-0\\.5{gap:.125rem}.nt-gap-1{gap:.25rem}.nt-gap-1\\.5{gap:.375rem}.nt-gap-2{gap:.5rem}.nt-gap-3{gap:.75rem}.nt-gap-4{gap:1rem}.nt-gap-6{gap:1.5rem}.nt-gap-8{gap:2rem}.nt-self-stretch{align-self:stretch}.nt-overflow-auto{overflow:auto}.nt-overflow-hidden{overflow:hidden}.nt-overflow-y-auto{overflow-y:auto}.nt-truncate{overflow:hidden;text-overflow:ellipsis}.nt-truncate,.nt-whitespace-nowrap{white-space:nowrap}.nt-whitespace-pre-wrap{white-space:pre-wrap}.nt-rounded{border-radius:var(--nv-radius-base)}.nt-rounded-full{border-radius:var(--nv-radius-full)}.nt-rounded-lg{border-radius:var(--nv-radius-lg)}.nt-rounded-md{border-radius:var(--nv-radius-md)}.nt-rounded-sm{border-radius:var(--nv-radius-sm)}.nt-rounded-xl{border-radius:var(--nv-radius-xl)}.nt-border{border-width:1px}.nt-border-b{border-bottom-width:1px}.nt-border-t{border-top-width:1px}.nt-border-background{border-color:var(--nv-color-background)}.nt-border-border{border-color:var(--nv-color-neutral-alpha-100)}.nt-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.nt-border-neutral-alpha-100{border-color:var(--nv-color-neutral-alpha-100)}.nt-border-neutral-alpha-200{border-color:var(--nv-color-neutral-alpha-200)}.nt-border-neutral-alpha-400{border-color:var(--nv-color-neutral-alpha-400)}.nt-border-neutral-alpha-50{border-color:var(--nv-color-neutral-alpha-50)}.nt-border-t-neutral-alpha-200{border-top-color:var(--nv-color-neutral-alpha-200)}.nt-bg-\\[oklch\\(from_var\\(--nv-color-stripes\\)_l_c_h_\\/_0\\.1\\)\\]{background-color:oklch(from var(--nv-color-stripes) l c h/.1)}.nt-bg-background{background-color:var(--nv-color-background)}.nt-bg-counter{background-color:var(--nv-color-counter)}.nt-bg-foreground{background-color:var(--nv-color-foreground)}.nt-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.nt-bg-neutral-alpha-100{background-color:var(--nv-color-neutral-alpha-100)}.nt-bg-neutral-alpha-25{background-color:var(--nv-color-neutral-alpha-25)}.nt-bg-neutral-alpha-300{background-color:var(--nv-color-neutral-alpha-300)}.nt-bg-neutral-alpha-50{background-color:var(--nv-color-neutral-alpha-50)}.nt-bg-primary{background-color:var(--nv-color-primary)}.nt-bg-primary-alpha-300{background-color:var(--nv-color-primary-alpha-300)}.nt-bg-primary-alpha-400{background-color:var(--nv-color-primary-alpha-400)}.nt-bg-secondary{background-color:var(--nv-color-secondary)}.nt-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.nt-bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.nt-bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.nt-from-foreground-alpha-50{--tw-gradient-from:var(--nv-color-foreground-alpha-50) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.nt-from-primary-foreground-alpha-200{--tw-gradient-from:var(--nv-color-primary-foreground-alpha-200) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.nt-from-transparent{--tw-gradient-from:#0000 var(--tw-gradient-from-position);--tw-gradient-to:#0000 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.nt-from-20\\%{--tw-gradient-from-position:20%}.nt-to-background{--tw-gradient-to:var(--nv-color-background) var(--tw-gradient-to-position)}.nt-to-transparent{--tw-gradient-to:#0000 var(--tw-gradient-to-position)}.nt-object-cover{object-fit:cover}.nt-p-0{padding:0}.nt-p-0\\.5{padding:.125rem}.nt-p-1{padding:.25rem}.nt-p-2{padding:.5rem}.nt-p-2\\.5{padding:.625rem}.nt-p-3{padding:.75rem}.nt-p-4{padding:1rem}.nt-px-1{padding-left:.25rem;padding-right:.25rem}.nt-px-2{padding-left:.5rem;padding-right:.5rem}.nt-px-3{padding-left:.75rem;padding-right:.75rem}.nt-px-4{padding-left:1rem;padding-right:1rem}.nt-px-8{padding-left:2rem;padding-right:2rem}.nt-px-\\[6px\\]{padding-left:6px;padding-right:6px}.nt-py-1{padding-bottom:.25rem;padding-top:.25rem}.nt-py-2{padding-bottom:.5rem;padding-top:.5rem}.nt-py-3{padding-bottom:.75rem;padding-top:.75rem}.nt-py-3\\.5{padding-bottom:.875rem;padding-top:.875rem}.nt-py-4{padding-bottom:1rem;padding-top:1rem}.nt-py-px{padding-bottom:1px;padding-top:1px}.nt-pb-2{padding-bottom:.5rem}.nt-pb-\\[0\\.625rem\\]{padding-bottom:.625rem}.nt-pr-0{padding-right:0}.nt-pt-2\\.5{padding-top:.625rem}.nt-text-center{text-align:center}.nt-text-start{text-align:start}.nt-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.nt-text-\\[0\\.8rem\\]{font-size:.8rem}.nt-text-\\[12px\\]{font-size:12px}.nt-text-base{font-size:var(--nv-font-size-base);line-height:var(--nv-line-height-base)}.nt-text-sm{font-size:var(--nv-font-size-sm);line-height:var(--nv-line-height-sm)}.nt-text-xl{font-size:var(--nv-font-size-xl);line-height:var(--nv-line-height-xl)}.nt-text-xs{font-size:var(--nv-font-size-xs);line-height:var(--nv-line-height-xs)}.nt-font-medium{font-weight:500}.nt-font-normal{font-weight:400}.nt-font-semibold{font-weight:600}.nt-leading-none{line-height:1}.nt-text-\\[\\#000000\\]{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.nt-text-background{color:var(--nv-color-background)}.nt-text-counter-foreground{color:var(--nv-color-counter-foreground)}.nt-text-foreground{color:var(--nv-color-foreground)}.nt-text-foreground-alpha-300{color:var(--nv-color-foreground-alpha-300)}.nt-text-foreground-alpha-400{color:var(--nv-color-foreground-alpha-400)}.nt-text-foreground-alpha-600{color:var(--nv-color-foreground-alpha-600)}.nt-text-foreground-alpha-700{color:var(--nv-color-foreground-alpha-700)}.nt-text-primary-foreground{color:var(--nv-color-primary-foreground)}.nt-text-secondary-foreground{color:var(--nv-color-secondary-foreground)}.nt-text-stripes{color:var(--nv-color-stripes)}.nt-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.nt-underline{text-decoration-line:underline}.nt-opacity-0{opacity:0}.nt-opacity-20{opacity:.2}.nt-opacity-50{opacity:.5}.nt-shadow{--tw-shadow:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-\\[0_0_0_0\\.5px_var\\(--nv-color-primary-600\\)\\]{--tw-shadow:0 0 0 0.5px var(--nv-color-primary-600);--tw-shadow-colored:0 0 0 0.5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-\\[0_0_0_0\\.5px_var\\(--nv-color-secondary-600\\)\\]{--tw-shadow:0 0 0 0.5px var(--nv-color-secondary-600);--tw-shadow-colored:0 0 0 0.5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-\\[0px_1px_2px_0px_rgba\\(10\\,13\\,20\\,0\\.03\\)\\]{--tw-shadow:0px 1px 2px 0px #0a0d1408;--tw-shadow-colored:0px 1px 2px 0px var(--tw-shadow-color)}.nt-shadow-\\[0px_1px_2px_0px_rgba\\(10\\,13\\,20\\,0\\.03\\)\\],.nt-shadow-dropdown{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-dropdown{--tw-shadow:0px 12px 16px -4px oklch(from var(--nv-color-shadow) l c h/0.08),0px 4px 6px -2px oklch(from var(--nv-color-shadow) l c h/0.03);--tw-shadow-colored:0px 12px 16px -4px var(--tw-shadow-color),0px 4px 6px -2px var(--tw-shadow-color)}.nt-shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.nt-shadow-lg,.nt-shadow-none{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}.nt-shadow-popover{--tw-shadow:0px 8px 26px 0px oklch(from var(--nv-color-shadow) l c h/0.08),0px 2px 6px 0px oklch(from var(--nv-color-shadow) l c h/0.12);--tw-shadow-colored:0px 8px 26px 0px var(--tw-shadow-color),0px 2px 6px 0px var(--tw-shadow-color)}.nt-shadow-popover,.nt-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.nt-shadow-tooltip{--tw-shadow:0 5px 20px 0 oklch(from var(--nv-color-shadow) l c h/0.08);--tw-shadow-colored:0 5px 20px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-outline-none{outline:2px solid #0000;outline-offset:2px}.nt-backdrop-blur-lg{--tw-backdrop-blur:blur(16px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.nt-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nt-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nt-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nt-duration-100{transition-duration:.1s}.nt-duration-200{transition-duration:.2s}.nt-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.nt-animate-in{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.nt-fade-in{--tw-enter-opacity:0}.nt-slide-in-from-top-2{--tw-enter-translate-y:-0.5rem}.nt-duration-100{animation-duration:.1s}.nt-duration-200{animation-duration:.2s}.nt-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[interpolate-size\\:allow-keywords\\]{interpolate-size:allow-keywords}.\\[scrollbar-gutter\\:stable\\]{scrollbar-gutter:stable}.\\[word-break\\:break-word\\]{word-break:break-word}.before\\:nt-absolute:before{content:var(--tw-content);position:absolute}.before\\:nt-inset-0:before{content:var(--tw-content);inset:0}.before\\:-nt-right-\\[calc\\(0\\+var\\(--stripes-size\\)\\)\\]:before{content:var(--tw-content);right:calc(var(--stripes-size)*-1)}@keyframes nt-stripes{0%{content:var(--tw-content);transform:translateX(0)}to{content:var(--tw-content);transform:translateX(calc(var(--stripes-size)*-1))}}.before\\:nt-animate-stripes:before{animation:nt-stripes 1s linear infinite paused;content:var(--tw-content)}.before\\:nt-rounded-lg:before{border-radius:var(--nv-radius-lg);content:var(--tw-content)}.before\\:nt-rounded-md:before{border-radius:var(--nv-radius-md);content:var(--tw-content)}.before\\:nt-rounded-xl:before{border-radius:var(--nv-radius-xl);content:var(--tw-content)}.before\\:nt-border:before{border-width:1px;content:var(--tw-content)}.before\\:nt-border-primary-foreground-alpha-100:before{border-color:var(--nv-color-primary-foreground-alpha-100);content:var(--tw-content)}.before\\:nt-border-secondary-foreground-alpha-100:before{border-color:var(--nv-color-secondary-foreground-alpha-100);content:var(--tw-content)}.before\\:nt-bg-dev-stripes-gradient:before{background-image:repeating-linear-gradient(135deg,oklch(from var(--nv-color-stripes) l c h/.1) 25%,oklch(from var(--nv-color-stripes) l c h/.1) 50%,oklch(from var(--nv-color-stripes) l c h/.2) 50%,oklch(from var(--nv-color-stripes) l c h/.2) 75%);content:var(--tw-content)}.before\\:nt-bg-\\[length\\:var\\(--stripes-size\\)_var\\(--stripes-size\\)\\]:before{background-size:var(--stripes-size) var(--stripes-size);content:var(--tw-content)}.before\\:nt-content-\\[\\"\\"\\]:before{--tw-content:"";content:var(--tw-content)}.before\\:\\[mask-image\\:linear-gradient\\(transparent_0\\%\\2c black\\)\\]:before{content:var(--tw-content);-webkit-mask-image:linear-gradient(#0000,#000);mask-image:linear-gradient(#0000,#000)}.after\\:nt-absolute:after{content:var(--tw-content);position:absolute}.after\\:nt-inset-0:after{content:var(--tw-content);inset:0}.after\\:-nt-top-12:after{content:var(--tw-content);top:-3rem}.after\\:nt-bottom-0:after{bottom:0;content:var(--tw-content)}.after\\:nt-left-0:after{content:var(--tw-content);left:0}.after\\:nt-left-0\\.5:after{content:var(--tw-content);left:.125rem}.after\\:nt-top-0\\.5:after{content:var(--tw-content);top:.125rem}.after\\:nt-size-3:after{content:var(--tw-content);height:.75rem;width:.75rem}.after\\:nt-h-\\[2px\\]:after{content:var(--tw-content);height:2px}.after\\:nt-w-full:after{content:var(--tw-content);width:100%}.after\\:nt-translate-x-1\\/2:after{--tw-translate-x:50%}.after\\:nt-translate-x-1\\/2:after,.after\\:nt-translate-x-full:after{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:nt-translate-x-full:after{--tw-translate-x:100%}.after\\:nt-rounded-full:after{border-radius:var(--nv-radius-full);content:var(--tw-content)}.after\\:nt-rounded-lg:after{border-radius:var(--nv-radius-lg);content:var(--tw-content)}.after\\:nt-rounded-md:after{border-radius:var(--nv-radius-md);content:var(--tw-content)}.after\\:nt-rounded-xl:after{border-radius:var(--nv-radius-xl);content:var(--tw-content)}.after\\:nt-border-b-2:after{border-bottom-width:2px;content:var(--tw-content)}.after\\:nt-border-background:after{border-color:var(--nv-color-background);content:var(--tw-content)}.after\\:nt-border-b-primary:after{border-bottom-color:var(--nv-color-primary);content:var(--tw-content)}.after\\:nt-border-b-transparent:after{border-bottom-color:#0000;content:var(--tw-content)}.after\\:nt-bg-background:after{background-color:var(--nv-color-background);content:var(--tw-content)}.after\\:nt-bg-\\[linear-gradient\\(180deg\\2c transparent\\2c oklch\\(from_var\\(--nv-color-background\\)_l_c_h_\\/_0\\.9\\)_55\\%\\2c transparent\\)\\]:after{background-image:linear-gradient(180deg,#0000,oklch(from var(--nv-color-background) l c h/.9) 55%,#0000);content:var(--tw-content)}.after\\:nt-bg-\\[linear-gradient\\(180deg\\2c transparent\\2c oklch\\(from_var\\(--nv-color-stripes\\)_l_c_h_\\/_0\\.07\\)_55\\%\\2c transparent\\)\\2c linear-gradient\\(180deg\\2c transparent\\2c oklch\\(from_var\\(--nv-color-background\\)_l_c_h_\\/_0\\.9\\)_55\\%\\2c transparent\\)\\]:after{background-image:linear-gradient(180deg,#0000,oklch(from var(--nv-color-stripes) l c h/.07) 55%,#0000),linear-gradient(180deg,#0000,oklch(from var(--nv-color-background) l c h/.9) 55%,#0000);content:var(--tw-content)}.after\\:nt-bg-gradient-to-b:after{background-image:linear-gradient(to bottom,var(--tw-gradient-stops));content:var(--tw-content)}.after\\:nt-from-primary-foreground-alpha-50:after{content:var(--tw-content);--tw-gradient-from:var(--nv-color-primary-foreground-alpha-50) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.after\\:nt-from-secondary-foreground-alpha-50:after{content:var(--tw-content);--tw-gradient-from:var(--nv-color-secondary-foreground-alpha-50) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.after\\:nt-to-transparent:after{content:var(--tw-content);--tw-gradient-to:#0000 var(--tw-gradient-to-position)}.after\\:nt-opacity-0:after{content:var(--tw-content);opacity:0}.after\\:nt-transition-all:after{content:var(--tw-content);transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\\:nt-transition-opacity:after{content:var(--tw-content);transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\\:nt-duration-200:after{transition-duration:.2s}.after\\:nt-content-\\[\\"\\"\\]:after,.after\\:nt-content-\\[\\'\\'\\]:after{--tw-content:"";content:var(--tw-content)}.after\\:nt-duration-200:after{animation-duration:.2s;content:var(--tw-content)}.hover\\:nt-bg-neutral-alpha-100:hover{background-color:var(--nv-color-neutral-alpha-100)}.hover\\:nt-bg-neutral-alpha-50:hover{background-color:var(--nv-color-neutral-alpha-50)}.hover\\:nt-bg-primary-600:hover{background-color:var(--nv-color-primary-600)}.hover\\:nt-bg-primary-alpha-25:hover{background-color:var(--nv-color-primary-alpha-25)}.hover\\:nt-bg-primary-alpha-400:hover{background-color:var(--nv-color-primary-alpha-400)}.hover\\:nt-text-foreground-alpha-800:hover{color:var(--nv-color-foreground-alpha-800)}.before\\:hover\\:\\[animation-play-state\\:running\\]:hover:before{animation-play-state:running;content:var(--tw-content)}.hover\\:after\\:nt-opacity-100:hover:after{content:var(--tw-content);opacity:1}.focus\\:nt-outline-none:focus{outline:2px solid #0000;outline-offset:2px}.focus-visible\\:nt-rounded-lg:focus-visible{border-radius:var(--nv-radius-lg)}.focus-visible\\:nt-rounded-md:focus-visible{border-radius:var(--nv-radius-md)}.focus-visible\\:nt-rounded-xl:focus-visible{border-radius:var(--nv-radius-xl)}.focus-visible\\:nt-bg-neutral-alpha-50:focus-visible{background-color:var(--nv-color-neutral-alpha-50)}.focus-visible\\:nt-outline-none:focus-visible{outline:2px solid #0000;outline-offset:2px}.focus-visible\\:nt-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:nt-ring-primary:focus-visible{--tw-ring-color:var(--nv-color-primary)}.focus-visible\\:nt-ring-ring:focus-visible{--tw-ring-color:var(--nv-color-ring)}.focus-visible\\:nt-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:nt-pointer-events-none:disabled{pointer-events:none}.disabled\\:nt-opacity-20:disabled{opacity:.2}.disabled\\:nt-opacity-50:disabled{opacity:.5}.nt-group:focus-within .group-focus-within\\:nt-opacity-100,.nt-group:hover .group-hover\\:nt-opacity-100{opacity:1}.data-\\[open\\=true\\]\\:nt-rotate-180[data-open=true]{--tw-rotate:180deg}.data-\\[open\\=true\\]\\:nt-rotate-180[data-open=true],.data-\\[open\\=true\\]\\:nt-transform[data-open=true]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[disabled\\=true\\]\\:nt-text-foreground-alpha-400[data-disabled=true]{color:var(--nv-color-foreground-alpha-400)}.data-\\[disabled\\=true\\]\\:nt-text-foreground-alpha-600[data-disabled=true]{color:var(--nv-color-foreground-alpha-600)}.data-\\[state\\=active\\]\\:nt-text-foreground[data-state=active]{color:var(--nv-color-foreground)}.data-\\[state\\=active\\]\\:after\\:nt-border-b-2[data-state=active]:after{border-bottom-width:2px;content:var(--tw-content)}.data-\\[state\\=active\\]\\:after\\:nt-border-primary[data-state=active]:after{border-color:var(--nv-color-primary);content:var(--tw-content)}.data-\\[state\\=active\\]\\:after\\:nt-opacity-100[data-state=active]:after{content:var(--tw-content);opacity:1}.\\[\\&\\:not\\(\\:first-child\\)\\]\\:nt-border-t:not(:first-child){border-top-width:1px}.\\[\\&_\\.nv-notificationList\\]\\:nt-pb-12 .nv-notificationList{padding-bottom:3rem}.\\[\\&_\\.nv-notificationList\\]\\:nt-pb-8 .nv-notificationList{padding-bottom:2rem}.\\[\\&_\\.nv-preferencesContainer\\]\\:nt-pb-12 .nv-preferencesContainer{padding-bottom:3rem}.\\[\\&_\\.nv-preferencesContainer\\]\\:nt-pb-8 .nv-preferencesContainer{padding-bottom:2rem}.\\[\\&_svg\\]\\:nt-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:nt-shrink-0 svg{flex-shrink:0}`;
22
22
 
23
23
  // src/ui/config/appearanceKeys.ts
@@ -1339,7 +1339,7 @@ var useInboxContext = () => {
1339
1339
  };
1340
1340
  var NovuContext = solidJs.createContext(void 0);
1341
1341
  function NovuProvider(props) {
1342
- const novu = solidJs.createMemo(() => props.novu || new chunkJOKRZMGH_js.Novu(props.options));
1342
+ const novu = solidJs.createMemo(() => props.novu || new chunkKOX7YLPE_js.Novu(props.options));
1343
1343
  return web.createComponent(NovuContext.Provider, {
1344
1344
  get value() {
1345
1345
  return novu();
@@ -1470,8 +1470,8 @@ var CountProvider = (props) => {
1470
1470
  for (const tab of currentTabs) {
1471
1471
  const tabTags = getTagsFromTab(tab);
1472
1472
  const tabDataFilterCriteria = (_a = tab.filter) == null ? void 0 : _a.data;
1473
- const matchesTagFilter = chunkJOKRZMGH_js.checkNotificationTagFilter(notification.tags, tabTags);
1474
- const matchesDataFilterCriteria = chunkJOKRZMGH_js.checkNotificationDataFilter(notification.data, tabDataFilterCriteria);
1473
+ const matchesTagFilter = chunkKOX7YLPE_js.checkNotificationTagFilter(notification.tags, tabTags);
1474
+ const matchesDataFilterCriteria = chunkKOX7YLPE_js.checkNotificationDataFilter(notification.data, tabDataFilterCriteria);
1475
1475
  if (matchesTagFilter && matchesDataFilterCriteria) {
1476
1476
  updateNewNotificationCountsOrCache(notification, tabTags, tabDataFilterCriteria);
1477
1477
  }
@@ -2348,7 +2348,7 @@ var Footer = () => {
2348
2348
  });
2349
2349
  };
2350
2350
  function getCurrentDomain() {
2351
- if (chunkJOKRZMGH_js.isBrowser()) {
2351
+ if (chunkKOX7YLPE_js.isBrowser()) {
2352
2352
  return window.location.hostname;
2353
2353
  }
2354
2354
  return "";
@@ -2360,7 +2360,7 @@ function getCurlCommand() {
2360
2360
  return "";
2361
2361
  }
2362
2362
  const DEFAULT_BACKEND_URL = typeof window !== "undefined" && window.NOVU_LOCAL_BACKEND_URL || "https://api.novu.co";
2363
- return `curl -X POST ${DEFAULT_BACKEND_URL}/${chunkJOKRZMGH_js.DEFAULT_API_VERSION}/events/trigger -H 'Authorization: Keyless ${identifier}' -H 'Content-Type: application/json' -d '{
2363
+ return `curl -X POST ${DEFAULT_BACKEND_URL}/${chunkKOX7YLPE_js.DEFAULT_API_VERSION}/events/trigger -H 'Authorization: Keyless ${identifier}' -H 'Content-Type: application/json' -d '{
2364
2364
  "name": "hello-world",
2365
2365
  "to": {
2366
2366
  "subscriberId": "keyless-subscriber-id"
@@ -3519,7 +3519,7 @@ var useNotificationsInfiniteScroll = (props) => {
3519
3519
  );
3520
3520
  solidJs.onMount(() => {
3521
3521
  const listener = ({ data: data2 }) => {
3522
- if (!data2 || !chunkJOKRZMGH_js.isSameFilter(filter, data2.filter)) {
3522
+ if (!data2 || !chunkKOX7YLPE_js.isSameFilter(filter, data2.filter)) {
3523
3523
  return;
3524
3524
  }
3525
3525
  mutate({ data: data2.notifications, hasMore: data2.hasMore });
@@ -3529,7 +3529,7 @@ var useNotificationsInfiniteScroll = (props) => {
3529
3529
  });
3530
3530
  solidJs.createEffect(() => chunk7B52C2XE_js.__async(void 0, null, function* () {
3531
3531
  const newFilter = chunk7B52C2XE_js.__spreadValues({}, props.options());
3532
- if (chunkJOKRZMGH_js.isSameFilter(filter, newFilter)) {
3532
+ if (chunkKOX7YLPE_js.isSameFilter(filter, newFilter)) {
3533
3533
  return;
3534
3534
  }
3535
3535
  novu.notifications.clearCache();
@@ -122,7 +122,7 @@ function checkNotificationMatchesFilter(notification, filter) {
122
122
 
123
123
  // src/api/http-client.ts
124
124
  var DEFAULT_API_VERSION = "v1";
125
- var DEFAULT_USER_AGENT = `${"@novu/js"}@${"3.8.1"}`;
125
+ var DEFAULT_USER_AGENT = `${"@novu/js"}@${"3.8.2"}`;
126
126
  var HttpClient = class {
127
127
  constructor(options = {}) {
128
128
  // Environment variable for local development that overrides the default API endpoint without affecting the Inbox DX
@@ -343,7 +343,7 @@ var InboxService = class {
343
343
  });
344
344
  }
345
345
  archiveAllRead({ tags, data }) {
346
- return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/archive/read`, {
346
+ return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/read-archive`, {
347
347
  tags,
348
348
  data: data ? JSON.stringify(data) : void 0
349
349
  });
@@ -1,3 +1,3 @@
1
- export { ChannelType, NotificationStatus, Novu, PreferenceLevel, WebSocketEvent, areTagsEqual, checkNotificationDataFilter, checkNotificationMatchesFilter, isSameFilter } from './chunk-HL3WZM2B.mjs';
1
+ export { ChannelType, NotificationStatus, Novu, PreferenceLevel, WebSocketEvent, areTagsEqual, checkNotificationDataFilter, checkNotificationMatchesFilter, isSameFilter } from './chunk-VWUMXBD2.mjs';
2
2
  import './chunk-QOD7NZ77.mjs';
3
3
  import './chunk-STZMOEWR.mjs';
@@ -1,4 +1,4 @@
1
- import { Novu, checkNotificationTagFilter, checkNotificationDataFilter, isBrowser, DEFAULT_API_VERSION, isSameFilter } from '../chunk-HL3WZM2B.mjs';
1
+ import { Novu, checkNotificationTagFilter, checkNotificationDataFilter, isBrowser, DEFAULT_API_VERSION, isSameFilter } from '../chunk-VWUMXBD2.mjs';
2
2
  import { parseMarkdownIntoTokens } from '../chunk-QOD7NZ77.mjs';
3
3
  import { __privateAdd, __privateMethod, __privateSet, __privateGet, __spreadProps, __spreadValues, __objRest, __async } from '../chunk-STZMOEWR.mjs';
4
4
  import { createComponent, mergeProps, delegateEvents, render, Portal, spread, template, insert, memo, effect, className, use, setAttribute, Dynamic } from 'solid-js/web';
@@ -11,7 +11,7 @@ import { autoUpdate, offset, flip, shift } from '@floating-ui/dom';
11
11
  import { useFloating } from 'solid-floating-ui';
12
12
  import { cva } from 'class-variance-authority';
13
13
 
14
- // _j9cq3718i:/home/runner/work/novu/novu/packages/js/src/ui/index.directcss
14
+ // _17wpg8v60:/home/runner/_work/novu/novu/packages/js/src/ui/index.directcss
15
15
  var ui_default = `.novu{scrollbar-color:var(--nv-color-secondary-foreground-alpha-300) #0000;:where(*),:where(*) :after,:where(*) :before,:where(*):after,:where(*):before{border:0 solid #e5e7eb;box-sizing:border-box}:where(html,:host){line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;tab-size:4;-webkit-tap-highlight-color:transparent}:where(body){line-height:inherit;margin:0}:where(hr){border-top-width:1px;color:inherit;height:0}:where(abbr:where([title])){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:where(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(a){color:inherit;text-decoration:inherit}:where(b,strong){font-weight:bolder}:where(code,kbd,samp,pre){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}:where(small){font-size:80%}:where(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:initial}:where(sub){bottom:-.25em}:where(sup){top:-.5em}:where(table){border-collapse:collapse;border-color:inherit;text-indent:0}:where(button,input,optgroup,select,textarea){color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}:where(button,select){text-transform:none}:where(button,input:where([type=button]),input:where([type=reset]),input:where([type=submit])){-webkit-appearance:button;background-color:initial;background-image:none}:where(:-moz-focusring){outline:auto}:where(:-moz-ui-invalid){box-shadow:none}:where(progress){vertical-align:initial}:where(*)::-webkit-inner-spin-button,:where(*)::-webkit-outer-spin-button{height:auto}:where([type=search]){-webkit-appearance:textfield;outline-offset:-2px}:where(*)::-webkit-search-decoration{-webkit-appearance:none}:where(*)::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(summary){display:list-item}:where(blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre){margin:0}:where(fieldset){margin:0;padding:0}:where(legend){padding:0}:where(ol,ul,menu){list-style:none;margin:0;padding:0}:where(dialog){padding:0}:where(textarea){resize:vertical}:where(input)::placeholder,:where(textarea)::placeholder{color:#9ca3af;opacity:1}:where(button,[role=button]){cursor:pointer}:where(:disabled){cursor:default}:where(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(img,video){height:auto;max-width:100%}:where([hidden]){display:none}:where(*),:where(*) :after,:where(*) :before,:where(*):after,:where(*):before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:where(*) ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::-webkit-scrollbar{height:.5rem;width:.5rem}::-webkit-scrollbar-thumb{background-clip:"padding-box";background-color:var(--nv-color-secondary-foreground-alpha-300);border-radius:.25rem}::-webkit-scrollbar-corner,::-webkit-scrollbar-track{background-color:initial}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}}.nt-sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.\\!nt-pointer-events-auto{pointer-events:auto!important}.nt-invisible{visibility:hidden}.nt-absolute{position:absolute}.nt-relative{position:relative}.nt-inset-0{inset:0}.nt-inset-2{inset:.5rem}.nt-left-0\\.5{left:.125rem}.nt-right-0{right:0}.nt-right-3{right:.75rem}.nt-top-0{top:0}.nt-top-0\\.5{top:.125rem}.nt-top-3{top:.75rem}.nt-z-10{z-index:10}.nt-z-\\[-1\\]{z-index:-1}.nt-mx-auto{margin-left:auto;margin-right:auto}.nt--mt-\\[50px\\]{margin-top:-50px}.nt-mb-1{margin-bottom:.25rem}.nt-mb-2{margin-bottom:.5rem}.nt-mb-4{margin-bottom:1rem}.nt-mb-\\[0\\.625rem\\]{margin-bottom:.625rem}.nt-ml-1{margin-left:.25rem}.nt-ml-2{margin-left:.5rem}.nt-ml-auto{margin-left:auto}.nt-mr-2{margin-right:.5rem}.nt-mr-auto{margin-right:auto}.nt-mt-1{margin-top:.25rem}.nt-mt-auto{margin-top:auto}.nt-block{display:block}.nt-flex{display:flex}.nt-inline-flex{display:inline-flex}.nt-grid{display:grid}.nt-hidden{display:none}.nt-aspect-square{aspect-ratio:1/1}.nt-size-1\\.5{height:.375rem;width:.375rem}.nt-size-2{height:.5rem;width:.5rem}.nt-size-2\\.5{height:.625rem;width:.625rem}.nt-size-3{height:.75rem;width:.75rem}.nt-size-3\\.5{height:.875rem;width:.875rem}.nt-size-4{height:1rem;width:1rem}.nt-size-5{height:1.25rem;width:1.25rem}.nt-size-8{height:2rem;width:2rem}.nt-size-fit{height:fit-content;width:fit-content}.nt-size-full{height:100%;width:100%}.nt-h-2{height:.5rem}.nt-h-3{height:.75rem}.nt-h-4{height:1rem}.nt-h-5{height:1.25rem}.nt-h-7{height:1.75rem}.nt-h-8{height:2rem}.nt-h-9{height:2.25rem}.nt-h-\\[600px\\]{height:600px}.nt-h-fit{height:fit-content}.nt-h-full{height:100%}.nt-min-h-0{min-height:0}.nt-w-1\\/3{width:33.333333%}.nt-w-2\\/3{width:66.666667%}.nt-w-5{width:1.25rem}.nt-w-7{width:1.75rem}.nt-w-8{width:2rem}.nt-w-\\[260px\\]{width:260px}.nt-w-\\[400px\\]{width:400px}.nt-w-\\[60px\\]{width:60px}.nt-w-\\[calc\\(2ch\\+2rem\\)\\]{width:calc(2ch + 2rem)}.nt-w-fit{width:fit-content}.nt-w-full{width:100%}.nt-w-max{width:max-content}.nt-min-w-52{min-width:13rem}.nt-flex-1{flex:1 1 0%}.nt-shrink-0{flex-shrink:0}.nt-translate-x-1\\/2{--tw-translate-x:50%}.nt-transform,.nt-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.nt-cursor-default{cursor:default}.nt-cursor-not-allowed{cursor:not-allowed}.nt-cursor-pointer{cursor:pointer}.nt-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.nt-flex-row{flex-direction:row}.nt-flex-col{flex-direction:column}.nt-flex-wrap{flex-wrap:wrap}.nt-flex-nowrap{flex-wrap:nowrap}.nt-items-start{align-items:flex-start}.nt-items-center{align-items:center}.nt-justify-end{justify-content:flex-end}.nt-justify-center{justify-content:center}.nt-justify-between{justify-content:space-between}.nt-gap-0\\.5{gap:.125rem}.nt-gap-1{gap:.25rem}.nt-gap-1\\.5{gap:.375rem}.nt-gap-2{gap:.5rem}.nt-gap-3{gap:.75rem}.nt-gap-4{gap:1rem}.nt-gap-6{gap:1.5rem}.nt-gap-8{gap:2rem}.nt-self-stretch{align-self:stretch}.nt-overflow-auto{overflow:auto}.nt-overflow-hidden{overflow:hidden}.nt-overflow-y-auto{overflow-y:auto}.nt-truncate{overflow:hidden;text-overflow:ellipsis}.nt-truncate,.nt-whitespace-nowrap{white-space:nowrap}.nt-whitespace-pre-wrap{white-space:pre-wrap}.nt-rounded{border-radius:var(--nv-radius-base)}.nt-rounded-full{border-radius:var(--nv-radius-full)}.nt-rounded-lg{border-radius:var(--nv-radius-lg)}.nt-rounded-md{border-radius:var(--nv-radius-md)}.nt-rounded-sm{border-radius:var(--nv-radius-sm)}.nt-rounded-xl{border-radius:var(--nv-radius-xl)}.nt-border{border-width:1px}.nt-border-b{border-bottom-width:1px}.nt-border-t{border-top-width:1px}.nt-border-background{border-color:var(--nv-color-background)}.nt-border-border{border-color:var(--nv-color-neutral-alpha-100)}.nt-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.nt-border-neutral-alpha-100{border-color:var(--nv-color-neutral-alpha-100)}.nt-border-neutral-alpha-200{border-color:var(--nv-color-neutral-alpha-200)}.nt-border-neutral-alpha-400{border-color:var(--nv-color-neutral-alpha-400)}.nt-border-neutral-alpha-50{border-color:var(--nv-color-neutral-alpha-50)}.nt-border-t-neutral-alpha-200{border-top-color:var(--nv-color-neutral-alpha-200)}.nt-bg-\\[oklch\\(from_var\\(--nv-color-stripes\\)_l_c_h_\\/_0\\.1\\)\\]{background-color:oklch(from var(--nv-color-stripes) l c h/.1)}.nt-bg-background{background-color:var(--nv-color-background)}.nt-bg-counter{background-color:var(--nv-color-counter)}.nt-bg-foreground{background-color:var(--nv-color-foreground)}.nt-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.nt-bg-neutral-alpha-100{background-color:var(--nv-color-neutral-alpha-100)}.nt-bg-neutral-alpha-25{background-color:var(--nv-color-neutral-alpha-25)}.nt-bg-neutral-alpha-300{background-color:var(--nv-color-neutral-alpha-300)}.nt-bg-neutral-alpha-50{background-color:var(--nv-color-neutral-alpha-50)}.nt-bg-primary{background-color:var(--nv-color-primary)}.nt-bg-primary-alpha-300{background-color:var(--nv-color-primary-alpha-300)}.nt-bg-primary-alpha-400{background-color:var(--nv-color-primary-alpha-400)}.nt-bg-secondary{background-color:var(--nv-color-secondary)}.nt-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.nt-bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.nt-bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.nt-from-foreground-alpha-50{--tw-gradient-from:var(--nv-color-foreground-alpha-50) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.nt-from-primary-foreground-alpha-200{--tw-gradient-from:var(--nv-color-primary-foreground-alpha-200) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.nt-from-transparent{--tw-gradient-from:#0000 var(--tw-gradient-from-position);--tw-gradient-to:#0000 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.nt-from-20\\%{--tw-gradient-from-position:20%}.nt-to-background{--tw-gradient-to:var(--nv-color-background) var(--tw-gradient-to-position)}.nt-to-transparent{--tw-gradient-to:#0000 var(--tw-gradient-to-position)}.nt-object-cover{object-fit:cover}.nt-p-0{padding:0}.nt-p-0\\.5{padding:.125rem}.nt-p-1{padding:.25rem}.nt-p-2{padding:.5rem}.nt-p-2\\.5{padding:.625rem}.nt-p-3{padding:.75rem}.nt-p-4{padding:1rem}.nt-px-1{padding-left:.25rem;padding-right:.25rem}.nt-px-2{padding-left:.5rem;padding-right:.5rem}.nt-px-3{padding-left:.75rem;padding-right:.75rem}.nt-px-4{padding-left:1rem;padding-right:1rem}.nt-px-8{padding-left:2rem;padding-right:2rem}.nt-px-\\[6px\\]{padding-left:6px;padding-right:6px}.nt-py-1{padding-bottom:.25rem;padding-top:.25rem}.nt-py-2{padding-bottom:.5rem;padding-top:.5rem}.nt-py-3{padding-bottom:.75rem;padding-top:.75rem}.nt-py-3\\.5{padding-bottom:.875rem;padding-top:.875rem}.nt-py-4{padding-bottom:1rem;padding-top:1rem}.nt-py-px{padding-bottom:1px;padding-top:1px}.nt-pb-2{padding-bottom:.5rem}.nt-pb-\\[0\\.625rem\\]{padding-bottom:.625rem}.nt-pr-0{padding-right:0}.nt-pt-2\\.5{padding-top:.625rem}.nt-text-center{text-align:center}.nt-text-start{text-align:start}.nt-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.nt-text-\\[0\\.8rem\\]{font-size:.8rem}.nt-text-\\[12px\\]{font-size:12px}.nt-text-base{font-size:var(--nv-font-size-base);line-height:var(--nv-line-height-base)}.nt-text-sm{font-size:var(--nv-font-size-sm);line-height:var(--nv-line-height-sm)}.nt-text-xl{font-size:var(--nv-font-size-xl);line-height:var(--nv-line-height-xl)}.nt-text-xs{font-size:var(--nv-font-size-xs);line-height:var(--nv-line-height-xs)}.nt-font-medium{font-weight:500}.nt-font-normal{font-weight:400}.nt-font-semibold{font-weight:600}.nt-leading-none{line-height:1}.nt-text-\\[\\#000000\\]{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.nt-text-background{color:var(--nv-color-background)}.nt-text-counter-foreground{color:var(--nv-color-counter-foreground)}.nt-text-foreground{color:var(--nv-color-foreground)}.nt-text-foreground-alpha-300{color:var(--nv-color-foreground-alpha-300)}.nt-text-foreground-alpha-400{color:var(--nv-color-foreground-alpha-400)}.nt-text-foreground-alpha-600{color:var(--nv-color-foreground-alpha-600)}.nt-text-foreground-alpha-700{color:var(--nv-color-foreground-alpha-700)}.nt-text-primary-foreground{color:var(--nv-color-primary-foreground)}.nt-text-secondary-foreground{color:var(--nv-color-secondary-foreground)}.nt-text-stripes{color:var(--nv-color-stripes)}.nt-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.nt-underline{text-decoration-line:underline}.nt-opacity-0{opacity:0}.nt-opacity-20{opacity:.2}.nt-opacity-50{opacity:.5}.nt-shadow{--tw-shadow:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-\\[0_0_0_0\\.5px_var\\(--nv-color-primary-600\\)\\]{--tw-shadow:0 0 0 0.5px var(--nv-color-primary-600);--tw-shadow-colored:0 0 0 0.5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-\\[0_0_0_0\\.5px_var\\(--nv-color-secondary-600\\)\\]{--tw-shadow:0 0 0 0.5px var(--nv-color-secondary-600);--tw-shadow-colored:0 0 0 0.5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-\\[0px_1px_2px_0px_rgba\\(10\\,13\\,20\\,0\\.03\\)\\]{--tw-shadow:0px 1px 2px 0px #0a0d1408;--tw-shadow-colored:0px 1px 2px 0px var(--tw-shadow-color)}.nt-shadow-\\[0px_1px_2px_0px_rgba\\(10\\,13\\,20\\,0\\.03\\)\\],.nt-shadow-dropdown{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-dropdown{--tw-shadow:0px 12px 16px -4px oklch(from var(--nv-color-shadow) l c h/0.08),0px 4px 6px -2px oklch(from var(--nv-color-shadow) l c h/0.03);--tw-shadow-colored:0px 12px 16px -4px var(--tw-shadow-color),0px 4px 6px -2px var(--tw-shadow-color)}.nt-shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.nt-shadow-lg,.nt-shadow-none{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}.nt-shadow-popover{--tw-shadow:0px 8px 26px 0px oklch(from var(--nv-color-shadow) l c h/0.08),0px 2px 6px 0px oklch(from var(--nv-color-shadow) l c h/0.12);--tw-shadow-colored:0px 8px 26px 0px var(--tw-shadow-color),0px 2px 6px 0px var(--tw-shadow-color)}.nt-shadow-popover,.nt-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.nt-shadow-tooltip{--tw-shadow:0 5px 20px 0 oklch(from var(--nv-color-shadow) l c h/0.08);--tw-shadow-colored:0 5px 20px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.nt-outline-none{outline:2px solid #0000;outline-offset:2px}.nt-backdrop-blur-lg{--tw-backdrop-blur:blur(16px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.nt-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nt-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nt-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nt-duration-100{transition-duration:.1s}.nt-duration-200{transition-duration:.2s}.nt-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.nt-animate-in{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.nt-fade-in{--tw-enter-opacity:0}.nt-slide-in-from-top-2{--tw-enter-translate-y:-0.5rem}.nt-duration-100{animation-duration:.1s}.nt-duration-200{animation-duration:.2s}.nt-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[interpolate-size\\:allow-keywords\\]{interpolate-size:allow-keywords}.\\[scrollbar-gutter\\:stable\\]{scrollbar-gutter:stable}.\\[word-break\\:break-word\\]{word-break:break-word}.before\\:nt-absolute:before{content:var(--tw-content);position:absolute}.before\\:nt-inset-0:before{content:var(--tw-content);inset:0}.before\\:-nt-right-\\[calc\\(0\\+var\\(--stripes-size\\)\\)\\]:before{content:var(--tw-content);right:calc(var(--stripes-size)*-1)}@keyframes nt-stripes{0%{content:var(--tw-content);transform:translateX(0)}to{content:var(--tw-content);transform:translateX(calc(var(--stripes-size)*-1))}}.before\\:nt-animate-stripes:before{animation:nt-stripes 1s linear infinite paused;content:var(--tw-content)}.before\\:nt-rounded-lg:before{border-radius:var(--nv-radius-lg);content:var(--tw-content)}.before\\:nt-rounded-md:before{border-radius:var(--nv-radius-md);content:var(--tw-content)}.before\\:nt-rounded-xl:before{border-radius:var(--nv-radius-xl);content:var(--tw-content)}.before\\:nt-border:before{border-width:1px;content:var(--tw-content)}.before\\:nt-border-primary-foreground-alpha-100:before{border-color:var(--nv-color-primary-foreground-alpha-100);content:var(--tw-content)}.before\\:nt-border-secondary-foreground-alpha-100:before{border-color:var(--nv-color-secondary-foreground-alpha-100);content:var(--tw-content)}.before\\:nt-bg-dev-stripes-gradient:before{background-image:repeating-linear-gradient(135deg,oklch(from var(--nv-color-stripes) l c h/.1) 25%,oklch(from var(--nv-color-stripes) l c h/.1) 50%,oklch(from var(--nv-color-stripes) l c h/.2) 50%,oklch(from var(--nv-color-stripes) l c h/.2) 75%);content:var(--tw-content)}.before\\:nt-bg-\\[length\\:var\\(--stripes-size\\)_var\\(--stripes-size\\)\\]:before{background-size:var(--stripes-size) var(--stripes-size);content:var(--tw-content)}.before\\:nt-content-\\[\\"\\"\\]:before{--tw-content:"";content:var(--tw-content)}.before\\:\\[mask-image\\:linear-gradient\\(transparent_0\\%\\2c black\\)\\]:before{content:var(--tw-content);-webkit-mask-image:linear-gradient(#0000,#000);mask-image:linear-gradient(#0000,#000)}.after\\:nt-absolute:after{content:var(--tw-content);position:absolute}.after\\:nt-inset-0:after{content:var(--tw-content);inset:0}.after\\:-nt-top-12:after{content:var(--tw-content);top:-3rem}.after\\:nt-bottom-0:after{bottom:0;content:var(--tw-content)}.after\\:nt-left-0:after{content:var(--tw-content);left:0}.after\\:nt-left-0\\.5:after{content:var(--tw-content);left:.125rem}.after\\:nt-top-0\\.5:after{content:var(--tw-content);top:.125rem}.after\\:nt-size-3:after{content:var(--tw-content);height:.75rem;width:.75rem}.after\\:nt-h-\\[2px\\]:after{content:var(--tw-content);height:2px}.after\\:nt-w-full:after{content:var(--tw-content);width:100%}.after\\:nt-translate-x-1\\/2:after{--tw-translate-x:50%}.after\\:nt-translate-x-1\\/2:after,.after\\:nt-translate-x-full:after{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:nt-translate-x-full:after{--tw-translate-x:100%}.after\\:nt-rounded-full:after{border-radius:var(--nv-radius-full);content:var(--tw-content)}.after\\:nt-rounded-lg:after{border-radius:var(--nv-radius-lg);content:var(--tw-content)}.after\\:nt-rounded-md:after{border-radius:var(--nv-radius-md);content:var(--tw-content)}.after\\:nt-rounded-xl:after{border-radius:var(--nv-radius-xl);content:var(--tw-content)}.after\\:nt-border-b-2:after{border-bottom-width:2px;content:var(--tw-content)}.after\\:nt-border-background:after{border-color:var(--nv-color-background);content:var(--tw-content)}.after\\:nt-border-b-primary:after{border-bottom-color:var(--nv-color-primary);content:var(--tw-content)}.after\\:nt-border-b-transparent:after{border-bottom-color:#0000;content:var(--tw-content)}.after\\:nt-bg-background:after{background-color:var(--nv-color-background);content:var(--tw-content)}.after\\:nt-bg-\\[linear-gradient\\(180deg\\2c transparent\\2c oklch\\(from_var\\(--nv-color-background\\)_l_c_h_\\/_0\\.9\\)_55\\%\\2c transparent\\)\\]:after{background-image:linear-gradient(180deg,#0000,oklch(from var(--nv-color-background) l c h/.9) 55%,#0000);content:var(--tw-content)}.after\\:nt-bg-\\[linear-gradient\\(180deg\\2c transparent\\2c oklch\\(from_var\\(--nv-color-stripes\\)_l_c_h_\\/_0\\.07\\)_55\\%\\2c transparent\\)\\2c linear-gradient\\(180deg\\2c transparent\\2c oklch\\(from_var\\(--nv-color-background\\)_l_c_h_\\/_0\\.9\\)_55\\%\\2c transparent\\)\\]:after{background-image:linear-gradient(180deg,#0000,oklch(from var(--nv-color-stripes) l c h/.07) 55%,#0000),linear-gradient(180deg,#0000,oklch(from var(--nv-color-background) l c h/.9) 55%,#0000);content:var(--tw-content)}.after\\:nt-bg-gradient-to-b:after{background-image:linear-gradient(to bottom,var(--tw-gradient-stops));content:var(--tw-content)}.after\\:nt-from-primary-foreground-alpha-50:after{content:var(--tw-content);--tw-gradient-from:var(--nv-color-primary-foreground-alpha-50) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.after\\:nt-from-secondary-foreground-alpha-50:after{content:var(--tw-content);--tw-gradient-from:var(--nv-color-secondary-foreground-alpha-50) var(--tw-gradient-from-position);--tw-gradient-to:#fff0 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.after\\:nt-to-transparent:after{content:var(--tw-content);--tw-gradient-to:#0000 var(--tw-gradient-to-position)}.after\\:nt-opacity-0:after{content:var(--tw-content);opacity:0}.after\\:nt-transition-all:after{content:var(--tw-content);transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\\:nt-transition-opacity:after{content:var(--tw-content);transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\\:nt-duration-200:after{transition-duration:.2s}.after\\:nt-content-\\[\\"\\"\\]:after,.after\\:nt-content-\\[\\'\\'\\]:after{--tw-content:"";content:var(--tw-content)}.after\\:nt-duration-200:after{animation-duration:.2s;content:var(--tw-content)}.hover\\:nt-bg-neutral-alpha-100:hover{background-color:var(--nv-color-neutral-alpha-100)}.hover\\:nt-bg-neutral-alpha-50:hover{background-color:var(--nv-color-neutral-alpha-50)}.hover\\:nt-bg-primary-600:hover{background-color:var(--nv-color-primary-600)}.hover\\:nt-bg-primary-alpha-25:hover{background-color:var(--nv-color-primary-alpha-25)}.hover\\:nt-bg-primary-alpha-400:hover{background-color:var(--nv-color-primary-alpha-400)}.hover\\:nt-text-foreground-alpha-800:hover{color:var(--nv-color-foreground-alpha-800)}.before\\:hover\\:\\[animation-play-state\\:running\\]:hover:before{animation-play-state:running;content:var(--tw-content)}.hover\\:after\\:nt-opacity-100:hover:after{content:var(--tw-content);opacity:1}.focus\\:nt-outline-none:focus{outline:2px solid #0000;outline-offset:2px}.focus-visible\\:nt-rounded-lg:focus-visible{border-radius:var(--nv-radius-lg)}.focus-visible\\:nt-rounded-md:focus-visible{border-radius:var(--nv-radius-md)}.focus-visible\\:nt-rounded-xl:focus-visible{border-radius:var(--nv-radius-xl)}.focus-visible\\:nt-bg-neutral-alpha-50:focus-visible{background-color:var(--nv-color-neutral-alpha-50)}.focus-visible\\:nt-outline-none:focus-visible{outline:2px solid #0000;outline-offset:2px}.focus-visible\\:nt-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:nt-ring-primary:focus-visible{--tw-ring-color:var(--nv-color-primary)}.focus-visible\\:nt-ring-ring:focus-visible{--tw-ring-color:var(--nv-color-ring)}.focus-visible\\:nt-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:nt-pointer-events-none:disabled{pointer-events:none}.disabled\\:nt-opacity-20:disabled{opacity:.2}.disabled\\:nt-opacity-50:disabled{opacity:.5}.nt-group:focus-within .group-focus-within\\:nt-opacity-100,.nt-group:hover .group-hover\\:nt-opacity-100{opacity:1}.data-\\[open\\=true\\]\\:nt-rotate-180[data-open=true]{--tw-rotate:180deg}.data-\\[open\\=true\\]\\:nt-rotate-180[data-open=true],.data-\\[open\\=true\\]\\:nt-transform[data-open=true]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[disabled\\=true\\]\\:nt-text-foreground-alpha-400[data-disabled=true]{color:var(--nv-color-foreground-alpha-400)}.data-\\[disabled\\=true\\]\\:nt-text-foreground-alpha-600[data-disabled=true]{color:var(--nv-color-foreground-alpha-600)}.data-\\[state\\=active\\]\\:nt-text-foreground[data-state=active]{color:var(--nv-color-foreground)}.data-\\[state\\=active\\]\\:after\\:nt-border-b-2[data-state=active]:after{border-bottom-width:2px;content:var(--tw-content)}.data-\\[state\\=active\\]\\:after\\:nt-border-primary[data-state=active]:after{border-color:var(--nv-color-primary);content:var(--tw-content)}.data-\\[state\\=active\\]\\:after\\:nt-opacity-100[data-state=active]:after{content:var(--tw-content);opacity:1}.\\[\\&\\:not\\(\\:first-child\\)\\]\\:nt-border-t:not(:first-child){border-top-width:1px}.\\[\\&_\\.nv-notificationList\\]\\:nt-pb-12 .nv-notificationList{padding-bottom:3rem}.\\[\\&_\\.nv-notificationList\\]\\:nt-pb-8 .nv-notificationList{padding-bottom:2rem}.\\[\\&_\\.nv-preferencesContainer\\]\\:nt-pb-12 .nv-preferencesContainer{padding-bottom:3rem}.\\[\\&_\\.nv-preferencesContainer\\]\\:nt-pb-8 .nv-preferencesContainer{padding-bottom:2rem}.\\[\\&_svg\\]\\:nt-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:nt-shrink-0 svg{flex-shrink:0}`;
16
16
 
17
17
  // src/ui/config/appearanceKeys.ts
package/dist/novu.min.js CHANGED
@@ -13,7 +13,7 @@
13
13
  `).join(`
14
14
  `+s),i.push(n+"m+"+er.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=vl()+e+" "+i[0]}function vl(){return j.inspectOpts.hideDate?"":new Date().toISOString()+" "}function _l(...i){return process.stderr.write(Zi.formatWithOptions(j.inspectOpts,...i)+`
15
15
  `)}function El(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function Sl(){return process.env.DEBUG}function wl(i){i.inspectOpts={};let e=Object.keys(j.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=j.inspectOpts[e[t]]}er.exports=en()(j);var{formatters:Eo}=er.exports;Eo.o=function(i){return this.inspectOpts.colors=this.useColors,Zi.inspect(i,this.inspectOpts).split(`
16
- `).map(e=>e.trim()).join(" ")};Eo.O=function(i){return this.inspectOpts.colors=this.useColors,Zi.inspect(i,this.inspectOpts)}});var ei=F((Yu,tn)=>{"use strict";typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?tn.exports=_o():tn.exports=So()});var Xo="v1",Qo=`${PACKAGE_NAME}@${PACKAGE_VERSION}`,ci=class{constructor(e={}){this.DEFAULT_BACKEND_URL=typeof window!="undefined"&&window.NOVU_LOCAL_BACKEND_URL||"https://api.novu.co";let{apiVersion:t=Xo,apiUrl:r=this.DEFAULT_BACKEND_URL,userAgent:n=Qo,headers:s={}}=e||{};this.apiVersion=t,this.apiUrl=`${r}/${t}`,this.headers=_({"Novu-API-Version":NOVU_API_VERSION,"Content-Type":"application/json","User-Agent":n},s)}setAuthorizationToken(e){this.headers.Authorization=`Bearer ${e}`}setKeylessHeader(e){var r;let t=e||typeof window!="undefined"&&((r=window.localStorage)==null?void 0:r.getItem("novu_keyless_application_identifier"));!t||!t.startsWith("pk_keyless_")||(this.headers["Novu-Application-Identifier"]=t)}setHeaders(e){this.headers=_(_({},this.headers),e)}get(e,t,r=!0){return m(this,null,function*(){return this.doFetch({path:e,searchParams:t,options:{method:"GET"},unwrapEnvelope:r})})}post(e,t,r){return m(this,null,function*(){return this.doFetch({path:e,options:{method:"POST",body:t,headers:r==null?void 0:r.headers}})})}patch(e,t){return m(this,null,function*(){return this.doFetch({path:e,options:{method:"PATCH",body:t}})})}delete(e,t){return m(this,null,function*(){return this.doFetch({path:e,options:{method:"DELETE",body:t}})})}doFetch(s){return m(this,arguments,function*({path:e,searchParams:t,options:r,unwrapEnvelope:n=!0}){let o=Zo(this.apiUrl,e,t?`?${t.toString()}`:""),a={method:(r==null?void 0:r.method)||"GET",headers:_(_({},this.headers),(r==null?void 0:r.headers)||{}),body:r!=null&&r.body?JSON.stringify(r.body):void 0},h=yield fetch(o,a);if(!h.ok){let l=yield h.json();throw new Error(`${this.headers["User-Agent"]} error. Status: ${h.status}, Message: ${l.message}`)}if(h.status===204)return;let u=yield h.json();return n?u.data:u})}};function Zo(...i){return i.reduce((e,t)=>(t&&e.push(t.replace(new RegExp("(?<!https?:)\\/+","g"),"/").replace(/^\/+|\/+$/g,"")),e),[]).join("/").replace(/\/\?/,"?")}var ct="/inbox",Z=`${ct}/notifications`,P,li=class{constructor(e={}){this.isSessionInitialized=!1;S(this,P);w(this,P,new ci(e))}initializeSession(n){return m(this,arguments,function*({applicationIdentifier:e,subscriberHash:t,subscriber:r}){let s=yield c(this,P).post(`${ct}/session`,{applicationIdentifier:e,subscriberHash:t,subscriber:r});return c(this,P).setAuthorizationToken(s.token),c(this,P).setKeylessHeader(s.applicationIdentifier),this.isSessionInitialized=!0,s})}fetchNotifications({after:e,archived:t,limit:r=10,offset:n,read:s,tags:o,snoozed:a,seen:h,data:u}){let l=new URLSearchParams(`limit=${r}`);return e&&l.append("after",e),n&&l.append("offset",`${n}`),o&&o.forEach(f=>l.append("tags[]",f)),s!==void 0&&l.append("read",`${s}`),t!==void 0&&l.append("archived",`${t}`),a!==void 0&&l.append("snoozed",`${a}`),h!==void 0&&l.append("seen",`${h}`),u!==void 0&&l.append("data",JSON.stringify(u)),c(this,P).get(Z,l,!1)}count({filters:e}){return c(this,P).get(`${Z}/count`,new URLSearchParams({filters:JSON.stringify(e)}),!1)}read(e){return c(this,P).patch(`${Z}/${e}/read`)}unread(e){return c(this,P).patch(`${Z}/${e}/unread`)}archive(e){return c(this,P).patch(`${Z}/${e}/archive`)}unarchive(e){return c(this,P).patch(`${Z}/${e}/unarchive`)}snooze(e,t){return c(this,P).patch(`${Z}/${e}/snooze`,{snoozeUntil:t})}unsnooze(e){return c(this,P).patch(`${Z}/${e}/unsnooze`)}readAll({tags:e,data:t}){return c(this,P).post(`${Z}/read`,{tags:e,data:t?JSON.stringify(t):void 0})}archiveAll({tags:e,data:t}){return c(this,P).post(`${Z}/archive`,{tags:e,data:t?JSON.stringify(t):void 0})}archiveAllRead({tags:e,data:t}){return c(this,P).post(`${Z}/archive/read`,{tags:e,data:t?JSON.stringify(t):void 0})}markAsSeen({notificationIds:e,tags:t,data:r}){return c(this,P).post(`${Z}/seen`,{notificationIds:e,tags:t,data:r?JSON.stringify(r):void 0})}seen(e){return this.markAsSeen({notificationIds:[e]})}completeAction({actionType:e,notificationId:t}){return c(this,P).patch(`${Z}/${t}/complete`,{actionType:e})}revertAction({actionType:e,notificationId:t}){return c(this,P).patch(`${Z}/${t}/revert`,{actionType:e})}fetchPreferences(e){let t=new URLSearchParams;e&&e.forEach(n=>t.append("tags[]",n));let r=t.size?`?${t.toString()}`:"";return c(this,P).get(`${ct}/preferences${r}`)}bulkUpdatePreferences(e){return c(this,P).patch(`${ct}/preferences/bulk`,{preferences:e})}updateGlobalPreferences(e){return c(this,P).patch(`${ct}/preferences`,e)}updateWorkflowPreferences({workflowId:e,channels:t}){return c(this,P).patch(`${ct}/preferences/${e}`,t)}triggerHelloWorldEvent(){let e={name:"hello-world",to:{subscriberId:"keyless-subscriber-id"},payload:{subject:"Novu Keyless Environment",body:"You're using a keyless demo environment. For full access to Novu features and cloud integration, obtain your API key.",primaryActionText:"Obtain API Key",primaryActionUrl:"https://go.novu.co/keyless",secondaryActionText:"Explore Documentation",secondaryActionUrl:"https://go.novu.co/keyless-docs"}};return c(this,P).post("/inbox/events",e)}};P=new WeakMap;function mn(i){return{all:i=i||new Map,on:function(e,t){var r=i.get(e);r?r.push(t):i.set(e,[t])},off:function(e,t){var r=i.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var r=i.get(e);r&&r.slice().map(function(n){n(t)}),(r=i.get("*"))&&r.slice().map(function(n){n(e,t)})}}}var Ye,hi=class{constructor(){S(this,Ye);w(this,Ye,mn())}on(e,t){return c(this,Ye).on(e,t),()=>{this.off(e,t)}}off(e,t){c(this,Ye).off(e,t)}emit(e,t){c(this,Ye).emit(e,t)}};Ye=new WeakMap;var A=class extends Error{constructor(e,t){super(e),this.originalError=t}};var fi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0},{emitter:i,apiService:e});try{i.emit("notification.read.pending",{args:t,data:s});let o=yield e.read(n),a=new U(o,i,e);return i.emit("notification.read.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.read.resolved",{args:t,error:o}),{error:new A("Failed to read notification",o)}}}),ui=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isRead:!1,readAt:null,isArchived:!1,archivedAt:void 0},{emitter:i,apiService:e});try{i.emit("notification.unread.pending",{args:t,data:s});let o=yield e.unread(n),a=new U(o,i,e);return i.emit("notification.unread.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.unread.resolved",{args:t,error:o}),{error:new A("Failed to unread notification",o)}}}),di=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isSeen:!0},{emitter:i,apiService:e});try{if(i.emit("notification.seen.pending",{args:t,data:s}),yield e.seen(n),!s)throw new Error("Failed to create optimistic value for notification");let o=new U(s,i,e);return i.emit("notification.seen.resolved",{args:t,data:o}),{data:o}}catch(o){return i.emit("notification.seen.resolved",{args:t,error:o}),{error:new A("Failed to mark notification as seen",o)}}}),pi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isArchived:!0,archivedAt:new Date().toISOString(),isRead:!0,readAt:new Date().toISOString()},{emitter:i,apiService:e});try{i.emit("notification.archive.pending",{args:t,data:s});let o=yield e.archive(n),a=new U(o,i,e);return i.emit("notification.archive.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.archive.resolved",{args:t,error:o}),{error:new A("Failed to archive notification",o)}}}),mi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isArchived:!1,archivedAt:null,isRead:!0,readAt:new Date().toISOString()},{emitter:i,apiService:e});try{i.emit("notification.unarchive.pending",{args:t,data:s});let o=yield e.unarchive(n),a=new U(o,i,e);return i.emit("notification.unarchive.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.unarchive.resolved",{args:t,error:o}),{error:new A("Failed to unarchive notification",o)}}}),gi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isSnoozed:!0,snoozedUntil:t.snoozeUntil},{emitter:i,apiService:e});try{i.emit("notification.snooze.pending",{args:t,data:s});let o=yield e.snooze(n,t.snoozeUntil),a=new U(o,i,e);return i.emit("notification.snooze.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.snooze.resolved",{args:t,error:o}),{error:new A("Failed to snooze notification",o)}}}),yi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isSnoozed:!1,snoozedUntil:null},{emitter:i,apiService:e});try{i.emit("notification.unsnooze.pending",{args:t,data:s});let o=yield e.unsnooze(n),a=new U(o,i,e);return i.emit("notification.unsnooze.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.unsnooze.resolved",{args:t,error:o}),{error:new A("Failed to unsnooze notification",o)}}}),lt=n=>m(void 0,[n],function*({emitter:i,apiService:e,args:t,actionType:r}){let s=r==="primary"?{primaryAction:k(_({},"notification"in t?t.notification.primaryAction:{}),{isCompleted:!0})}:{secondaryAction:k(_({},"notification"in t?t.notification.secondaryAction:{}),{isCompleted:!0})},{notificationId:o,optimisticValue:a}=ke(t,s,{emitter:i,apiService:e});try{i.emit("notification.complete_action.pending",{args:t,data:a});let h=yield e.completeAction({actionType:r,notificationId:o}),u=new U(h,i,e);return i.emit("notification.complete_action.resolved",{args:t,data:u}),{data:u}}catch(h){return i.emit("notification.complete_action.resolved",{args:t,error:h}),{error:new A(`Failed to complete ${r} action on the notification`,h)}}}),ht=n=>m(void 0,[n],function*({emitter:i,apiService:e,args:t,actionType:r}){let s=r==="primary"?{primaryAction:k(_({},"notification"in t?t.notification.primaryAction:{}),{isCompleted:!1})}:{secondaryAction:k(_({},"notification"in t?t.notification.secondaryAction:{}),{isCompleted:!1})},{notificationId:o,optimisticValue:a}=ke(t,s,{emitter:i,apiService:e});try{i.emit("notification.revert_action.pending",{args:t,data:a});let h=yield e.revertAction({actionType:r,notificationId:o}),u=new U(h,i,e);return i.emit("notification.revert_action.resolved",{args:t,data:u}),{data:u}}catch(h){return i.emit("notification.revert_action.resolved",{args:t,error:h}),{error:new A("Failed to fetch notifications",h)}}}),ke=(i,e,t)=>"notification"in i?{notificationId:i.notification.id,optimisticValue:new U(_(_({},i.notification),e),t.emitter,t.apiService)}:{notificationId:i.notificationId},gn=s=>m(void 0,[s],function*({emitter:i,inboxService:e,notificationsCache:t,tags:r,data:n}){try{let a=t.getUniqueNotifications({tags:r,data:n}).map(h=>new U(k(_({},h),{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0}),i,e));return i.emit("notifications.read_all.pending",{args:{tags:r,data:n},data:a}),yield e.readAll({tags:r,data:n}),i.emit("notifications.read_all.resolved",{args:{tags:r,data:n},data:a}),{}}catch(o){return i.emit("notifications.read_all.resolved",{args:{tags:r,data:n},error:o}),{error:new A("Failed to read all notifications",o)}}}),hr=o=>m(void 0,[o],function*({emitter:i,inboxService:e,notificationsCache:t,notificationIds:r,tags:n,data:s}){try{let a=t.getUniqueNotifications({tags:n,data:s}),u=(r&&r.length>0?a.filter(l=>r.includes(l.id)):a).map(l=>new U(k(_({},l),{isSeen:!0,firstSeenAt:l.firstSeenAt||new Date().toISOString()}),i,e));return i.emit("notifications.seen_all.pending",{args:{notificationIds:r,tags:n,data:s},data:u}),yield e.markAsSeen({notificationIds:r,tags:n,data:s}),i.emit("notifications.seen_all.resolved",{args:{notificationIds:r,tags:n,data:s},data:u}),{}}catch(a){return i.emit("notifications.seen_all.resolved",{args:{notificationIds:r,tags:n,data:s},error:a}),{error:new A("Failed to mark all notifications as seen",a)}}}),yn=s=>m(void 0,[s],function*({emitter:i,inboxService:e,notificationsCache:t,tags:r,data:n}){try{let a=t.getUniqueNotifications({tags:r,data:n}).map(h=>new U(k(_({},h),{isRead:!0,readAt:new Date().toISOString(),isArchived:!0,archivedAt:new Date().toISOString()}),i,e));return i.emit("notifications.archive_all.pending",{args:{tags:r,data:n},data:a}),yield e.archiveAll({tags:r,data:n}),i.emit("notifications.archive_all.resolved",{args:{tags:r,data:n},data:a}),{}}catch(o){return i.emit("notifications.archive_all.resolved",{args:{tags:r,data:n},error:o}),{error:new A("Failed to archive all notifications",o)}}}),vn=s=>m(void 0,[s],function*({emitter:i,inboxService:e,notificationsCache:t,tags:r,data:n}){try{let a=t.getUniqueNotifications({tags:r,data:n,read:!0}).map(h=>new U(k(_({},h),{isArchived:!0,archivedAt:new Date().toISOString()}),i,e));return i.emit("notifications.archive_all_read.pending",{args:{tags:r,data:n},data:a}),yield e.archiveAllRead({tags:r,data:n}),i.emit("notifications.archive_all_read.resolved",{args:{tags:r,data:n},data:a}),{}}catch(o){return i.emit("notifications.archive_all_read.resolved",{args:{tags:r,data:n},error:o}),{error:new A("Failed to archive all read notifications",o)}}});var G,Q,U=class{constructor(e,t,r){S(this,G);S(this,Q);w(this,G,t),w(this,Q,r),this.id=e.id,this.transactionId=e.transactionId,this.subject=e.subject,this.body=e.body,this.to=e.to,this.isRead=e.isRead,this.isSeen=e.isSeen,this.isArchived=e.isArchived,this.isSnoozed=e.isSnoozed,this.snoozedUntil=e.snoozedUntil,this.deliveredAt=e.deliveredAt,this.createdAt=e.createdAt,this.readAt=e.readAt,this.firstSeenAt=e.firstSeenAt,this.archivedAt=e.archivedAt,this.avatar=e.avatar,this.primaryAction=e.primaryAction,this.secondaryAction=e.secondaryAction,this.channelType=e.channelType,this.tags=e.tags,this.redirect=e.redirect,this.data=e.data,this.workflow=e.workflow}read(){return fi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}unread(){return ui({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}seen(){return di({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}archive(){return pi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}unarchive(){return mi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}snooze(e){return gi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this,snoozeUntil:e}})}unsnooze(){return yi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}completePrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return lt({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"primary"})}completeSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return lt({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"secondary"})}revertPrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return ht({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"primary"})}revertSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return ht({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"secondary"})}on(e,t){let r=c(this,G).on(e,t);return()=>{r()}}off(e,t){c(this,G).off(e,t)}};G=new WeakMap,Q=new WeakMap;var Me,ft,Se=class{constructor({inboxServiceInstance:e,eventEmitterInstance:t}){S(this,Me,[]);S(this,ft);this._emitter=t,this._inboxService=e,this._emitter.on("session.initialize.resolved",({error:r,data:n})=>{n?(this.onSessionSuccess(n),c(this,Me).forEach(a=>m(this,[a],function*({fn:s,resolve:o}){o(yield s())})),w(this,Me,[])):r&&(this.onSessionError(r),w(this,ft,r),c(this,Me).forEach(({resolve:s})=>{s({error:new A("Failed to initialize session, please contact the support",r)})}),w(this,Me,[]))})}onSessionSuccess(e){}onSessionError(e){}callWithSession(e){return m(this,null,function*(){return this._inboxService.isSessionInitialized?e():c(this,ft)?Promise.resolve({error:new A("Failed to initialize session, please contact the support",c(this,ft))}):new Promise((t,r)=>{c(this,Me).push({fn:e,resolve:t,reject:r})})})}};Me=new WeakMap,ft=new WeakMap;var _n=(i,e)=>i===e?!0:!i||!e||i.length!==e.length?!1:i.every((t,r)=>t===e[r]);var ah=["seen","unseen"],ch=["read","unread"],fr=(i,e)=>_n(i,e)||!i&&(e==null?void 0:e.length)===0||(i==null?void 0:i.length)===0&&!e,ur=(i,e)=>{if(!i&&!e)return!0;if(!i||!e)return!1;try{return JSON.stringify(i)===JSON.stringify(e)}catch(t){return!1}},dr=(i,e)=>ur(i.data,e.data)&&fr(i.tags,e.tags)&&i.read===e.read&&i.archived===e.archived&&i.snoozed===e.snoozed&&i.seen===e.seen;var pe,ut=class{constructor(){S(this,pe);w(this,pe,new Map)}get(e){return c(this,pe).get(e)}getValues(){return Array.from(c(this,pe).values())}entries(){return Array.from(c(this,pe).entries())}keys(){return Array.from(c(this,pe).keys())}set(e,t){c(this,pe).set(e,t)}remove(e){c(this,pe).delete(e)}clear(){c(this,pe).clear()}};pe=new WeakMap;var En=({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h})=>Object.entries({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h}).filter(([u,l])=>l!=null&&!(Array.isArray(l)&&l.length===0)).reduce((u,[l,f])=>(u[l]=f,u),{}),pr=({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h})=>JSON.stringify(En({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h})),ea=({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s})=>JSON.stringify(En({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s})),dt=i=>JSON.parse(i),ta=["notification.read.pending","notification.read.resolved","notification.unread.pending","notification.unread.resolved","notification.complete_action.pending","notification.complete_action.resolved","notification.revert_action.pending","notification.revert_action.resolved","notifications.read_all.pending","notifications.read_all.resolved"],ia=["notification.archive.pending","notification.unarchive.pending","notification.snooze.pending","notification.unsnooze.pending","notifications.archive_all.pending","notifications.archive_all_read.pending"],qe,$,Rt=class{constructor({emitter:e}){S(this,qe);S(this,$);this.updateNotification=(e,t)=>{let r=c(this,$).get(e);if(!r)return!1;let n=r.notifications.findIndex(o=>o.id===t.id);if(n===-1)return!1;let s=[...r.notifications];return s[n]=t,c(this,$).set(e,k(_({},r),{notifications:s})),!0};this.removeNotification=(e,t)=>{let r=c(this,$).get(e);if(!r)return!1;let n=r.notifications.findIndex(o=>o.id===t.id);if(n===-1)return!1;let s=[...r.notifications];return s.splice(n,1),c(this,$).set(e,k(_({},r),{notifications:s})),!0};this.handleNotificationEvent=({remove:e}={remove:!1})=>({data:t})=>{if(!t)return;let r=Array.isArray(t)?t:[t],n=new Set;c(this,$).keys().forEach(s=>{r.forEach(o=>{let a=!1;e?a=this.removeNotification(s,o):a=this.updateNotification(s,o),a&&n.add(ea(dt(s)))})}),n.forEach(s=>{let o=this.getAggregated(dt(s));c(this,qe).emit("notifications.list.updated",{data:o})})};w(this,qe,e),ta.forEach(t=>{c(this,qe).on(t,this.handleNotificationEvent())}),ia.forEach(t=>{c(this,qe).on(t,this.handleNotificationEvent({remove:!0}))}),w(this,$,new ut)}getAggregated(e){return c(this,$).keys().filter(r=>{let n=dt(r);return dr(n,e)}).map(r=>c(this,$).get(r)).reduce((r,n)=>n?{hasMore:n.hasMore,filter:n.filter,notifications:[...r.notifications,...n.notifications]}:r,{hasMore:!1,filter:{},notifications:[]})}has(e){return c(this,$).get(pr(e))!==void 0}set(e,t){c(this,$).set(pr(e),t)}update(e,t){this.set(e,t);let r=this.getAggregated(dt(pr(e)));c(this,qe).emit("notifications.list.updated",{data:r})}getAll(e){if(this.has(e))return this.getAggregated({tags:e.tags,data:e.data,read:e.read,snoozed:e.snoozed,archived:e.archived,seen:e.seen})}getUniqueNotifications({tags:e,read:t,data:r}){let n=c(this,$).keys(),s=new Map;return n.forEach(o=>{let a=dt(o);if(fr(e,a.tags)&&ur(r,a.data)){let h=c(this,$).get(o);if(!h)return;h.notifications.filter(u=>typeof t=="undefined"||t===u.isRead).forEach(u=>s.set(u.id,u))}}),Array.from(s.values())}clear(e){c(this,$).keys().forEach(r=>{dr(dt(r),e)&&c(this,$).remove(r)})}clearAll(){c(this,$).clear()}};qe=new WeakMap,$=new WeakMap;var Tt,vi=class extends Se{constructor({useCache:t,inboxServiceInstance:r,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:r});S(this,Tt);this.cache=new Rt({emitter:n}),w(this,Tt,t)}get inboxService(){return this._inboxService}list(){return m(this,arguments,function*(n={}){var s=n,{limit:t=10}=s,r=cr(s,["limit"]);return this.callWithSession(()=>m(this,null,function*(){let o=_({limit:t},r);try{let a="useCache"in o?o.useCache:c(this,Tt),h=a?this.cache.getAll(o):void 0;if(this._emitter.emit("notifications.list.pending",{args:o,data:h}),!h){let u=yield this._inboxService.fetchNotifications(_({limit:t},r));h={hasMore:u.hasMore,filter:u.filter,notifications:u.data.map(l=>new U(l,this._emitter,this._inboxService))},a&&(this.cache.set(o,h),h=this.cache.getAll(o))}return this._emitter.emit("notifications.list.resolved",{args:o,data:h}),{data:h}}catch(a){return this._emitter.emit("notifications.list.resolved",{args:o,error:a}),{error:new A("Failed to fetch notifications",a)}}}))})}count(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){let r=t&&"filters"in t?t.filters:[_({},t)];try{this._emitter.emit("notifications.count.pending",{args:t});let n=yield this._inboxService.count({filters:r}),s=t&&"filters"in t?{counts:n.data}:n.data[0];return this._emitter.emit("notifications.count.resolved",{args:t,data:s}),{data:s}}catch(n){return this._emitter.emit("notifications.count.resolved",{args:t,error:n}),{error:new A("Failed to count notifications",n)}}}))})}read(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return fi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}unread(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return ui({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}seen(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return di({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}archive(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return pi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}unarchive(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return mi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}snooze(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return gi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}unsnooze(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return yi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}completePrimary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return lt({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"primary"})}))})}completeSecondary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return lt({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"secondary"})}))})}revertPrimary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return ht({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"primary"})}))})}revertSecondary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return ht({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"secondary"})}))})}readAll(){return m(this,arguments,function*({tags:t,data:r}={}){return this.callWithSession(()=>m(this,null,function*(){return gn({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:t,data:r})}))})}seenAll(){return m(this,arguments,function*(t={}){return this.callWithSession(()=>m(this,null,function*(){return"notificationIds"in t?hr({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,notificationIds:t.notificationIds}):hr({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:"tags"in t?t.tags:void 0,data:"data"in t?t.data:void 0})}))})}archiveAll(){return m(this,arguments,function*({tags:t,data:r}={}){return this.callWithSession(()=>m(this,null,function*(){return yn({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:t,data:r})}))})}archiveAllRead(){return m(this,arguments,function*({tags:t,data:r}={}){return this.callWithSession(()=>m(this,null,function*(){return vn({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:t,data:r})}))})}clearCache({filter:t}={}){return t?this.cache.clear(t!=null?t:{}):this.cache.clearAll()}triggerHelloWorldEvent(){return m(this,null,function*(){return this._inboxService.triggerHelloWorldEvent()})}};Tt=new WeakMap;var ra=["preference.update.pending","preference.update.resolved","preferences.bulk_update.pending","preferences.bulk_update.resolved"],na=({tags:i})=>Object.entries({tags:i}).reduce((e,[t,r])=>(r==null||Array.isArray(r)&&r.length===0||(e[t]=r),e),{}),mr=({tags:i})=>JSON.stringify(na({tags:i})),pt,re,_i=class{constructor({emitterInstance:e}){S(this,pt);S(this,re);this.updatePreference=(e,t)=>{let r=c(this,re).get(e);if(!r)return!1;let n=r.findIndex(o=>{var a,h;return((a=o.workflow)==null?void 0:a.id)===((h=t.workflow)==null?void 0:h.id)||o.level===t.level&&t.level==="global"});if(n===-1)return!1;let s=[...r];return s[n]=t,c(this,re).set(e,s),!0};this.handlePreferenceEvent=({data:e})=>{if(!e)return;let t=Array.isArray(e)?e:[e],r=new Set;c(this,re).keys().forEach(n=>{t.forEach(s=>{let o=this.updatePreference(n,s),a=c(this,re).get(n);!o||!a||r.add(n)})}),r.forEach(n=>{var s;c(this,pt).emit("preferences.list.updated",{data:(s=c(this,re).get(n))!=null?s:[]})})};w(this,pt,e),ra.forEach(t=>{c(this,pt).on(t,this.handlePreferenceEvent)}),w(this,re,new ut)}has(e){return c(this,re).get(mr(e))!==void 0}set(e,t){c(this,re).set(mr(e),t)}getAll(e){if(this.has(e))return c(this,re).get(mr(e))}clearAll(){c(this,re).clear()}};pt=new WeakMap,re=new WeakMap;var Ot,It,Pt,Lt,we=class{constructor(e,{emitterInstance:t,inboxServiceInstance:r,cache:n,useCache:s}){S(this,Ot);S(this,It);S(this,Pt);S(this,Lt);w(this,Ot,t),w(this,It,r),w(this,Pt,n),w(this,Lt,s),this.level=e.level,this.enabled=e.enabled,this.channels=e.channels,this.workflow=e.workflow}update({channels:e,channelPreferences:t}){var r;return Ei({emitter:c(this,Ot),apiService:c(this,It),cache:c(this,Pt),useCache:c(this,Lt),args:{workflowId:(r=this.workflow)==null?void 0:r.id,channels:e||t,preference:this}})}};Ot=new WeakMap,It=new WeakMap,Pt=new WeakMap,Lt=new WeakMap;var Ei=s=>m(void 0,[s],function*({emitter:i,apiService:e,cache:t,useCache:r,args:n}){var h;let{channels:o}=n,a="workflowId"in n?n.workflowId:(h=n.preference.workflow)==null?void 0:h.id;try{i.emit("preference.update.pending",{args:n,data:"preference"in n?new we(k(_({},n.preference),{channels:_(_({},n.preference.channels),o)}),{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}):void 0});let u;a?u=yield e.updateWorkflowPreferences({workflowId:a,channels:o}):(sa({emitter:i,apiService:e,cache:t,useCache:r,args:n}),u=yield e.updateGlobalPreferences(o));let l=new we(u,{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r});return i.emit("preference.update.resolved",{args:n,data:l}),{data:l}}catch(u){return i.emit("preference.update.resolved",{args:n,error:u}),{error:new A("Failed to update preference",u)}}}),Sn=s=>m(void 0,[s],function*({emitter:i,apiService:e,cache:t,useCache:r,args:n}){if(n.find(a=>"preference"in a&&a.preference.level==="global"))return{error:new A("Global preference is not supported in bulk update","")};try{let a=n.map(f=>"preference"in f?new we(k(_({},f.preference),{channels:_(_({},f.preference.channels),f.channels)}),{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}):void 0).filter(f=>f!==void 0);i.emit("preferences.bulk_update.pending",{args:n,data:a});let h=n.map(f=>{var p,d,b,g;return _({workflowId:"workflowId"in f?f.workflowId:(g=(b=(p=f.preference.workflow)==null?void 0:p.id)!=null?b:(d=f.preference.workflow)==null?void 0:d.identifier)!=null?g:""},f.channels)}),l=(yield e.bulkUpdatePreferences(h)).map(f=>new we(f,{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}));return i.emit("preferences.bulk_update.resolved",{args:n,data:l}),{data:l}}catch(a){return i.emit("preferences.bulk_update.resolved",{args:n,error:a}),{error:new A("Failed to bulk update preferences",a)}}}),sa=({emitter:i,apiService:e,cache:t,useCache:r,args:n})=>{let s=r?t==null?void 0:t.getAll({}):void 0;s==null||s.forEach(o=>{var a,h;if(o.level==="template"){let u=k(_({},o),{channels:Object.entries(o.channels).reduce((f,[p,d])=>{var g;let b=p;return f[b]=(g=n.channels[b])!=null?g:d,f},{})}),l="preference"in n?new we(u,{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}):void 0;l&&i.emit("preference.update.pending",{args:{workflowId:(h=(a=o.workflow)==null?void 0:a.id)!=null?h:"",channels:l.channels},data:l})}})};var Ae,Si=class extends Se{constructor({useCache:t,inboxServiceInstance:r,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:r});S(this,Ae);this.cache=new _i({emitterInstance:this._emitter}),w(this,Ae,t)}list(){return m(this,arguments,function*(t={}){return this.callWithSession(()=>m(this,null,function*(){try{let r=c(this,Ae)?this.cache.getAll(t):void 0;return this._emitter.emit("preferences.list.pending",{args:t,data:r}),r||(r=(yield this._inboxService.fetchPreferences(t.tags)).map(s=>new we(s,{emitterInstance:this._emitter,inboxServiceInstance:this._inboxService,cache:this.cache,useCache:c(this,Ae)})),c(this,Ae)&&(this.cache.set(t,r),r=this.cache.getAll(t))),this._emitter.emit("preferences.list.resolved",{args:t,data:r}),{data:r}}catch(r){throw this._emitter.emit("preferences.list.resolved",{args:t,error:r}),r}}))})}update(t){return m(this,null,function*(){return this.callWithSession(()=>Ei({emitter:this._emitter,apiService:this._inboxService,cache:this.cache,useCache:c(this,Ae),args:t}))})}bulkUpdate(t){return m(this,null,function*(){return this.callWithSession(()=>Sn({emitter:this._emitter,apiService:this._inboxService,cache:this.cache,useCache:c(this,Ae),args:t}))})}};Ae=new WeakMap;function wn(){return typeof window!="undefined"}var Je,Ft,fe,wi=class{constructor(e,t,r){S(this,Je);S(this,Ft);S(this,fe);w(this,Je,r),w(this,Ft,t),w(this,fe,e)}get applicationIdentifier(){return c(this,fe).applicationIdentifier}get subscriberId(){var e;return(e=c(this,fe).subscriber)==null?void 0:e.subscriberId}handleApplicationIdentifier(e,t){if(typeof window=="undefined"||!window.localStorage)return null;let r="novu_keyless_application_identifier";switch(e){case"get":return window.localStorage.getItem(r);case"store":return t&&window.localStorage.setItem(r,t),null;case"delete":return window.localStorage.removeItem(r),null;default:return null}}initialize(e){return m(this,null,function*(){var t,r,n,s,o,a;if(((t=c(this,fe).subscriber)==null?void 0:t.subscriberId)!==((r=e==null?void 0:e.subscriber)==null?void 0:r.subscriberId))try{e&&w(this,fe,e);let{subscriber:h,subscriberHash:u,applicationIdentifier:l}=c(this,fe),f;wn()&&(f=Intl.DateTimeFormat().resolvedOptions().timeZone);let p=l;if(p)this.handleApplicationIdentifier("delete");else{let b=this.handleApplicationIdentifier("get");b&&(p=b)}c(this,Je).emit("session.initialize.pending",{args:c(this,fe)});let d=yield c(this,Ft).initializeSession({applicationIdentifier:p,subscriberHash:u,subscriber:k(_({},h),{subscriberId:(n=h==null?void 0:h.subscriberId)!=null?n:"",timezone:(s=h==null?void 0:h.timezone)!=null?s:f})});(o=d==null?void 0:d.applicationIdentifier)!=null&&o.startsWith("pk_keyless_")&&this.handleApplicationIdentifier("store",d.applicationIdentifier),(a=d==null?void 0:d.applicationIdentifier)!=null&&a.startsWith("pk_keyless_")||this.handleApplicationIdentifier("delete"),c(this,Je).emit("session.initialize.resolved",{args:c(this,fe),data:d})}catch(h){c(this,Je).emit("session.initialize.resolved",{args:c(this,fe),error:h})}})}};Je=new WeakMap,Ft=new WeakMap,fe=new WeakMap;function bn({subscriberId:i,subscriber:e}){return e?typeof e=="string"?{subscriberId:e}:e:i?{subscriberId:i}:{subscriberId:""}}(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
16
+ `).map(e=>e.trim()).join(" ")};Eo.O=function(i){return this.inspectOpts.colors=this.useColors,Zi.inspect(i,this.inspectOpts)}});var ei=F((Yu,tn)=>{"use strict";typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?tn.exports=_o():tn.exports=So()});var Xo="v1",Qo=`${PACKAGE_NAME}@${PACKAGE_VERSION}`,ci=class{constructor(e={}){this.DEFAULT_BACKEND_URL=typeof window!="undefined"&&window.NOVU_LOCAL_BACKEND_URL||"https://api.novu.co";let{apiVersion:t=Xo,apiUrl:r=this.DEFAULT_BACKEND_URL,userAgent:n=Qo,headers:s={}}=e||{};this.apiVersion=t,this.apiUrl=`${r}/${t}`,this.headers=_({"Novu-API-Version":NOVU_API_VERSION,"Content-Type":"application/json","User-Agent":n},s)}setAuthorizationToken(e){this.headers.Authorization=`Bearer ${e}`}setKeylessHeader(e){var r;let t=e||typeof window!="undefined"&&((r=window.localStorage)==null?void 0:r.getItem("novu_keyless_application_identifier"));!t||!t.startsWith("pk_keyless_")||(this.headers["Novu-Application-Identifier"]=t)}setHeaders(e){this.headers=_(_({},this.headers),e)}get(e,t,r=!0){return m(this,null,function*(){return this.doFetch({path:e,searchParams:t,options:{method:"GET"},unwrapEnvelope:r})})}post(e,t,r){return m(this,null,function*(){return this.doFetch({path:e,options:{method:"POST",body:t,headers:r==null?void 0:r.headers}})})}patch(e,t){return m(this,null,function*(){return this.doFetch({path:e,options:{method:"PATCH",body:t}})})}delete(e,t){return m(this,null,function*(){return this.doFetch({path:e,options:{method:"DELETE",body:t}})})}doFetch(s){return m(this,arguments,function*({path:e,searchParams:t,options:r,unwrapEnvelope:n=!0}){let o=Zo(this.apiUrl,e,t?`?${t.toString()}`:""),a={method:(r==null?void 0:r.method)||"GET",headers:_(_({},this.headers),(r==null?void 0:r.headers)||{}),body:r!=null&&r.body?JSON.stringify(r.body):void 0},h=yield fetch(o,a);if(!h.ok){let l=yield h.json();throw new Error(`${this.headers["User-Agent"]} error. Status: ${h.status}, Message: ${l.message}`)}if(h.status===204)return;let u=yield h.json();return n?u.data:u})}};function Zo(...i){return i.reduce((e,t)=>(t&&e.push(t.replace(new RegExp("(?<!https?:)\\/+","g"),"/").replace(/^\/+|\/+$/g,"")),e),[]).join("/").replace(/\/\?/,"?")}var ct="/inbox",Z=`${ct}/notifications`,P,li=class{constructor(e={}){this.isSessionInitialized=!1;S(this,P);w(this,P,new ci(e))}initializeSession(n){return m(this,arguments,function*({applicationIdentifier:e,subscriberHash:t,subscriber:r}){let s=yield c(this,P).post(`${ct}/session`,{applicationIdentifier:e,subscriberHash:t,subscriber:r});return c(this,P).setAuthorizationToken(s.token),c(this,P).setKeylessHeader(s.applicationIdentifier),this.isSessionInitialized=!0,s})}fetchNotifications({after:e,archived:t,limit:r=10,offset:n,read:s,tags:o,snoozed:a,seen:h,data:u}){let l=new URLSearchParams(`limit=${r}`);return e&&l.append("after",e),n&&l.append("offset",`${n}`),o&&o.forEach(f=>l.append("tags[]",f)),s!==void 0&&l.append("read",`${s}`),t!==void 0&&l.append("archived",`${t}`),a!==void 0&&l.append("snoozed",`${a}`),h!==void 0&&l.append("seen",`${h}`),u!==void 0&&l.append("data",JSON.stringify(u)),c(this,P).get(Z,l,!1)}count({filters:e}){return c(this,P).get(`${Z}/count`,new URLSearchParams({filters:JSON.stringify(e)}),!1)}read(e){return c(this,P).patch(`${Z}/${e}/read`)}unread(e){return c(this,P).patch(`${Z}/${e}/unread`)}archive(e){return c(this,P).patch(`${Z}/${e}/archive`)}unarchive(e){return c(this,P).patch(`${Z}/${e}/unarchive`)}snooze(e,t){return c(this,P).patch(`${Z}/${e}/snooze`,{snoozeUntil:t})}unsnooze(e){return c(this,P).patch(`${Z}/${e}/unsnooze`)}readAll({tags:e,data:t}){return c(this,P).post(`${Z}/read`,{tags:e,data:t?JSON.stringify(t):void 0})}archiveAll({tags:e,data:t}){return c(this,P).post(`${Z}/archive`,{tags:e,data:t?JSON.stringify(t):void 0})}archiveAllRead({tags:e,data:t}){return c(this,P).post(`${Z}/read-archive`,{tags:e,data:t?JSON.stringify(t):void 0})}markAsSeen({notificationIds:e,tags:t,data:r}){return c(this,P).post(`${Z}/seen`,{notificationIds:e,tags:t,data:r?JSON.stringify(r):void 0})}seen(e){return this.markAsSeen({notificationIds:[e]})}completeAction({actionType:e,notificationId:t}){return c(this,P).patch(`${Z}/${t}/complete`,{actionType:e})}revertAction({actionType:e,notificationId:t}){return c(this,P).patch(`${Z}/${t}/revert`,{actionType:e})}fetchPreferences(e){let t=new URLSearchParams;e&&e.forEach(n=>t.append("tags[]",n));let r=t.size?`?${t.toString()}`:"";return c(this,P).get(`${ct}/preferences${r}`)}bulkUpdatePreferences(e){return c(this,P).patch(`${ct}/preferences/bulk`,{preferences:e})}updateGlobalPreferences(e){return c(this,P).patch(`${ct}/preferences`,e)}updateWorkflowPreferences({workflowId:e,channels:t}){return c(this,P).patch(`${ct}/preferences/${e}`,t)}triggerHelloWorldEvent(){let e={name:"hello-world",to:{subscriberId:"keyless-subscriber-id"},payload:{subject:"Novu Keyless Environment",body:"You're using a keyless demo environment. For full access to Novu features and cloud integration, obtain your API key.",primaryActionText:"Obtain API Key",primaryActionUrl:"https://go.novu.co/keyless",secondaryActionText:"Explore Documentation",secondaryActionUrl:"https://go.novu.co/keyless-docs"}};return c(this,P).post("/inbox/events",e)}};P=new WeakMap;function mn(i){return{all:i=i||new Map,on:function(e,t){var r=i.get(e);r?r.push(t):i.set(e,[t])},off:function(e,t){var r=i.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var r=i.get(e);r&&r.slice().map(function(n){n(t)}),(r=i.get("*"))&&r.slice().map(function(n){n(e,t)})}}}var Ye,hi=class{constructor(){S(this,Ye);w(this,Ye,mn())}on(e,t){return c(this,Ye).on(e,t),()=>{this.off(e,t)}}off(e,t){c(this,Ye).off(e,t)}emit(e,t){c(this,Ye).emit(e,t)}};Ye=new WeakMap;var A=class extends Error{constructor(e,t){super(e),this.originalError=t}};var fi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0},{emitter:i,apiService:e});try{i.emit("notification.read.pending",{args:t,data:s});let o=yield e.read(n),a=new U(o,i,e);return i.emit("notification.read.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.read.resolved",{args:t,error:o}),{error:new A("Failed to read notification",o)}}}),ui=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isRead:!1,readAt:null,isArchived:!1,archivedAt:void 0},{emitter:i,apiService:e});try{i.emit("notification.unread.pending",{args:t,data:s});let o=yield e.unread(n),a=new U(o,i,e);return i.emit("notification.unread.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.unread.resolved",{args:t,error:o}),{error:new A("Failed to unread notification",o)}}}),di=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isSeen:!0},{emitter:i,apiService:e});try{if(i.emit("notification.seen.pending",{args:t,data:s}),yield e.seen(n),!s)throw new Error("Failed to create optimistic value for notification");let o=new U(s,i,e);return i.emit("notification.seen.resolved",{args:t,data:o}),{data:o}}catch(o){return i.emit("notification.seen.resolved",{args:t,error:o}),{error:new A("Failed to mark notification as seen",o)}}}),pi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isArchived:!0,archivedAt:new Date().toISOString(),isRead:!0,readAt:new Date().toISOString()},{emitter:i,apiService:e});try{i.emit("notification.archive.pending",{args:t,data:s});let o=yield e.archive(n),a=new U(o,i,e);return i.emit("notification.archive.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.archive.resolved",{args:t,error:o}),{error:new A("Failed to archive notification",o)}}}),mi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isArchived:!1,archivedAt:null,isRead:!0,readAt:new Date().toISOString()},{emitter:i,apiService:e});try{i.emit("notification.unarchive.pending",{args:t,data:s});let o=yield e.unarchive(n),a=new U(o,i,e);return i.emit("notification.unarchive.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.unarchive.resolved",{args:t,error:o}),{error:new A("Failed to unarchive notification",o)}}}),gi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isSnoozed:!0,snoozedUntil:t.snoozeUntil},{emitter:i,apiService:e});try{i.emit("notification.snooze.pending",{args:t,data:s});let o=yield e.snooze(n,t.snoozeUntil),a=new U(o,i,e);return i.emit("notification.snooze.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.snooze.resolved",{args:t,error:o}),{error:new A("Failed to snooze notification",o)}}}),yi=r=>m(void 0,[r],function*({emitter:i,apiService:e,args:t}){let{notificationId:n,optimisticValue:s}=ke(t,{isSnoozed:!1,snoozedUntil:null},{emitter:i,apiService:e});try{i.emit("notification.unsnooze.pending",{args:t,data:s});let o=yield e.unsnooze(n),a=new U(o,i,e);return i.emit("notification.unsnooze.resolved",{args:t,data:a}),{data:a}}catch(o){return i.emit("notification.unsnooze.resolved",{args:t,error:o}),{error:new A("Failed to unsnooze notification",o)}}}),lt=n=>m(void 0,[n],function*({emitter:i,apiService:e,args:t,actionType:r}){let s=r==="primary"?{primaryAction:k(_({},"notification"in t?t.notification.primaryAction:{}),{isCompleted:!0})}:{secondaryAction:k(_({},"notification"in t?t.notification.secondaryAction:{}),{isCompleted:!0})},{notificationId:o,optimisticValue:a}=ke(t,s,{emitter:i,apiService:e});try{i.emit("notification.complete_action.pending",{args:t,data:a});let h=yield e.completeAction({actionType:r,notificationId:o}),u=new U(h,i,e);return i.emit("notification.complete_action.resolved",{args:t,data:u}),{data:u}}catch(h){return i.emit("notification.complete_action.resolved",{args:t,error:h}),{error:new A(`Failed to complete ${r} action on the notification`,h)}}}),ht=n=>m(void 0,[n],function*({emitter:i,apiService:e,args:t,actionType:r}){let s=r==="primary"?{primaryAction:k(_({},"notification"in t?t.notification.primaryAction:{}),{isCompleted:!1})}:{secondaryAction:k(_({},"notification"in t?t.notification.secondaryAction:{}),{isCompleted:!1})},{notificationId:o,optimisticValue:a}=ke(t,s,{emitter:i,apiService:e});try{i.emit("notification.revert_action.pending",{args:t,data:a});let h=yield e.revertAction({actionType:r,notificationId:o}),u=new U(h,i,e);return i.emit("notification.revert_action.resolved",{args:t,data:u}),{data:u}}catch(h){return i.emit("notification.revert_action.resolved",{args:t,error:h}),{error:new A("Failed to fetch notifications",h)}}}),ke=(i,e,t)=>"notification"in i?{notificationId:i.notification.id,optimisticValue:new U(_(_({},i.notification),e),t.emitter,t.apiService)}:{notificationId:i.notificationId},gn=s=>m(void 0,[s],function*({emitter:i,inboxService:e,notificationsCache:t,tags:r,data:n}){try{let a=t.getUniqueNotifications({tags:r,data:n}).map(h=>new U(k(_({},h),{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0}),i,e));return i.emit("notifications.read_all.pending",{args:{tags:r,data:n},data:a}),yield e.readAll({tags:r,data:n}),i.emit("notifications.read_all.resolved",{args:{tags:r,data:n},data:a}),{}}catch(o){return i.emit("notifications.read_all.resolved",{args:{tags:r,data:n},error:o}),{error:new A("Failed to read all notifications",o)}}}),hr=o=>m(void 0,[o],function*({emitter:i,inboxService:e,notificationsCache:t,notificationIds:r,tags:n,data:s}){try{let a=t.getUniqueNotifications({tags:n,data:s}),u=(r&&r.length>0?a.filter(l=>r.includes(l.id)):a).map(l=>new U(k(_({},l),{isSeen:!0,firstSeenAt:l.firstSeenAt||new Date().toISOString()}),i,e));return i.emit("notifications.seen_all.pending",{args:{notificationIds:r,tags:n,data:s},data:u}),yield e.markAsSeen({notificationIds:r,tags:n,data:s}),i.emit("notifications.seen_all.resolved",{args:{notificationIds:r,tags:n,data:s},data:u}),{}}catch(a){return i.emit("notifications.seen_all.resolved",{args:{notificationIds:r,tags:n,data:s},error:a}),{error:new A("Failed to mark all notifications as seen",a)}}}),yn=s=>m(void 0,[s],function*({emitter:i,inboxService:e,notificationsCache:t,tags:r,data:n}){try{let a=t.getUniqueNotifications({tags:r,data:n}).map(h=>new U(k(_({},h),{isRead:!0,readAt:new Date().toISOString(),isArchived:!0,archivedAt:new Date().toISOString()}),i,e));return i.emit("notifications.archive_all.pending",{args:{tags:r,data:n},data:a}),yield e.archiveAll({tags:r,data:n}),i.emit("notifications.archive_all.resolved",{args:{tags:r,data:n},data:a}),{}}catch(o){return i.emit("notifications.archive_all.resolved",{args:{tags:r,data:n},error:o}),{error:new A("Failed to archive all notifications",o)}}}),vn=s=>m(void 0,[s],function*({emitter:i,inboxService:e,notificationsCache:t,tags:r,data:n}){try{let a=t.getUniqueNotifications({tags:r,data:n,read:!0}).map(h=>new U(k(_({},h),{isArchived:!0,archivedAt:new Date().toISOString()}),i,e));return i.emit("notifications.archive_all_read.pending",{args:{tags:r,data:n},data:a}),yield e.archiveAllRead({tags:r,data:n}),i.emit("notifications.archive_all_read.resolved",{args:{tags:r,data:n},data:a}),{}}catch(o){return i.emit("notifications.archive_all_read.resolved",{args:{tags:r,data:n},error:o}),{error:new A("Failed to archive all read notifications",o)}}});var G,Q,U=class{constructor(e,t,r){S(this,G);S(this,Q);w(this,G,t),w(this,Q,r),this.id=e.id,this.transactionId=e.transactionId,this.subject=e.subject,this.body=e.body,this.to=e.to,this.isRead=e.isRead,this.isSeen=e.isSeen,this.isArchived=e.isArchived,this.isSnoozed=e.isSnoozed,this.snoozedUntil=e.snoozedUntil,this.deliveredAt=e.deliveredAt,this.createdAt=e.createdAt,this.readAt=e.readAt,this.firstSeenAt=e.firstSeenAt,this.archivedAt=e.archivedAt,this.avatar=e.avatar,this.primaryAction=e.primaryAction,this.secondaryAction=e.secondaryAction,this.channelType=e.channelType,this.tags=e.tags,this.redirect=e.redirect,this.data=e.data,this.workflow=e.workflow}read(){return fi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}unread(){return ui({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}seen(){return di({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}archive(){return pi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}unarchive(){return mi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}snooze(e){return gi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this,snoozeUntil:e}})}unsnooze(){return yi({emitter:c(this,G),apiService:c(this,Q),args:{notification:this}})}completePrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return lt({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"primary"})}completeSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return lt({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"secondary"})}revertPrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return ht({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"primary"})}revertSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return ht({emitter:c(this,G),apiService:c(this,Q),args:{notification:this},actionType:"secondary"})}on(e,t){let r=c(this,G).on(e,t);return()=>{r()}}off(e,t){c(this,G).off(e,t)}};G=new WeakMap,Q=new WeakMap;var Me,ft,Se=class{constructor({inboxServiceInstance:e,eventEmitterInstance:t}){S(this,Me,[]);S(this,ft);this._emitter=t,this._inboxService=e,this._emitter.on("session.initialize.resolved",({error:r,data:n})=>{n?(this.onSessionSuccess(n),c(this,Me).forEach(a=>m(this,[a],function*({fn:s,resolve:o}){o(yield s())})),w(this,Me,[])):r&&(this.onSessionError(r),w(this,ft,r),c(this,Me).forEach(({resolve:s})=>{s({error:new A("Failed to initialize session, please contact the support",r)})}),w(this,Me,[]))})}onSessionSuccess(e){}onSessionError(e){}callWithSession(e){return m(this,null,function*(){return this._inboxService.isSessionInitialized?e():c(this,ft)?Promise.resolve({error:new A("Failed to initialize session, please contact the support",c(this,ft))}):new Promise((t,r)=>{c(this,Me).push({fn:e,resolve:t,reject:r})})})}};Me=new WeakMap,ft=new WeakMap;var _n=(i,e)=>i===e?!0:!i||!e||i.length!==e.length?!1:i.every((t,r)=>t===e[r]);var ah=["seen","unseen"],ch=["read","unread"],fr=(i,e)=>_n(i,e)||!i&&(e==null?void 0:e.length)===0||(i==null?void 0:i.length)===0&&!e,ur=(i,e)=>{if(!i&&!e)return!0;if(!i||!e)return!1;try{return JSON.stringify(i)===JSON.stringify(e)}catch(t){return!1}},dr=(i,e)=>ur(i.data,e.data)&&fr(i.tags,e.tags)&&i.read===e.read&&i.archived===e.archived&&i.snoozed===e.snoozed&&i.seen===e.seen;var pe,ut=class{constructor(){S(this,pe);w(this,pe,new Map)}get(e){return c(this,pe).get(e)}getValues(){return Array.from(c(this,pe).values())}entries(){return Array.from(c(this,pe).entries())}keys(){return Array.from(c(this,pe).keys())}set(e,t){c(this,pe).set(e,t)}remove(e){c(this,pe).delete(e)}clear(){c(this,pe).clear()}};pe=new WeakMap;var En=({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h})=>Object.entries({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h}).filter(([u,l])=>l!=null&&!(Array.isArray(l)&&l.length===0)).reduce((u,[l,f])=>(u[l]=f,u),{}),pr=({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h})=>JSON.stringify(En({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s,limit:o,offset:a,after:h})),ea=({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s})=>JSON.stringify(En({tags:i,data:e,read:t,archived:r,snoozed:n,seen:s})),dt=i=>JSON.parse(i),ta=["notification.read.pending","notification.read.resolved","notification.unread.pending","notification.unread.resolved","notification.complete_action.pending","notification.complete_action.resolved","notification.revert_action.pending","notification.revert_action.resolved","notifications.read_all.pending","notifications.read_all.resolved"],ia=["notification.archive.pending","notification.unarchive.pending","notification.snooze.pending","notification.unsnooze.pending","notifications.archive_all.pending","notifications.archive_all_read.pending"],qe,$,Rt=class{constructor({emitter:e}){S(this,qe);S(this,$);this.updateNotification=(e,t)=>{let r=c(this,$).get(e);if(!r)return!1;let n=r.notifications.findIndex(o=>o.id===t.id);if(n===-1)return!1;let s=[...r.notifications];return s[n]=t,c(this,$).set(e,k(_({},r),{notifications:s})),!0};this.removeNotification=(e,t)=>{let r=c(this,$).get(e);if(!r)return!1;let n=r.notifications.findIndex(o=>o.id===t.id);if(n===-1)return!1;let s=[...r.notifications];return s.splice(n,1),c(this,$).set(e,k(_({},r),{notifications:s})),!0};this.handleNotificationEvent=({remove:e}={remove:!1})=>({data:t})=>{if(!t)return;let r=Array.isArray(t)?t:[t],n=new Set;c(this,$).keys().forEach(s=>{r.forEach(o=>{let a=!1;e?a=this.removeNotification(s,o):a=this.updateNotification(s,o),a&&n.add(ea(dt(s)))})}),n.forEach(s=>{let o=this.getAggregated(dt(s));c(this,qe).emit("notifications.list.updated",{data:o})})};w(this,qe,e),ta.forEach(t=>{c(this,qe).on(t,this.handleNotificationEvent())}),ia.forEach(t=>{c(this,qe).on(t,this.handleNotificationEvent({remove:!0}))}),w(this,$,new ut)}getAggregated(e){return c(this,$).keys().filter(r=>{let n=dt(r);return dr(n,e)}).map(r=>c(this,$).get(r)).reduce((r,n)=>n?{hasMore:n.hasMore,filter:n.filter,notifications:[...r.notifications,...n.notifications]}:r,{hasMore:!1,filter:{},notifications:[]})}has(e){return c(this,$).get(pr(e))!==void 0}set(e,t){c(this,$).set(pr(e),t)}update(e,t){this.set(e,t);let r=this.getAggregated(dt(pr(e)));c(this,qe).emit("notifications.list.updated",{data:r})}getAll(e){if(this.has(e))return this.getAggregated({tags:e.tags,data:e.data,read:e.read,snoozed:e.snoozed,archived:e.archived,seen:e.seen})}getUniqueNotifications({tags:e,read:t,data:r}){let n=c(this,$).keys(),s=new Map;return n.forEach(o=>{let a=dt(o);if(fr(e,a.tags)&&ur(r,a.data)){let h=c(this,$).get(o);if(!h)return;h.notifications.filter(u=>typeof t=="undefined"||t===u.isRead).forEach(u=>s.set(u.id,u))}}),Array.from(s.values())}clear(e){c(this,$).keys().forEach(r=>{dr(dt(r),e)&&c(this,$).remove(r)})}clearAll(){c(this,$).clear()}};qe=new WeakMap,$=new WeakMap;var Tt,vi=class extends Se{constructor({useCache:t,inboxServiceInstance:r,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:r});S(this,Tt);this.cache=new Rt({emitter:n}),w(this,Tt,t)}get inboxService(){return this._inboxService}list(){return m(this,arguments,function*(n={}){var s=n,{limit:t=10}=s,r=cr(s,["limit"]);return this.callWithSession(()=>m(this,null,function*(){let o=_({limit:t},r);try{let a="useCache"in o?o.useCache:c(this,Tt),h=a?this.cache.getAll(o):void 0;if(this._emitter.emit("notifications.list.pending",{args:o,data:h}),!h){let u=yield this._inboxService.fetchNotifications(_({limit:t},r));h={hasMore:u.hasMore,filter:u.filter,notifications:u.data.map(l=>new U(l,this._emitter,this._inboxService))},a&&(this.cache.set(o,h),h=this.cache.getAll(o))}return this._emitter.emit("notifications.list.resolved",{args:o,data:h}),{data:h}}catch(a){return this._emitter.emit("notifications.list.resolved",{args:o,error:a}),{error:new A("Failed to fetch notifications",a)}}}))})}count(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){let r=t&&"filters"in t?t.filters:[_({},t)];try{this._emitter.emit("notifications.count.pending",{args:t});let n=yield this._inboxService.count({filters:r}),s=t&&"filters"in t?{counts:n.data}:n.data[0];return this._emitter.emit("notifications.count.resolved",{args:t,data:s}),{data:s}}catch(n){return this._emitter.emit("notifications.count.resolved",{args:t,error:n}),{error:new A("Failed to count notifications",n)}}}))})}read(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return fi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}unread(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return ui({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}seen(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return di({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}archive(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return pi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}unarchive(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return mi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}snooze(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return gi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}unsnooze(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return yi({emitter:this._emitter,apiService:this._inboxService,args:t})}))})}completePrimary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return lt({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"primary"})}))})}completeSecondary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return lt({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"secondary"})}))})}revertPrimary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return ht({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"primary"})}))})}revertSecondary(t){return m(this,null,function*(){return this.callWithSession(()=>m(this,null,function*(){return ht({emitter:this._emitter,apiService:this._inboxService,args:t,actionType:"secondary"})}))})}readAll(){return m(this,arguments,function*({tags:t,data:r}={}){return this.callWithSession(()=>m(this,null,function*(){return gn({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:t,data:r})}))})}seenAll(){return m(this,arguments,function*(t={}){return this.callWithSession(()=>m(this,null,function*(){return"notificationIds"in t?hr({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,notificationIds:t.notificationIds}):hr({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:"tags"in t?t.tags:void 0,data:"data"in t?t.data:void 0})}))})}archiveAll(){return m(this,arguments,function*({tags:t,data:r}={}){return this.callWithSession(()=>m(this,null,function*(){return yn({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:t,data:r})}))})}archiveAllRead(){return m(this,arguments,function*({tags:t,data:r}={}){return this.callWithSession(()=>m(this,null,function*(){return vn({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:t,data:r})}))})}clearCache({filter:t}={}){return t?this.cache.clear(t!=null?t:{}):this.cache.clearAll()}triggerHelloWorldEvent(){return m(this,null,function*(){return this._inboxService.triggerHelloWorldEvent()})}};Tt=new WeakMap;var ra=["preference.update.pending","preference.update.resolved","preferences.bulk_update.pending","preferences.bulk_update.resolved"],na=({tags:i})=>Object.entries({tags:i}).reduce((e,[t,r])=>(r==null||Array.isArray(r)&&r.length===0||(e[t]=r),e),{}),mr=({tags:i})=>JSON.stringify(na({tags:i})),pt,re,_i=class{constructor({emitterInstance:e}){S(this,pt);S(this,re);this.updatePreference=(e,t)=>{let r=c(this,re).get(e);if(!r)return!1;let n=r.findIndex(o=>{var a,h;return((a=o.workflow)==null?void 0:a.id)===((h=t.workflow)==null?void 0:h.id)||o.level===t.level&&t.level==="global"});if(n===-1)return!1;let s=[...r];return s[n]=t,c(this,re).set(e,s),!0};this.handlePreferenceEvent=({data:e})=>{if(!e)return;let t=Array.isArray(e)?e:[e],r=new Set;c(this,re).keys().forEach(n=>{t.forEach(s=>{let o=this.updatePreference(n,s),a=c(this,re).get(n);!o||!a||r.add(n)})}),r.forEach(n=>{var s;c(this,pt).emit("preferences.list.updated",{data:(s=c(this,re).get(n))!=null?s:[]})})};w(this,pt,e),ra.forEach(t=>{c(this,pt).on(t,this.handlePreferenceEvent)}),w(this,re,new ut)}has(e){return c(this,re).get(mr(e))!==void 0}set(e,t){c(this,re).set(mr(e),t)}getAll(e){if(this.has(e))return c(this,re).get(mr(e))}clearAll(){c(this,re).clear()}};pt=new WeakMap,re=new WeakMap;var Ot,It,Pt,Lt,we=class{constructor(e,{emitterInstance:t,inboxServiceInstance:r,cache:n,useCache:s}){S(this,Ot);S(this,It);S(this,Pt);S(this,Lt);w(this,Ot,t),w(this,It,r),w(this,Pt,n),w(this,Lt,s),this.level=e.level,this.enabled=e.enabled,this.channels=e.channels,this.workflow=e.workflow}update({channels:e,channelPreferences:t}){var r;return Ei({emitter:c(this,Ot),apiService:c(this,It),cache:c(this,Pt),useCache:c(this,Lt),args:{workflowId:(r=this.workflow)==null?void 0:r.id,channels:e||t,preference:this}})}};Ot=new WeakMap,It=new WeakMap,Pt=new WeakMap,Lt=new WeakMap;var Ei=s=>m(void 0,[s],function*({emitter:i,apiService:e,cache:t,useCache:r,args:n}){var h;let{channels:o}=n,a="workflowId"in n?n.workflowId:(h=n.preference.workflow)==null?void 0:h.id;try{i.emit("preference.update.pending",{args:n,data:"preference"in n?new we(k(_({},n.preference),{channels:_(_({},n.preference.channels),o)}),{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}):void 0});let u;a?u=yield e.updateWorkflowPreferences({workflowId:a,channels:o}):(sa({emitter:i,apiService:e,cache:t,useCache:r,args:n}),u=yield e.updateGlobalPreferences(o));let l=new we(u,{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r});return i.emit("preference.update.resolved",{args:n,data:l}),{data:l}}catch(u){return i.emit("preference.update.resolved",{args:n,error:u}),{error:new A("Failed to update preference",u)}}}),Sn=s=>m(void 0,[s],function*({emitter:i,apiService:e,cache:t,useCache:r,args:n}){if(n.find(a=>"preference"in a&&a.preference.level==="global"))return{error:new A("Global preference is not supported in bulk update","")};try{let a=n.map(f=>"preference"in f?new we(k(_({},f.preference),{channels:_(_({},f.preference.channels),f.channels)}),{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}):void 0).filter(f=>f!==void 0);i.emit("preferences.bulk_update.pending",{args:n,data:a});let h=n.map(f=>{var p,d,b,g;return _({workflowId:"workflowId"in f?f.workflowId:(g=(b=(p=f.preference.workflow)==null?void 0:p.id)!=null?b:(d=f.preference.workflow)==null?void 0:d.identifier)!=null?g:""},f.channels)}),l=(yield e.bulkUpdatePreferences(h)).map(f=>new we(f,{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}));return i.emit("preferences.bulk_update.resolved",{args:n,data:l}),{data:l}}catch(a){return i.emit("preferences.bulk_update.resolved",{args:n,error:a}),{error:new A("Failed to bulk update preferences",a)}}}),sa=({emitter:i,apiService:e,cache:t,useCache:r,args:n})=>{let s=r?t==null?void 0:t.getAll({}):void 0;s==null||s.forEach(o=>{var a,h;if(o.level==="template"){let u=k(_({},o),{channels:Object.entries(o.channels).reduce((f,[p,d])=>{var g;let b=p;return f[b]=(g=n.channels[b])!=null?g:d,f},{})}),l="preference"in n?new we(u,{emitterInstance:i,inboxServiceInstance:e,cache:t,useCache:r}):void 0;l&&i.emit("preference.update.pending",{args:{workflowId:(h=(a=o.workflow)==null?void 0:a.id)!=null?h:"",channels:l.channels},data:l})}})};var Ae,Si=class extends Se{constructor({useCache:t,inboxServiceInstance:r,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:r});S(this,Ae);this.cache=new _i({emitterInstance:this._emitter}),w(this,Ae,t)}list(){return m(this,arguments,function*(t={}){return this.callWithSession(()=>m(this,null,function*(){try{let r=c(this,Ae)?this.cache.getAll(t):void 0;return this._emitter.emit("preferences.list.pending",{args:t,data:r}),r||(r=(yield this._inboxService.fetchPreferences(t.tags)).map(s=>new we(s,{emitterInstance:this._emitter,inboxServiceInstance:this._inboxService,cache:this.cache,useCache:c(this,Ae)})),c(this,Ae)&&(this.cache.set(t,r),r=this.cache.getAll(t))),this._emitter.emit("preferences.list.resolved",{args:t,data:r}),{data:r}}catch(r){throw this._emitter.emit("preferences.list.resolved",{args:t,error:r}),r}}))})}update(t){return m(this,null,function*(){return this.callWithSession(()=>Ei({emitter:this._emitter,apiService:this._inboxService,cache:this.cache,useCache:c(this,Ae),args:t}))})}bulkUpdate(t){return m(this,null,function*(){return this.callWithSession(()=>Sn({emitter:this._emitter,apiService:this._inboxService,cache:this.cache,useCache:c(this,Ae),args:t}))})}};Ae=new WeakMap;function wn(){return typeof window!="undefined"}var Je,Ft,fe,wi=class{constructor(e,t,r){S(this,Je);S(this,Ft);S(this,fe);w(this,Je,r),w(this,Ft,t),w(this,fe,e)}get applicationIdentifier(){return c(this,fe).applicationIdentifier}get subscriberId(){var e;return(e=c(this,fe).subscriber)==null?void 0:e.subscriberId}handleApplicationIdentifier(e,t){if(typeof window=="undefined"||!window.localStorage)return null;let r="novu_keyless_application_identifier";switch(e){case"get":return window.localStorage.getItem(r);case"store":return t&&window.localStorage.setItem(r,t),null;case"delete":return window.localStorage.removeItem(r),null;default:return null}}initialize(e){return m(this,null,function*(){var t,r,n,s,o,a;if(((t=c(this,fe).subscriber)==null?void 0:t.subscriberId)!==((r=e==null?void 0:e.subscriber)==null?void 0:r.subscriberId))try{e&&w(this,fe,e);let{subscriber:h,subscriberHash:u,applicationIdentifier:l}=c(this,fe),f;wn()&&(f=Intl.DateTimeFormat().resolvedOptions().timeZone);let p=l;if(p)this.handleApplicationIdentifier("delete");else{let b=this.handleApplicationIdentifier("get");b&&(p=b)}c(this,Je).emit("session.initialize.pending",{args:c(this,fe)});let d=yield c(this,Ft).initializeSession({applicationIdentifier:p,subscriberHash:u,subscriber:k(_({},h),{subscriberId:(n=h==null?void 0:h.subscriberId)!=null?n:"",timezone:(s=h==null?void 0:h.timezone)!=null?s:f})});(o=d==null?void 0:d.applicationIdentifier)!=null&&o.startsWith("pk_keyless_")&&this.handleApplicationIdentifier("store",d.applicationIdentifier),(a=d==null?void 0:d.applicationIdentifier)!=null&&a.startsWith("pk_keyless_")||this.handleApplicationIdentifier("delete"),c(this,Je).emit("session.initialize.resolved",{args:c(this,fe),data:d})}catch(h){c(this,Je).emit("session.initialize.resolved",{args:c(this,fe),error:h})}})}};Je=new WeakMap,Ft=new WeakMap,fe=new WeakMap;function bn({subscriberId:i,subscriber:e}){return e?typeof e=="string"?{subscriberId:e}:e:i?{subscriberId:i}:{subscriberId:""}}(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
17
17
  PartySocket requires a global 'EventTarget' class to be available!
18
18
  You can polyfill this global by adding this to your code before any partysocket imports:
19
19
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novu/js",
3
- "version": "3.8.1",
3
+ "version": "3.8.2",
4
4
  "repository": "https://github.com/novuhq/novu",
5
5
  "description": "Novu JavaScript SDK for <Inbox />",
6
6
  "author": "",