@rpcbase/client 0.458.0 → 0.460.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -416,7 +416,7 @@ function _temp4$1() {
416
416
  function _temp5$1() {
417
417
  return startToaster();
418
418
  }
419
- function _temp6() {
419
+ function _temp6$1() {
420
420
  return startToaster();
421
421
  }
422
422
  function _temp7() {
@@ -426,7 +426,7 @@ function _temp7() {
426
426
  });
427
427
  return;
428
428
  }
429
- window.setTimeout(_temp6, 150);
429
+ window.setTimeout(_temp6$1, 150);
430
430
  }
431
431
  function _temp8() {
432
432
  if (typeof window === "undefined") {
@@ -2566,12 +2566,15 @@ const toIso = (value) => {
2566
2566
  return void 0;
2567
2567
  };
2568
2568
  const toNotificationItem = (doc) => {
2569
- const id = typeof doc._id === "string" ? doc._id : String(doc._id ?? "");
2569
+ const rawId = doc.notificationId ?? doc._id;
2570
+ const id = typeof rawId === "string" ? rawId : String(rawId ?? "");
2570
2571
  if (!id) return null;
2571
2572
  if (typeof doc.title !== "string") return null;
2572
2573
  return {
2573
2574
  id,
2574
2575
  topic: typeof doc.topic === "string" ? doc.topic : void 0,
2576
+ tag: typeof doc.tag === "string" ? doc.tag : void 0,
2577
+ deliveryId: typeof doc.deliveryId === "string" ? doc.deliveryId : void 0,
2575
2578
  title: doc.title,
2576
2579
  body: doc.body,
2577
2580
  image: doc.image,
@@ -2643,6 +2646,7 @@ const getScopedNotificationKey = (userId, appName) => `${encodeURIComponent(appN
2643
2646
  const getTabStateKey = (userId, appName) => `${TAB_STATE_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}:${NOTIFICATION_TAB_ID}`;
2644
2647
  const getTabStateKeyPrefix = (userId, appName) => `${TAB_STATE_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}:`;
2645
2648
  const getDeliveryKey = (userId, appName, mode, notificationId) => `${DELIVERY_KEY_PREFIX}${mode}:${getScopedNotificationKey(userId, appName)}:${encodeURIComponent(notificationId)}`;
2649
+ const getNotificationDeliveryId = (item) => item.deliveryId ?? `${item.id}:${item.createdAt}`;
2646
2650
  const getDeliveryLockName = (userId, appName) => `${DELIVERY_LOCK_PREFIX}${getScopedNotificationKey(userId, appName)}`;
2647
2651
  const getFallbackDeliveryLockKey = (userId, appName) => `${FALLBACK_DELIVERY_LOCK_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}`;
2648
2652
  const getLocalStorage = () => {
@@ -2733,20 +2737,20 @@ const removeNotificationDeliveryMarkers = (items, userId, appName, mode) => {
2733
2737
  if (!storage) return;
2734
2738
  try {
2735
2739
  for (const item of items) {
2736
- storage.removeItem(getDeliveryKey(userId, appName, mode, item.id));
2740
+ storage.removeItem(getDeliveryKey(userId, appName, mode, getNotificationDeliveryId(item)));
2737
2741
  }
2738
2742
  } catch {
2739
2743
  return;
2740
2744
  }
2741
2745
  };
2742
- const filterNotificationsWithoutDelivery = (items, userId, appName, mode) => items.filter((item) => !hasRecentNotificationDelivery(userId, appName, mode, item.id));
2746
+ const filterNotificationsWithoutDelivery = (items, userId, appName, mode) => items.filter((item) => !hasRecentNotificationDelivery(userId, appName, mode, getNotificationDeliveryId(item)));
2743
2747
  const claimNotificationDeliveriesFromStorage = (items, userId, appName, mode) => {
2744
2748
  const storage = getLocalStorage();
2745
2749
  if (!storage) return items;
2746
2750
  const now = Date.now();
2747
2751
  const claimed = [];
2748
2752
  for (const item of items) {
2749
- const key = getDeliveryKey(userId, appName, mode, item.id);
2753
+ const key = getDeliveryKey(userId, appName, mode, getNotificationDeliveryId(item));
2750
2754
  const current = parseJsonRecord(storage.getItem(key));
2751
2755
  const deliveredAt = typeof current?.deliveredAt === "number" ? current.deliveredAt : 0;
2752
2756
  if (deliveredAt && now - deliveredAt < DELIVERY_TTL_MS) continue;
@@ -2891,7 +2895,7 @@ const getNativeNotificationOptions = (item) => {
2891
2895
  return {
2892
2896
  body: item.body,
2893
2897
  icon: item.image,
2894
- tag: `${NATIVE_NOTIFICATION_TAG_PREFIX}:${item.id}`,
2898
+ tag: `${NATIVE_NOTIFICATION_TAG_PREFIX}:${encodeURIComponent(getNotificationDeliveryId(item))}`,
2895
2899
  data: {
2896
2900
  ...item.data,
2897
2901
  notificationId: item.id,
@@ -2969,12 +2973,12 @@ const flushPendingInAppToasts = (pendingInAppToastItems, userId, appName, render
2969
2973
  };
2970
2974
  const queuePendingInAppToasts = (pendingInAppToastItems, items, userId, appName, renderNotificationToast) => {
2971
2975
  for (const item of items) {
2972
- pendingInAppToastItems.current.set(item.id, item);
2976
+ pendingInAppToastItems.current.set(getNotificationDeliveryId(item), item);
2973
2977
  }
2974
2978
  flushPendingInAppToasts(pendingInAppToastItems, userId, appName, renderNotificationToast);
2975
2979
  };
2976
2980
  function NotificationsRealtimeProvider(t0) {
2977
- const $ = c(66);
2981
+ const $ = c(73);
2978
2982
  const {
2979
2983
  userId,
2980
2984
  appName,
@@ -3113,99 +3117,148 @@ function NotificationsRealtimeProvider(t0) {
3113
3117
  }
3114
3118
  const notificationsQuery = useQuery("RBNotification", query, t10);
3115
3119
  let t11;
3120
+ if ($[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3121
+ t11 = {
3122
+ createdAt: -1
3123
+ };
3124
+ $[22] = t11;
3125
+ } else {
3126
+ t11 = $[22];
3127
+ }
3128
+ let t12;
3129
+ if ($[23] !== canUseRts || $[24] !== limit) {
3130
+ t12 = {
3131
+ key: "rb.notification-deliveries",
3132
+ sort: t11,
3133
+ limit,
3134
+ enabled: canUseRts
3135
+ };
3136
+ $[23] = canUseRts;
3137
+ $[24] = limit;
3138
+ $[25] = t12;
3139
+ } else {
3140
+ t12 = $[25];
3141
+ }
3142
+ const notificationDeliveriesQuery = useQuery("RBNotificationDelivery", query, t12);
3143
+ let t13;
3116
3144
  bb1: {
3117
3145
  const raw = notificationsQuery.data;
3118
3146
  if (!Array.isArray(raw)) {
3119
- let t123;
3120
- if ($[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3121
- t123 = [];
3122
- $[22] = t123;
3147
+ let t143;
3148
+ if ($[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3149
+ t143 = [];
3150
+ $[26] = t143;
3123
3151
  } else {
3124
- t123 = $[22];
3152
+ t143 = $[26];
3125
3153
  }
3126
- t11 = t123;
3154
+ t13 = t143;
3127
3155
  break bb1;
3128
3156
  }
3129
- let t122;
3130
- if ($[23] !== raw) {
3131
- t122 = raw.map(_temp).filter(_temp2);
3132
- $[23] = raw;
3133
- $[24] = t122;
3157
+ let t142;
3158
+ if ($[27] !== raw) {
3159
+ t142 = raw.map(_temp).filter(_temp2);
3160
+ $[27] = raw;
3161
+ $[28] = t142;
3134
3162
  } else {
3135
- t122 = $[24];
3163
+ t142 = $[28];
3136
3164
  }
3137
- t11 = t122;
3165
+ t13 = t142;
3138
3166
  }
3139
- const notifications = t11;
3140
- let t12;
3141
- if ($[25] !== notifications) {
3142
- t12 = notifications.reduce(_temp3, 0);
3143
- $[25] = notifications;
3144
- $[26] = t12;
3167
+ const notifications = t13;
3168
+ let t14;
3169
+ bb2: {
3170
+ const raw_0 = notificationDeliveriesQuery.data;
3171
+ if (!Array.isArray(raw_0)) {
3172
+ let t153;
3173
+ if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3174
+ t153 = [];
3175
+ $[29] = t153;
3176
+ } else {
3177
+ t153 = $[29];
3178
+ }
3179
+ t14 = t153;
3180
+ break bb2;
3181
+ }
3182
+ let t152;
3183
+ if ($[30] !== raw_0) {
3184
+ t152 = raw_0.map(_temp3).filter(_temp4);
3185
+ $[30] = raw_0;
3186
+ $[31] = t152;
3187
+ } else {
3188
+ t152 = $[31];
3189
+ }
3190
+ t14 = t152;
3191
+ }
3192
+ const notificationDeliveries = t14;
3193
+ let t15;
3194
+ if ($[32] !== notifications) {
3195
+ t15 = notifications.reduce(_temp5, 0);
3196
+ $[32] = notifications;
3197
+ $[33] = t15;
3145
3198
  } else {
3146
- t12 = $[26];
3199
+ t15 = $[33];
3147
3200
  }
3148
- const unreadCount = t12;
3149
- let t13;
3150
- if ($[27] !== notifications) {
3151
- t13 = notifications.reduce(_temp4, 0);
3152
- $[27] = notifications;
3153
- $[28] = t13;
3201
+ const unreadCount = t15;
3202
+ let t16;
3203
+ if ($[34] !== notifications) {
3204
+ t16 = notifications.reduce(_temp6, 0);
3205
+ $[34] = notifications;
3206
+ $[35] = t16;
3154
3207
  } else {
3155
- t13 = $[28];
3208
+ t16 = $[35];
3156
3209
  }
3157
- const unseenCount = t13;
3158
- let t14;
3159
- if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3160
- t14 = /* @__PURE__ */ new Set();
3161
- $[29] = t14;
3210
+ const unseenCount = t16;
3211
+ let t17;
3212
+ if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3213
+ t17 = /* @__PURE__ */ new Set();
3214
+ $[36] = t17;
3162
3215
  } else {
3163
- t14 = $[29];
3216
+ t17 = $[36];
3164
3217
  }
3165
- const lastToastIds = useRef(t14);
3218
+ const lastToastDeliveryIds = useRef(t17);
3166
3219
  const hasSeededToastIds = useRef(false);
3167
- let t15;
3168
- if ($[30] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3169
- t15 = Date.now();
3170
- $[30] = t15;
3220
+ let t18;
3221
+ if ($[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3222
+ t18 = Date.now();
3223
+ $[37] = t18;
3171
3224
  } else {
3172
- t15 = $[30];
3225
+ t18 = $[37];
3173
3226
  }
3174
- const toastStartMs = useRef(t15);
3175
- let t16;
3176
- if ($[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3177
- t16 = /* @__PURE__ */ new Map();
3178
- $[31] = t16;
3227
+ const toastStartMs = useRef(t18);
3228
+ let t19;
3229
+ if ($[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3230
+ t19 = /* @__PURE__ */ new Map();
3231
+ $[38] = t19;
3179
3232
  } else {
3180
- t16 = $[31];
3233
+ t19 = $[38];
3181
3234
  }
3182
- const pendingInAppToastItems = useRef(t16);
3183
- let t17;
3184
- if ($[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3185
- t17 = () => {
3235
+ const pendingInAppToastItems = useRef(t19);
3236
+ let t20;
3237
+ if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3238
+ t20 = () => {
3186
3239
  hasSeededToastIds.current = false;
3187
- lastToastIds.current = /* @__PURE__ */ new Set();
3240
+ lastToastDeliveryIds.current = /* @__PURE__ */ new Set();
3188
3241
  toastStartMs.current = Date.now();
3189
3242
  pendingInAppToastItems.current = /* @__PURE__ */ new Map();
3190
3243
  };
3191
- $[32] = t17;
3244
+ $[39] = t20;
3192
3245
  } else {
3193
- t17 = $[32];
3246
+ t20 = $[39];
3194
3247
  }
3195
- let t18;
3196
- if ($[33] !== normalizedAppName || $[34] !== trimmedUserId) {
3197
- t18 = [normalizedAppName, trimmedUserId];
3198
- $[33] = normalizedAppName;
3199
- $[34] = trimmedUserId;
3200
- $[35] = t18;
3248
+ let t21;
3249
+ if ($[40] !== normalizedAppName || $[41] !== trimmedUserId) {
3250
+ t21 = [normalizedAppName, trimmedUserId];
3251
+ $[40] = normalizedAppName;
3252
+ $[41] = trimmedUserId;
3253
+ $[42] = t21;
3201
3254
  } else {
3202
- t18 = $[35];
3255
+ t21 = $[42];
3203
3256
  }
3204
- useEffect(t17, t18);
3205
- let t19;
3206
- let t20;
3207
- if ($[36] !== canUseRts || $[37] !== normalizedAppName || $[38] !== trimmedUserId) {
3208
- t19 = () => {
3257
+ useEffect(t20, t21);
3258
+ let t22;
3259
+ let t23;
3260
+ if ($[43] !== canUseRts || $[44] !== normalizedAppName || $[45] !== trimmedUserId) {
3261
+ t22 = () => {
3209
3262
  if (!canUseRts) {
3210
3263
  return;
3211
3264
  }
@@ -3231,21 +3284,21 @@ function NotificationsRealtimeProvider(t0) {
3231
3284
  removeState();
3232
3285
  };
3233
3286
  };
3234
- t20 = [canUseRts, normalizedAppName, trimmedUserId];
3235
- $[36] = canUseRts;
3236
- $[37] = normalizedAppName;
3237
- $[38] = trimmedUserId;
3238
- $[39] = t19;
3239
- $[40] = t20;
3287
+ t23 = [canUseRts, normalizedAppName, trimmedUserId];
3288
+ $[43] = canUseRts;
3289
+ $[44] = normalizedAppName;
3290
+ $[45] = trimmedUserId;
3291
+ $[46] = t22;
3292
+ $[47] = t23;
3240
3293
  } else {
3241
- t19 = $[39];
3242
- t20 = $[40];
3294
+ t22 = $[46];
3295
+ t23 = $[47];
3243
3296
  }
3244
- useEffect(t19, t20);
3245
- let t21;
3246
- let t22;
3247
- if ($[41] !== canUseRts || $[42] !== normalizedAppName || $[43] !== renderNotificationToast || $[44] !== trimmedUserId) {
3248
- t21 = () => {
3297
+ useEffect(t22, t23);
3298
+ let t24;
3299
+ let t25;
3300
+ if ($[48] !== canUseRts || $[49] !== normalizedAppName || $[50] !== renderNotificationToast || $[51] !== trimmedUserId) {
3301
+ t24 = () => {
3249
3302
  if (!canUseRts) {
3250
3303
  return;
3251
3304
  }
@@ -3262,35 +3315,35 @@ function NotificationsRealtimeProvider(t0) {
3262
3315
  document.removeEventListener("visibilitychange", handlePendingInAppToastFlush);
3263
3316
  };
3264
3317
  };
3265
- t22 = [canUseRts, normalizedAppName, renderNotificationToast, trimmedUserId];
3266
- $[41] = canUseRts;
3267
- $[42] = normalizedAppName;
3268
- $[43] = renderNotificationToast;
3269
- $[44] = trimmedUserId;
3270
- $[45] = t21;
3271
- $[46] = t22;
3318
+ t25 = [canUseRts, normalizedAppName, renderNotificationToast, trimmedUserId];
3319
+ $[48] = canUseRts;
3320
+ $[49] = normalizedAppName;
3321
+ $[50] = renderNotificationToast;
3322
+ $[51] = trimmedUserId;
3323
+ $[52] = t24;
3324
+ $[53] = t25;
3272
3325
  } else {
3273
- t21 = $[45];
3274
- t22 = $[46];
3326
+ t24 = $[52];
3327
+ t25 = $[53];
3275
3328
  }
3276
- useEffect(t21, t22);
3277
- let t23;
3278
- let t24;
3279
- if ($[47] !== canUseRts || $[48] !== normalizedAppName || $[49] !== notifications || $[50] !== notificationsQuery.loading || $[51] !== renderNotificationToast || $[52] !== toastOnNew || $[53] !== trimmedUserId) {
3280
- t23 = () => {
3329
+ useEffect(t24, t25);
3330
+ let t26;
3331
+ let t27;
3332
+ if ($[54] !== canUseRts || $[55] !== normalizedAppName || $[56] !== notificationDeliveries || $[57] !== notificationDeliveriesQuery.loading || $[58] !== renderNotificationToast || $[59] !== toastOnNew || $[60] !== trimmedUserId) {
3333
+ t26 = () => {
3281
3334
  if (!toastOnNew) {
3282
3335
  return;
3283
3336
  }
3284
3337
  if (!canUseRts) {
3285
3338
  return;
3286
3339
  }
3287
- if (notificationsQuery.loading) {
3340
+ if (notificationDeliveriesQuery.loading) {
3288
3341
  return;
3289
3342
  }
3290
3343
  if (!hasSeededToastIds.current) {
3291
3344
  hasSeededToastIds.current = true;
3292
- lastToastIds.current = new Set(notifications.map(_temp5));
3293
- const eligible = notifications.filter((n_3) => {
3345
+ lastToastDeliveryIds.current = new Set(notificationDeliveries.map(getNotificationDeliveryId));
3346
+ const eligible = notificationDeliveries.filter((n_3) => {
3294
3347
  const createdAtMs = Date.parse(n_3.createdAt);
3295
3348
  if (!Number.isFinite(createdAtMs)) {
3296
3349
  return false;
@@ -3304,12 +3357,12 @@ function NotificationsRealtimeProvider(t0) {
3304
3357
  }
3305
3358
  return;
3306
3359
  }
3307
- const nextNew = notifications.filter((n_4) => !lastToastIds.current.has(n_4.id));
3360
+ const nextNew = notificationDeliveries.filter((n_4) => !lastToastDeliveryIds.current.has(getNotificationDeliveryId(n_4)));
3308
3361
  if (!nextNew.length) {
3309
3362
  return;
3310
3363
  }
3311
3364
  for (const n_5 of nextNew) {
3312
- lastToastIds.current.add(n_5.id);
3365
+ lastToastDeliveryIds.current.add(getNotificationDeliveryId(n_5));
3313
3366
  }
3314
3367
  const eligible_0 = nextNew.filter((n_6) => {
3315
3368
  const createdAtMs_0 = Date.parse(n_6.createdAt);
@@ -3325,70 +3378,73 @@ function NotificationsRealtimeProvider(t0) {
3325
3378
  queuePendingInAppToasts(pendingInAppToastItems, pending_0, trimmedUserId, normalizedAppName, renderNotificationToast);
3326
3379
  });
3327
3380
  };
3328
- t24 = [canUseRts, normalizedAppName, notifications, notificationsQuery.loading, renderNotificationToast, toastOnNew, trimmedUserId];
3329
- $[47] = canUseRts;
3330
- $[48] = normalizedAppName;
3331
- $[49] = notifications;
3332
- $[50] = notificationsQuery.loading;
3333
- $[51] = renderNotificationToast;
3334
- $[52] = toastOnNew;
3335
- $[53] = trimmedUserId;
3336
- $[54] = t23;
3337
- $[55] = t24;
3381
+ t27 = [canUseRts, normalizedAppName, notificationDeliveries, notificationDeliveriesQuery.loading, renderNotificationToast, toastOnNew, trimmedUserId];
3382
+ $[54] = canUseRts;
3383
+ $[55] = normalizedAppName;
3384
+ $[56] = notificationDeliveries;
3385
+ $[57] = notificationDeliveriesQuery.loading;
3386
+ $[58] = renderNotificationToast;
3387
+ $[59] = toastOnNew;
3388
+ $[60] = trimmedUserId;
3389
+ $[61] = t26;
3390
+ $[62] = t27;
3338
3391
  } else {
3339
- t23 = $[54];
3340
- t24 = $[55];
3392
+ t26 = $[61];
3393
+ t27 = $[62];
3341
3394
  }
3342
- useEffect(t23, t24);
3343
- let t25;
3344
- if ($[56] !== notifications || $[57] !== notificationsQuery.error || $[58] !== notificationsQuery.loading || $[59] !== unreadCount || $[60] !== unseenCount) {
3345
- t25 = {
3395
+ useEffect(t26, t27);
3396
+ let t28;
3397
+ if ($[63] !== notifications || $[64] !== notificationsQuery.error || $[65] !== notificationsQuery.loading || $[66] !== unreadCount || $[67] !== unseenCount) {
3398
+ t28 = {
3346
3399
  notifications,
3347
3400
  unreadCount,
3348
3401
  unseenCount,
3349
3402
  loading: notificationsQuery.loading,
3350
3403
  error: notificationsQuery.error
3351
3404
  };
3352
- $[56] = notifications;
3353
- $[57] = notificationsQuery.error;
3354
- $[58] = notificationsQuery.loading;
3355
- $[59] = unreadCount;
3356
- $[60] = unseenCount;
3357
- $[61] = t25;
3405
+ $[63] = notifications;
3406
+ $[64] = notificationsQuery.error;
3407
+ $[65] = notificationsQuery.loading;
3408
+ $[66] = unreadCount;
3409
+ $[67] = unseenCount;
3410
+ $[68] = t28;
3358
3411
  } else {
3359
- t25 = $[61];
3360
- }
3361
- const value = t25;
3362
- const t26 = canUseRts ? value : null;
3363
- let t27;
3364
- if ($[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3365
- t27 = /* @__PURE__ */ jsx("style", { children: notificationToastStyles });
3366
- $[62] = t27;
3412
+ t28 = $[68];
3413
+ }
3414
+ const value = t28;
3415
+ const t29 = canUseRts ? value : null;
3416
+ let t30;
3417
+ if ($[69] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3418
+ t30 = /* @__PURE__ */ jsx("style", { children: notificationToastStyles });
3419
+ $[69] = t30;
3367
3420
  } else {
3368
- t27 = $[62];
3421
+ t30 = $[69];
3369
3422
  }
3370
- let t28;
3371
- if ($[63] !== children || $[64] !== t26) {
3372
- t28 = /* @__PURE__ */ jsxs(NotificationsRealtimeContext.Provider, { value: t26, children: [
3373
- t27,
3423
+ let t31;
3424
+ if ($[70] !== children || $[71] !== t29) {
3425
+ t31 = /* @__PURE__ */ jsxs(NotificationsRealtimeContext.Provider, { value: t29, children: [
3426
+ t30,
3374
3427
  children
3375
3428
  ] });
3376
- $[63] = children;
3377
- $[64] = t26;
3378
- $[65] = t28;
3429
+ $[70] = children;
3430
+ $[71] = t29;
3431
+ $[72] = t31;
3379
3432
  } else {
3380
- t28 = $[65];
3433
+ t31 = $[72];
3381
3434
  }
3382
- return t28;
3435
+ return t31;
3436
+ }
3437
+ function _temp6(acc_0, n_2) {
3438
+ return acc_0 + (n_2.seenAt ? 0 : 1);
3383
3439
  }
3384
- function _temp5(n_2) {
3385
- return n_2.id;
3440
+ function _temp5(acc, n_1) {
3441
+ return acc + (n_1.readAt ? 0 : 1);
3386
3442
  }
3387
- function _temp4(acc_0, n_1) {
3388
- return acc_0 + (n_1.seenAt ? 0 : 1);
3443
+ function _temp4(n_0) {
3444
+ return Boolean(n_0);
3389
3445
  }
3390
- function _temp3(acc, n_0) {
3391
- return acc + (n_0.readAt ? 0 : 1);
3446
+ function _temp3(doc_0) {
3447
+ return toNotificationItem(doc_0);
3392
3448
  }
3393
3449
  function _temp2(n) {
3394
3450
  return Boolean(n);