@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/add-circle-icon_21.entry-125b87a0.js +1719 -0
  2. package/dist/add-circle-icon_21.entry-1a699a29.cjs +1 -0
  3. package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-70efea56.js} +19 -19
  4. package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-a69d3d98.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-0a07d7cc.cjs} +1 -1
  6. package/dist/{arrow-icon.entry-8b2e96a6.js → arrow-icon.entry-c9230436.js} +2 -2
  7. package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-54ff7799.js} +4 -4
  8. package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-f7df4331.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-71cc68e2.cjs} +1 -1
  10. package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-e5157332.js} +5 -5
  11. package/dist/calendar-check-icon_2.entry-f02bf0fe.cjs +1 -0
  12. package/dist/calendar-check-icon_2.entry-f75ef95e.js +25 -0
  13. package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-67aa69f5.js} +5 -5
  14. package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-a164e957.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-7687ca7a.cjs +1 -0
  16. package/dist/chevron-icon_3.entry-81c68946.js +117 -0
  17. package/dist/close-icon.entry-147b4d47.cjs +1 -0
  18. package/dist/close-icon.entry-3325a08e.js +15 -0
  19. package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-f34b9c6e-21ac1910.js} +1665 -2374
  20. package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-f34b9c6e-99030371.cjs} +6 -6
  21. package/dist/{document-refresh-icon.entry-9083a2e9.js → document-refresh-icon.entry-1b076630.js} +5 -5
  22. package/dist/document-refresh-icon.entry-dea23e07.cjs +1 -0
  23. package/dist/elements/index.d.ts +32 -2
  24. package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-83c23e9b.cjs} +1 -1
  25. package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-c69d1f8a.js} +1 -1
  26. package/dist/focus-visible-e8093c16-3082af2c.cjs +1 -0
  27. package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-a6aff071.js} +5 -3
  28. package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-55fce1ca.js} +83 -85
  29. package/dist/forward-icon_6.entry-59c7a975.cjs +3 -0
  30. package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-25145785.js} +4 -4
  31. package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-904f180f.cjs} +1 -1
  32. package/dist/google-logo-icon_4.entry-1f7b9522.js +387 -0
  33. package/dist/google-logo-icon_4.entry-feb7a561.cjs +1 -0
  34. package/dist/index-5f0940e0.cjs +37 -0
  35. package/dist/index-fd39ea9d.js +4042 -0
  36. package/dist/index.d.ts +3 -1
  37. package/dist/index.es-be19d2df-9ba9a7a6.cjs +7 -0
  38. package/dist/{index-b30d446a-a90f84b2.js → index.es-be19d2df-ff4f0a10.js} +945 -1041
  39. package/dist/info-icon_2.entry-0e2105da.js +34 -0
  40. package/dist/info-icon_2.entry-808e6516.cjs +1 -0
  41. package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-17efa7ca.cjs} +1 -1
  42. package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-a3b845bf.js} +2 -2
  43. package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-76540d24-5f0d1dff.js} +2 -2
  44. package/dist/mailbox-store-76540d24-ad0e366a.cjs +1 -0
  45. package/dist/nylas-additional-participants.entry-4120ea2e.js +81 -0
  46. package/dist/nylas-additional-participants.entry-7e2446cb.cjs +1 -0
  47. package/dist/nylas-booked-event-card_10.entry-44812e35.cjs +1 -0
  48. package/dist/nylas-booked-event-card_10.entry-5e87b199.js +805 -0
  49. package/dist/nylas-custom-booking-flow.entry-cbff44c8.js +106 -0
  50. package/dist/nylas-custom-booking-flow.entry-da5e66bb.cjs +1 -0
  51. package/dist/nylas-form-card.entry-1c608edd.js +54 -0
  52. package/dist/nylas-form-card.entry-2e629e36.cjs +1 -0
  53. package/dist/nylas-if-state.entry-2c0d8724.js +94 -0
  54. package/dist/nylas-if-state.entry-61771f3d.cjs +1 -0
  55. package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-d6e085b0.js} +10 -11
  56. package/dist/nylas-list-folders.entry-fa8e8ce9.cjs +1 -0
  57. package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-4dd2de0a.js} +5 -6
  58. package/dist/nylas-list-threads.entry-99fc0baa.cjs +1 -0
  59. package/dist/nylas-login.entry-0ec0813c.cjs +1 -0
  60. package/dist/nylas-login.entry-6730e226.js +73 -0
  61. package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-5310880c.js} +7 -8
  62. package/dist/nylas-mailbox-pagination.entry-e3e52f42.cjs +1 -0
  63. package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-028075db.js} +15 -16
  64. package/dist/nylas-mailbox-toolbar-button.entry-4c377337.cjs +1 -0
  65. package/dist/nylas-mailbox.entry-87304850.cjs +1 -0
  66. package/dist/nylas-mailbox.entry-ab92780c.js +134 -0
  67. package/dist/nylas-provider.entry-3fb60fe4.cjs +1 -0
  68. package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-678a9fe7.js} +40 -29
  69. package/dist/nylas-scheduler-editor.entry-a0de0ae6.js +2269 -0
  70. package/dist/nylas-scheduler-editor.entry-cf19391e.cjs +7 -0
  71. package/dist/nylas-scheduling.entry-d8bb2648.cjs +1 -0
  72. package/dist/nylas-scheduling.entry-e38c3870.js +248 -0
  73. package/dist/nylas-threads-refresh.entry-79c8a061.cjs +1 -0
  74. package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-fcb2175f.js} +4 -5
  75. package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7565bdf8.js} +4 -5
  76. package/dist/nylas-threads-search.entry-f2d5d0fb.cjs +1 -0
  77. package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-1772e0c4.js} +10 -11
  78. package/dist/nylas-view-thread.entry-6a2ccece.cjs +1 -0
  79. package/dist/people-icon.entry-3218a267.cjs +1 -0
  80. package/dist/people-icon.entry-bc2c70cf.js +15 -0
  81. package/dist/play-icon_2.entry-450a7fa6.cjs +1 -0
  82. package/dist/play-icon_2.entry-b4dc4e6d.js +25 -0
  83. package/dist/react.cjs +1 -1
  84. package/dist/react.js +94 -62
  85. package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-030dda82.cjs} +1 -1
  86. package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-d30c7264.js} +5 -5
  87. package/dist/register-component-83e24412-0b25de7f.cjs +1 -0
  88. package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-83e24412-35c484c4.js} +37 -33
  89. package/dist/scheduler-config-store-ec3b6190-6d8cef0f.cjs +1 -0
  90. package/dist/scheduler-config-store-ec3b6190-d5edbae5.js +23 -0
  91. package/dist/scheduler-store-8ca9003d-38cca5ba.js +321 -0
  92. package/dist/scheduler-store-8ca9003d-c2aa3522.cjs +1 -0
  93. package/dist/time-period-selector.entry-b366ba86.js +76 -0
  94. package/dist/time-period-selector.entry-b3d04e93.cjs +1 -0
  95. package/dist/translate-icon.entry-03ab2513.cjs +1 -0
  96. package/dist/translate-icon.entry-b3c21ae9.js +15 -0
  97. package/dist/warning-icon.entry-602d459b.js +15 -0
  98. package/dist/warning-icon.entry-65ecfdf0.cjs +1 -0
  99. package/package.json +7 -4
  100. package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
  101. package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
  102. package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
  103. package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
  104. package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
  105. package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
  106. package/dist/chevron-icon.entry-58366662.cjs +0 -1
  107. package/dist/chevron-icon.entry-5e11cef5.js +0 -15
  108. package/dist/close-icon_2.entry-011d9cf4.js +0 -25
  109. package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
  110. package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
  111. package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
  112. package/dist/duration-bddc4a13-179ce826.js +0 -41
  113. package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
  114. package/dist/forward-icon_6.entry-3345af84.cjs +0 -3
  115. package/dist/index-3b6f5cd5.cjs +0 -30
  116. package/dist/index-630f4e87.js +0 -1498
  117. package/dist/index-b30d446a-cbbef925.cjs +0 -7
  118. package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
  119. package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
  120. package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
  121. package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
  122. package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
  123. package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
  124. package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
  125. package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
  126. package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
  127. package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
  128. package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
  129. package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
  130. package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
  131. package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
  132. package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
  133. package/dist/play-icon_2.entry-ed5877e3.js +0 -25
  134. package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
  135. package/dist/register-component-152c6ad2-0df7215b.cjs +0 -1
  136. package/dist/scheduler-store-7d48e682-0c0c3991.js +0 -289
  137. package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
  138. package/dist/search-icon_3.entry-292138c3.js +0 -101
  139. package/dist/search-icon_3.entry-8e555357.cjs +0 -1
  140. package/dist/utils-5074a070-ce33ee6b.js +0 -119
  141. package/dist/utils-5074a070-d5ba6add.cjs +0 -2
@@ -1,6 +1,5 @@
1
- import { d as T, u as or, e as dn } from "./utils-5074a070-ce33ee6b.js";
2
- import { a as fn, f as pn } from "./index-630f4e87.js";
3
- class ar {
1
+ import { d as T, u as nr, l as hn } from "./index-fd39ea9d.js";
2
+ class rr {
4
3
  constructor(e, n, r = !0, s) {
5
4
  this.automaticComponentRegistration = !0, this.registeredComponents = {}, this.propStateRegistrations = /* @__PURE__ */ new Map(), this.eventListenerRegistrations = /* @__PURE__ */ new Map(), this.host = e, this.stores = n, this.automaticComponentRegistration = r, this.eventOverrides = s, T(`[${this.hostTagName}] Initializing (abstract) provider.`, { eventOverrides: s }), this.registerComponent = this.registerComponent.bind(this), this.getStore = this.getStore.bind(this), Object.keys(this.stores).forEach((i) => {
6
5
  this.propStateRegistrations.set(i, /* @__PURE__ */ new Map());
@@ -27,7 +26,8 @@ class ar {
27
26
  stateToProps: s.stateToProps,
28
27
  authToProp: s.authToProp,
29
28
  eventToProps: s.eventToProps,
30
- connectorToProp: s.connectorToProp
29
+ connectorToProp: s.connectorToProp,
30
+ localPropsToProp: s.localPropsToProp
31
31
  };
32
32
  this.registerComponent(i);
33
33
  });
@@ -61,37 +61,40 @@ class ar {
61
61
  T(`[${this.hostTagName}] Component ${e.name} already registered. Skipping.`);
62
62
  return;
63
63
  }
64
- const { stateToProps: r, getStoresToProp: s, eventToProps: i, storeToProps: o, connectorToProp: u, element: a } = e;
65
- a.dataset.nylasId = or(), this.registeredComponents[a.dataset.nylasId] = e;
66
- const l = this.eventOverrides;
67
- i == null || i.forEach((h, c) => {
64
+ const { stateToProps: r, getStoresToProp: s, eventToProps: i, storeToProps: o, connectorToProp: u, localPropsToProp: a, element: c } = e;
65
+ c.dataset.nylasId = nr(), this.registeredComponents[c.dataset.nylasId] = e;
66
+ const d = this.eventOverrides;
67
+ i == null || i.forEach((l, h) => {
68
68
  var y;
69
- const d = this.nylasConnector, m = async (g) => {
70
- T(`[${this.hostTagName}] Handling "${e.name}" prop "${String(c)}" event.`, { event: g }), c in l && (T(`[${this.hostTagName}] Found event override for "${String(c)}" event. Calling override.`), await l[c](g, d)), g.defaultPrevented || await h(g, d);
69
+ const f = this.nylasConnector, m = async (g) => {
70
+ T(`[${this.hostTagName}] Handling "${e.name}" prop "${String(h)}" event.`, { event: g }), h in d && (T(`[${this.hostTagName}] Found event override for "${String(h)}" event. Calling override.`), await d[h](g, f)), g.defaultPrevented || await l(g, f);
71
71
  }, p = e.element.dataset.nylasId;
72
- p && !this.eventListenerRegistrations.has(p) && this.eventListenerRegistrations.set(p, []), p && ((y = this.eventListenerRegistrations.get(p)) == null || y.push([a, c, m])), T(`[${this.hostTagName}] Setting "${e.name}" event "${String(c)}" to automcially call NylasConnector method.`);
73
- const f = dn(c.toString());
74
- T(`[${this.hostTagName}] Adding event listener for "${f}" on "${a.tagName}"`), a.addEventListener(f, m);
75
- }), r == null || r.forEach((h, c) => {
76
- var y, g, v, b;
77
- const [d, m] = c.split("."), f = this.getStore(d).state[m];
78
- if (!a.dataset.nylasId) {
72
+ p && !this.eventListenerRegistrations.has(p) && this.eventListenerRegistrations.set(p, []), p && ((y = this.eventListenerRegistrations.get(p)) == null || y.push([c, h, m])), T(`[${this.hostTagName}] Setting "${e.name}" event "${String(h)}" to automcially call NylasConnector method.`);
73
+ const v = hn(h.toString());
74
+ T(`[${this.hostTagName}] Adding event listener for "${v}" on "${c.tagName}"`), c.addEventListener(v, m);
75
+ }), r == null || r.forEach((l, h) => {
76
+ var y, g, b, k;
77
+ const [f, m] = h.split("."), v = this.getStore(f).state[m];
78
+ if (!c.dataset.nylasId) {
79
79
  T(`[${this.hostTagName}] Component "${e.name}" not registered. Skipping.`, { component: e });
80
80
  return;
81
81
  }
82
- this.propStateRegistrations.has(d) || this.propStateRegistrations.set(d, /* @__PURE__ */ new Map()), (y = this.propStateRegistrations.get(d)) != null && y.has(m) ? (b = (v = this.propStateRegistrations.get(d)) == null ? void 0 : v.get(m)) == null || b.push({
83
- elementId: a.dataset.nylasId,
84
- propKey: h
85
- }) : (g = this.propStateRegistrations.get(d)) == null || g.set(m, [
82
+ this.propStateRegistrations.has(f) || this.propStateRegistrations.set(f, /* @__PURE__ */ new Map()), (y = this.propStateRegistrations.get(f)) != null && y.has(m) ? (k = (b = this.propStateRegistrations.get(f)) == null ? void 0 : b.get(m)) == null || k.push({
83
+ elementId: c.dataset.nylasId,
84
+ propKey: l
85
+ }) : (g = this.propStateRegistrations.get(f)) == null || g.set(m, [
86
86
  {
87
- elementId: a.dataset.nylasId,
88
- propKey: h
87
+ elementId: c.dataset.nylasId,
88
+ propKey: l
89
89
  }
90
- ]), a[h.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" value.`, { stateValue: f });
91
- }), s && (a[s == null ? void 0 : s.toString()] = this.getStore, T(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)), o == null || o.forEach((h, c) => {
92
- const d = this.getStore(c);
93
- a[h.toString()] = d, T(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" store.`, { store: d });
94
- }), u && (a[u == null ? void 0 : u.toString()] = this.nylasConnector, T(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`, { connectorToProp: u })), T(`[${this.hostTagName}] Component ${e.name} registered.`);
90
+ ]), c[l.toString()] = v, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to "${h}" value.`, { stateValue: v });
91
+ }), a == null || a.forEach((l, h) => {
92
+ const f = this.host[h];
93
+ c[l.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to the value of "${h}" value.`, { value: h, mappedPropValue: f });
94
+ }), s && (c[s == null ? void 0 : s.toString()] = this.getStore, T(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)), o == null || o.forEach((l, h) => {
95
+ const f = this.getStore(h);
96
+ c[l.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to "${h}" store.`, { store: f });
97
+ }), u && (c[u == null ? void 0 : u.toString()] = this.nylasConnector, T(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`, { connectorToProp: u })), T(`[${this.hostTagName}] Component ${e.name} registered.`);
95
98
  }
96
99
  unregisterComponent(e) {
97
100
  T(`[${this.hostTagName}] Unregistering component ${e.name}.`);
@@ -106,14 +109,14 @@ class ar {
106
109
  }
107
110
  this.propStateRegistrations.forEach((s, i) => {
108
111
  s.forEach((o, u) => {
109
- var h, c;
110
- const a = (h = this.propStateRegistrations.get(i)) == null ? void 0 : h.get(u), l = a == null ? void 0 : a.filter((d) => d.elementId !== n);
111
- l && ((c = this.propStateRegistrations.get(i)) == null || c.set(u, l));
112
+ var d, l;
113
+ const a = (d = this.propStateRegistrations.get(i)) == null ? void 0 : d.get(u), c = a == null ? void 0 : a.filter((h) => h.elementId !== n);
114
+ c && ((l = this.propStateRegistrations.get(i)) == null || l.set(u, c));
112
115
  });
113
116
  });
114
117
  const r = this.eventListenerRegistrations.get(n);
115
118
  r == null || r.forEach(([s, i, o]) => {
116
- const u = dn(i.toString());
119
+ const u = hn(i.toString());
117
120
  T(`[${this.hostTagName}] Removing event listener for "${u}" on "${s.tagName}"`), s.removeEventListener(u, o);
118
121
  }), delete this.registeredComponents[n];
119
122
  }
@@ -128,7 +131,7 @@ class ar {
128
131
  Object.entries(this.stores).forEach(([n, r]) => {
129
132
  T(`[${e.hostTagName}] Listening for changes in "${n}" store.`), r.use({
130
133
  set(s, i, o) {
131
- var l;
134
+ var c;
132
135
  if (T(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" changed`, { newValue: i, oldValue: o }), i === o) {
133
136
  T(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" unchanged. Skipping.`);
134
137
  return;
@@ -138,18 +141,18 @@ class ar {
138
141
  T(`[${e.hostTagName}] No registered components found. Skipping.`);
139
142
  return;
140
143
  }
141
- const a = ((l = e.propStateRegistrations.get(n)) == null ? void 0 : l.get(s.toString())) || [];
144
+ const a = ((c = e.propStateRegistrations.get(n)) == null ? void 0 : c.get(s.toString())) || [];
142
145
  T(`[${e.hostTagName}] Found ${a.length} prop(s) registered for "${s.toString()}" store.`, {
143
146
  props: a,
144
147
  propStateRegistrations: e.propStateRegistrations
145
- }), a.forEach(({ elementId: h, propKey: c }) => {
146
- const d = u[h];
147
- if (!d) {
148
- T(`[${e.hostTagName}] Component "${h}" not found. Skipping.`, { component: d });
148
+ }), a.forEach(({ elementId: d, propKey: l }) => {
149
+ const h = u[d];
150
+ if (!h) {
151
+ T(`[${e.hostTagName}] Component "${d}" not found. Skipping.`, { component: h });
149
152
  return;
150
153
  }
151
- const p = e.getStore(n).state[s];
152
- d.element[c.toString()] = p, T(`[${e.hostTagName}] Setting "${d.name}" prop "${c.toString()}" to "${s.toString()}" value.`, { stateValue: p });
154
+ const m = e.getStore(n).state[s];
155
+ h.element[l.toString()] = m, T(`[${e.hostTagName}] Setting "${h.name}" prop "${l.toString()}" to "${s.toString()}" value.`, { stateValue: m });
153
156
  });
154
157
  }
155
158
  });
@@ -160,64 +163,65 @@ class ar {
160
163
  return ((n = (e = this.host) == null ? void 0 : e.tagName) == null ? void 0 : n.toLowerCase()) ?? "nylas-provider";
161
164
  }
162
165
  }
163
- class ds extends ar {
166
+ class ns extends rr {
164
167
  }
165
- var ur = Object.defineProperty, cr = (t, e, n) => e in t ? ur(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ut = (t, e, n) => (cr(t, typeof e != "symbol" ? e + "" : e, n), n), lr = /* @__PURE__ */ ((t) => (t.Error = "error", t.Warning = "warning", t.Info = "info", t.Success = "success", t))(lr || {});
166
- const fs = (t) => "error" in t;
167
- class ps extends Error {
168
+ const sr = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {};
169
+ var ir = Object.defineProperty, or = (t, e, n) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ut = (t, e, n) => (or(t, typeof e != "symbol" ? e + "" : e, n), n), ar = /* @__PURE__ */ ((t) => (t.Error = "error", t.Warning = "warning", t.Info = "info", t.Success = "success", t))(ar || {});
170
+ const rs = (t) => t !== null && typeof t == "object" && "error" in t;
171
+ class ss extends Error {
168
172
  constructor(e) {
169
173
  super(e == null ? void 0 : e.message), ut(this, "apiError"), this.name = "NylasAPIError", this.stack = new Error().stack, this.apiError = e;
170
174
  }
171
175
  }
172
- async function mn(t) {
176
+ async function dn(t) {
173
177
  const e = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", e), r = Array.from(new Uint8Array(n)).map((s) => s.toString(16).padStart(2, "0")).join("");
174
178
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
175
179
  }
176
- const K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, $ = Object.keys, F = Array.isArray;
180
+ const K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : sr, $ = Object.keys, M = Array.isArray;
177
181
  function U(t, e) {
178
182
  return typeof e != "object" || $(e).forEach(function(n) {
179
183
  t[n] = e[n];
180
184
  }), t;
181
185
  }
182
186
  typeof Promise > "u" || K.Promise || (K.Promise = Promise);
183
- const Be = Object.getPrototypeOf, hr = {}.hasOwnProperty;
187
+ const Be = Object.getPrototypeOf, ur = {}.hasOwnProperty;
184
188
  function z(t, e) {
185
- return hr.call(t, e);
189
+ return ur.call(t, e);
186
190
  }
187
- function Ee(t, e) {
191
+ function Pe(t, e) {
188
192
  typeof e == "function" && (e = e(Be(t))), (typeof Reflect > "u" ? $ : Reflect.ownKeys)(e).forEach((n) => {
189
193
  ee(t, n, e[n]);
190
194
  });
191
195
  }
192
- const An = Object.defineProperty;
196
+ const Pn = Object.defineProperty;
193
197
  function ee(t, e, n, r) {
194
- An(t, e, U(n && z(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
198
+ Pn(t, e, U(n && z(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
195
199
  }
196
200
  function ke(t) {
197
201
  return { from: function(e) {
198
- return t.prototype = Object.create(e.prototype), ee(t.prototype, "constructor", t), { extend: Ee.bind(null, t.prototype) };
202
+ return t.prototype = Object.create(e.prototype), ee(t.prototype, "constructor", t), { extend: Pe.bind(null, t.prototype) };
199
203
  } };
200
204
  }
201
- const dr = Object.getOwnPropertyDescriptor;
202
- function Zt(t, e) {
205
+ const lr = Object.getOwnPropertyDescriptor;
206
+ function Jt(t, e) {
203
207
  let n;
204
- return dr(t, e) || (n = Be(t)) && Zt(n, e);
208
+ return lr(t, e) || (n = Be(t)) && Jt(n, e);
205
209
  }
206
- const fr = [].slice;
207
- function ct(t, e, n) {
208
- return fr.call(t, e, n);
210
+ const cr = [].slice;
211
+ function lt(t, e, n) {
212
+ return cr.call(t, e, n);
209
213
  }
210
- function On(t, e) {
214
+ function En(t, e) {
211
215
  return e(t);
212
216
  }
213
217
  function Ie(t) {
214
218
  if (!t)
215
219
  throw new Error("Assertion Failed");
216
220
  }
217
- function In(t) {
221
+ function Cn(t) {
218
222
  K.setImmediate ? setImmediate(t) : setTimeout(t, 0);
219
223
  }
220
- function Kn(t, e) {
224
+ function Tn(t, e) {
221
225
  return t.reduce((n, r, s) => {
222
226
  var i = e(r, s);
223
227
  return i && (n[i[0]] = i[1]), n;
@@ -252,70 +256,70 @@ function H(t, e, n) {
252
256
  if (i !== -1) {
253
257
  var o = e.substr(0, i), u = e.substr(i + 1);
254
258
  if (u === "")
255
- n === void 0 ? F(t) && !isNaN(parseInt(o)) ? t.splice(o, 1) : delete t[o] : t[o] = n;
259
+ n === void 0 ? M(t) && !isNaN(parseInt(o)) ? t.splice(o, 1) : delete t[o] : t[o] = n;
256
260
  else {
257
261
  var a = t[o];
258
262
  a && z(t, o) || (a = t[o] = {}), H(a, u, n);
259
263
  }
260
264
  } else
261
- n === void 0 ? F(t) && !isNaN(parseInt(e)) ? t.splice(e, 1) : delete t[e] : t[e] = n;
265
+ n === void 0 ? M(t) && !isNaN(parseInt(e)) ? t.splice(e, 1) : delete t[e] : t[e] = n;
262
266
  }
263
267
  }
264
- function Rn(t) {
268
+ function An(t) {
265
269
  var e = {};
266
270
  for (var n in t)
267
271
  z(t, n) && (e[n] = t[n]);
268
272
  return e;
269
273
  }
270
- const pr = [].concat;
271
- function jn(t) {
272
- return pr.apply([], t);
274
+ const hr = [].concat;
275
+ function On(t) {
276
+ return hr.apply([], t);
273
277
  }
274
- const Dn = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(jn([8, 16, 32, 64].map((t) => ["Int", "Uint", "Float"].map((e) => e + t + "Array")))).filter((t) => K[t]), mr = Dn.map((t) => K[t]);
275
- Kn(Dn, (t) => [t, !0]);
278
+ const In = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(On([8, 16, 32, 64].map((t) => ["Int", "Uint", "Float"].map((e) => e + t + "Array")))).filter((t) => K[t]), dr = In.map((t) => K[t]);
279
+ Tn(In, (t) => [t, !0]);
276
280
  let se = null;
277
281
  function We(t) {
278
282
  se = typeof WeakMap < "u" && /* @__PURE__ */ new WeakMap();
279
- const e = Tt(t);
283
+ const e = Ct(t);
280
284
  return se = null, e;
281
285
  }
282
- function Tt(t) {
286
+ function Ct(t) {
283
287
  if (!t || typeof t != "object")
284
288
  return t;
285
289
  let e = se && se.get(t);
286
290
  if (e)
287
291
  return e;
288
- if (F(t)) {
292
+ if (M(t)) {
289
293
  e = [], se && se.set(t, e);
290
294
  for (var n = 0, r = t.length; n < r; ++n)
291
- e.push(Tt(t[n]));
292
- } else if (mr.indexOf(t.constructor) >= 0)
295
+ e.push(Ct(t[n]));
296
+ } else if (dr.indexOf(t.constructor) >= 0)
293
297
  e = t;
294
298
  else {
295
299
  const i = Be(t);
296
300
  for (var s in e = i === Object.prototype ? {} : Object.create(i), se && se.set(t, e), t)
297
- z(t, s) && (e[s] = Tt(t[s]));
301
+ z(t, s) && (e[s] = Ct(t[s]));
298
302
  }
299
303
  return e;
300
304
  }
301
- const { toString: gr } = {};
302
- function At(t) {
303
- return gr.call(t).slice(8, -1);
305
+ const { toString: fr } = {};
306
+ function Tt(t) {
307
+ return fr.call(t).slice(8, -1);
304
308
  }
305
- const Ot = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", yr = typeof Ot == "symbol" ? function(t) {
309
+ const At = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", pr = typeof At == "symbol" ? function(t) {
306
310
  var e;
307
- return t != null && (e = t[Ot]) && e.apply(t);
311
+ return t != null && (e = t[At]) && e.apply(t);
308
312
  } : function() {
309
313
  return null;
310
314
  }, _e = {};
311
315
  function J(t) {
312
316
  var e, n, r, s;
313
317
  if (arguments.length === 1) {
314
- if (F(t))
318
+ if (M(t))
315
319
  return t.slice();
316
320
  if (this === _e && typeof t == "string")
317
321
  return [t];
318
- if (s = yr(t)) {
322
+ if (s = pr(t)) {
319
323
  for (n = []; !(r = s.next()).done; )
320
324
  n.push(r.value);
321
325
  return n;
@@ -333,15 +337,15 @@ function J(t) {
333
337
  n[e] = arguments[e];
334
338
  return n;
335
339
  }
336
- const en = typeof Symbol < "u" ? (t) => t[Symbol.toStringTag] === "AsyncFunction" : () => !1;
340
+ const Zt = typeof Symbol < "u" ? (t) => t[Symbol.toStringTag] === "AsyncFunction" : () => !1;
337
341
  var G = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
338
- function $n(t, e) {
339
- G = t, Nn = e;
342
+ function Kn(t, e) {
343
+ G = t, jn = e;
340
344
  }
341
- var Nn = () => !0;
342
- const vr = !new Error("").stack;
343
- function Pe() {
344
- if (vr)
345
+ var jn = () => !0;
346
+ const mr = !new Error("").stack;
347
+ function Ee() {
348
+ if (mr)
345
349
  try {
346
350
  throw new Error();
347
351
  } catch (t) {
@@ -349,51 +353,51 @@ function Pe() {
349
353
  }
350
354
  return new Error();
351
355
  }
352
- function It(t, e) {
356
+ function Ot(t, e) {
353
357
  var n = t.stack;
354
358
  return n ? (e = e || 0, n.indexOf(t.name) === 0 && (e += (t.name + t.message).split(`
355
359
  `).length), n.split(`
356
- `).slice(e).filter(Nn).map((r) => `
360
+ `).slice(e).filter(jn).map((r) => `
357
361
  ` + r).join("")) : "";
358
362
  }
359
- var Bn = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], tn = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Bn), br = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
363
+ var Rn = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], en = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Rn), gr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
360
364
  function xe(t, e) {
361
- this._e = Pe(), this.name = t, this.message = e;
365
+ this._e = Ee(), this.name = t, this.message = e;
362
366
  }
363
- function Mn(t, e) {
367
+ function Nn(t, e) {
364
368
  return t + ". Errors: " + Object.keys(e).map((n) => e[n].toString()).filter((n, r, s) => s.indexOf(n) === r).join(`
365
369
  `);
366
370
  }
367
- function lt(t, e, n, r) {
368
- this._e = Pe(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = Mn(t, e);
371
+ function ct(t, e, n, r) {
372
+ this._e = Ee(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = Nn(t, e);
369
373
  }
370
- function Re(t, e) {
371
- this._e = Pe(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message = Mn(t, e);
374
+ function je(t, e) {
375
+ this._e = Ee(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message = Nn(t, e);
372
376
  }
373
377
  ke(xe).from(Error).extend({ stack: { get: function() {
374
- return this._stack || (this._stack = this.name + ": " + this.message + It(this._e, 2));
378
+ return this._stack || (this._stack = this.name + ": " + this.message + Ot(this._e, 2));
375
379
  } }, toString: function() {
376
380
  return this.name + ": " + this.message;
377
- } }), ke(lt).from(xe), ke(Re).from(xe);
378
- var nn = tn.reduce((t, e) => (t[e] = e + "Error", t), {});
379
- const wr = xe;
380
- var C = tn.reduce((t, e) => {
381
+ } }), ke(ct).from(xe), ke(je).from(xe);
382
+ var tn = en.reduce((t, e) => (t[e] = e + "Error", t), {});
383
+ const yr = xe;
384
+ var C = en.reduce((t, e) => {
381
385
  var n = e + "Error";
382
386
  function r(s, i) {
383
- this._e = Pe(), this.name = n, s ? typeof s == "string" ? (this.message = `${s}${i ? `
384
- ` + i : ""}`, this.inner = i || null) : typeof s == "object" && (this.message = `${s.name} ${s.message}`, this.inner = s) : (this.message = br[e] || n, this.inner = null);
387
+ this._e = Ee(), this.name = n, s ? typeof s == "string" ? (this.message = `${s}${i ? `
388
+ ` + i : ""}`, this.inner = i || null) : typeof s == "object" && (this.message = `${s.name} ${s.message}`, this.inner = s) : (this.message = gr[e] || n, this.inner = null);
385
389
  }
386
- return ke(r).from(wr), t[e] = r, t;
390
+ return ke(r).from(yr), t[e] = r, t;
387
391
  }, {});
388
392
  C.Syntax = SyntaxError, C.Type = TypeError, C.Range = RangeError;
389
- var gn = Bn.reduce((t, e) => (t[e + "Error"] = C[e], t), {}), tt = tn.reduce((t, e) => (["Syntax", "Type", "Range"].indexOf(e) === -1 && (t[e + "Error"] = C[e]), t), {});
393
+ var fn = Rn.reduce((t, e) => (t[e + "Error"] = C[e], t), {}), tt = en.reduce((t, e) => (["Syntax", "Type", "Range"].indexOf(e) === -1 && (t[e + "Error"] = C[e]), t), {});
390
394
  function I() {
391
395
  }
392
- function Me(t) {
396
+ function Fe(t) {
393
397
  return t;
394
398
  }
395
- function _r(t, e) {
396
- return t == null || t === Me ? e : function(n) {
399
+ function vr(t, e) {
400
+ return t == null || t === Fe ? e : function(n) {
397
401
  return e(t(n));
398
402
  };
399
403
  }
@@ -402,7 +406,7 @@ function me(t, e) {
402
406
  t.apply(this, arguments), e.apply(this, arguments);
403
407
  };
404
408
  }
405
- function kr(t, e) {
409
+ function br(t, e) {
406
410
  return t === I ? e : function() {
407
411
  var n = t.apply(this, arguments);
408
412
  n !== void 0 && (arguments[0] = n);
@@ -412,14 +416,14 @@ function kr(t, e) {
412
416
  return r && (this.onsuccess = this.onsuccess ? me(r, this.onsuccess) : r), s && (this.onerror = this.onerror ? me(s, this.onerror) : s), i !== void 0 ? i : n;
413
417
  };
414
418
  }
415
- function xr(t, e) {
419
+ function wr(t, e) {
416
420
  return t === I ? e : function() {
417
421
  t.apply(this, arguments);
418
422
  var n = this.onsuccess, r = this.onerror;
419
423
  this.onsuccess = this.onerror = null, e.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? me(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? me(r, this.onerror) : r);
420
424
  };
421
425
  }
422
- function Sr(t, e) {
426
+ function _r(t, e) {
423
427
  return t === I ? e : function(n) {
424
428
  var r = t.apply(this, arguments);
425
429
  U(n, r);
@@ -429,12 +433,12 @@ function Sr(t, e) {
429
433
  return s && (this.onsuccess = this.onsuccess ? me(s, this.onsuccess) : s), i && (this.onerror = this.onerror ? me(i, this.onerror) : i), r === void 0 ? o === void 0 ? void 0 : o : U(r, o);
430
434
  };
431
435
  }
432
- function Er(t, e) {
436
+ function kr(t, e) {
433
437
  return t === I ? e : function() {
434
438
  return e.apply(this, arguments) !== !1 && t.apply(this, arguments);
435
439
  };
436
440
  }
437
- function rn(t, e) {
441
+ function nn(t, e) {
438
442
  return t === I ? e : function() {
439
443
  var n = t.apply(this, arguments);
440
444
  if (n && typeof n.then == "function") {
@@ -447,17 +451,17 @@ function rn(t, e) {
447
451
  return e.apply(this, arguments);
448
452
  };
449
453
  }
450
- tt.ModifyError = lt, tt.DexieError = xe, tt.BulkError = Re;
451
- var Fe = {};
452
- const Fn = 100, [Kt, ht, Rt] = typeof Promise > "u" ? [] : (() => {
454
+ tt.ModifyError = ct, tt.DexieError = xe, tt.BulkError = je;
455
+ var Me = {};
456
+ const $n = 100, [It, ht, Kt] = typeof Promise > "u" ? [] : (() => {
453
457
  let t = Promise.resolve();
454
458
  if (typeof crypto > "u" || !crypto.subtle)
455
459
  return [t, Be(t), t];
456
460
  const e = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
457
461
  return [e, Be(e), t];
458
- })(), qn = ht && ht.then, nt = Kt && Kt.constructor, sn = !!Rt;
459
- var jt = !1, Pr = Rt ? () => {
460
- Rt.then(Ye);
462
+ })(), Dn = ht && ht.then, nt = It && It.constructor, rn = !!Kt;
463
+ var jt = !1, xr = Kt ? () => {
464
+ Kt.then(Ye);
461
465
  } : K.setImmediate ? setImmediate.bind(null, Ye) : K.MutationObserver ? () => {
462
466
  var t = document.createElement("div");
463
467
  new MutationObserver(() => {
@@ -465,102 +469,102 @@ var jt = !1, Pr = Rt ? () => {
465
469
  }).observe(t, { attributes: !0 }), t.setAttribute("i", "1");
466
470
  } : () => {
467
471
  setTimeout(Ye, 0);
468
- }, je = function(t, e) {
469
- Ke.push([t, e]), dt && (Pr(), dt = !1);
470
- }, Dt = !0, dt = !0, de = [], rt = [], $t = null, Nt = Me, Se = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: bn, pgp: !1, env: {}, finalize: function() {
472
+ }, Re = function(t, e) {
473
+ Ke.push([t, e]), dt && (xr(), dt = !1);
474
+ }, Rt = !0, dt = !0, de = [], rt = [], Nt = null, $t = Fe, Se = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: gn, pgp: !1, env: {}, finalize: function() {
471
475
  this.unhandleds.forEach((t) => {
472
476
  try {
473
- bn(t[0], t[1]);
477
+ gn(t[0], t[1]);
474
478
  } catch {
475
479
  }
476
480
  });
477
- } }, P = Se, Ke = [], fe = 0, st = [];
481
+ } }, E = Se, Ke = [], fe = 0, st = [];
478
482
  function S(t) {
479
483
  if (typeof this != "object")
480
484
  throw new TypeError("Promises must be constructed via new");
481
485
  this._listeners = [], this.onuncatched = I, this._lib = !1;
482
- var e = this._PSD = P;
483
- if (G && (this._stackHolder = Pe(), this._prev = null, this._numPrev = 0), typeof t != "function") {
484
- if (t !== Fe)
486
+ var e = this._PSD = E;
487
+ if (G && (this._stackHolder = Ee(), this._prev = null, this._numPrev = 0), typeof t != "function") {
488
+ if (t !== Me)
485
489
  throw new TypeError("Not a function");
486
- return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Mt(this, this._value));
490
+ return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Bt(this, this._value));
487
491
  }
488
- this._state = null, this._value = null, ++e.ref, Un(this, t);
492
+ this._state = null, this._value = null, ++e.ref, Fn(this, t);
489
493
  }
490
- const Bt = { get: function() {
491
- var t = P, e = ft;
494
+ const Dt = { get: function() {
495
+ var t = E, e = ft;
492
496
  function n(r, s) {
493
- var i = !t.global && (t !== P || e !== ft);
497
+ var i = !t.global && (t !== E || e !== ft);
494
498
  const o = i && !ne();
495
- var u = new S((a, l) => {
496
- on(this, new Ln(pt(r, t, i, o), pt(s, t, i, o), a, l, t));
499
+ var u = new S((a, c) => {
500
+ sn(this, new Bn(pt(r, t, i, o), pt(s, t, i, o), a, c, t));
497
501
  });
498
- return G && zn(u, this), u;
502
+ return G && Ln(u, this), u;
499
503
  }
500
- return n.prototype = Fe, n;
504
+ return n.prototype = Me, n;
501
505
  }, set: function(t) {
502
- ee(this, "then", t && t.prototype === Fe ? Bt : { get: function() {
506
+ ee(this, "then", t && t.prototype === Me ? Dt : { get: function() {
503
507
  return t;
504
- }, set: Bt.set });
508
+ }, set: Dt.set });
505
509
  } };
506
- function Ln(t, e, n, r, s) {
510
+ function Bn(t, e, n, r, s) {
507
511
  this.onFulfilled = typeof t == "function" ? t : null, this.onRejected = typeof e == "function" ? e : null, this.resolve = n, this.reject = r, this.psd = s;
508
512
  }
509
- function Un(t, e) {
513
+ function Fn(t, e) {
510
514
  try {
511
515
  e((n) => {
512
516
  if (t._state === null) {
513
517
  if (n === t)
514
518
  throw new TypeError("A promise cannot be resolved with itself.");
515
519
  var r = t._lib && ze();
516
- n && typeof n.then == "function" ? Un(t, (s, i) => {
520
+ n && typeof n.then == "function" ? Fn(t, (s, i) => {
517
521
  n instanceof S ? n._then(s, i) : n.then(s, i);
518
- }) : (t._state = !0, t._value = n, Vn(t)), r && He();
522
+ }) : (t._state = !0, t._value = n, Mn(t)), r && He();
519
523
  }
520
- }, Mt.bind(null, t));
524
+ }, Bt.bind(null, t));
521
525
  } catch (n) {
522
- Mt(t, n);
526
+ Bt(t, n);
523
527
  }
524
528
  }
525
- function Mt(t, e) {
529
+ function Bt(t, e) {
526
530
  if (rt.push(e), t._state === null) {
527
531
  var n = t._lib && ze();
528
- e = Nt(e), t._state = !1, t._value = e, G && e !== null && typeof e == "object" && !e._promise && function(r, s, i) {
532
+ e = $t(e), t._state = !1, t._value = e, G && e !== null && typeof e == "object" && !e._promise && function(r, s, i) {
529
533
  try {
530
534
  r.apply(null, i);
531
535
  } catch (o) {
532
536
  s && s(o);
533
537
  }
534
538
  }(() => {
535
- var r = Zt(e, "stack");
539
+ var r = Jt(e, "stack");
536
540
  e._promise = t, ee(e, "stack", { get: () => jt ? r && (r.get ? r.get.apply(e) : r.value) : t.stack });
537
541
  }), function(r) {
538
542
  de.some((s) => s._value === r._value) || de.push(r);
539
- }(t), Vn(t), n && He();
543
+ }(t), Mn(t), n && He();
540
544
  }
541
545
  }
542
- function Vn(t) {
546
+ function Mn(t) {
543
547
  var e = t._listeners;
544
548
  t._listeners = [];
545
549
  for (var n = 0, r = e.length; n < r; ++n)
546
- on(t, e[n]);
550
+ sn(t, e[n]);
547
551
  var s = t._PSD;
548
- --s.ref || s.finalize(), fe === 0 && (++fe, je(() => {
549
- --fe == 0 && an();
552
+ --s.ref || s.finalize(), fe === 0 && (++fe, Re(() => {
553
+ --fe == 0 && on();
550
554
  }, []));
551
555
  }
552
- function on(t, e) {
556
+ function sn(t, e) {
553
557
  if (t._state !== null) {
554
558
  var n = t._state ? e.onFulfilled : e.onRejected;
555
559
  if (n === null)
556
560
  return (t._state ? e.resolve : e.reject)(t._value);
557
- ++e.psd.ref, ++fe, je(Cr, [n, t, e]);
561
+ ++e.psd.ref, ++fe, Re(Sr, [n, t, e]);
558
562
  } else
559
563
  t._listeners.push(e);
560
564
  }
561
- function Cr(t, e, n) {
565
+ function Sr(t, e, n) {
562
566
  try {
563
- $t = e;
567
+ Nt = e;
564
568
  var r, s = e._value;
565
569
  e._state ? r = t(s) : (rt.length && (rt = []), r = t(s), rt.indexOf(s) === -1 && function(i) {
566
570
  for (var o = de.length; o; )
@@ -570,20 +574,20 @@ function Cr(t, e, n) {
570
574
  } catch (i) {
571
575
  n.reject(i);
572
576
  } finally {
573
- $t = null, --fe == 0 && an(), --n.psd.ref || n.psd.finalize();
577
+ Nt = null, --fe == 0 && on(), --n.psd.ref || n.psd.finalize();
574
578
  }
575
579
  }
576
- function Wn(t, e, n) {
580
+ function qn(t, e, n) {
577
581
  if (e.length === n)
578
582
  return e;
579
583
  var r = "";
580
584
  if (t._state === !1) {
581
585
  var s, i, o = t._value;
582
- o != null ? (s = o.name || "Error", i = o.message || o, r = It(o, 0)) : (s = o, i = ""), e.push(s + (i ? ": " + i : "") + r);
586
+ o != null ? (s = o.name || "Error", i = o.message || o, r = Ot(o, 0)) : (s = o, i = ""), e.push(s + (i ? ": " + i : "") + r);
583
587
  }
584
- return G && ((r = It(t._stackHolder, 2)) && e.indexOf(r) === -1 && e.push(r), t._prev && Wn(t._prev, e, n)), e;
588
+ return G && ((r = Ot(t._stackHolder, 2)) && e.indexOf(r) === -1 && e.push(r), t._prev && qn(t._prev, e, n)), e;
585
589
  }
586
- function zn(t, e) {
590
+ function Ln(t, e) {
587
591
  var n = e ? e._numPrev + 1 : 0;
588
592
  n < 100 && (t._prev = e, t._numPrev = n);
589
593
  }
@@ -591,8 +595,8 @@ function Ye() {
591
595
  ze() && He();
592
596
  }
593
597
  function ze() {
594
- var t = Dt;
595
- return Dt = !1, dt = !1, t;
598
+ var t = Rt;
599
+ return Rt = !1, dt = !1, t;
596
600
  }
597
601
  function He() {
598
602
  var t, e, n;
@@ -603,9 +607,9 @@ function He() {
603
607
  r[0].apply(null, r[1]);
604
608
  }
605
609
  while (Ke.length > 0);
606
- Dt = !0, dt = !0;
610
+ Rt = !0, dt = !0;
607
611
  }
608
- function an() {
612
+ function on() {
609
613
  var t = de;
610
614
  de = [], t.forEach((r) => {
611
615
  r._PSD.onunhandled.call(null, r._value, r);
@@ -614,12 +618,12 @@ function an() {
614
618
  e[--n]();
615
619
  }
616
620
  function Ge(t) {
617
- return new S(Fe, !1, t);
621
+ return new S(Me, !1, t);
618
622
  }
619
- function R(t, e) {
620
- var n = P;
623
+ function j(t, e) {
624
+ var n = E;
621
625
  return function() {
622
- var r = ze(), s = P;
626
+ var r = ze(), s = E;
623
627
  try {
624
628
  return ae(n, !0), t.apply(this, arguments);
625
629
  } catch (i) {
@@ -629,8 +633,8 @@ function R(t, e) {
629
633
  }
630
634
  };
631
635
  }
632
- Ee(S.prototype, { then: Bt, _then: function(t, e) {
633
- on(this, new Ln(null, null, t, e, P));
636
+ Pe(S.prototype, { then: Dt, _then: function(t, e) {
637
+ sn(this, new Bn(null, null, t, e, E));
634
638
  }, catch: function(t) {
635
639
  if (arguments.length === 1)
636
640
  return this.then(null, t);
@@ -643,7 +647,7 @@ Ee(S.prototype, { then: Bt, _then: function(t, e) {
643
647
  return this._stack;
644
648
  try {
645
649
  jt = !0;
646
- var t = Wn(this, [], 20).join(`
650
+ var t = qn(this, [], 20).join(`
647
651
  From previous: `);
648
652
  return this._state !== null && (this._stack = t), t;
649
653
  } finally {
@@ -654,7 +658,7 @@ From previous: `);
654
658
  var s = setTimeout(() => r(new C.Timeout(e)), t);
655
659
  this.then(n, r).finally(clearTimeout.bind(null, s));
656
660
  }) : this;
657
- } }), typeof Symbol < "u" && Symbol.toStringTag && ee(S.prototype, Symbol.toStringTag, "Dexie.Promise"), Se.env = Hn(), Ee(S, { all: function() {
661
+ } }), typeof Symbol < "u" && Symbol.toStringTag && ee(S.prototype, Symbol.toStringTag, "Dexie.Promise"), Se.env = Un(), Pe(S, { all: function() {
658
662
  var t = J.apply(null, arguments).map(Xe);
659
663
  return new S(function(e, n) {
660
664
  t.length === 0 && e([]);
@@ -670,26 +674,26 @@ From previous: `);
670
674
  return new S((n, r) => {
671
675
  t.then(n, r);
672
676
  });
673
- var e = new S(Fe, !0, t);
674
- return zn(e, $t), e;
677
+ var e = new S(Me, !0, t);
678
+ return Ln(e, Nt), e;
675
679
  }, reject: Ge, race: function() {
676
680
  var t = J.apply(null, arguments).map(Xe);
677
681
  return new S((e, n) => {
678
682
  t.map((r) => S.resolve(r).then(e, n));
679
683
  });
680
- }, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => ft }, newPSD: oe, usePSD: Te, scheduler: { get: () => je, set: (t) => {
681
- je = t;
682
- } }, rejectionMapper: { get: () => Nt, set: (t) => {
683
- Nt = t;
684
+ }, PSD: { get: () => E, set: (t) => E = t }, totalEchoes: { get: () => ft }, newPSD: oe, usePSD: Te, scheduler: { get: () => Re, set: (t) => {
685
+ Re = t;
686
+ } }, rejectionMapper: { get: () => $t, set: (t) => {
687
+ $t = t;
684
688
  } }, follow: (t, e) => new S((n, r) => oe((s, i) => {
685
- var o = P;
689
+ var o = E;
686
690
  o.unhandleds = [], o.onunhandled = i, o.finalize = me(function() {
687
691
  (function(u) {
688
692
  function a() {
689
693
  u(), st.splice(st.indexOf(a), 1);
690
694
  }
691
- st.push(a), ++fe, je(() => {
692
- --fe == 0 && an();
695
+ st.push(a), ++fe, Re(() => {
696
+ --fe == 0 && on();
693
697
  }, []);
694
698
  })(() => {
695
699
  this.unhandleds.length === 0 ? s() : i(this.unhandleds[0]);
@@ -714,75 +718,75 @@ From previous: `);
714
718
  }));
715
719
  });
716
720
  }));
717
- const M = { awaits: 0, echoes: 0, id: 0 };
718
- var Tr = 0, it = [], wt = 0, ft = 0, Ar = 0;
721
+ const F = { awaits: 0, echoes: 0, id: 0 };
722
+ var Pr = 0, it = [], wt = 0, ft = 0, Er = 0;
719
723
  function oe(t, e, n, r) {
720
- var s = P, i = Object.create(s);
721
- i.parent = s, i.ref = 0, i.global = !1, i.id = ++Ar;
724
+ var s = E, i = Object.create(s);
725
+ i.parent = s, i.ref = 0, i.global = !1, i.id = ++Er;
722
726
  var o = Se.env;
723
- i.env = sn ? { Promise: S, PromiseProp: { value: S, configurable: !0, writable: !0 }, all: S.all, race: S.race, allSettled: S.allSettled, any: S.any, resolve: S.resolve, reject: S.reject, nthen: yn(o.nthen, i), gthen: yn(o.gthen, i) } : {}, e && U(i, e), ++s.ref, i.finalize = function() {
727
+ i.env = rn ? { Promise: S, PromiseProp: { value: S, configurable: !0, writable: !0 }, all: S.all, race: S.race, allSettled: S.allSettled, any: S.any, resolve: S.resolve, reject: S.reject, nthen: pn(o.nthen, i), gthen: pn(o.gthen, i) } : {}, e && U(i, e), ++s.ref, i.finalize = function() {
724
728
  --this.parent.ref || this.parent.finalize();
725
729
  };
726
730
  var u = Te(i, t, n, r);
727
731
  return i.ref === 0 && i.finalize(), u;
728
732
  }
729
733
  function Ce() {
730
- return M.id || (M.id = ++Tr), ++M.awaits, M.echoes += Fn, M.id;
734
+ return F.id || (F.id = ++Pr), ++F.awaits, F.echoes += $n, F.id;
731
735
  }
732
736
  function ne() {
733
- return !!M.awaits && (--M.awaits == 0 && (M.id = 0), M.echoes = M.awaits * Fn, !0);
737
+ return !!F.awaits && (--F.awaits == 0 && (F.id = 0), F.echoes = F.awaits * $n, !0);
734
738
  }
735
739
  function Xe(t) {
736
- return M.echoes && t && t.constructor === nt ? (Ce(), t.then((e) => (ne(), e), (e) => (ne(), N(e)))) : t;
740
+ return F.echoes && t && t.constructor === nt ? (Ce(), t.then((e) => (ne(), e), (e) => (ne(), D(e)))) : t;
737
741
  }
738
- function Or(t) {
739
- ++ft, M.echoes && --M.echoes != 0 || (M.echoes = M.id = 0), it.push(P), ae(t, !0);
742
+ function Cr(t) {
743
+ ++ft, F.echoes && --F.echoes != 0 || (F.echoes = F.id = 0), it.push(E), ae(t, !0);
740
744
  }
741
- function Ir() {
745
+ function Tr() {
742
746
  var t = it[it.length - 1];
743
747
  it.pop(), ae(t, !1);
744
748
  }
745
749
  function ae(t, e) {
746
- var n = P;
747
- if ((e ? !M.echoes || wt++ && t === P : !wt || --wt && t === P) || Yn(e ? Or.bind(null, t) : Ir), t !== P && (P = t, n === Se && (Se.env = Hn()), sn)) {
750
+ var n = E;
751
+ if ((e ? !F.echoes || wt++ && t === E : !wt || --wt && t === E) || Vn(e ? Cr.bind(null, t) : Tr), t !== E && (E = t, n === Se && (Se.env = Un()), rn)) {
748
752
  var r = Se.env.Promise, s = t.env;
749
753
  ht.then = s.nthen, r.prototype.then = s.gthen, (n.global || t.global) && (Object.defineProperty(K, "Promise", s.PromiseProp), r.all = s.all, r.race = s.race, r.resolve = s.resolve, r.reject = s.reject, s.allSettled && (r.allSettled = s.allSettled), s.any && (r.any = s.any));
750
754
  }
751
755
  }
752
- function Hn() {
756
+ function Un() {
753
757
  var t = K.Promise;
754
- return sn ? { Promise: t, PromiseProp: Object.getOwnPropertyDescriptor(K, "Promise"), all: t.all, race: t.race, allSettled: t.allSettled, any: t.any, resolve: t.resolve, reject: t.reject, nthen: ht.then, gthen: t.prototype.then } : {};
758
+ return rn ? { Promise: t, PromiseProp: Object.getOwnPropertyDescriptor(K, "Promise"), all: t.all, race: t.race, allSettled: t.allSettled, any: t.any, resolve: t.resolve, reject: t.reject, nthen: ht.then, gthen: t.prototype.then } : {};
755
759
  }
756
760
  function Te(t, e, n, r, s) {
757
- var i = P;
761
+ var i = E;
758
762
  try {
759
763
  return ae(t, !0), e(n, r, s);
760
764
  } finally {
761
765
  ae(i, !1);
762
766
  }
763
767
  }
764
- function Yn(t) {
765
- qn.call(Kt, t);
768
+ function Vn(t) {
769
+ Dn.call(It, t);
766
770
  }
767
771
  function pt(t, e, n, r) {
768
772
  return typeof t != "function" ? t : function() {
769
- var s = P;
773
+ var s = E;
770
774
  n && Ce(), ae(e, !0);
771
775
  try {
772
776
  return t.apply(this, arguments);
773
777
  } finally {
774
- ae(s, !1), r && Yn(ne);
778
+ ae(s, !1), r && Vn(ne);
775
779
  }
776
780
  };
777
781
  }
778
- function yn(t, e) {
782
+ function pn(t, e) {
779
783
  return function(n, r) {
780
784
  return t.call(this, pt(n, e), pt(r, e));
781
785
  };
782
786
  }
783
- ("" + qn).indexOf("[native code]") === -1 && (Ce = ne = I);
784
- const vn = "unhandledrejection";
785
- function bn(t, e) {
787
+ ("" + Dn).indexOf("[native code]") === -1 && (Ce = ne = I);
788
+ const mn = "unhandledrejection";
789
+ function gn(t, e) {
786
790
  var n;
787
791
  try {
788
792
  n = e.onuncatched(t);
@@ -791,7 +795,7 @@ function bn(t, e) {
791
795
  if (n !== !1)
792
796
  try {
793
797
  var r, s = { promise: e, reason: t };
794
- if (K.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(vn, !0, !0), U(r, s)) : K.CustomEvent && U(r = new CustomEvent(vn, { detail: s }), s), r && K.dispatchEvent && (dispatchEvent(r), !K.PromiseRejectionEvent && K.onunhandledrejection))
798
+ if (K.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(mn, !0, !0), U(r, s)) : K.CustomEvent && U(r = new CustomEvent(mn, { detail: s }), s), r && K.dispatchEvent && (dispatchEvent(r), !K.PromiseRejectionEvent && K.onunhandledrejection))
795
799
  try {
796
800
  K.onunhandledrejection(r);
797
801
  } catch {
@@ -800,47 +804,47 @@ function bn(t, e) {
800
804
  } catch {
801
805
  }
802
806
  }
803
- var N = S.reject;
807
+ var D = S.reject;
804
808
  function Ft(t, e, n, r) {
805
- if (t.idbdb && (t._state.openComplete || P.letThrough || t._vip)) {
809
+ if (t.idbdb && (t._state.openComplete || E.letThrough || t._vip)) {
806
810
  var s = t._createTransaction(e, n, t._dbSchema);
807
811
  try {
808
812
  s.create(), t._state.PR1398_maxLoop = 3;
809
813
  } catch (i) {
810
- return i.name === nn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Ft(t, e, n, r))) : N(i);
814
+ return i.name === tn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Ft(t, e, n, r))) : D(i);
811
815
  }
812
- return s._promise(e, (i, o) => oe(() => (P.trans = s, r(i, o, s)))).then((i) => s._completion.then(() => i));
816
+ return s._promise(e, (i, o) => oe(() => (E.trans = s, r(i, o, s)))).then((i) => s._completion.then(() => i));
813
817
  }
814
818
  if (t._state.openComplete)
815
- return N(new C.DatabaseClosed(t._state.dbOpenError));
819
+ return D(new C.DatabaseClosed(t._state.dbOpenError));
816
820
  if (!t._state.isBeingOpened) {
817
821
  if (!t._options.autoOpen)
818
- return N(new C.DatabaseClosed());
822
+ return D(new C.DatabaseClosed());
819
823
  t.open().catch(I);
820
824
  }
821
825
  return t._state.dbReadyPromise.then(() => Ft(t, e, n, r));
822
826
  }
823
- const wn = "3.2.4", he = String.fromCharCode(65535), qt = -1 / 0, X = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Gn = "String expected.", De = [], yt = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Kr = yt, Rr = yt, Xn = (t) => !/(dexie\.js|dexie\.min\.js)/.test(t), vt = "__dbnames", _t = "readonly", kt = "readwrite";
827
+ const yn = "3.2.4", he = String.fromCharCode(65535), Mt = -1 / 0, X = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Wn = "String expected.", Ne = [], yt = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Ar = yt, Or = yt, zn = (t) => !/(dexie\.js|dexie\.min\.js)/.test(t), vt = "__dbnames", _t = "readonly", kt = "readwrite";
824
828
  function ge(t, e) {
825
829
  return t ? e ? function() {
826
830
  return t.apply(this, arguments) && e.apply(this, arguments);
827
831
  } : t : e;
828
832
  }
829
- const Qn = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
833
+ const Hn = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
830
834
  function Qe(t) {
831
835
  return typeof t != "string" || /\./.test(t) ? (e) => e : (e) => (e[t] === void 0 && t in e && delete (e = We(e))[t], e);
832
836
  }
833
- class jr {
837
+ class Ir {
834
838
  _trans(e, n, r) {
835
- const s = this._tx || P.trans, i = this.name;
836
- function o(a, l, h) {
837
- if (!h.schema[i])
839
+ const s = this._tx || E.trans, i = this.name;
840
+ function o(a, c, d) {
841
+ if (!d.schema[i])
838
842
  throw new C.NotFound("Table " + i + " not part of transaction");
839
- return n(h.idbtrans, h);
843
+ return n(d.idbtrans, d);
840
844
  }
841
845
  const u = ze();
842
846
  try {
843
- return s && s.db === this.db ? s === P.trans ? s._promise(e, o, r) : oe(() => s._promise(e, o, r), { trans: s, transless: P.transless || P }) : Ft(this.db, e, [this.name], o);
847
+ return s && s.db === this.db ? s === E.trans ? s._promise(e, o, r) : oe(() => s._promise(e, o, r), { trans: s, transless: E.transless || E }) : Ft(this.db, e, [this.name], o);
844
848
  } finally {
845
849
  u && He();
846
850
  }
@@ -851,29 +855,29 @@ class jr {
851
855
  where(e) {
852
856
  if (typeof e == "string")
853
857
  return new this.db.WhereClause(this, e);
854
- if (F(e))
858
+ if (M(e))
855
859
  return new this.db.WhereClause(this, `[${e.join("+")}]`);
856
860
  const n = $(e);
857
861
  if (n.length === 1)
858
862
  return this.where(n[0]).equals(e[n[0]]);
859
- const r = this.schema.indexes.concat(this.schema.primKey).filter((l) => l.compound && n.every((h) => l.keyPath.indexOf(h) >= 0) && l.keyPath.every((h) => n.indexOf(h) >= 0))[0];
863
+ const r = this.schema.indexes.concat(this.schema.primKey).filter((c) => c.compound && n.every((d) => c.keyPath.indexOf(d) >= 0) && c.keyPath.every((d) => n.indexOf(d) >= 0))[0];
860
864
  if (r && this.db._maxKey !== he)
861
- return this.where(r.name).equals(r.keyPath.map((l) => e[l]));
865
+ return this.where(r.name).equals(r.keyPath.map((c) => e[c]));
862
866
  !r && G && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);
863
867
  const { idxByName: s } = this.schema, i = this.db._deps.indexedDB;
864
- function o(l, h) {
868
+ function o(c, d) {
865
869
  try {
866
- return i.cmp(l, h) === 0;
870
+ return i.cmp(c, d) === 0;
867
871
  } catch {
868
872
  return !1;
869
873
  }
870
874
  }
871
- const [u, a] = n.reduce(([l, h], c) => {
872
- const d = s[c], m = e[c];
873
- return [l || d, l || !d ? ge(h, d && d.multi ? (p) => {
874
- const f = te(p, c);
875
- return F(f) && f.some((y) => o(m, y));
876
- } : (p) => o(m, te(p, c))) : h];
875
+ const [u, a] = n.reduce(([c, d], l) => {
876
+ const h = s[l], f = e[l];
877
+ return [c || h, c || !h ? ge(d, h && h.multi ? (m) => {
878
+ const p = te(m, l);
879
+ return M(p) && p.some((v) => o(f, v));
880
+ } : (m) => o(f, te(m, l))) : d];
877
881
  }, [null, null]);
878
882
  return u ? this.where(u.name).equals(e[u.keyPath]).filter(a) : r ? this.filter(a) : this.where(n).equals("");
879
883
  }
@@ -899,7 +903,7 @@ class jr {
899
903
  return new this.db.Collection(new this.db.WhereClause(this));
900
904
  }
901
905
  orderBy(e) {
902
- return new this.db.Collection(new this.db.WhereClause(this, F(e) ? `[${e.join("+")}]` : e));
906
+ return new this.db.Collection(new this.db.WhereClause(this, M(e) ? `[${e.join("+")}]` : e));
903
907
  }
904
908
  reverse() {
905
909
  return this.toCollection().reverse();
@@ -938,12 +942,12 @@ class jr {
938
942
  });
939
943
  }
940
944
  update(e, n) {
941
- if (typeof e != "object" || F(e))
945
+ if (typeof e != "object" || M(e))
942
946
  return this.where(":id").equals(e).modify(n);
943
947
  {
944
948
  const r = te(e, this.schema.primKey.keyPath);
945
949
  if (r === void 0)
946
- return N(new C.InvalidArgument("Given object does not contain its primary key"));
950
+ return D(new C.InvalidArgument("Given object does not contain its primary key"));
947
951
  try {
948
952
  typeof n != "function" ? $(n).forEach((s) => {
949
953
  H(e, s, n[s]);
@@ -969,7 +973,7 @@ class jr {
969
973
  return this._trans("readwrite", (n) => this.core.mutate({ trans: n, type: "delete", keys: [e] })).then((n) => n.numFailures ? S.reject(n.failures[0]) : void 0);
970
974
  }
971
975
  clear() {
972
- return this._trans("readwrite", (e) => this.core.mutate({ trans: e, type: "deleteRange", range: Qn })).then((e) => e.numFailures ? S.reject(e.failures[0]) : void 0);
976
+ return this._trans("readwrite", (e) => this.core.mutate({ trans: e, type: "deleteRange", range: Hn })).then((e) => e.numFailures ? S.reject(e.failures[0]) : void 0);
973
977
  }
974
978
  bulkGet(e) {
975
979
  return this._trans("readonly", (n) => this.core.getMany({ keys: e, trans: n }).then((r) => r.map((s) => this.hook.reading.fire(s))));
@@ -982,12 +986,12 @@ class jr {
982
986
  throw new C.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
983
987
  if (s && s.length !== e.length)
984
988
  throw new C.InvalidArgument("Arguments objects and keys must have the same length");
985
- const l = e.length;
986
- let h = a && u ? e.map(Qe(a)) : e;
987
- return this.core.mutate({ trans: o, type: "add", keys: s, values: h, wantResults: i }).then(({ numFailures: c, results: d, lastResult: m, failures: p }) => {
988
- if (c === 0)
989
- return i ? d : m;
990
- throw new Re(`${this.name}.bulkAdd(): ${c} of ${l} operations failed`, p);
989
+ const c = e.length;
990
+ let d = a && u ? e.map(Qe(a)) : e;
991
+ return this.core.mutate({ trans: o, type: "add", keys: s, values: d, wantResults: i }).then(({ numFailures: l, results: h, lastResult: f, failures: m }) => {
992
+ if (l === 0)
993
+ return i ? h : f;
994
+ throw new je(`${this.name}.bulkAdd(): ${l} of ${c} operations failed`, m);
991
995
  });
992
996
  });
993
997
  }
@@ -999,12 +1003,12 @@ class jr {
999
1003
  throw new C.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
1000
1004
  if (s && s.length !== e.length)
1001
1005
  throw new C.InvalidArgument("Arguments objects and keys must have the same length");
1002
- const l = e.length;
1003
- let h = a && u ? e.map(Qe(a)) : e;
1004
- return this.core.mutate({ trans: o, type: "put", keys: s, values: h, wantResults: i }).then(({ numFailures: c, results: d, lastResult: m, failures: p }) => {
1005
- if (c === 0)
1006
- return i ? d : m;
1007
- throw new Re(`${this.name}.bulkPut(): ${c} of ${l} operations failed`, p);
1006
+ const c = e.length;
1007
+ let d = a && u ? e.map(Qe(a)) : e;
1008
+ return this.core.mutate({ trans: o, type: "put", keys: s, values: d, wantResults: i }).then(({ numFailures: l, results: h, lastResult: f, failures: m }) => {
1009
+ if (l === 0)
1010
+ return i ? h : f;
1011
+ throw new je(`${this.name}.bulkPut(): ${l} of ${c} operations failed`, m);
1008
1012
  });
1009
1013
  });
1010
1014
  }
@@ -1013,16 +1017,16 @@ class jr {
1013
1017
  return this._trans("readwrite", (r) => this.core.mutate({ trans: r, type: "delete", keys: e })).then(({ numFailures: r, lastResult: s, failures: i }) => {
1014
1018
  if (r === 0)
1015
1019
  return s;
1016
- throw new Re(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
1020
+ throw new je(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
1017
1021
  });
1018
1022
  }
1019
1023
  }
1020
1024
  function $e(t) {
1021
1025
  var e = {}, n = function(o, u) {
1022
1026
  if (u) {
1023
- for (var a = arguments.length, l = new Array(a - 1); --a; )
1024
- l[a - 1] = arguments[a];
1025
- return e[o].subscribe.apply(null, l), t;
1027
+ for (var a = arguments.length, c = new Array(a - 1); --a; )
1028
+ c[a - 1] = arguments[a];
1029
+ return e[o].subscribe.apply(null, c), t;
1026
1030
  }
1027
1031
  if (typeof o == "string")
1028
1032
  return e[o];
@@ -1033,30 +1037,30 @@ function $e(t) {
1033
1037
  return n;
1034
1038
  function i(o, u, a) {
1035
1039
  if (typeof o != "object") {
1036
- var l;
1037
- u || (u = Er), a || (a = I);
1038
- var h = { subscribers: [], fire: a, subscribe: function(c) {
1039
- h.subscribers.indexOf(c) === -1 && (h.subscribers.push(c), h.fire = u(h.fire, c));
1040
- }, unsubscribe: function(c) {
1041
- h.subscribers = h.subscribers.filter(function(d) {
1042
- return d !== c;
1043
- }), h.fire = h.subscribers.reduce(u, a);
1040
+ var c;
1041
+ u || (u = kr), a || (a = I);
1042
+ var d = { subscribers: [], fire: a, subscribe: function(l) {
1043
+ d.subscribers.indexOf(l) === -1 && (d.subscribers.push(l), d.fire = u(d.fire, l));
1044
+ }, unsubscribe: function(l) {
1045
+ d.subscribers = d.subscribers.filter(function(h) {
1046
+ return h !== l;
1047
+ }), d.fire = d.subscribers.reduce(u, a);
1044
1048
  } };
1045
- return e[o] = n[o] = h, h;
1049
+ return e[o] = n[o] = d, d;
1046
1050
  }
1047
- $(l = o).forEach(function(c) {
1048
- var d = l[c];
1049
- if (F(d))
1050
- i(c, l[c][0], l[c][1]);
1051
+ $(c = o).forEach(function(l) {
1052
+ var h = c[l];
1053
+ if (M(h))
1054
+ i(l, c[l][0], c[l][1]);
1051
1055
  else {
1052
- if (d !== "asap")
1056
+ if (h !== "asap")
1053
1057
  throw new C.InvalidArgument("Invalid event config");
1054
- var m = i(c, Me, function() {
1055
- for (var p = arguments.length, f = new Array(p); p--; )
1056
- f[p] = arguments[p];
1057
- m.subscribers.forEach(function(y) {
1058
- In(function() {
1059
- y.apply(null, f);
1058
+ var f = i(l, Fe, function() {
1059
+ for (var m = arguments.length, p = new Array(m); m--; )
1060
+ p[m] = arguments[m];
1061
+ f.subscribers.forEach(function(v) {
1062
+ Cn(function() {
1063
+ v.apply(null, p);
1060
1064
  });
1061
1065
  });
1062
1066
  });
@@ -1085,25 +1089,25 @@ function ot(t, e) {
1085
1089
  throw new C.Schema("KeyPath " + t.index + " on object store " + e.name + " is not indexed");
1086
1090
  return n;
1087
1091
  }
1088
- function _n(t, e, n) {
1092
+ function vn(t, e, n) {
1089
1093
  const r = ot(t, e.schema);
1090
1094
  return e.openCursor({ trans: n, values: !t.keysOnly, reverse: t.dir === "prev", unique: !!t.unique, query: { index: r, range: t.range } });
1091
1095
  }
1092
1096
  function Je(t, e, n, r) {
1093
1097
  const s = t.replayFilter ? ge(t.filter, t.replayFilter()) : t.filter;
1094
1098
  if (t.or) {
1095
- const i = {}, o = (u, a, l) => {
1096
- if (!s || s(a, l, (d) => a.stop(d), (d) => a.fail(d))) {
1097
- var h = a.primaryKey, c = "" + h;
1098
- c === "[object ArrayBuffer]" && (c = "" + new Uint8Array(h)), z(i, c) || (i[c] = !0, e(u, a, l));
1099
+ const i = {}, o = (u, a, c) => {
1100
+ if (!s || s(a, c, (h) => a.stop(h), (h) => a.fail(h))) {
1101
+ var d = a.primaryKey, l = "" + d;
1102
+ l === "[object ArrayBuffer]" && (l = "" + new Uint8Array(d)), z(i, l) || (i[l] = !0, e(u, a, c));
1099
1103
  }
1100
1104
  };
1101
- return Promise.all([t.or._iterate(o, n), kn(_n(t, r, n), t.algorithm, o, !t.keysOnly && t.valueMapper)]);
1105
+ return Promise.all([t.or._iterate(o, n), bn(vn(t, r, n), t.algorithm, o, !t.keysOnly && t.valueMapper)]);
1102
1106
  }
1103
- return kn(_n(t, r, n), ge(t.algorithm, s), e, !t.keysOnly && t.valueMapper);
1107
+ return bn(vn(t, r, n), ge(t.algorithm, s), e, !t.keysOnly && t.valueMapper);
1104
1108
  }
1105
- function kn(t, e, n, r) {
1106
- var s = R(r ? (i, o, u) => n(r(i), o, u) : n);
1109
+ function bn(t, e, n, r) {
1110
+ var s = j(r ? (i, o, u) => n(r(i), o, u) : n);
1107
1111
  return t.then((i) => {
1108
1112
  if (i)
1109
1113
  return i.start(() => {
@@ -1118,7 +1122,7 @@ function kn(t, e, n, r) {
1118
1122
  }
1119
1123
  function L(t, e) {
1120
1124
  try {
1121
- const n = xn(t), r = xn(e);
1125
+ const n = wn(t), r = wn(e);
1122
1126
  if (n !== r)
1123
1127
  return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
1124
1128
  switch (n) {
@@ -1129,18 +1133,18 @@ function L(t, e) {
1129
1133
  case "binary":
1130
1134
  return function(s, i) {
1131
1135
  const o = s.length, u = i.length, a = o < u ? o : u;
1132
- for (let l = 0; l < a; ++l)
1133
- if (s[l] !== i[l])
1134
- return s[l] < i[l] ? -1 : 1;
1136
+ for (let c = 0; c < a; ++c)
1137
+ if (s[c] !== i[c])
1138
+ return s[c] < i[c] ? -1 : 1;
1135
1139
  return o === u ? 0 : o < u ? -1 : 1;
1136
- }(Sn(t), Sn(e));
1140
+ }(_n(t), _n(e));
1137
1141
  case "Array":
1138
1142
  return function(s, i) {
1139
1143
  const o = s.length, u = i.length, a = o < u ? o : u;
1140
- for (let l = 0; l < a; ++l) {
1141
- const h = L(s[l], i[l]);
1142
- if (h !== 0)
1143
- return h;
1144
+ for (let c = 0; c < a; ++c) {
1145
+ const d = L(s[c], i[c]);
1146
+ if (d !== 0)
1147
+ return d;
1144
1148
  }
1145
1149
  return o === u ? 0 : o < u ? -1 : 1;
1146
1150
  }(t, e);
@@ -1149,26 +1153,26 @@ function L(t, e) {
1149
1153
  }
1150
1154
  return NaN;
1151
1155
  }
1152
- function xn(t) {
1156
+ function wn(t) {
1153
1157
  const e = typeof t;
1154
1158
  if (e !== "object")
1155
1159
  return e;
1156
1160
  if (ArrayBuffer.isView(t))
1157
1161
  return "binary";
1158
- const n = At(t);
1162
+ const n = Tt(t);
1159
1163
  return n === "ArrayBuffer" ? "binary" : n;
1160
1164
  }
1161
- function Sn(t) {
1165
+ function _n(t) {
1162
1166
  return t instanceof Uint8Array ? t : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : new Uint8Array(t);
1163
1167
  }
1164
- class Dr {
1168
+ class Kr {
1165
1169
  _read(e, n) {
1166
1170
  var r = this._ctx;
1167
- return r.error ? r.table._trans(null, N.bind(null, r.error)) : r.table._trans("readonly", e).then(n);
1171
+ return r.error ? r.table._trans(null, D.bind(null, r.error)) : r.table._trans("readonly", e).then(n);
1168
1172
  }
1169
1173
  _write(e) {
1170
1174
  var n = this._ctx;
1171
- return n.error ? n.table._trans(null, N.bind(null, n.error)) : n.table._trans("readwrite", e, "locked");
1175
+ return n.error ? n.table._trans(null, D.bind(null, n.error)) : n.table._trans("readwrite", e, "locked");
1172
1176
  }
1173
1177
  _addAlgorithm(e) {
1174
1178
  var n = this._ctx;
@@ -1199,16 +1203,16 @@ class Dr {
1199
1203
  }
1200
1204
  sortBy(e, n) {
1201
1205
  const r = e.split(".").reverse(), s = r[0], i = r.length - 1;
1202
- function o(l, h) {
1203
- return h ? o(l[r[h]], h - 1) : l[s];
1206
+ function o(c, d) {
1207
+ return d ? o(c[r[d]], d - 1) : c[s];
1204
1208
  }
1205
1209
  var u = this._ctx.dir === "next" ? 1 : -1;
1206
- function a(l, h) {
1207
- var c = o(l, i), d = o(h, i);
1208
- return c < d ? -u : c > d ? u : 0;
1210
+ function a(c, d) {
1211
+ var l = o(c, i), h = o(d, i);
1212
+ return l < h ? -u : l > h ? u : 0;
1209
1213
  }
1210
- return this.toArray(function(l) {
1211
- return l.sort(a);
1214
+ return this.toArray(function(c) {
1215
+ return c.sort(a);
1212
1216
  }).then(n);
1213
1217
  }
1214
1218
  toArray(e) {
@@ -1344,132 +1348,132 @@ class Dr {
1344
1348
  s = e;
1345
1349
  else {
1346
1350
  var i = $(e), o = i.length;
1347
- s = function(f) {
1348
- for (var y = !1, g = 0; g < o; ++g) {
1349
- var v = i[g], b = e[v];
1350
- te(f, v) !== b && (H(f, v, b), y = !0);
1351
+ s = function(p) {
1352
+ for (var v = !1, y = 0; y < o; ++y) {
1353
+ var g = i[y], b = e[g];
1354
+ te(p, g) !== b && (H(p, g, b), v = !0);
1351
1355
  }
1352
- return y;
1356
+ return v;
1353
1357
  };
1354
1358
  }
1355
- const u = n.table.core, { outbound: a, extractKey: l } = u.schema.primaryKey, h = this.db._options.modifyChunkSize || 200, c = [];
1356
- let d = 0;
1357
- const m = [], p = (f, y) => {
1358
- const { failures: g, numFailures: v } = y;
1359
- d += f - v;
1360
- for (let b of $(g))
1361
- c.push(g[b]);
1359
+ const u = n.table.core, { outbound: a, extractKey: c } = u.schema.primaryKey, d = this.db._options.modifyChunkSize || 200, l = [];
1360
+ let h = 0;
1361
+ const f = [], m = (p, v) => {
1362
+ const { failures: y, numFailures: g } = v;
1363
+ h += p - g;
1364
+ for (let b of $(y))
1365
+ l.push(y[b]);
1362
1366
  };
1363
- return this.clone().primaryKeys().then((f) => {
1364
- const y = (g) => {
1365
- const v = Math.min(h, f.length - g);
1366
- return u.getMany({ trans: r, keys: f.slice(g, g + v), cache: "immutable" }).then((b) => {
1367
- const x = [], E = [], k = a ? [] : null, w = [];
1368
- for (let _ = 0; _ < v; ++_) {
1369
- const j = b[_], O = { value: We(j), primKey: f[g + _] };
1370
- s.call(O, O.value, O) !== !1 && (O.value == null ? w.push(f[g + _]) : a || L(l(j), l(O.value)) === 0 ? (E.push(O.value), a && k.push(f[g + _])) : (w.push(f[g + _]), x.push(O.value)));
1367
+ return this.clone().primaryKeys().then((p) => {
1368
+ const v = (y) => {
1369
+ const g = Math.min(d, p.length - y);
1370
+ return u.getMany({ trans: r, keys: p.slice(y, y + g), cache: "immutable" }).then((b) => {
1371
+ const k = [], P = [], x = a ? [] : null, w = [];
1372
+ for (let _ = 0; _ < g; ++_) {
1373
+ const R = b[_], O = { value: We(R), primKey: p[y + _] };
1374
+ s.call(O, O.value, O) !== !1 && (O.value == null ? w.push(p[y + _]) : a || L(c(R), c(O.value)) === 0 ? (P.push(O.value), a && x.push(p[y + _])) : (w.push(p[y + _]), k.push(O.value)));
1371
1375
  }
1372
- const A = be(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Et) && { index: n.index, range: n.range };
1373
- return Promise.resolve(x.length > 0 && u.mutate({ trans: r, type: "add", values: x }).then((_) => {
1374
- for (let j in _.failures)
1375
- w.splice(parseInt(j), 1);
1376
- p(x.length, _);
1377
- })).then(() => (E.length > 0 || A && typeof e == "object") && u.mutate({ trans: r, type: "put", keys: k, values: E, criteria: A, changeSpec: typeof e != "function" && e }).then((_) => p(E.length, _))).then(() => (w.length > 0 || A && e === Et) && u.mutate({ trans: r, type: "delete", keys: w, criteria: A }).then((_) => p(w.length, _))).then(() => f.length > g + v && y(g + h));
1376
+ const A = be(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Pt) && { index: n.index, range: n.range };
1377
+ return Promise.resolve(k.length > 0 && u.mutate({ trans: r, type: "add", values: k }).then((_) => {
1378
+ for (let R in _.failures)
1379
+ w.splice(parseInt(R), 1);
1380
+ m(k.length, _);
1381
+ })).then(() => (P.length > 0 || A && typeof e == "object") && u.mutate({ trans: r, type: "put", keys: x, values: P, criteria: A, changeSpec: typeof e != "function" && e }).then((_) => m(P.length, _))).then(() => (w.length > 0 || A && e === Pt) && u.mutate({ trans: r, type: "delete", keys: w, criteria: A }).then((_) => m(w.length, _))).then(() => p.length > y + g && v(y + d));
1378
1382
  });
1379
1383
  };
1380
- return y(0).then(() => {
1381
- if (c.length > 0)
1382
- throw new lt("Error modifying one or more objects", c, d, m);
1383
- return f.length;
1384
+ return v(0).then(() => {
1385
+ if (l.length > 0)
1386
+ throw new ct("Error modifying one or more objects", l, h, f);
1387
+ return p.length;
1384
1388
  });
1385
1389
  });
1386
1390
  });
1387
1391
  }
1388
1392
  delete() {
1389
1393
  var e = this._ctx, n = e.range;
1390
- return be(e) && (e.isPrimKey && !Rr || n.type === 3) ? this._write((r) => {
1394
+ return be(e) && (e.isPrimKey && !Or || n.type === 3) ? this._write((r) => {
1391
1395
  const { primaryKey: s } = e.table.core.schema, i = n;
1392
- return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: u, lastResult: a, results: l, numFailures: h }) => {
1393
- if (h)
1394
- throw new lt("Could not delete some values", Object.keys(u).map((c) => u[c]), o - h);
1395
- return o - h;
1396
+ return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: u, lastResult: a, results: c, numFailures: d }) => {
1397
+ if (d)
1398
+ throw new ct("Could not delete some values", Object.keys(u).map((l) => u[l]), o - d);
1399
+ return o - d;
1396
1400
  }));
1397
- }) : this.modify(Et);
1401
+ }) : this.modify(Pt);
1398
1402
  }
1399
1403
  }
1400
- const Et = (t, e) => e.value = null;
1401
- function $r(t, e) {
1404
+ const Pt = (t, e) => e.value = null;
1405
+ function jr(t, e) {
1402
1406
  return t < e ? -1 : t === e ? 0 : 1;
1403
1407
  }
1404
- function Nr(t, e) {
1408
+ function Rr(t, e) {
1405
1409
  return t > e ? -1 : t === e ? 0 : 1;
1406
1410
  }
1407
1411
  function W(t, e, n) {
1408
- var r = t instanceof Zn ? new t.Collection(t) : t;
1412
+ var r = t instanceof Gn ? new t.Collection(t) : t;
1409
1413
  return r._ctx.error = n ? new n(e) : new TypeError(e), r;
1410
1414
  }
1411
1415
  function we(t) {
1412
- return new t.Collection(t, () => Jn("")).limit(0);
1416
+ return new t.Collection(t, () => Yn("")).limit(0);
1413
1417
  }
1414
- function Br(t, e, n, r, s, i) {
1418
+ function Nr(t, e, n, r, s, i) {
1415
1419
  for (var o = Math.min(t.length, r.length), u = -1, a = 0; a < o; ++a) {
1416
- var l = e[a];
1417
- if (l !== r[a])
1420
+ var c = e[a];
1421
+ if (c !== r[a])
1418
1422
  return s(t[a], n[a]) < 0 ? t.substr(0, a) + n[a] + n.substr(a + 1) : s(t[a], r[a]) < 0 ? t.substr(0, a) + r[a] + n.substr(a + 1) : u >= 0 ? t.substr(0, u) + e[u] + n.substr(u + 1) : null;
1419
- s(t[a], l) < 0 && (u = a);
1423
+ s(t[a], c) < 0 && (u = a);
1420
1424
  }
1421
1425
  return o < r.length && i === "next" ? t + n.substr(t.length) : o < t.length && i === "prev" ? t.substr(0, n.length) : u < 0 ? null : t.substr(0, u) + r[u] + n.substr(u + 1);
1422
1426
  }
1423
1427
  function Ze(t, e, n, r) {
1424
- var s, i, o, u, a, l, h, c = n.length;
1425
- if (!n.every((f) => typeof f == "string"))
1426
- return W(t, Gn);
1427
- function d(f) {
1428
- s = function(g) {
1429
- return g === "next" ? (v) => v.toUpperCase() : (v) => v.toLowerCase();
1430
- }(f), i = function(g) {
1431
- return g === "next" ? (v) => v.toLowerCase() : (v) => v.toUpperCase();
1432
- }(f), o = f === "next" ? $r : Nr;
1433
- var y = n.map(function(g) {
1434
- return { lower: i(g), upper: s(g) };
1435
- }).sort(function(g, v) {
1436
- return o(g.lower, v.lower);
1428
+ var s, i, o, u, a, c, d, l = n.length;
1429
+ if (!n.every((p) => typeof p == "string"))
1430
+ return W(t, Wn);
1431
+ function h(p) {
1432
+ s = function(y) {
1433
+ return y === "next" ? (g) => g.toUpperCase() : (g) => g.toLowerCase();
1434
+ }(p), i = function(y) {
1435
+ return y === "next" ? (g) => g.toLowerCase() : (g) => g.toUpperCase();
1436
+ }(p), o = p === "next" ? jr : Rr;
1437
+ var v = n.map(function(y) {
1438
+ return { lower: i(y), upper: s(y) };
1439
+ }).sort(function(y, g) {
1440
+ return o(y.lower, g.lower);
1437
1441
  });
1438
- u = y.map(function(g) {
1439
- return g.upper;
1440
- }), a = y.map(function(g) {
1441
- return g.lower;
1442
- }), l = f, h = f === "next" ? "" : r;
1443
- }
1444
- d("next");
1445
- var m = new t.Collection(t, () => re(u[0], a[c - 1] + r));
1446
- m._ondirectionchange = function(f) {
1447
- d(f);
1442
+ u = v.map(function(y) {
1443
+ return y.upper;
1444
+ }), a = v.map(function(y) {
1445
+ return y.lower;
1446
+ }), c = p, d = p === "next" ? "" : r;
1447
+ }
1448
+ h("next");
1449
+ var f = new t.Collection(t, () => re(u[0], a[l - 1] + r));
1450
+ f._ondirectionchange = function(p) {
1451
+ h(p);
1448
1452
  };
1449
- var p = 0;
1450
- return m._addAlgorithm(function(f, y, g) {
1451
- var v = f.key;
1452
- if (typeof v != "string")
1453
+ var m = 0;
1454
+ return f._addAlgorithm(function(p, v, y) {
1455
+ var g = p.key;
1456
+ if (typeof g != "string")
1453
1457
  return !1;
1454
- var b = i(v);
1455
- if (e(b, a, p))
1458
+ var b = i(g);
1459
+ if (e(b, a, m))
1456
1460
  return !0;
1457
- for (var x = null, E = p; E < c; ++E) {
1458
- var k = Br(v, b, u[E], a[E], o, l);
1459
- k === null && x === null ? p = E + 1 : (x === null || o(x, k) > 0) && (x = k);
1461
+ for (var k = null, P = m; P < l; ++P) {
1462
+ var x = Nr(g, b, u[P], a[P], o, c);
1463
+ x === null && k === null ? m = P + 1 : (k === null || o(k, x) > 0) && (k = x);
1460
1464
  }
1461
- return y(x !== null ? function() {
1462
- f.continue(x + h);
1463
- } : g), !1;
1464
- }), m;
1465
+ return v(k !== null ? function() {
1466
+ p.continue(k + d);
1467
+ } : y), !1;
1468
+ }), f;
1465
1469
  }
1466
1470
  function re(t, e, n, r) {
1467
1471
  return { type: 2, lower: t, upper: e, lowerOpen: n, upperOpen: r };
1468
1472
  }
1469
- function Jn(t) {
1473
+ function Yn(t) {
1470
1474
  return { type: 1, lower: t, upper: t };
1471
1475
  }
1472
- class Zn {
1476
+ class Gn {
1473
1477
  get Collection() {
1474
1478
  return this._ctx.table.db.Collection;
1475
1479
  }
@@ -1482,7 +1486,7 @@ class Zn {
1482
1486
  }
1483
1487
  }
1484
1488
  equals(e) {
1485
- return e == null ? W(this, X) : new this.Collection(this, () => Jn(e));
1489
+ return e == null ? W(this, X) : new this.Collection(this, () => Yn(e));
1486
1490
  }
1487
1491
  above(e) {
1488
1492
  return e == null ? W(this, X) : new this.Collection(this, () => re(e, void 0, !0));
@@ -1497,7 +1501,7 @@ class Zn {
1497
1501
  return e == null ? W(this, X) : new this.Collection(this, () => re(void 0, e));
1498
1502
  }
1499
1503
  startsWith(e) {
1500
- return typeof e != "string" ? W(this, Gn) : this.between(e, e + he, !0, !0);
1504
+ return typeof e != "string" ? W(this, Wn) : this.between(e, e + he, !0, !0);
1501
1505
  }
1502
1506
  startsWithIgnoreCase(e) {
1503
1507
  return e === "" ? this.startsWith(e) : Ze(this, (n, r) => n.indexOf(r[0]) === 0, [e], he);
@@ -1539,7 +1543,7 @@ class Zn {
1539
1543
  }), r;
1540
1544
  }
1541
1545
  notEqual(e) {
1542
- return this.inAnyRange([[qt, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
1546
+ return this.inAnyRange([[Mt, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
1543
1547
  }
1544
1548
  noneOf() {
1545
1549
  const e = J.apply(_e, arguments);
@@ -1550,51 +1554,51 @@ class Zn {
1550
1554
  } catch {
1551
1555
  return W(this, X);
1552
1556
  }
1553
- const n = e.reduce((r, s) => r ? r.concat([[r[r.length - 1][1], s]]) : [[qt, s]], null);
1557
+ const n = e.reduce((r, s) => r ? r.concat([[r[r.length - 1][1], s]]) : [[Mt, s]], null);
1554
1558
  return n.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
1555
1559
  }
1556
1560
  inAnyRange(e, n) {
1557
1561
  const r = this._cmp, s = this._ascending, i = this._descending, o = this._min, u = this._max;
1558
1562
  if (e.length === 0)
1559
1563
  return we(this);
1560
- if (!e.every((v) => v[0] !== void 0 && v[1] !== void 0 && s(v[0], v[1]) <= 0))
1564
+ if (!e.every((g) => g[0] !== void 0 && g[1] !== void 0 && s(g[0], g[1]) <= 0))
1561
1565
  return W(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", C.InvalidArgument);
1562
- const a = !n || n.includeLowers !== !1, l = n && n.includeUppers === !0;
1563
- let h, c = s;
1564
- function d(v, b) {
1565
- return c(v[0], b[0]);
1566
+ const a = !n || n.includeLowers !== !1, c = n && n.includeUppers === !0;
1567
+ let d, l = s;
1568
+ function h(g, b) {
1569
+ return l(g[0], b[0]);
1566
1570
  }
1567
1571
  try {
1568
- h = e.reduce(function(v, b) {
1569
- let x = 0, E = v.length;
1570
- for (; x < E; ++x) {
1571
- const k = v[x];
1572
- if (r(b[0], k[1]) < 0 && r(b[1], k[0]) > 0) {
1573
- k[0] = o(k[0], b[0]), k[1] = u(k[1], b[1]);
1572
+ d = e.reduce(function(g, b) {
1573
+ let k = 0, P = g.length;
1574
+ for (; k < P; ++k) {
1575
+ const x = g[k];
1576
+ if (r(b[0], x[1]) < 0 && r(b[1], x[0]) > 0) {
1577
+ x[0] = o(x[0], b[0]), x[1] = u(x[1], b[1]);
1574
1578
  break;
1575
1579
  }
1576
1580
  }
1577
- return x === E && v.push(b), v;
1578
- }, []), h.sort(d);
1581
+ return k === P && g.push(b), g;
1582
+ }, []), d.sort(h);
1579
1583
  } catch {
1580
1584
  return W(this, X);
1581
1585
  }
1582
- let m = 0;
1583
- const p = l ? (v) => s(v, h[m][1]) > 0 : (v) => s(v, h[m][1]) >= 0, f = a ? (v) => i(v, h[m][0]) > 0 : (v) => i(v, h[m][0]) >= 0;
1584
- let y = p;
1585
- const g = new this.Collection(this, () => re(h[0][0], h[h.length - 1][1], !a, !l));
1586
- return g._ondirectionchange = (v) => {
1587
- v === "next" ? (y = p, c = s) : (y = f, c = i), h.sort(d);
1588
- }, g._addAlgorithm((v, b, x) => {
1589
- for (var E = v.key; y(E); )
1590
- if (++m, m === h.length)
1591
- return b(x), !1;
1592
- return !!function(k) {
1593
- return !p(k) && !f(k);
1594
- }(E) || (this._cmp(E, h[m][1]) === 0 || this._cmp(E, h[m][0]) === 0 || b(() => {
1595
- c === s ? v.continue(h[m][0]) : v.continue(h[m][1]);
1586
+ let f = 0;
1587
+ const m = c ? (g) => s(g, d[f][1]) > 0 : (g) => s(g, d[f][1]) >= 0, p = a ? (g) => i(g, d[f][0]) > 0 : (g) => i(g, d[f][0]) >= 0;
1588
+ let v = m;
1589
+ const y = new this.Collection(this, () => re(d[0][0], d[d.length - 1][1], !a, !c));
1590
+ return y._ondirectionchange = (g) => {
1591
+ g === "next" ? (v = m, l = s) : (v = p, l = i), d.sort(h);
1592
+ }, y._addAlgorithm((g, b, k) => {
1593
+ for (var P = g.key; v(P); )
1594
+ if (++f, f === d.length)
1595
+ return b(k), !1;
1596
+ return !!function(x) {
1597
+ return !m(x) && !p(x);
1598
+ }(P) || (this._cmp(P, d[f][1]) === 0 || this._cmp(P, d[f][0]) === 0 || b(() => {
1599
+ l === s ? g.continue(d[f][0]) : g.continue(d[f][1]);
1596
1600
  }), !1);
1597
- }), g;
1601
+ }), y;
1598
1602
  }
1599
1603
  startsWithAnyOf() {
1600
1604
  const e = J.apply(_e, arguments);
@@ -1602,7 +1606,7 @@ class Zn {
1602
1606
  }
1603
1607
  }
1604
1608
  function Y(t) {
1605
- return R(function(e) {
1609
+ return j(function(e) {
1606
1610
  return qe(e), t(e.target.error), !1;
1607
1611
  });
1608
1612
  }
@@ -1610,13 +1614,13 @@ function qe(t) {
1610
1614
  t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault();
1611
1615
  }
1612
1616
  const Le = "storagemutated", ie = "x-storagemutated-1", ue = $e(null, Le);
1613
- class Mr {
1617
+ class $r {
1614
1618
  _lock() {
1615
- return Ie(!P.global), ++this._reculock, this._reculock !== 1 || P.global || (P.lockOwnerFor = this), this;
1619
+ return Ie(!E.global), ++this._reculock, this._reculock !== 1 || E.global || (E.lockOwnerFor = this), this;
1616
1620
  }
1617
1621
  _unlock() {
1618
- if (Ie(!P.global), --this._reculock == 0)
1619
- for (P.global || (P.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked(); ) {
1622
+ if (Ie(!E.global), --this._reculock == 0)
1623
+ for (E.global || (E.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked(); ) {
1620
1624
  var e = this._blockedFuncs.shift();
1621
1625
  try {
1622
1626
  Te(e[1], e[0]);
@@ -1626,7 +1630,7 @@ class Mr {
1626
1630
  return this;
1627
1631
  }
1628
1632
  _locked() {
1629
- return this._reculock && P.lockOwnerFor !== this;
1633
+ return this._reculock && E.lockOwnerFor !== this;
1630
1634
  }
1631
1635
  create(e) {
1632
1636
  if (!this.mode)
@@ -1643,24 +1647,24 @@ class Mr {
1643
1647
  }
1644
1648
  if (!this.active)
1645
1649
  throw new C.TransactionInactive();
1646
- return Ie(this._completion._state === null), (e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }))).onerror = R((s) => {
1650
+ return Ie(this._completion._state === null), (e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }))).onerror = j((s) => {
1647
1651
  qe(s), this._reject(e.error);
1648
- }), e.onabort = R((s) => {
1652
+ }), e.onabort = j((s) => {
1649
1653
  qe(s), this.active && this._reject(new C.Abort(e.error)), this.active = !1, this.on("abort").fire(s);
1650
- }), e.oncomplete = R(() => {
1654
+ }), e.oncomplete = j(() => {
1651
1655
  this.active = !1, this._resolve(), "mutatedParts" in e && ue.storagemutated.fire(e.mutatedParts);
1652
1656
  }), this;
1653
1657
  }
1654
1658
  _promise(e, n, r) {
1655
1659
  if (e === "readwrite" && this.mode !== "readwrite")
1656
- return N(new C.ReadOnly("Transaction is readonly"));
1660
+ return D(new C.ReadOnly("Transaction is readonly"));
1657
1661
  if (!this.active)
1658
- return N(new C.TransactionInactive());
1662
+ return D(new C.TransactionInactive());
1659
1663
  if (this._locked())
1660
1664
  return new S((i, o) => {
1661
1665
  this._blockedFuncs.push([() => {
1662
1666
  this._promise(e, n, r).then(i, o);
1663
- }, P]);
1667
+ }, E]);
1664
1668
  });
1665
1669
  if (r)
1666
1670
  return oe(() => {
@@ -1696,7 +1700,7 @@ class Mr {
1696
1700
  }
1697
1701
  var i = n._waitingFor;
1698
1702
  return new S((o, u) => {
1699
- r.then((a) => n._waitingQueue.push(R(o.bind(null, a))), (a) => n._waitingQueue.push(R(u.bind(null, a)))).finally(() => {
1703
+ r.then((a) => n._waitingQueue.push(j(o.bind(null, a))), (a) => n._waitingQueue.push(j(u.bind(null, a)))).finally(() => {
1700
1704
  n._waitingFor === i && (n._waitingFor = null);
1701
1705
  });
1702
1706
  });
@@ -1715,14 +1719,14 @@ class Mr {
1715
1719
  return s.core = this.db.core.table(e), n[e] = s, s;
1716
1720
  }
1717
1721
  }
1718
- function Lt(t, e, n, r, s, i, o) {
1719
- return { name: t, keyPath: e, unique: n, multi: r, auto: s, compound: i, src: (n && !o ? "&" : "") + (r ? "*" : "") + (s ? "++" : "") + er(e) };
1722
+ function qt(t, e, n, r, s, i, o) {
1723
+ return { name: t, keyPath: e, unique: n, multi: r, auto: s, compound: i, src: (n && !o ? "&" : "") + (r ? "*" : "") + (s ? "++" : "") + Xn(e) };
1720
1724
  }
1721
- function er(t) {
1725
+ function Xn(t) {
1722
1726
  return typeof t == "string" ? t : t ? "[" + [].join.call(t, "+") + "]" : "";
1723
1727
  }
1724
- function tr(t, e, n) {
1725
- return { name: t, primKey: e, indexes: n, mappedClass: null, idxByName: Kn(n, (r) => [r.name, r]) };
1728
+ function Qn(t, e, n) {
1729
+ return { name: t, primKey: e, indexes: n, mappedClass: null, idxByName: Tn(n, (r) => [r.name, r]) };
1726
1730
  }
1727
1731
  let Ue = (t) => {
1728
1732
  try {
@@ -1731,139 +1735,139 @@ let Ue = (t) => {
1731
1735
  return Ue = () => he, he;
1732
1736
  }
1733
1737
  };
1734
- function Ut(t) {
1738
+ function Lt(t) {
1735
1739
  return t == null ? () => {
1736
1740
  } : typeof t == "string" ? function(e) {
1737
1741
  return e.split(".").length === 1 ? (n) => n[e] : (n) => te(n, e);
1738
1742
  }(t) : (e) => te(e, t);
1739
1743
  }
1740
- function En(t) {
1744
+ function kn(t) {
1741
1745
  return [].slice.call(t);
1742
1746
  }
1743
- let Fr = 0;
1744
- function Ne(t) {
1747
+ let Dr = 0;
1748
+ function De(t) {
1745
1749
  return t == null ? ":id" : typeof t == "string" ? t : `[${t.join("+")}]`;
1746
1750
  }
1747
- function qr(t, e, n) {
1751
+ function Br(t, e, n) {
1748
1752
  function r(a) {
1749
1753
  if (a.type === 3)
1750
1754
  return null;
1751
1755
  if (a.type === 4)
1752
1756
  throw new Error("Cannot convert never type to IDBKeyRange");
1753
- const { lower: l, upper: h, lowerOpen: c, upperOpen: d } = a;
1754
- return l === void 0 ? h === void 0 ? null : e.upperBound(h, !!d) : h === void 0 ? e.lowerBound(l, !!c) : e.bound(l, h, !!c, !!d);
1755
- }
1756
- const { schema: s, hasGetAll: i } = function(a, l) {
1757
- const h = En(a.objectStoreNames);
1758
- return { schema: { name: a.name, tables: h.map((c) => l.objectStore(c)).map((c) => {
1759
- const { keyPath: d, autoIncrement: m } = c, p = F(d), f = d == null, y = {}, g = { name: c.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: f, compound: p, keyPath: d, autoIncrement: m, unique: !0, extractKey: Ut(d) }, indexes: En(c.indexNames).map((v) => c.index(v)).map((v) => {
1760
- const { name: b, unique: x, multiEntry: E, keyPath: k } = v, w = { name: b, compound: F(k), keyPath: k, unique: x, multiEntry: E, extractKey: Ut(k) };
1761
- return y[Ne(k)] = w, w;
1762
- }), getIndexByKeyPath: (v) => y[Ne(v)] };
1763
- return y[":id"] = g.primaryKey, d != null && (y[Ne(d)] = g.primaryKey), g;
1764
- }) }, hasGetAll: h.length > 0 && "getAll" in l.objectStore(h[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
1765
- }(t, n), o = s.tables.map((a) => function(l) {
1766
- const h = l.name;
1767
- return { name: h, schema: l, mutate: function({ trans: c, type: d, keys: m, values: p, range: f }) {
1768
- return new Promise((y, g) => {
1769
- y = R(y);
1770
- const v = c.objectStore(h), b = v.keyPath == null, x = d === "put" || d === "add";
1771
- if (!x && d !== "delete" && d !== "deleteRange")
1772
- throw new Error("Invalid operation type: " + d);
1773
- const { length: E } = m || p || { length: 1 };
1774
- if (m && p && m.length !== p.length)
1757
+ const { lower: c, upper: d, lowerOpen: l, upperOpen: h } = a;
1758
+ return c === void 0 ? d === void 0 ? null : e.upperBound(d, !!h) : d === void 0 ? e.lowerBound(c, !!l) : e.bound(c, d, !!l, !!h);
1759
+ }
1760
+ const { schema: s, hasGetAll: i } = function(a, c) {
1761
+ const d = kn(a.objectStoreNames);
1762
+ return { schema: { name: a.name, tables: d.map((l) => c.objectStore(l)).map((l) => {
1763
+ const { keyPath: h, autoIncrement: f } = l, m = M(h), p = h == null, v = {}, y = { name: l.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p, compound: m, keyPath: h, autoIncrement: f, unique: !0, extractKey: Lt(h) }, indexes: kn(l.indexNames).map((g) => l.index(g)).map((g) => {
1764
+ const { name: b, unique: k, multiEntry: P, keyPath: x } = g, w = { name: b, compound: M(x), keyPath: x, unique: k, multiEntry: P, extractKey: Lt(x) };
1765
+ return v[De(x)] = w, w;
1766
+ }), getIndexByKeyPath: (g) => v[De(g)] };
1767
+ return v[":id"] = y.primaryKey, h != null && (v[De(h)] = y.primaryKey), y;
1768
+ }) }, hasGetAll: d.length > 0 && "getAll" in c.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
1769
+ }(t, n), o = s.tables.map((a) => function(c) {
1770
+ const d = c.name;
1771
+ return { name: d, schema: c, mutate: function({ trans: l, type: h, keys: f, values: m, range: p }) {
1772
+ return new Promise((v, y) => {
1773
+ v = j(v);
1774
+ const g = l.objectStore(d), b = g.keyPath == null, k = h === "put" || h === "add";
1775
+ if (!k && h !== "delete" && h !== "deleteRange")
1776
+ throw new Error("Invalid operation type: " + h);
1777
+ const { length: P } = f || m || { length: 1 };
1778
+ if (f && m && f.length !== m.length)
1775
1779
  throw new Error("Given keys array must have same length as given values array.");
1776
- if (E === 0)
1777
- return y({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
1778
- let k;
1780
+ if (P === 0)
1781
+ return v({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
1782
+ let x;
1779
1783
  const w = [], A = [];
1780
1784
  let _ = 0;
1781
- const j = (q) => {
1785
+ const R = (q) => {
1782
1786
  ++_, qe(q);
1783
1787
  };
1784
- if (d === "deleteRange") {
1785
- if (f.type === 4)
1786
- return y({ numFailures: _, failures: A, results: [], lastResult: void 0 });
1787
- f.type === 3 ? w.push(k = v.clear()) : w.push(k = v.delete(r(f)));
1788
+ if (h === "deleteRange") {
1789
+ if (p.type === 4)
1790
+ return v({ numFailures: _, failures: A, results: [], lastResult: void 0 });
1791
+ p.type === 3 ? w.push(x = g.clear()) : w.push(x = g.delete(r(p)));
1788
1792
  } else {
1789
- const [q, B] = x ? b ? [p, m] : [p, null] : [m, null];
1790
- if (x)
1791
- for (let D = 0; D < E; ++D)
1792
- w.push(k = B && B[D] !== void 0 ? v[d](q[D], B[D]) : v[d](q[D])), k.onerror = j;
1793
+ const [q, B] = k ? b ? [m, f] : [m, null] : [f, null];
1794
+ if (k)
1795
+ for (let N = 0; N < P; ++N)
1796
+ w.push(x = B && B[N] !== void 0 ? g[h](q[N], B[N]) : g[h](q[N])), x.onerror = R;
1793
1797
  else
1794
- for (let D = 0; D < E; ++D)
1795
- w.push(k = v[d](q[D])), k.onerror = j;
1798
+ for (let N = 0; N < P; ++N)
1799
+ w.push(x = g[h](q[N])), x.onerror = R;
1796
1800
  }
1797
1801
  const O = (q) => {
1798
1802
  const B = q.target.result;
1799
- w.forEach((D, ye) => D.error != null && (A[ye] = D.error)), y({ numFailures: _, failures: A, results: d === "delete" ? m : w.map((D) => D.result), lastResult: B });
1803
+ w.forEach((N, ye) => N.error != null && (A[ye] = N.error)), v({ numFailures: _, failures: A, results: h === "delete" ? f : w.map((N) => N.result), lastResult: B });
1800
1804
  };
1801
- k.onerror = (q) => {
1802
- j(q), O(q);
1803
- }, k.onsuccess = O;
1805
+ x.onerror = (q) => {
1806
+ R(q), O(q);
1807
+ }, x.onsuccess = O;
1804
1808
  });
1805
- }, getMany: ({ trans: c, keys: d }) => new Promise((m, p) => {
1806
- m = R(m);
1807
- const f = c.objectStore(h), y = d.length, g = new Array(y);
1808
- let v, b = 0, x = 0;
1809
- const E = (w) => {
1809
+ }, getMany: ({ trans: l, keys: h }) => new Promise((f, m) => {
1810
+ f = j(f);
1811
+ const p = l.objectStore(d), v = h.length, y = new Array(v);
1812
+ let g, b = 0, k = 0;
1813
+ const P = (w) => {
1810
1814
  const A = w.target;
1811
- g[A._pos] = A.result, ++x === b && m(g);
1812
- }, k = Y(p);
1813
- for (let w = 0; w < y; ++w)
1814
- d[w] != null && (v = f.get(d[w]), v._pos = w, v.onsuccess = E, v.onerror = k, ++b);
1815
- b === 0 && m(g);
1816
- }), get: ({ trans: c, key: d }) => new Promise((m, p) => {
1817
- m = R(m);
1818
- const f = c.objectStore(h).get(d);
1819
- f.onsuccess = (y) => m(y.target.result), f.onerror = Y(p);
1820
- }), query: function(c) {
1821
- return (d) => new Promise((m, p) => {
1822
- m = R(m);
1823
- const { trans: f, values: y, limit: g, query: v } = d, b = g === 1 / 0 ? void 0 : g, { index: x, range: E } = v, k = f.objectStore(h), w = x.isPrimaryKey ? k : k.index(x.name), A = r(E);
1824
- if (g === 0)
1825
- return m({ result: [] });
1826
- if (c) {
1827
- const _ = y ? w.getAll(A, b) : w.getAllKeys(A, b);
1828
- _.onsuccess = (j) => m({ result: j.target.result }), _.onerror = Y(p);
1815
+ y[A._pos] = A.result, ++k === b && f(y);
1816
+ }, x = Y(m);
1817
+ for (let w = 0; w < v; ++w)
1818
+ h[w] != null && (g = p.get(h[w]), g._pos = w, g.onsuccess = P, g.onerror = x, ++b);
1819
+ b === 0 && f(y);
1820
+ }), get: ({ trans: l, key: h }) => new Promise((f, m) => {
1821
+ f = j(f);
1822
+ const p = l.objectStore(d).get(h);
1823
+ p.onsuccess = (v) => f(v.target.result), p.onerror = Y(m);
1824
+ }), query: function(l) {
1825
+ return (h) => new Promise((f, m) => {
1826
+ f = j(f);
1827
+ const { trans: p, values: v, limit: y, query: g } = h, b = y === 1 / 0 ? void 0 : y, { index: k, range: P } = g, x = p.objectStore(d), w = k.isPrimaryKey ? x : x.index(k.name), A = r(P);
1828
+ if (y === 0)
1829
+ return f({ result: [] });
1830
+ if (l) {
1831
+ const _ = v ? w.getAll(A, b) : w.getAllKeys(A, b);
1832
+ _.onsuccess = (R) => f({ result: R.target.result }), _.onerror = Y(m);
1829
1833
  } else {
1830
1834
  let _ = 0;
1831
- const j = y || !("openKeyCursor" in w) ? w.openCursor(A) : w.openKeyCursor(A), O = [];
1832
- j.onsuccess = (q) => {
1833
- const B = j.result;
1834
- return B ? (O.push(y ? B.value : B.primaryKey), ++_ === g ? m({ result: O }) : void B.continue()) : m({ result: O });
1835
- }, j.onerror = Y(p);
1835
+ const R = v || !("openKeyCursor" in w) ? w.openCursor(A) : w.openKeyCursor(A), O = [];
1836
+ R.onsuccess = (q) => {
1837
+ const B = R.result;
1838
+ return B ? (O.push(v ? B.value : B.primaryKey), ++_ === y ? f({ result: O }) : void B.continue()) : f({ result: O });
1839
+ }, R.onerror = Y(m);
1836
1840
  }
1837
1841
  });
1838
- }(i), openCursor: function({ trans: c, values: d, query: m, reverse: p, unique: f }) {
1839
- return new Promise((y, g) => {
1840
- y = R(y);
1841
- const { index: v, range: b } = m, x = c.objectStore(h), E = v.isPrimaryKey ? x : x.index(v.name), k = p ? f ? "prevunique" : "prev" : f ? "nextunique" : "next", w = d || !("openKeyCursor" in E) ? E.openCursor(r(b), k) : E.openKeyCursor(r(b), k);
1842
- w.onerror = Y(g), w.onsuccess = R((A) => {
1842
+ }(i), openCursor: function({ trans: l, values: h, query: f, reverse: m, unique: p }) {
1843
+ return new Promise((v, y) => {
1844
+ v = j(v);
1845
+ const { index: g, range: b } = f, k = l.objectStore(d), P = g.isPrimaryKey ? k : k.index(g.name), x = m ? p ? "prevunique" : "prev" : p ? "nextunique" : "next", w = h || !("openKeyCursor" in P) ? P.openCursor(r(b), x) : P.openKeyCursor(r(b), x);
1846
+ w.onerror = Y(y), w.onsuccess = j((A) => {
1843
1847
  const _ = w.result;
1844
1848
  if (!_)
1845
- return void y(null);
1846
- _.___id = ++Fr, _.done = !1;
1847
- const j = _.continue.bind(_);
1849
+ return void v(null);
1850
+ _.___id = ++Dr, _.done = !1;
1851
+ const R = _.continue.bind(_);
1848
1852
  let O = _.continuePrimaryKey;
1849
1853
  O && (O = O.bind(_));
1850
1854
  const q = _.advance.bind(_), B = () => {
1851
1855
  throw new Error("Cursor not stopped");
1852
1856
  };
1853
- _.trans = c, _.stop = _.continue = _.continuePrimaryKey = _.advance = () => {
1857
+ _.trans = l, _.stop = _.continue = _.continuePrimaryKey = _.advance = () => {
1854
1858
  throw new Error("Cursor not started");
1855
- }, _.fail = R(g), _.next = function() {
1856
- let D = 1;
1857
- return this.start(() => D-- ? this.continue() : this.stop()).then(() => this);
1858
- }, _.start = (D) => {
1859
- const ye = new Promise((V, ce) => {
1860
- V = R(V), w.onerror = Y(ce), _.fail = ce, _.stop = (Ae) => {
1859
+ }, _.fail = j(y), _.next = function() {
1860
+ let N = 1;
1861
+ return this.start(() => N-- ? this.continue() : this.stop()).then(() => this);
1862
+ }, _.start = (N) => {
1863
+ const ye = new Promise((V, le) => {
1864
+ V = j(V), w.onerror = Y(le), _.fail = le, _.stop = (Ae) => {
1861
1865
  _.stop = _.continue = _.continuePrimaryKey = _.advance = B, V(Ae);
1862
1866
  };
1863
1867
  }), ve = () => {
1864
1868
  if (w.result)
1865
1869
  try {
1866
- D();
1870
+ N();
1867
1871
  } catch (V) {
1868
1872
  _.fail(V);
1869
1873
  }
@@ -1872,17 +1876,17 @@ function qr(t, e, n) {
1872
1876
  throw new Error("Cursor behind last entry");
1873
1877
  }, _.stop();
1874
1878
  };
1875
- return w.onsuccess = R((V) => {
1879
+ return w.onsuccess = j((V) => {
1876
1880
  w.onsuccess = ve, ve();
1877
- }), _.continue = j, _.continuePrimaryKey = O, _.advance = q, ve(), ye;
1878
- }, y(_);
1879
- }, g);
1881
+ }), _.continue = R, _.continuePrimaryKey = O, _.advance = q, ve(), ye;
1882
+ }, v(_);
1883
+ }, y);
1880
1884
  });
1881
- }, count({ query: c, trans: d }) {
1882
- const { index: m, range: p } = c;
1883
- return new Promise((f, y) => {
1884
- const g = d.objectStore(h), v = m.isPrimaryKey ? g : g.index(m.name), b = r(p), x = b ? v.count(b) : v.count();
1885
- x.onsuccess = R((E) => f(E.target.result)), x.onerror = Y(y);
1885
+ }, count({ query: l, trans: h }) {
1886
+ const { index: f, range: m } = l;
1887
+ return new Promise((p, v) => {
1888
+ const y = h.objectStore(d), g = f.isPrimaryKey ? y : y.index(f.name), b = r(m), k = b ? g.count(b) : g.count();
1889
+ k.onsuccess = j((P) => p(P.target.result)), k.onerror = Y(v);
1886
1890
  });
1887
1891
  } };
1888
1892
  }(a)), u = {};
@@ -1892,11 +1896,11 @@ function qr(t, e, n) {
1892
1896
  return u[a];
1893
1897
  }, MIN_KEY: -1 / 0, MAX_KEY: Ue(e), schema: s };
1894
1898
  }
1895
- function Vt({ _novip: t }, e) {
1899
+ function Ut({ _novip: t }, e) {
1896
1900
  const n = e.db, r = function(s, i, { IDBKeyRange: o, indexedDB: u }, a) {
1897
- return { dbcore: function(l, h) {
1898
- return h.reduce((c, { create: d }) => ({ ...c, ...d(c) }), l);
1899
- }(qr(i, o, a), s.dbcore) };
1901
+ return { dbcore: function(c, d) {
1902
+ return d.reduce((l, { create: h }) => ({ ...l, ...h(l) }), c);
1903
+ }(Br(i, o, a), s.dbcore) };
1900
1904
  }(t._middlewares, n, t._deps, e);
1901
1905
  t.core = r.dbcore, t.tables.forEach((s) => {
1902
1906
  const i = s.name;
@@ -1907,88 +1911,88 @@ function mt({ _novip: t }, e, n, r) {
1907
1911
  n.forEach((s) => {
1908
1912
  const i = r[s];
1909
1913
  e.forEach((o) => {
1910
- const u = Zt(o, s);
1914
+ const u = Jt(o, s);
1911
1915
  (!u || "value" in u && u.value === void 0) && (o === t.Transaction.prototype || o instanceof t.Transaction ? ee(o, s, { get() {
1912
1916
  return this.table(s);
1913
1917
  }, set(a) {
1914
- An(this, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
1918
+ Pn(this, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
1915
1919
  } }) : o[s] = new t.Table(s, i));
1916
1920
  });
1917
1921
  });
1918
1922
  }
1919
- function Wt({ _novip: t }, e) {
1923
+ function Vt({ _novip: t }, e) {
1920
1924
  e.forEach((n) => {
1921
1925
  for (let r in n)
1922
1926
  n[r] instanceof t.Table && delete n[r];
1923
1927
  });
1924
1928
  }
1925
- function Lr(t, e) {
1929
+ function Fr(t, e) {
1926
1930
  return t._cfg.version - e._cfg.version;
1927
1931
  }
1928
- function Ur(t, e, n, r) {
1932
+ function Mr(t, e, n, r) {
1929
1933
  const s = t._dbSchema, i = t._createTransaction("readwrite", t._storeNames, s);
1930
1934
  i.create(n), i._completion.catch(r);
1931
- const o = i._reject.bind(i), u = P.transless || P;
1935
+ const o = i._reject.bind(i), u = E.transless || E;
1932
1936
  oe(() => {
1933
- P.trans = i, P.transless = u, e === 0 ? ($(s).forEach((a) => {
1934
- Pt(n, a, s[a].primKey, s[a].indexes);
1935
- }), Vt(t, n), S.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: a }, l, h, c) {
1936
- const d = [], m = a._versions;
1937
- let p = a._dbSchema = Ht(a, a.idbdb, c), f = !1;
1938
- const y = m.filter((v) => v._cfg.version >= l);
1939
- function g() {
1940
- return d.length ? S.resolve(d.shift()(h.idbtrans)).then(g) : S.resolve();
1937
+ E.trans = i, E.transless = u, e === 0 ? ($(s).forEach((a) => {
1938
+ Et(n, a, s[a].primKey, s[a].indexes);
1939
+ }), Ut(t, n), S.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: a }, c, d, l) {
1940
+ const h = [], f = a._versions;
1941
+ let m = a._dbSchema = zt(a, a.idbdb, l), p = !1;
1942
+ const v = f.filter((g) => g._cfg.version >= c);
1943
+ function y() {
1944
+ return h.length ? S.resolve(h.shift()(d.idbtrans)).then(y) : S.resolve();
1941
1945
  }
1942
- return y.forEach((v) => {
1943
- d.push(() => {
1944
- const b = p, x = v._cfg.dbschema;
1945
- Yt(a, b, c), Yt(a, x, c), p = a._dbSchema = x;
1946
- const E = nr(b, x);
1947
- E.add.forEach((w) => {
1948
- Pt(c, w[0], w[1].primKey, w[1].indexes);
1949
- }), E.change.forEach((w) => {
1946
+ return v.forEach((g) => {
1947
+ h.push(() => {
1948
+ const b = m, k = g._cfg.dbschema;
1949
+ Ht(a, b, l), Ht(a, k, l), m = a._dbSchema = k;
1950
+ const P = Jn(b, k);
1951
+ P.add.forEach((w) => {
1952
+ Et(l, w[0], w[1].primKey, w[1].indexes);
1953
+ }), P.change.forEach((w) => {
1950
1954
  if (w.recreate)
1951
1955
  throw new C.Upgrade("Not yet support for changing primary key");
1952
1956
  {
1953
- const A = c.objectStore(w.name);
1954
- w.add.forEach((_) => zt(A, _)), w.change.forEach((_) => {
1955
- A.deleteIndex(_.name), zt(A, _);
1957
+ const A = l.objectStore(w.name);
1958
+ w.add.forEach((_) => Wt(A, _)), w.change.forEach((_) => {
1959
+ A.deleteIndex(_.name), Wt(A, _);
1956
1960
  }), w.del.forEach((_) => A.deleteIndex(_));
1957
1961
  }
1958
1962
  });
1959
- const k = v._cfg.contentUpgrade;
1960
- if (k && v._cfg.version > l) {
1961
- Vt(a, c), h._memoizedTables = {}, f = !0;
1962
- let w = Rn(x);
1963
- E.del.forEach((O) => {
1963
+ const x = g._cfg.contentUpgrade;
1964
+ if (x && g._cfg.version > c) {
1965
+ Ut(a, l), d._memoizedTables = {}, p = !0;
1966
+ let w = An(k);
1967
+ P.del.forEach((O) => {
1964
1968
  w[O] = b[O];
1965
- }), Wt(a, [a.Transaction.prototype]), mt(a, [a.Transaction.prototype], $(w), w), h.schema = w;
1966
- const A = en(k);
1969
+ }), Vt(a, [a.Transaction.prototype]), mt(a, [a.Transaction.prototype], $(w), w), d.schema = w;
1970
+ const A = Zt(x);
1967
1971
  let _;
1968
1972
  A && Ce();
1969
- const j = S.follow(() => {
1970
- if (_ = k(h), _ && A) {
1973
+ const R = S.follow(() => {
1974
+ if (_ = x(d), _ && A) {
1971
1975
  var O = ne.bind(null, null);
1972
1976
  _.then(O, O);
1973
1977
  }
1974
1978
  });
1975
- return _ && typeof _.then == "function" ? S.resolve(_) : j.then(() => _);
1979
+ return _ && typeof _.then == "function" ? S.resolve(_) : R.then(() => _);
1976
1980
  }
1977
- }), d.push((b) => {
1978
- (!f || !Kr) && function(x, E) {
1979
- [].slice.call(E.db.objectStoreNames).forEach((k) => x[k] == null && E.db.deleteObjectStore(k));
1980
- }(v._cfg.dbschema, b), Wt(a, [a.Transaction.prototype]), mt(a, [a.Transaction.prototype], a._storeNames, a._dbSchema), h.schema = a._dbSchema;
1981
+ }), h.push((b) => {
1982
+ (!p || !Ar) && function(k, P) {
1983
+ [].slice.call(P.db.objectStoreNames).forEach((x) => k[x] == null && P.db.deleteObjectStore(x));
1984
+ }(g._cfg.dbschema, b), Vt(a, [a.Transaction.prototype]), mt(a, [a.Transaction.prototype], a._storeNames, a._dbSchema), d.schema = a._dbSchema;
1981
1985
  });
1982
- }), g().then(() => {
1983
- var v, b;
1984
- b = c, $(v = p).forEach((x) => {
1985
- b.db.objectStoreNames.contains(x) || Pt(b, x, v[x].primKey, v[x].indexes);
1986
+ }), y().then(() => {
1987
+ var g, b;
1988
+ b = l, $(g = m).forEach((k) => {
1989
+ b.db.objectStoreNames.contains(k) || Et(b, k, g[k].primKey, g[k].indexes);
1986
1990
  });
1987
1991
  });
1988
1992
  }(t, e, i, n).catch(o);
1989
1993
  });
1990
1994
  }
1991
- function nr(t, e) {
1995
+ function Jn(t, e) {
1992
1996
  const n = { del: [], add: [], change: [] };
1993
1997
  let r;
1994
1998
  for (r in t)
@@ -2001,12 +2005,12 @@ function nr(t, e) {
2001
2005
  o.recreate = !0, n.change.push(o);
2002
2006
  else {
2003
2007
  const u = s.idxByName, a = i.idxByName;
2004
- let l;
2005
- for (l in u)
2006
- a[l] || o.del.push(l);
2007
- for (l in a) {
2008
- const h = u[l], c = a[l];
2009
- h ? h.src !== c.src && o.change.push(c) : o.add.push(c);
2008
+ let c;
2009
+ for (c in u)
2010
+ a[c] || o.del.push(c);
2011
+ for (c in a) {
2012
+ const d = u[c], l = a[c];
2013
+ d ? d.src !== l.src && o.change.push(l) : o.add.push(l);
2010
2014
  }
2011
2015
  (o.del.length > 0 || o.add.length > 0 || o.change.length > 0) && n.change.push(o);
2012
2016
  }
@@ -2015,50 +2019,50 @@ function nr(t, e) {
2015
2019
  }
2016
2020
  return n;
2017
2021
  }
2018
- function Pt(t, e, n, r) {
2022
+ function Et(t, e, n, r) {
2019
2023
  const s = t.db.createObjectStore(e, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
2020
- return r.forEach((i) => zt(s, i)), s;
2024
+ return r.forEach((i) => Wt(s, i)), s;
2021
2025
  }
2022
- function zt(t, e) {
2026
+ function Wt(t, e) {
2023
2027
  t.createIndex(e.name, e.keyPath, { unique: e.unique, multiEntry: e.multi });
2024
2028
  }
2025
- function Ht(t, e, n) {
2029
+ function zt(t, e, n) {
2026
2030
  const r = {};
2027
- return ct(e.objectStoreNames, 0).forEach((s) => {
2031
+ return lt(e.objectStoreNames, 0).forEach((s) => {
2028
2032
  const i = n.objectStore(s);
2029
2033
  let o = i.keyPath;
2030
- const u = Lt(er(o), o || "", !1, !1, !!i.autoIncrement, o && typeof o != "string", !0), a = [];
2031
- for (let h = 0; h < i.indexNames.length; ++h) {
2032
- const c = i.index(i.indexNames[h]);
2033
- o = c.keyPath;
2034
- var l = Lt(c.name, o, !!c.unique, !!c.multiEntry, !1, o && typeof o != "string", !1);
2035
- a.push(l);
2034
+ const u = qt(Xn(o), o || "", !1, !1, !!i.autoIncrement, o && typeof o != "string", !0), a = [];
2035
+ for (let d = 0; d < i.indexNames.length; ++d) {
2036
+ const l = i.index(i.indexNames[d]);
2037
+ o = l.keyPath;
2038
+ var c = qt(l.name, o, !!l.unique, !!l.multiEntry, !1, o && typeof o != "string", !1);
2039
+ a.push(c);
2036
2040
  }
2037
- r[s] = tr(s, u, a);
2041
+ r[s] = Qn(s, u, a);
2038
2042
  }), r;
2039
2043
  }
2040
- function Yt({ _novip: t }, e, n) {
2044
+ function Ht({ _novip: t }, e, n) {
2041
2045
  const r = n.db.objectStoreNames;
2042
2046
  for (let s = 0; s < r.length; ++s) {
2043
2047
  const i = r[s], o = n.objectStore(i);
2044
2048
  t._hasGetAll = "getAll" in o;
2045
2049
  for (let u = 0; u < o.indexNames.length; ++u) {
2046
- const a = o.indexNames[u], l = o.index(a).keyPath, h = typeof l == "string" ? l : "[" + ct(l).join("+") + "]";
2050
+ const a = o.indexNames[u], c = o.index(a).keyPath, d = typeof c == "string" ? c : "[" + lt(c).join("+") + "]";
2047
2051
  if (e[i]) {
2048
- const c = e[i].idxByName[h];
2049
- c && (c.name = a, delete e[i].idxByName[h], e[i].idxByName[a] = c);
2052
+ const l = e[i].idxByName[d];
2053
+ l && (l.name = a, delete e[i].idxByName[d], e[i].idxByName[a] = l);
2050
2054
  }
2051
2055
  }
2052
2056
  }
2053
2057
  typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && K.WorkerGlobalScope && K instanceof K.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (t._hasGetAll = !1);
2054
2058
  }
2055
- class Vr {
2059
+ class qr {
2056
2060
  _parseStoresSpec(e, n) {
2057
2061
  $(e).forEach((r) => {
2058
2062
  if (e[r] !== null) {
2059
2063
  var s = e[r].split(",").map((o, u) => {
2060
- const a = (o = o.trim()).replace(/([&*]|\+\+)/g, ""), l = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
2061
- return Lt(a, l || null, /\&/.test(o), /\*/.test(o), /\+\+/.test(o), F(l), u === 0);
2064
+ const a = (o = o.trim()).replace(/([&*]|\+\+)/g, ""), c = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
2065
+ return qt(a, c || null, /\&/.test(o), /\*/.test(o), /\+\+/.test(o), M(c), u === 0);
2062
2066
  }), i = s.shift();
2063
2067
  if (i.multi)
2064
2068
  throw new C.Schema("Primary key cannot be multi-valued");
@@ -2067,7 +2071,7 @@ class Vr {
2067
2071
  throw new C.Schema("Only primary key can be marked as autoIncrement (++)");
2068
2072
  if (!o.keyPath)
2069
2073
  throw new C.Schema("Index must have a name and cannot be an empty string");
2070
- }), n[r] = tr(r, i, s);
2074
+ }), n[r] = Qn(r, i, s);
2071
2075
  }
2072
2076
  });
2073
2077
  }
@@ -2078,25 +2082,25 @@ class Vr {
2078
2082
  let i = {};
2079
2083
  return r.forEach((o) => {
2080
2084
  U(s, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(s, i);
2081
- }), n._dbSchema = i, Wt(n, [n._allTables, n, n.Transaction.prototype]), mt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], $(i), i), n._storeNames = $(i), this;
2085
+ }), n._dbSchema = i, Vt(n, [n._allTables, n, n.Transaction.prototype]), mt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], $(i), i), n._storeNames = $(i), this;
2082
2086
  }
2083
2087
  upgrade(e) {
2084
- return this._cfg.contentUpgrade = rn(this._cfg.contentUpgrade || I, e), this;
2088
+ return this._cfg.contentUpgrade = nn(this._cfg.contentUpgrade || I, e), this;
2085
2089
  }
2086
2090
  }
2087
- function un(t, e) {
2091
+ function an(t, e) {
2088
2092
  let n = t._dbNamesDB;
2089
2093
  return n || (n = t._dbNamesDB = new pe(vt, { addons: [], indexedDB: t, IDBKeyRange: e }), n.version(1).stores({ dbnames: "name" })), n.table("dbnames");
2090
2094
  }
2091
- function cn(t) {
2095
+ function un(t) {
2092
2096
  return t && typeof t.databases == "function";
2093
2097
  }
2094
- function Gt(t) {
2098
+ function Yt(t) {
2095
2099
  return oe(function() {
2096
- return P.letThrough = !0, t();
2100
+ return E.letThrough = !0, t();
2097
2101
  });
2098
2102
  }
2099
- function Wr() {
2103
+ function Lr() {
2100
2104
  var t;
2101
2105
  return !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(e) {
2102
2106
  var n = function() {
@@ -2107,64 +2111,64 @@ function Wr() {
2107
2111
  return clearInterval(t);
2108
2112
  }) : Promise.resolve();
2109
2113
  }
2110
- function zr(t) {
2114
+ function Ur(t) {
2111
2115
  const e = t._state, { indexedDB: n } = t._deps;
2112
2116
  if (e.isBeingOpened || t.idbdb)
2113
- return e.dbReadyPromise.then(() => e.dbOpenError ? N(e.dbOpenError) : t);
2114
- G && (e.openCanceller._stackHolder = Pe()), e.isBeingOpened = !0, e.dbOpenError = null, e.openComplete = !1;
2117
+ return e.dbReadyPromise.then(() => e.dbOpenError ? D(e.dbOpenError) : t);
2118
+ G && (e.openCanceller._stackHolder = Ee()), e.isBeingOpened = !0, e.dbOpenError = null, e.openComplete = !1;
2115
2119
  const r = e.openCanceller;
2116
2120
  function s() {
2117
2121
  if (e.openCanceller !== r)
2118
2122
  throw new C.DatabaseClosed("db.open() was cancelled");
2119
2123
  }
2120
2124
  let i = e.dbReadyResolve, o = null, u = !1;
2121
- return S.race([r, (typeof navigator > "u" ? S.resolve() : Wr()).then(() => new S((a, l) => {
2125
+ return S.race([r, (typeof navigator > "u" ? S.resolve() : Lr()).then(() => new S((a, c) => {
2122
2126
  if (s(), !n)
2123
2127
  throw new C.MissingAPI();
2124
- const h = t.name, c = e.autoSchema ? n.open(h) : n.open(h, Math.round(10 * t.verno));
2125
- if (!c)
2128
+ const d = t.name, l = e.autoSchema ? n.open(d) : n.open(d, Math.round(10 * t.verno));
2129
+ if (!l)
2126
2130
  throw new C.MissingAPI();
2127
- c.onerror = Y(l), c.onblocked = R(t._fireOnBlocked), c.onupgradeneeded = R((d) => {
2128
- if (o = c.transaction, e.autoSchema && !t._options.allowEmptyDB) {
2129
- c.onerror = qe, o.abort(), c.result.close();
2130
- const p = n.deleteDatabase(h);
2131
- p.onsuccess = p.onerror = R(() => {
2132
- l(new C.NoSuchDatabase(`Database ${h} doesnt exist`));
2131
+ l.onerror = Y(c), l.onblocked = j(t._fireOnBlocked), l.onupgradeneeded = j((h) => {
2132
+ if (o = l.transaction, e.autoSchema && !t._options.allowEmptyDB) {
2133
+ l.onerror = qe, o.abort(), l.result.close();
2134
+ const m = n.deleteDatabase(d);
2135
+ m.onsuccess = m.onerror = j(() => {
2136
+ c(new C.NoSuchDatabase(`Database ${d} doesnt exist`));
2133
2137
  });
2134
2138
  } else {
2135
- o.onerror = Y(l);
2136
- var m = d.oldVersion > Math.pow(2, 62) ? 0 : d.oldVersion;
2137
- u = m < 1, t._novip.idbdb = c.result, Ur(t, m / 10, o, l);
2139
+ o.onerror = Y(c);
2140
+ var f = h.oldVersion > Math.pow(2, 62) ? 0 : h.oldVersion;
2141
+ u = f < 1, t._novip.idbdb = l.result, Mr(t, f / 10, o, c);
2138
2142
  }
2139
- }, l), c.onsuccess = R(() => {
2143
+ }, c), l.onsuccess = j(() => {
2140
2144
  o = null;
2141
- const d = t._novip.idbdb = c.result, m = ct(d.objectStoreNames);
2142
- if (m.length > 0)
2145
+ const h = t._novip.idbdb = l.result, f = lt(h.objectStoreNames);
2146
+ if (f.length > 0)
2143
2147
  try {
2144
- const f = d.transaction((p = m).length === 1 ? p[0] : p, "readonly");
2145
- e.autoSchema ? function({ _novip: y }, g, v) {
2146
- y.verno = g.version / 10;
2147
- const b = y._dbSchema = Ht(0, g, v);
2148
- y._storeNames = ct(g.objectStoreNames, 0), mt(y, [y._allTables], $(b), b);
2149
- }(t, d, f) : (Yt(t, t._dbSchema, f), function(y, g) {
2150
- const v = nr(Ht(0, y.idbdb, g), y._dbSchema);
2151
- return !(v.add.length || v.change.some((b) => b.add.length || b.change.length));
2152
- }(t, f) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Vt(t, f);
2148
+ const p = h.transaction((m = f).length === 1 ? m[0] : m, "readonly");
2149
+ e.autoSchema ? function({ _novip: v }, y, g) {
2150
+ v.verno = y.version / 10;
2151
+ const b = v._dbSchema = zt(0, y, g);
2152
+ v._storeNames = lt(y.objectStoreNames, 0), mt(v, [v._allTables], $(b), b);
2153
+ }(t, h, p) : (Ht(t, t._dbSchema, p), function(v, y) {
2154
+ const g = Jn(zt(0, v.idbdb, y), v._dbSchema);
2155
+ return !(g.add.length || g.change.some((b) => b.add.length || b.change.length));
2156
+ }(t, p) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Ut(t, p);
2153
2157
  } catch {
2154
2158
  }
2155
- var p;
2156
- De.push(t), d.onversionchange = R((f) => {
2157
- e.vcFired = !0, t.on("versionchange").fire(f);
2158
- }), d.onclose = R((f) => {
2159
- t.on("close").fire(f);
2160
- }), u && function({ indexedDB: f, IDBKeyRange: y }, g) {
2161
- !cn(f) && g !== vt && un(f, y).put({ name: g }).catch(I);
2162
- }(t._deps, h), a();
2163
- }, l);
2164
- }))]).then(() => (s(), e.onReadyBeingFired = [], S.resolve(Gt(() => t.on.ready.fire(t.vip))).then(function a() {
2159
+ var m;
2160
+ Ne.push(t), h.onversionchange = j((p) => {
2161
+ e.vcFired = !0, t.on("versionchange").fire(p);
2162
+ }), h.onclose = j((p) => {
2163
+ t.on("close").fire(p);
2164
+ }), u && function({ indexedDB: p, IDBKeyRange: v }, y) {
2165
+ !un(p) && y !== vt && an(p, v).put({ name: y }).catch(I);
2166
+ }(t._deps, d), a();
2167
+ }, c);
2168
+ }))]).then(() => (s(), e.onReadyBeingFired = [], S.resolve(Yt(() => t.on.ready.fire(t.vip))).then(function a() {
2165
2169
  if (e.onReadyBeingFired.length > 0) {
2166
- let l = e.onReadyBeingFired.reduce(rn, I);
2167
- return e.onReadyBeingFired = [], S.resolve(Gt(() => l(t.vip))).then(a);
2170
+ let c = e.onReadyBeingFired.reduce(nn, I);
2171
+ return e.onReadyBeingFired = [], S.resolve(Yt(() => c(t.vip))).then(a);
2168
2172
  }
2169
2173
  }))).finally(() => {
2170
2174
  e.onReadyBeingFired = null, e.isBeingOpened = !1;
@@ -2174,91 +2178,91 @@ function zr(t) {
2174
2178
  o && o.abort();
2175
2179
  } catch {
2176
2180
  }
2177
- return r === e.openCanceller && t._close(), N(a);
2181
+ return r === e.openCanceller && t._close(), D(a);
2178
2182
  }).finally(() => {
2179
2183
  e.openComplete = !0, i();
2180
2184
  });
2181
2185
  }
2182
- function Xt(t) {
2186
+ function Gt(t) {
2183
2187
  var e = (i) => t.next(i), n = s(e), r = s((i) => t.throw(i));
2184
2188
  function s(i) {
2185
2189
  return (o) => {
2186
2190
  var u = i(o), a = u.value;
2187
- return u.done ? a : a && typeof a.then == "function" ? a.then(n, r) : F(a) ? Promise.all(a).then(n, r) : n(a);
2191
+ return u.done ? a : a && typeof a.then == "function" ? a.then(n, r) : M(a) ? Promise.all(a).then(n, r) : n(a);
2188
2192
  };
2189
2193
  }
2190
2194
  return s(e)();
2191
2195
  }
2192
- function Hr(t, e, n) {
2196
+ function Vr(t, e, n) {
2193
2197
  var r = arguments.length;
2194
2198
  if (r < 2)
2195
2199
  throw new C.InvalidArgument("Too few arguments");
2196
2200
  for (var s = new Array(r - 1); --r; )
2197
2201
  s[r - 1] = arguments[r];
2198
- return n = s.pop(), [t, jn(s), n];
2202
+ return n = s.pop(), [t, On(s), n];
2199
2203
  }
2200
- function rr(t, e, n, r, s) {
2204
+ function Zn(t, e, n, r, s) {
2201
2205
  return S.resolve().then(() => {
2202
- const i = P.transless || P, o = t._createTransaction(e, n, t._dbSchema, r), u = { trans: o, transless: i };
2206
+ const i = E.transless || E, o = t._createTransaction(e, n, t._dbSchema, r), u = { trans: o, transless: i };
2203
2207
  if (r)
2204
2208
  o.idbtrans = r.idbtrans;
2205
2209
  else
2206
2210
  try {
2207
2211
  o.create(), t._state.PR1398_maxLoop = 3;
2208
- } catch (c) {
2209
- return c.name === nn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => rr(t, e, n, null, s))) : N(c);
2212
+ } catch (l) {
2213
+ return l.name === tn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Zn(t, e, n, null, s))) : D(l);
2210
2214
  }
2211
- const a = en(s);
2212
- let l;
2215
+ const a = Zt(s);
2216
+ let c;
2213
2217
  a && Ce();
2214
- const h = S.follow(() => {
2215
- if (l = s.call(o, o), l)
2218
+ const d = S.follow(() => {
2219
+ if (c = s.call(o, o), c)
2216
2220
  if (a) {
2217
- var c = ne.bind(null, null);
2218
- l.then(c, c);
2221
+ var l = ne.bind(null, null);
2222
+ c.then(l, l);
2219
2223
  } else
2220
- typeof l.next == "function" && typeof l.throw == "function" && (l = Xt(l));
2224
+ typeof c.next == "function" && typeof c.throw == "function" && (c = Gt(c));
2221
2225
  }, u);
2222
- return (l && typeof l.then == "function" ? S.resolve(l).then((c) => o.active ? c : N(new C.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))) : h.then(() => l)).then((c) => (r && o._resolve(), o._completion.then(() => c))).catch((c) => (o._reject(c), N(c)));
2226
+ return (c && typeof c.then == "function" ? S.resolve(c).then((l) => o.active ? l : D(new C.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))) : d.then(() => c)).then((l) => (r && o._resolve(), o._completion.then(() => l))).catch((l) => (o._reject(l), D(l)));
2223
2227
  });
2224
2228
  }
2225
2229
  function et(t, e, n) {
2226
- const r = F(t) ? t.slice() : [t];
2230
+ const r = M(t) ? t.slice() : [t];
2227
2231
  for (let s = 0; s < n; ++s)
2228
2232
  r.push(e);
2229
2233
  return r;
2230
2234
  }
2231
- const Yr = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(t) {
2235
+ const Wr = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(t) {
2232
2236
  return { ...t, table(e) {
2233
2237
  const n = t.table(e), { schema: r } = n, s = {}, i = [];
2234
- function o(l, h, c) {
2235
- const d = Ne(l), m = s[d] = s[d] || [], p = l == null ? 0 : typeof l == "string" ? 1 : l.length, f = h > 0, y = { ...c, isVirtual: f, keyTail: h, keyLength: p, extractKey: Ut(l), unique: !f && c.unique };
2236
- return m.push(y), y.isPrimaryKey || i.push(y), p > 1 && o(p === 2 ? l[0] : l.slice(0, p - 1), h + 1, c), m.sort((g, v) => g.keyTail - v.keyTail), y;
2238
+ function o(c, d, l) {
2239
+ const h = De(c), f = s[h] = s[h] || [], m = c == null ? 0 : typeof c == "string" ? 1 : c.length, p = d > 0, v = { ...l, isVirtual: p, keyTail: d, keyLength: m, extractKey: Lt(c), unique: !p && l.unique };
2240
+ return f.push(v), v.isPrimaryKey || i.push(v), m > 1 && o(m === 2 ? c[0] : c.slice(0, m - 1), d + 1, l), f.sort((y, g) => y.keyTail - g.keyTail), v;
2237
2241
  }
2238
2242
  const u = o(r.primaryKey.keyPath, 0, r.primaryKey);
2239
2243
  s[":id"] = [u];
2240
- for (const l of r.indexes)
2241
- o(l.keyPath, 0, l);
2242
- function a(l) {
2243
- const h = l.query.index;
2244
- return h.isVirtual ? { ...l, query: { index: h, range: (c = l.query.range, d = h.keyTail, { type: c.type === 1 ? 2 : c.type, lower: et(c.lower, c.lowerOpen ? t.MAX_KEY : t.MIN_KEY, d), lowerOpen: !0, upper: et(c.upper, c.upperOpen ? t.MIN_KEY : t.MAX_KEY, d), upperOpen: !0 }) } } : l;
2245
- var c, d;
2244
+ for (const c of r.indexes)
2245
+ o(c.keyPath, 0, c);
2246
+ function a(c) {
2247
+ const d = c.query.index;
2248
+ return d.isVirtual ? { ...c, query: { index: d, range: (l = c.query.range, h = d.keyTail, { type: l.type === 1 ? 2 : l.type, lower: et(l.lower, l.lowerOpen ? t.MAX_KEY : t.MIN_KEY, h), lowerOpen: !0, upper: et(l.upper, l.upperOpen ? t.MIN_KEY : t.MAX_KEY, h), upperOpen: !0 }) } } : c;
2249
+ var l, h;
2246
2250
  }
2247
- return { ...n, schema: { ...r, primaryKey: u, indexes: i, getIndexByKeyPath: function(l) {
2248
- const h = s[Ne(l)];
2249
- return h && h[0];
2250
- } }, count: (l) => n.count(a(l)), query: (l) => n.query(a(l)), openCursor(l) {
2251
- const { keyTail: h, isVirtual: c, keyLength: d } = l.query.index;
2252
- return c ? n.openCursor(a(l)).then((m) => m && function(p) {
2253
- return Object.create(p, { continue: { value: function(f) {
2254
- f != null ? p.continue(et(f, l.reverse ? t.MAX_KEY : t.MIN_KEY, h)) : l.unique ? p.continue(p.key.slice(0, d).concat(l.reverse ? t.MIN_KEY : t.MAX_KEY, h)) : p.continue();
2255
- } }, continuePrimaryKey: { value(f, y) {
2256
- p.continuePrimaryKey(et(f, t.MAX_KEY, h), y);
2257
- } }, primaryKey: { get: () => p.primaryKey }, key: { get() {
2258
- const f = p.key;
2259
- return d === 1 ? f[0] : f.slice(0, d);
2260
- } }, value: { get: () => p.value } });
2261
- }(m)) : n.openCursor(l);
2251
+ return { ...n, schema: { ...r, primaryKey: u, indexes: i, getIndexByKeyPath: function(c) {
2252
+ const d = s[De(c)];
2253
+ return d && d[0];
2254
+ } }, count: (c) => n.count(a(c)), query: (c) => n.query(a(c)), openCursor(c) {
2255
+ const { keyTail: d, isVirtual: l, keyLength: h } = c.query.index;
2256
+ return l ? n.openCursor(a(c)).then((f) => f && function(m) {
2257
+ return Object.create(m, { continue: { value: function(p) {
2258
+ p != null ? m.continue(et(p, c.reverse ? t.MAX_KEY : t.MIN_KEY, d)) : c.unique ? m.continue(m.key.slice(0, h).concat(c.reverse ? t.MIN_KEY : t.MAX_KEY, d)) : m.continue();
2259
+ } }, continuePrimaryKey: { value(p, v) {
2260
+ m.continuePrimaryKey(et(p, t.MAX_KEY, d), v);
2261
+ } }, primaryKey: { get: () => m.primaryKey }, key: { get() {
2262
+ const p = m.key;
2263
+ return h === 1 ? p[0] : p.slice(0, h);
2264
+ } }, value: { get: () => m.value } });
2265
+ }(f)) : n.openCursor(c);
2262
2266
  } };
2263
2267
  } };
2264
2268
  } };
@@ -2267,8 +2271,8 @@ function ln(t, e, n, r) {
2267
2271
  if (z(e, s)) {
2268
2272
  var i = t[s], o = e[s];
2269
2273
  if (typeof i == "object" && typeof o == "object" && i && o) {
2270
- const u = At(i);
2271
- u !== At(o) ? n[r + s] = e[s] : u === "Object" ? ln(i, o, n, r + s + ".") : i !== o && (n[r + s] = e[s]);
2274
+ const u = Tt(i);
2275
+ u !== Tt(o) ? n[r + s] = e[s] : u === "Object" ? ln(i, o, n, r + s + ".") : i !== o && (n[r + s] = e[s]);
2272
2276
  } else
2273
2277
  i !== o && (n[r + s] = e[s]);
2274
2278
  } else
@@ -2277,73 +2281,73 @@ function ln(t, e, n, r) {
2277
2281
  z(t, s) || (n[r + s] = e[s]);
2278
2282
  }), n;
2279
2283
  }
2280
- const Gr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) => ({ ...t, table(e) {
2284
+ const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) => ({ ...t, table(e) {
2281
2285
  const n = t.table(e), { primaryKey: r } = n.schema;
2282
2286
  return { ...n, mutate(s) {
2283
- const i = P.trans, { deleting: o, creating: u, updating: a } = i.table(e).hook;
2287
+ const i = E.trans, { deleting: o, creating: u, updating: a } = i.table(e).hook;
2284
2288
  switch (s.type) {
2285
2289
  case "add":
2286
2290
  if (u.fire === I)
2287
2291
  break;
2288
- return i._promise("readwrite", () => l(s), !0);
2292
+ return i._promise("readwrite", () => c(s), !0);
2289
2293
  case "put":
2290
2294
  if (u.fire === I && a.fire === I)
2291
2295
  break;
2292
- return i._promise("readwrite", () => l(s), !0);
2296
+ return i._promise("readwrite", () => c(s), !0);
2293
2297
  case "delete":
2294
2298
  if (o.fire === I)
2295
2299
  break;
2296
- return i._promise("readwrite", () => l(s), !0);
2300
+ return i._promise("readwrite", () => c(s), !0);
2297
2301
  case "deleteRange":
2298
2302
  if (o.fire === I)
2299
2303
  break;
2300
- return i._promise("readwrite", () => function(c) {
2301
- return h(c.trans, c.range, 1e4);
2304
+ return i._promise("readwrite", () => function(l) {
2305
+ return d(l.trans, l.range, 1e4);
2302
2306
  }(s), !0);
2303
2307
  }
2304
2308
  return n.mutate(s);
2305
- function l(c) {
2306
- const d = P.trans, m = c.keys || function(p, f) {
2307
- return f.type === "delete" ? f.keys : f.keys || f.values.map(p.extractKey);
2308
- }(r, c);
2309
- if (!m)
2309
+ function c(l) {
2310
+ const h = E.trans, f = l.keys || function(m, p) {
2311
+ return p.type === "delete" ? p.keys : p.keys || p.values.map(m.extractKey);
2312
+ }(r, l);
2313
+ if (!f)
2310
2314
  throw new Error("Keys missing");
2311
- return (c = c.type === "add" || c.type === "put" ? { ...c, keys: m } : { ...c }).type !== "delete" && (c.values = [...c.values]), c.keys && (c.keys = [...c.keys]), function(p, f, y) {
2312
- return f.type === "add" ? Promise.resolve([]) : p.getMany({ trans: f.trans, keys: y, cache: "immutable" });
2313
- }(n, c, m).then((p) => {
2314
- const f = m.map((y, g) => {
2315
- const v = p[g], b = { onerror: null, onsuccess: null };
2316
- if (c.type === "delete")
2317
- o.fire.call(b, y, v, d);
2318
- else if (c.type === "add" || v === void 0) {
2319
- const x = u.fire.call(b, y, c.values[g], d);
2320
- y == null && x != null && (y = x, c.keys[g] = y, r.outbound || H(c.values[g], r.keyPath, y));
2315
+ return (l = l.type === "add" || l.type === "put" ? { ...l, keys: f } : { ...l }).type !== "delete" && (l.values = [...l.values]), l.keys && (l.keys = [...l.keys]), function(m, p, v) {
2316
+ return p.type === "add" ? Promise.resolve([]) : m.getMany({ trans: p.trans, keys: v, cache: "immutable" });
2317
+ }(n, l, f).then((m) => {
2318
+ const p = f.map((v, y) => {
2319
+ const g = m[y], b = { onerror: null, onsuccess: null };
2320
+ if (l.type === "delete")
2321
+ o.fire.call(b, v, g, h);
2322
+ else if (l.type === "add" || g === void 0) {
2323
+ const k = u.fire.call(b, v, l.values[y], h);
2324
+ v == null && k != null && (v = k, l.keys[y] = v, r.outbound || H(l.values[y], r.keyPath, v));
2321
2325
  } else {
2322
- const x = ln(v, c.values[g]), E = a.fire.call(b, x, y, v, d);
2323
- if (E) {
2324
- const k = c.values[g];
2325
- Object.keys(E).forEach((w) => {
2326
- z(k, w) ? k[w] = E[w] : H(k, w, E[w]);
2326
+ const k = ln(g, l.values[y]), P = a.fire.call(b, k, v, g, h);
2327
+ if (P) {
2328
+ const x = l.values[y];
2329
+ Object.keys(P).forEach((w) => {
2330
+ z(x, w) ? x[w] = P[w] : H(x, w, P[w]);
2327
2331
  });
2328
2332
  }
2329
2333
  }
2330
2334
  return b;
2331
2335
  });
2332
- return n.mutate(c).then(({ failures: y, results: g, numFailures: v, lastResult: b }) => {
2333
- for (let x = 0; x < m.length; ++x) {
2334
- const E = g ? g[x] : m[x], k = f[x];
2335
- E == null ? k.onerror && k.onerror(y[x]) : k.onsuccess && k.onsuccess(c.type === "put" && p[x] ? c.values[x] : E);
2336
+ return n.mutate(l).then(({ failures: v, results: y, numFailures: g, lastResult: b }) => {
2337
+ for (let k = 0; k < f.length; ++k) {
2338
+ const P = y ? y[k] : f[k], x = p[k];
2339
+ P == null ? x.onerror && x.onerror(v[k]) : x.onsuccess && x.onsuccess(l.type === "put" && m[k] ? l.values[k] : P);
2336
2340
  }
2337
- return { failures: y, results: g, numFailures: v, lastResult: b };
2338
- }).catch((y) => (f.forEach((g) => g.onerror && g.onerror(y)), Promise.reject(y)));
2341
+ return { failures: v, results: y, numFailures: g, lastResult: b };
2342
+ }).catch((v) => (p.forEach((y) => y.onerror && y.onerror(v)), Promise.reject(v)));
2339
2343
  });
2340
2344
  }
2341
- function h(c, d, m) {
2342
- return n.query({ trans: c, values: !1, query: { index: r, range: d }, limit: m }).then(({ result: p }) => l({ type: "delete", keys: p, trans: c }).then((f) => f.numFailures > 0 ? Promise.reject(f.failures[0]) : p.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : h(c, { ...d, lower: p[p.length - 1], lowerOpen: !0 }, m)));
2345
+ function d(l, h, f) {
2346
+ return n.query({ trans: l, values: !1, query: { index: r, range: h }, limit: f }).then(({ result: m }) => c({ type: "delete", keys: m, trans: l }).then((p) => p.numFailures > 0 ? Promise.reject(p.failures[0]) : m.length < f ? { failures: [], numFailures: 0, lastResult: void 0 } : d(l, { ...h, lower: m[m.length - 1], lowerOpen: !0 }, f)));
2343
2347
  }
2344
2348
  } };
2345
2349
  } }) };
2346
- function sr(t, e, n) {
2350
+ function er(t, e, n) {
2347
2351
  try {
2348
2352
  if (!e || e.keys.length < t.length)
2349
2353
  return null;
@@ -2355,16 +2359,16 @@ function sr(t, e, n) {
2355
2359
  return null;
2356
2360
  }
2357
2361
  }
2358
- const Xr = { stack: "dbcore", level: -1, create: (t) => ({ table: (e) => {
2362
+ const Hr = { stack: "dbcore", level: -1, create: (t) => ({ table: (e) => {
2359
2363
  const n = t.table(e);
2360
2364
  return { ...n, getMany: (r) => {
2361
2365
  if (!r.cache)
2362
2366
  return n.getMany(r);
2363
- const s = sr(r.keys, r.trans._cache, r.cache === "clone");
2367
+ const s = er(r.keys, r.trans._cache, r.cache === "clone");
2364
2368
  return s ? S.resolve(s) : n.getMany(r).then((i) => (r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? We(i) : i }, i));
2365
2369
  }, mutate: (r) => (r.type !== "add" && (r.trans._cache = null), n.mutate(r)) };
2366
2370
  } }) };
2367
- function hn(t) {
2371
+ function cn(t) {
2368
2372
  return !("from" in t);
2369
2373
  }
2370
2374
  const Q = function(t, e) {
@@ -2380,29 +2384,29 @@ function Ve(t, e, n) {
2380
2384
  return;
2381
2385
  if (r > 0)
2382
2386
  throw RangeError();
2383
- if (hn(t))
2387
+ if (cn(t))
2384
2388
  return U(t, { from: e, to: n, d: 1 });
2385
2389
  const s = t.l, i = t.r;
2386
2390
  if (L(n, t.from) < 0)
2387
- return s ? Ve(s, e, n) : t.l = { from: e, to: n, d: 1, l: null, r: null }, Pn(t);
2391
+ return s ? Ve(s, e, n) : t.l = { from: e, to: n, d: 1, l: null, r: null }, xn(t);
2388
2392
  if (L(e, t.to) > 0)
2389
- return i ? Ve(i, e, n) : t.r = { from: e, to: n, d: 1, l: null, r: null }, Pn(t);
2393
+ return i ? Ve(i, e, n) : t.r = { from: e, to: n, d: 1, l: null, r: null }, xn(t);
2390
2394
  L(e, t.from) < 0 && (t.from = e, t.l = null, t.d = i ? i.d + 1 : 1), L(n, t.to) > 0 && (t.to = n, t.r = null, t.d = t.l ? t.l.d + 1 : 1);
2391
2395
  const o = !t.r;
2392
2396
  s && !t.l && gt(t, s), i && o && gt(t, i);
2393
2397
  }
2394
2398
  function gt(t, e) {
2395
- hn(e) || function n(r, { from: s, to: i, l: o, r: u }) {
2399
+ cn(e) || function n(r, { from: s, to: i, l: o, r: u }) {
2396
2400
  Ve(r, s, i), o && n(r, o), u && n(r, u);
2397
2401
  }(t, e);
2398
2402
  }
2399
- function Qr(t, e) {
2400
- const n = Qt(e);
2403
+ function Yr(t, e) {
2404
+ const n = Xt(e);
2401
2405
  let r = n.next();
2402
2406
  if (r.done)
2403
2407
  return !1;
2404
2408
  let s = r.value;
2405
- const i = Qt(t);
2409
+ const i = Xt(t);
2406
2410
  let o = i.next(s.from), u = o.value;
2407
2411
  for (; !r.done && !o.done; ) {
2408
2412
  if (L(u.from, s.to) <= 0 && L(u.to, s.from) >= 0)
@@ -2411,8 +2415,8 @@ function Qr(t, e) {
2411
2415
  }
2412
2416
  return !1;
2413
2417
  }
2414
- function Qt(t) {
2415
- let e = hn(t) ? null : { s: 0, n: t };
2418
+ function Xt(t) {
2419
+ let e = cn(t) ? null : { s: 0, n: t };
2416
2420
  return { next(n) {
2417
2421
  const r = arguments.length > 0;
2418
2422
  for (; e; )
@@ -2438,99 +2442,99 @@ function Qt(t) {
2438
2442
  return { done: !0 };
2439
2443
  } };
2440
2444
  }
2441
- function Pn(t) {
2445
+ function xn(t) {
2442
2446
  var e, n;
2443
2447
  const r = (((e = t.r) === null || e === void 0 ? void 0 : e.d) || 0) - (((n = t.l) === null || n === void 0 ? void 0 : n.d) || 0), s = r > 1 ? "r" : r < -1 ? "l" : "";
2444
2448
  if (s) {
2445
2449
  const i = s === "r" ? "l" : "r", o = { ...t }, u = t[s];
2446
- t.from = u.from, t.to = u.to, t[s] = u[s], o[s] = u[i], t[i] = o, o.d = Cn(o);
2450
+ t.from = u.from, t.to = u.to, t[s] = u[s], o[s] = u[i], t[i] = o, o.d = Sn(o);
2447
2451
  }
2448
- t.d = Cn(t);
2452
+ t.d = Sn(t);
2449
2453
  }
2450
- function Cn({ r: t, l: e }) {
2454
+ function Sn({ r: t, l: e }) {
2451
2455
  return (t ? e ? Math.max(t.d, e.d) : t.d : e ? e.d : 0) + 1;
2452
2456
  }
2453
- Ee(Q.prototype, { add(t) {
2457
+ Pe(Q.prototype, { add(t) {
2454
2458
  return gt(this, t), this;
2455
2459
  }, addKey(t) {
2456
2460
  return Ve(this, t, t), this;
2457
2461
  }, addKeys(t) {
2458
2462
  return t.forEach((e) => Ve(this, e, e)), this;
2459
- }, [Ot]() {
2460
- return Qt(this);
2463
+ }, [At]() {
2464
+ return Xt(this);
2461
2465
  } });
2462
- const Jr = { stack: "dbcore", level: 0, create: (t) => {
2466
+ const Gr = { stack: "dbcore", level: 0, create: (t) => {
2463
2467
  const e = t.schema.name, n = new Q(t.MIN_KEY, t.MAX_KEY);
2464
2468
  return { ...t, table: (r) => {
2465
- const s = t.table(r), { schema: i } = s, { primaryKey: o } = i, { extractKey: u, outbound: a } = o, l = { ...s, mutate: (d) => {
2466
- const m = d.trans, p = m.mutatedParts || (m.mutatedParts = {}), f = (k) => {
2467
- const w = `idb://${e}/${r}/${k}`;
2468
- return p[w] || (p[w] = new Q());
2469
- }, y = f(""), g = f(":dels"), { type: v } = d;
2470
- let [b, x] = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [[], d.values] : [];
2471
- const E = d.trans._cache;
2472
- return s.mutate(d).then((k) => {
2473
- if (F(b)) {
2474
- v !== "delete" && (b = k.results), y.addKeys(b);
2475
- const w = sr(b, E);
2476
- w || v === "add" || g.addKeys(b), (w || x) && function(A, _, j, O) {
2469
+ const s = t.table(r), { schema: i } = s, { primaryKey: o } = i, { extractKey: u, outbound: a } = o, c = { ...s, mutate: (h) => {
2470
+ const f = h.trans, m = f.mutatedParts || (f.mutatedParts = {}), p = (x) => {
2471
+ const w = `idb://${e}/${r}/${x}`;
2472
+ return m[w] || (m[w] = new Q());
2473
+ }, v = p(""), y = p(":dels"), { type: g } = h;
2474
+ let [b, k] = h.type === "deleteRange" ? [h.range] : h.type === "delete" ? [h.keys] : h.values.length < 50 ? [[], h.values] : [];
2475
+ const P = h.trans._cache;
2476
+ return s.mutate(h).then((x) => {
2477
+ if (M(b)) {
2478
+ g !== "delete" && (b = x.results), v.addKeys(b);
2479
+ const w = er(b, P);
2480
+ w || g === "add" || y.addKeys(b), (w || k) && function(A, _, R, O) {
2477
2481
  function q(B) {
2478
- const D = A(B.name || "");
2482
+ const N = A(B.name || "");
2479
2483
  function ye(V) {
2480
2484
  return V != null ? B.extractKey(V) : null;
2481
2485
  }
2482
- const ve = (V) => B.multiEntry && F(V) ? V.forEach((ce) => D.addKey(ce)) : D.addKey(V);
2483
- (j || O).forEach((V, ce) => {
2484
- const Ae = j && ye(j[ce]), bt = O && ye(O[ce]);
2486
+ const ve = (V) => B.multiEntry && M(V) ? V.forEach((le) => N.addKey(le)) : N.addKey(V);
2487
+ (R || O).forEach((V, le) => {
2488
+ const Ae = R && ye(R[le]), bt = O && ye(O[le]);
2485
2489
  L(Ae, bt) !== 0 && (Ae != null && ve(Ae), bt != null && ve(bt));
2486
2490
  });
2487
2491
  }
2488
2492
  _.indexes.forEach(q);
2489
- }(f, i, w, x);
2493
+ }(p, i, w, k);
2490
2494
  } else if (b) {
2491
2495
  const w = { from: b.lower, to: b.upper };
2492
- g.add(w), y.add(w);
2496
+ y.add(w), v.add(w);
2493
2497
  } else
2494
- y.add(n), g.add(n), i.indexes.forEach((w) => f(w.name).add(n));
2495
- return k;
2498
+ v.add(n), y.add(n), i.indexes.forEach((w) => p(w.name).add(n));
2499
+ return x;
2496
2500
  });
2497
- } }, h = ({ query: { index: d, range: m } }) => {
2498
- var p, f;
2499
- return [d, new Q((p = m.lower) !== null && p !== void 0 ? p : t.MIN_KEY, (f = m.upper) !== null && f !== void 0 ? f : t.MAX_KEY)];
2500
- }, c = { get: (d) => [o, new Q(d.key)], getMany: (d) => [o, new Q().addKeys(d.keys)], count: h, query: h, openCursor: h };
2501
- return $(c).forEach((d) => {
2502
- l[d] = function(m) {
2503
- const { subscr: p } = P;
2504
- if (p) {
2505
- const f = (x) => {
2506
- const E = `idb://${e}/${r}/${x}`;
2507
- return p[E] || (p[E] = new Q());
2508
- }, y = f(""), g = f(":dels"), [v, b] = c[d](m);
2509
- if (f(v.name || "").add(b), !v.isPrimaryKey) {
2510
- if (d !== "count") {
2511
- const x = d === "query" && a && m.values && s.query({ ...m, values: !1 });
2512
- return s[d].apply(this, arguments).then((E) => {
2513
- if (d === "query") {
2514
- if (a && m.values)
2515
- return x.then(({ result: w }) => (y.addKeys(w), E));
2516
- const k = m.values ? E.result.map(u) : E.result;
2517
- m.values ? y.addKeys(k) : g.addKeys(k);
2518
- } else if (d === "openCursor") {
2519
- const k = E, w = m.values;
2520
- return k && Object.create(k, { key: { get: () => (g.addKey(k.primaryKey), k.key) }, primaryKey: { get() {
2521
- const A = k.primaryKey;
2522
- return g.addKey(A), A;
2523
- } }, value: { get: () => (w && y.addKey(k.primaryKey), k.value) } });
2501
+ } }, d = ({ query: { index: h, range: f } }) => {
2502
+ var m, p;
2503
+ return [h, new Q((m = f.lower) !== null && m !== void 0 ? m : t.MIN_KEY, (p = f.upper) !== null && p !== void 0 ? p : t.MAX_KEY)];
2504
+ }, l = { get: (h) => [o, new Q(h.key)], getMany: (h) => [o, new Q().addKeys(h.keys)], count: d, query: d, openCursor: d };
2505
+ return $(l).forEach((h) => {
2506
+ c[h] = function(f) {
2507
+ const { subscr: m } = E;
2508
+ if (m) {
2509
+ const p = (k) => {
2510
+ const P = `idb://${e}/${r}/${k}`;
2511
+ return m[P] || (m[P] = new Q());
2512
+ }, v = p(""), y = p(":dels"), [g, b] = l[h](f);
2513
+ if (p(g.name || "").add(b), !g.isPrimaryKey) {
2514
+ if (h !== "count") {
2515
+ const k = h === "query" && a && f.values && s.query({ ...f, values: !1 });
2516
+ return s[h].apply(this, arguments).then((P) => {
2517
+ if (h === "query") {
2518
+ if (a && f.values)
2519
+ return k.then(({ result: w }) => (v.addKeys(w), P));
2520
+ const x = f.values ? P.result.map(u) : P.result;
2521
+ f.values ? v.addKeys(x) : y.addKeys(x);
2522
+ } else if (h === "openCursor") {
2523
+ const x = P, w = f.values;
2524
+ return x && Object.create(x, { key: { get: () => (y.addKey(x.primaryKey), x.key) }, primaryKey: { get() {
2525
+ const A = x.primaryKey;
2526
+ return y.addKey(A), A;
2527
+ } }, value: { get: () => (w && v.addKey(x.primaryKey), x.value) } });
2524
2528
  }
2525
- return E;
2529
+ return P;
2526
2530
  });
2527
2531
  }
2528
- g.add(n);
2532
+ y.add(n);
2529
2533
  }
2530
2534
  }
2531
- return s[d].apply(this, arguments);
2535
+ return s[h].apply(this, arguments);
2532
2536
  };
2533
- }), l;
2537
+ }), c;
2534
2538
  } };
2535
2539
  } };
2536
2540
  class pe {
@@ -2546,66 +2550,66 @@ class pe {
2546
2550
  i.dbReadyResolve = u;
2547
2551
  }), i.openCanceller = new S((u, a) => {
2548
2552
  i.cancelOpen = a;
2549
- }), this._state = i, this.name = e, this.on = $e(this, "populate", "blocked", "versionchange", "close", { ready: [rn, I] }), this.on.ready.subscribe = On(this.on.ready.subscribe, (u) => (a, l) => {
2553
+ }), this._state = i, this.name = e, this.on = $e(this, "populate", "blocked", "versionchange", "close", { ready: [nn, I] }), this.on.ready.subscribe = En(this.on.ready.subscribe, (u) => (a, c) => {
2550
2554
  pe.vip(() => {
2551
- const h = this._state;
2552
- if (h.openComplete)
2553
- h.dbOpenError || S.resolve().then(a), l && u(a);
2554
- else if (h.onReadyBeingFired)
2555
- h.onReadyBeingFired.push(a), l && u(a);
2555
+ const d = this._state;
2556
+ if (d.openComplete)
2557
+ d.dbOpenError || S.resolve().then(a), c && u(a);
2558
+ else if (d.onReadyBeingFired)
2559
+ d.onReadyBeingFired.push(a), c && u(a);
2556
2560
  else {
2557
2561
  u(a);
2558
- const c = this;
2559
- l || u(function d() {
2560
- c.on.ready.unsubscribe(a), c.on.ready.unsubscribe(d);
2562
+ const l = this;
2563
+ c || u(function h() {
2564
+ l.on.ready.unsubscribe(a), l.on.ready.unsubscribe(h);
2561
2565
  });
2562
2566
  }
2563
2567
  });
2564
- }), this.Collection = (o = this, Oe(Dr.prototype, function(u, a) {
2568
+ }), this.Collection = (o = this, Oe(Kr.prototype, function(u, a) {
2565
2569
  this.db = o;
2566
- let l = Qn, h = null;
2570
+ let c = Hn, d = null;
2567
2571
  if (a)
2568
2572
  try {
2569
- l = a();
2570
- } catch (p) {
2571
- h = p;
2573
+ c = a();
2574
+ } catch (m) {
2575
+ d = m;
2572
2576
  }
2573
- const c = u._ctx, d = c.table, m = d.hook.reading.fire;
2574
- this._ctx = { table: d, index: c.index, isPrimKey: !c.index || d.schema.primKey.keyPath && c.index === d.schema.primKey.name, range: l, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: h, or: c.or, valueMapper: m !== Me ? m : null };
2577
+ const l = u._ctx, h = l.table, f = h.hook.reading.fire;
2578
+ this._ctx = { table: h, index: l.index, isPrimKey: !l.index || h.schema.primKey.keyPath && l.index === h.schema.primKey.name, range: c, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: d, or: l.or, valueMapper: f !== Fe ? f : null };
2575
2579
  })), this.Table = function(u) {
2576
- return Oe(jr.prototype, function(a, l, h) {
2577
- this.db = u, this._tx = h, this.name = a, this.schema = l, this.hook = u._allTables[a] ? u._allTables[a].hook : $e(null, { creating: [kr, I], reading: [_r, Me], updating: [Sr, I], deleting: [xr, I] });
2580
+ return Oe(Ir.prototype, function(a, c, d) {
2581
+ this.db = u, this._tx = d, this.name = a, this.schema = c, this.hook = u._allTables[a] ? u._allTables[a].hook : $e(null, { creating: [br, I], reading: [vr, Fe], updating: [_r, I], deleting: [wr, I] });
2578
2582
  });
2579
2583
  }(this), this.Transaction = function(u) {
2580
- return Oe(Mr.prototype, function(a, l, h, c, d) {
2581
- this.db = u, this.mode = a, this.storeNames = l, this.schema = h, this.chromeTransactionDurability = c, this.idbtrans = null, this.on = $e(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new S((m, p) => {
2582
- this._resolve = m, this._reject = p;
2584
+ return Oe($r.prototype, function(a, c, d, l, h) {
2585
+ this.db = u, this.mode = a, this.storeNames = c, this.schema = d, this.chromeTransactionDurability = l, this.idbtrans = null, this.on = $e(this, "complete", "error", "abort"), this.parent = h || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new S((f, m) => {
2586
+ this._resolve = f, this._reject = m;
2583
2587
  }), this._completion.then(() => {
2584
2588
  this.active = !1, this.on.complete.fire();
2585
- }, (m) => {
2586
- var p = this.active;
2587
- return this.active = !1, this.on.error.fire(m), this.parent ? this.parent._reject(m) : p && this.idbtrans && this.idbtrans.abort(), N(m);
2589
+ }, (f) => {
2590
+ var m = this.active;
2591
+ return this.active = !1, this.on.error.fire(f), this.parent ? this.parent._reject(f) : m && this.idbtrans && this.idbtrans.abort(), D(f);
2588
2592
  });
2589
2593
  });
2590
2594
  }(this), this.Version = function(u) {
2591
- return Oe(Vr.prototype, function(a) {
2595
+ return Oe(qr.prototype, function(a) {
2592
2596
  this.db = u, this._cfg = { version: a, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
2593
2597
  });
2594
2598
  }(this), this.WhereClause = function(u) {
2595
- return Oe(Zn.prototype, function(a, l, h) {
2596
- this.db = u, this._ctx = { table: a, index: l === ":id" ? null : l, or: h };
2597
- const c = u._deps.indexedDB;
2598
- if (!c)
2599
+ return Oe(Gn.prototype, function(a, c, d) {
2600
+ this.db = u, this._ctx = { table: a, index: c === ":id" ? null : c, or: d };
2601
+ const l = u._deps.indexedDB;
2602
+ if (!l)
2599
2603
  throw new C.MissingAPI();
2600
- this._cmp = this._ascending = c.cmp.bind(c), this._descending = (d, m) => c.cmp(m, d), this._max = (d, m) => c.cmp(d, m) > 0 ? d : m, this._min = (d, m) => c.cmp(d, m) < 0 ? d : m, this._IDBKeyRange = u._deps.IDBKeyRange;
2604
+ this._cmp = this._ascending = l.cmp.bind(l), this._descending = (h, f) => l.cmp(f, h), this._max = (h, f) => l.cmp(h, f) > 0 ? h : f, this._min = (h, f) => l.cmp(h, f) < 0 ? h : f, this._IDBKeyRange = u._deps.IDBKeyRange;
2601
2605
  });
2602
2606
  }(this), this.on("versionchange", (u) => {
2603
2607
  u.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`), this.close();
2604
2608
  }), this.on("blocked", (u) => {
2605
2609
  !u.newVersion || u.newVersion < u.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${u.oldVersion / 10}`);
2606
- }), this._maxKey = Ue(n.IDBKeyRange), this._createTransaction = (u, a, l, h) => new this.Transaction(u, a, l, this._options.chromeTransactionDurability, h), this._fireOnBlocked = (u) => {
2607
- this.on("blocked").fire(u), De.filter((a) => a.name === this.name && a !== this && !a._state.vcFired).map((a) => a.on("versionchange").fire(u));
2608
- }, this.use(Yr), this.use(Gr), this.use(Jr), this.use(Xr), this.vip = Object.create(this, { _vip: { value: !0 } }), s.forEach((u) => u(this));
2610
+ }), this._maxKey = Ue(n.IDBKeyRange), this._createTransaction = (u, a, c, d) => new this.Transaction(u, a, c, this._options.chromeTransactionDurability, d), this._fireOnBlocked = (u) => {
2611
+ this.on("blocked").fire(u), Ne.filter((a) => a.name === this.name && a !== this && !a._state.vcFired).map((a) => a.on("versionchange").fire(u));
2612
+ }, this.use(Wr), this.use(zr), this.use(Gr), this.use(Hr), this.vip = Object.create(this, { _vip: { value: !0 } }), s.forEach((u) => u(this));
2609
2613
  }
2610
2614
  version(e) {
2611
2615
  if (isNaN(e) || e < 0.1)
@@ -2615,10 +2619,10 @@ class pe {
2615
2619
  this.verno = Math.max(this.verno, e);
2616
2620
  const n = this._versions;
2617
2621
  var r = n.filter((s) => s._cfg.version === e)[0];
2618
- return r || (r = new this.Version(e), n.push(r), n.sort(Lr), r.stores({}), this._state.autoSchema = !1, r);
2622
+ return r || (r = new this.Version(e), n.push(r), n.sort(Fr), r.stores({}), this._state.autoSchema = !1, r);
2619
2623
  }
2620
2624
  _whenReady(e) {
2621
- return this.idbdb && (this._state.openComplete || P.letThrough || this._vip) ? e() : new S((n, r) => {
2625
+ return this.idbdb && (this._state.openComplete || E.letThrough || this._vip) ? e() : new S((n, r) => {
2622
2626
  if (this._state.openComplete)
2623
2627
  return r(new C.DatabaseClosed(this._state.dbOpenError));
2624
2628
  if (!this._state.isBeingOpened) {
@@ -2638,11 +2642,11 @@ class pe {
2638
2642
  return e && this._middlewares[e] && (this._middlewares[e] = this._middlewares[e].filter((s) => r ? s.create !== r : !!n && s.name !== n)), this;
2639
2643
  }
2640
2644
  open() {
2641
- return zr(this);
2645
+ return Ur(this);
2642
2646
  }
2643
2647
  _close() {
2644
- const e = this._state, n = De.indexOf(this);
2645
- if (n >= 0 && De.splice(n, 1), this.idbdb) {
2648
+ const e = this._state, n = Ne.indexOf(this);
2649
+ if (n >= 0 && Ne.splice(n, 1), this.idbdb) {
2646
2650
  try {
2647
2651
  this.idbdb.close();
2648
2652
  } catch {
@@ -2666,9 +2670,9 @@ class pe {
2666
2670
  const i = () => {
2667
2671
  this.close();
2668
2672
  var o = this._deps.indexedDB.deleteDatabase(this.name);
2669
- o.onsuccess = R(() => {
2670
- (function({ indexedDB: u, IDBKeyRange: a }, l) {
2671
- !cn(u) && l !== vt && un(u, a).delete(l).catch(I);
2673
+ o.onsuccess = j(() => {
2674
+ (function({ indexedDB: u, IDBKeyRange: a }, c) {
2675
+ !un(u) && c !== vt && an(u, a).delete(c).catch(I);
2672
2676
  })(this._deps, this.name), r();
2673
2677
  }), o.onerror = Y(s), o.onblocked = this._fireOnBlocked;
2674
2678
  };
@@ -2697,21 +2701,21 @@ class pe {
2697
2701
  return $(this._allTables).map((e) => this._allTables[e]);
2698
2702
  }
2699
2703
  transaction() {
2700
- const e = Hr.apply(this, arguments);
2704
+ const e = Vr.apply(this, arguments);
2701
2705
  return this._transaction.apply(this, e);
2702
2706
  }
2703
2707
  _transaction(e, n, r) {
2704
- let s = P.trans;
2708
+ let s = E.trans;
2705
2709
  s && s.db === this && e.indexOf("!") === -1 || (s = null);
2706
2710
  const i = e.indexOf("?") !== -1;
2707
2711
  let o, u;
2708
2712
  e = e.replace("!", "").replace("?", "");
2709
2713
  try {
2710
- if (u = n.map((l) => {
2711
- var h = l instanceof this.Table ? l.name : l;
2712
- if (typeof h != "string")
2714
+ if (u = n.map((c) => {
2715
+ var d = c instanceof this.Table ? c.name : c;
2716
+ if (typeof d != "string")
2713
2717
  throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
2714
- return h;
2718
+ return d;
2715
2719
  }), e == "r" || e === _t)
2716
2720
  o = _t;
2717
2721
  else {
@@ -2725,21 +2729,21 @@ class pe {
2725
2729
  throw new C.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
2726
2730
  s = null;
2727
2731
  }
2728
- s && u.forEach((l) => {
2729
- if (s && s.storeNames.indexOf(l) === -1) {
2732
+ s && u.forEach((c) => {
2733
+ if (s && s.storeNames.indexOf(c) === -1) {
2730
2734
  if (!i)
2731
- throw new C.SubTransaction("Table " + l + " not included in parent transaction.");
2735
+ throw new C.SubTransaction("Table " + c + " not included in parent transaction.");
2732
2736
  s = null;
2733
2737
  }
2734
2738
  }), i && s && !s.active && (s = null);
2735
2739
  }
2736
- } catch (l) {
2737
- return s ? s._promise(null, (h, c) => {
2738
- c(l);
2739
- }) : N(l);
2740
+ } catch (c) {
2741
+ return s ? s._promise(null, (d, l) => {
2742
+ l(c);
2743
+ }) : D(c);
2740
2744
  }
2741
- const a = rr.bind(null, this, o, u, s, r);
2742
- return s ? s._promise(o, a, "lock") : P.trans ? Te(P.transless, () => this._whenReady(a)) : this._whenReady(a);
2745
+ const a = Zn.bind(null, this, o, u, s, r);
2746
+ return s ? s._promise(o, a, "lock") : E.trans ? Te(E.transless, () => this._whenReady(a)) : this._whenReady(a);
2743
2747
  }
2744
2748
  table(e) {
2745
2749
  if (!z(this._allTables, e))
@@ -2747,66 +2751,66 @@ class pe {
2747
2751
  return this._allTables[e];
2748
2752
  }
2749
2753
  }
2750
- const Zr = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable";
2751
- class es {
2754
+ const Xr = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable";
2755
+ class Qr {
2752
2756
  constructor(e) {
2753
2757
  this._subscribe = e;
2754
2758
  }
2755
2759
  subscribe(e, n, r) {
2756
2760
  return this._subscribe(e && typeof e != "function" ? e : { next: e, error: n, complete: r });
2757
2761
  }
2758
- [Zr]() {
2762
+ [Xr]() {
2759
2763
  return this;
2760
2764
  }
2761
2765
  }
2762
- function ir(t, e) {
2766
+ function tr(t, e) {
2763
2767
  return $(e).forEach((n) => {
2764
2768
  gt(t[n] || (t[n] = new Q()), e[n]);
2765
2769
  }), t;
2766
2770
  }
2767
- function ts(t) {
2771
+ function Jr(t) {
2768
2772
  let e, n = !1;
2769
- const r = new es((s) => {
2770
- const i = en(t);
2773
+ const r = new Qr((s) => {
2774
+ const i = Zt(t);
2771
2775
  let o = !1, u = {}, a = {};
2772
- const l = { get closed() {
2776
+ const c = { get closed() {
2773
2777
  return o;
2774
2778
  }, unsubscribe: () => {
2775
- o = !0, ue.storagemutated.unsubscribe(m);
2779
+ o = !0, ue.storagemutated.unsubscribe(f);
2776
2780
  } };
2777
- s.start && s.start(l);
2778
- let h = !1, c = !1;
2779
- function d() {
2780
- return $(a).some((f) => u[f] && Qr(u[f], a[f]));
2781
+ s.start && s.start(c);
2782
+ let d = !1, l = !1;
2783
+ function h() {
2784
+ return $(a).some((p) => u[p] && Yr(u[p], a[p]));
2781
2785
  }
2782
- const m = (f) => {
2783
- ir(u, f), d() && p();
2784
- }, p = () => {
2785
- if (h || o)
2786
+ const f = (p) => {
2787
+ tr(u, p), h() && m();
2788
+ }, m = () => {
2789
+ if (d || o)
2786
2790
  return;
2787
2791
  u = {};
2788
- const f = {}, y = function(g) {
2792
+ const p = {}, v = function(y) {
2789
2793
  i && Ce();
2790
- const v = () => oe(t, { subscr: g, trans: null }), b = P.trans ? Te(P.transless, v) : v();
2794
+ const g = () => oe(t, { subscr: y, trans: null }), b = E.trans ? Te(E.transless, g) : g();
2791
2795
  return i && b.then(ne, ne), b;
2792
- }(f);
2793
- c || (ue(Le, m), c = !0), h = !0, Promise.resolve(y).then((g) => {
2794
- n = !0, e = g, h = !1, o || (d() ? p() : (u = {}, a = f, s.next && s.next(g)));
2795
- }, (g) => {
2796
- h = !1, n = !1, s.error && s.error(g), l.unsubscribe();
2796
+ }(p);
2797
+ l || (ue(Le, f), l = !0), d = !0, Promise.resolve(v).then((y) => {
2798
+ n = !0, e = y, d = !1, o || (h() ? m() : (u = {}, a = p, s.next && s.next(y)));
2799
+ }, (y) => {
2800
+ d = !1, n = !1, s.error && s.error(y), c.unsubscribe();
2797
2801
  });
2798
2802
  };
2799
- return p(), l;
2803
+ return m(), c;
2800
2804
  });
2801
2805
  return r.hasValue = () => n, r.getValue = () => e, r;
2802
2806
  }
2803
- let Jt;
2807
+ let Qt;
2804
2808
  try {
2805
- Jt = { indexedDB: K.indexedDB || K.mozIndexedDB || K.webkitIndexedDB || K.msIndexedDB, IDBKeyRange: K.IDBKeyRange || K.webkitIDBKeyRange };
2809
+ Qt = { indexedDB: K.indexedDB || K.mozIndexedDB || K.webkitIndexedDB || K.msIndexedDB, IDBKeyRange: K.IDBKeyRange || K.webkitIDBKeyRange };
2806
2810
  } catch {
2807
- Jt = { indexedDB: null, IDBKeyRange: null };
2811
+ Qt = { indexedDB: null, IDBKeyRange: null };
2808
2812
  }
2809
- const le = pe;
2813
+ const ce = pe;
2810
2814
  function at(t) {
2811
2815
  let e = Z;
2812
2816
  try {
@@ -2815,42 +2819,42 @@ function at(t) {
2815
2819
  Z = e;
2816
2820
  }
2817
2821
  }
2818
- Ee(le, { ...tt, delete: (t) => new le(t, { addons: [] }).delete(), exists: (t) => new le(t, { addons: [] }).open().then((e) => (e.close(), !0)).catch("NoSuchDatabaseError", () => !1), getDatabaseNames(t) {
2822
+ Pe(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) => new ce(t, { addons: [] }).open().then((e) => (e.close(), !0)).catch("NoSuchDatabaseError", () => !1), getDatabaseNames(t) {
2819
2823
  try {
2820
2824
  return function({ indexedDB: e, IDBKeyRange: n }) {
2821
- return cn(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== vt)) : un(e, n).toCollection().primaryKeys();
2822
- }(le.dependencies).then(t);
2825
+ return un(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== vt)) : an(e, n).toCollection().primaryKeys();
2826
+ }(ce.dependencies).then(t);
2823
2827
  } catch {
2824
- return N(new C.MissingAPI());
2828
+ return D(new C.MissingAPI());
2825
2829
  }
2826
2830
  }, defineClass: () => function(t) {
2827
2831
  U(this, t);
2828
- }, ignoreTransaction: (t) => P.trans ? Te(P.transless, t) : t(), vip: Gt, async: function(t) {
2832
+ }, ignoreTransaction: (t) => E.trans ? Te(E.transless, t) : t(), vip: Yt, async: function(t) {
2829
2833
  return function() {
2830
2834
  try {
2831
- var e = Xt(t.apply(this, arguments));
2835
+ var e = Gt(t.apply(this, arguments));
2832
2836
  return e && typeof e.then == "function" ? e : S.resolve(e);
2833
2837
  } catch (n) {
2834
- return N(n);
2838
+ return D(n);
2835
2839
  }
2836
2840
  };
2837
2841
  }, spawn: function(t, e, n) {
2838
2842
  try {
2839
- var r = Xt(t.apply(n, e || []));
2843
+ var r = Gt(t.apply(n, e || []));
2840
2844
  return r && typeof r.then == "function" ? r : S.resolve(r);
2841
2845
  } catch (s) {
2842
- return N(s);
2846
+ return D(s);
2843
2847
  }
2844
- }, currentTransaction: { get: () => P.trans || null }, waitFor: function(t, e) {
2845
- const n = S.resolve(typeof t == "function" ? le.ignoreTransaction(t) : t).timeout(e || 6e4);
2846
- return P.trans ? P.trans.waitFor(n) : n;
2848
+ }, currentTransaction: { get: () => E.trans || null }, waitFor: function(t, e) {
2849
+ const n = S.resolve(typeof t == "function" ? ce.ignoreTransaction(t) : t).timeout(e || 6e4);
2850
+ return E.trans ? E.trans.waitFor(n) : n;
2847
2851
  }, Promise: S, debug: { get: () => G, set: (t) => {
2848
- $n(t, t === "dexie" ? () => !0 : Xn);
2849
- } }, derive: ke, extend: U, props: Ee, override: On, Events: $e, on: ue, liveQuery: ts, extendObservabilitySet: ir, getByKeyPath: te, setByKeyPath: H, delByKeyPath: function(t, e) {
2852
+ Kn(t, t === "dexie" ? () => !0 : zn);
2853
+ } }, derive: ke, extend: U, props: Pe, override: En, Events: $e, on: ue, liveQuery: Jr, extendObservabilitySet: tr, getByKeyPath: te, setByKeyPath: H, delByKeyPath: function(t, e) {
2850
2854
  typeof e == "string" ? H(t, e, void 0) : "length" in e && [].map.call(e, function(n) {
2851
2855
  H(t, n, void 0);
2852
2856
  });
2853
- }, shallowClone: Rn, deepClone: We, getObjectDiff: ln, cmp: L, asap: In, minKey: qt, addons: [], connections: De, errnames: nn, dependencies: Jt, semVer: wn, version: wn.split(".").map((t) => parseInt(t)).reduce((t, e, n) => t + e / Math.pow(10, 2 * n)) }), le.maxKey = Ue(le.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (ue(Le, (t) => {
2857
+ }, shallowClone: An, deepClone: We, getObjectDiff: ln, cmp: L, asap: Cn, minKey: Mt, addons: [], connections: Ne, errnames: tn, dependencies: Qt, semVer: yn, version: yn.split(".").map((t) => parseInt(t)).reduce((t, e, n) => t + e / Math.pow(10, 2 * n)) }), ce.maxKey = Ue(ce.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (ue(Le, (t) => {
2854
2858
  if (!Z) {
2855
2859
  let e;
2856
2860
  yt ? (e = document.createEvent("CustomEvent"), e.initCustomEvent(ie, !0, !0, t)) : e = new CustomEvent(ie, { detail: t }), Z = !0, dispatchEvent(e), Z = !1;
@@ -2884,14 +2888,14 @@ if (typeof BroadcastChannel < "u") {
2884
2888
  });
2885
2889
  }
2886
2890
  S.rejectionMapper = function(t, e) {
2887
- if (!t || t instanceof xe || t instanceof TypeError || t instanceof SyntaxError || !t.name || !gn[t.name])
2891
+ if (!t || t instanceof xe || t instanceof TypeError || t instanceof SyntaxError || !t.name || !fn[t.name])
2888
2892
  return t;
2889
- var n = new gn[t.name](e || t.message, t);
2893
+ var n = new fn[t.name](e || t.message, t);
2890
2894
  return "stack" in t && ee(n, "stack", { get: function() {
2891
2895
  return this.inner.stack;
2892
2896
  } }), n;
2893
- }, $n(G, Xn);
2894
- class ns extends pe {
2897
+ }, Kn(G, zn);
2898
+ class Zr extends pe {
2895
2899
  constructor() {
2896
2900
  super("NylasAuthDatabase"), ut(this, "grant"), ut(this, "pkce"), this.version(1).stores({
2897
2901
  grant: "++id,token",
@@ -2899,9 +2903,9 @@ class ns extends pe {
2899
2903
  }), this.grant = this.table("grant"), this.pkce = this.table("pkce");
2900
2904
  }
2901
2905
  }
2902
- class rs {
2906
+ class es {
2903
2907
  constructor() {
2904
- ut(this, "theDB"), this.theDB = new ns();
2908
+ ut(this, "theDB"), this.theDB = new Zr();
2905
2909
  }
2906
2910
  async setCodeVerifier(e) {
2907
2911
  await this.theDB.pkce.put({ id: 1, codeVerifier: e }, 1);
@@ -2921,12 +2925,12 @@ class rs {
2921
2925
  await this.theDB.grant.clear();
2922
2926
  }
2923
2927
  }
2924
- function ms(t) {
2928
+ function is(t) {
2925
2929
  const e = "NylasAuth";
2926
2930
  if (!t)
2927
2931
  throw new Error("NylasAuth requires a config object");
2928
2932
  let n = null;
2929
- if (t.storageType === "indexeddb" && (n = new rs()), !n)
2933
+ if (t.storageType === "indexeddb" && (n = new es()), !n)
2930
2934
  throw new Error("NylasAuth requires a storage object");
2931
2935
  const r = [
2932
2936
  {
@@ -2979,18 +2983,18 @@ function ms(t) {
2979
2983
  value: "offline_access"
2980
2984
  }
2981
2985
  ];
2982
- async function i(o, u, a, l = !0, h, c) {
2983
- const d = await (n == null ? void 0 : n.getTokenInfo()), m = new URL(o, h ?? t.apiUri), p = new Headers();
2984
- p.append("Accept", "application/json"), p.append("Content-Type", "application/json"), p.append("User-Agent", e), d && p.append("Authorization", `Bearer ${d.access_token}`);
2985
- const f = await fetch(m.toString(), {
2986
+ async function i(o, u, a, c = !0, d, l) {
2987
+ const h = await (n == null ? void 0 : n.getTokenInfo()), f = new URL(o, d ?? t.apiUri), m = new Headers();
2988
+ m.append("Accept", "application/json"), m.append("Content-Type", "application/json"), m.append("User-Agent", e), h && m.append("Authorization", `Bearer ${h.access_token}`);
2989
+ const p = await fetch(f.toString(), {
2986
2990
  method: u || "GET",
2987
- headers: p,
2991
+ headers: m,
2988
2992
  mode: "cors",
2989
2993
  referrer: location.origin,
2990
2994
  body: a ? JSON.stringify(a) : void 0,
2991
- ...c || {}
2995
+ ...l || {}
2992
2996
  });
2993
- return l ? await f.json() : f.body;
2997
+ return c ? await p.json() : p.body;
2994
2998
  }
2995
2999
  return {
2996
3000
  config: t,
@@ -3002,10 +3006,10 @@ function ms(t) {
3002
3006
  * @returns A promise that resolves to a URL string that can be used to redirect the user to the Nylas API to complete the authorization flow
3003
3007
  */
3004
3008
  async getHostedAuthRedirectURL(o = t.defaultScopes, u, a) {
3005
- const l = await mn(Math.random().toString()), h = await mn(l);
3006
- await (n == null ? void 0 : n.setCodeVerifier(l));
3007
- const c = new URL(`${t.apiUri}/v3/connect/auth`);
3008
- return c.searchParams.set("client_id", t.clientId), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", o.join(" ")), c.searchParams.set("redirect_uri", t.redirectURI), c.searchParams.set("access_type", "offline"), c.searchParams.set("code_challenge", h), c.searchParams.set("code_challenge_method", "S256"), c.searchParams.set("options", "rotate_refresh_token"), a && c.searchParams.set("provider", a), u && c.searchParams.set("login_hint", u), c.toString();
3009
+ const c = await dn(Math.random().toString()), d = await dn(c);
3010
+ await (n == null ? void 0 : n.setCodeVerifier(c));
3011
+ const l = new URL(`${t.apiUri}/v3/connect/auth`);
3012
+ return l.searchParams.set("client_id", t.clientId), l.searchParams.set("response_type", "code"), l.searchParams.set("scope", o.join(" ")), l.searchParams.set("redirect_uri", t.redirectURI), l.searchParams.set("access_type", "offline"), l.searchParams.set("code_challenge", d), l.searchParams.set("code_challenge_method", "S256"), l.searchParams.set("options", "rotate_refresh_token"), a && l.searchParams.set("provider", a), u && l.searchParams.set("login_hint", u), l.toString();
3009
3013
  },
3010
3014
  /**
3011
3015
  * This method will make a request to the Nylas API to exchange an authorization code for an access token.
@@ -3038,10 +3042,10 @@ function ms(t) {
3038
3042
  * This method will make a `application/octet-stream` request to the Nylas API to download a file.
3039
3043
  */
3040
3044
  async nylasDownloadFileRequest(o, u = "GET", a) {
3041
- const l = await (n == null ? void 0 : n.getTokenInfo()), h = new URL(o, t.apiUri), c = new Headers();
3042
- return c.append("Accept", "application/json"), c.append("Content-Type", "application/octet-stream"), c.append("User-Agent", e), l && c.append("Authorization", `Bearer ${l.access_token}`), (await fetch(h.toString(), {
3045
+ const c = await (n == null ? void 0 : n.getTokenInfo()), d = new URL(o, t.apiUri), l = new Headers();
3046
+ return l.append("Accept", "application/json"), l.append("Content-Type", "application/octet-stream"), l.append("User-Agent", e), c && l.append("Authorization", `Bearer ${c.access_token}`), (await fetch(d.toString(), {
3043
3047
  method: u,
3044
- headers: c,
3048
+ headers: l,
3045
3049
  mode: "cors",
3046
3050
  referrer: location.origin,
3047
3051
  body: a ? JSON.stringify(a) : void 0
@@ -3104,10 +3108,10 @@ function ms(t) {
3104
3108
  const a = await (n == null ? void 0 : n.getTokenInfo());
3105
3109
  if (!a)
3106
3110
  return !1;
3107
- const l = a.scope.toLowerCase().split(" ");
3108
- let h = [];
3109
- const c = Array.isArray(u) ? u : [u];
3110
- return o === "email" && (h = [...s, ...r].filter((d) => c.includes(d.type))), h.every((d) => l.includes(d.value));
3111
+ const c = a.scope.toLowerCase().split(" ");
3112
+ let d = [];
3113
+ const l = Array.isArray(u) ? u : [u];
3114
+ return o === "email" && (d = [...s, ...r].filter((h) => l.includes(h.type))), d.every((h) => c.includes(h.value));
3111
3115
  },
3112
3116
  /**
3113
3117
  * A helper method to check if the current access token has a given scope.
@@ -3119,115 +3123,15 @@ function ms(t) {
3119
3123
  if (!u)
3120
3124
  return !1;
3121
3125
  const a = u.scope.toLowerCase().split(" ");
3122
- return (Array.isArray(o) ? o : [o]).some((l) => a.includes(l.toLowerCase()));
3126
+ return (Array.isArray(o) ? o : [o]).some((c) => a.includes(c.toLowerCase()));
3123
3127
  }
3124
3128
  };
3125
3129
  }
3126
- const ss = (t, e, n) => {
3127
- const r = t.get(e);
3128
- r ? r.includes(n) || r.push(n) : t.set(e, [n]);
3129
- }, is = (t, e) => {
3130
- let n;
3131
- return (...r) => {
3132
- n && clearTimeout(n), n = setTimeout(() => {
3133
- n = 0, t(...r);
3134
- }, e);
3135
- };
3136
- }, os = (t) => !("isConnected" in t) || t.isConnected, Tn = is((t) => {
3137
- for (let e of t.keys())
3138
- t.set(e, t.get(e).filter(os));
3139
- }, 2e3), as = () => {
3140
- if (typeof fn != "function")
3141
- return {};
3142
- const t = /* @__PURE__ */ new Map();
3143
- return {
3144
- dispose: () => t.clear(),
3145
- get: (e) => {
3146
- const n = fn();
3147
- n && ss(t, e, n);
3148
- },
3149
- set: (e) => {
3150
- const n = t.get(e);
3151
- n && t.set(e, n.filter(pn)), Tn(t);
3152
- },
3153
- reset: () => {
3154
- t.forEach((e) => e.forEach(pn)), Tn(t);
3155
- }
3156
- };
3157
- }, Ct = (t) => typeof t == "function" ? t() : t, us = (t, e = (n, r) => n !== r) => {
3158
- const n = Ct(t);
3159
- let r = new Map(Object.entries(n ?? {}));
3160
- const s = {
3161
- dispose: [],
3162
- get: [],
3163
- set: [],
3164
- reset: []
3165
- }, i = () => {
3166
- var p;
3167
- r = new Map(Object.entries((p = Ct(t)) !== null && p !== void 0 ? p : {})), s.reset.forEach((f) => f());
3168
- }, o = () => {
3169
- s.dispose.forEach((p) => p()), i();
3170
- }, u = (p) => (s.get.forEach((f) => f(p)), r.get(p)), a = (p, f) => {
3171
- const y = r.get(p);
3172
- e(f, y, p) && (r.set(p, f), s.set.forEach((g) => g(p, f, y)));
3173
- }, l = typeof Proxy > "u" ? {} : new Proxy(n, {
3174
- get(p, f) {
3175
- return u(f);
3176
- },
3177
- ownKeys(p) {
3178
- return Array.from(r.keys());
3179
- },
3180
- getOwnPropertyDescriptor() {
3181
- return {
3182
- enumerable: !0,
3183
- configurable: !0
3184
- };
3185
- },
3186
- has(p, f) {
3187
- return r.has(f);
3188
- },
3189
- set(p, f, y) {
3190
- return a(f, y), !0;
3191
- }
3192
- }), h = (p, f) => (s[p].push(f), () => {
3193
- cs(s[p], f);
3194
- });
3195
- return {
3196
- state: l,
3197
- get: u,
3198
- set: a,
3199
- on: h,
3200
- onChange: (p, f) => {
3201
- const y = h("set", (v, b) => {
3202
- v === p && f(b);
3203
- }), g = h("reset", () => f(Ct(t)[p]));
3204
- return () => {
3205
- y(), g();
3206
- };
3207
- },
3208
- use: (...p) => {
3209
- const f = p.reduce((y, g) => (g.set && y.push(h("set", g.set)), g.get && y.push(h("get", g.get)), g.reset && y.push(h("reset", g.reset)), g.dispose && y.push(h("dispose", g.dispose)), y), []);
3210
- return () => f.forEach((y) => y());
3211
- },
3212
- dispose: o,
3213
- reset: i,
3214
- forceUpdate: (p) => {
3215
- const f = r.get(p);
3216
- s.set.forEach((y) => y(p, f, f));
3217
- }
3218
- };
3219
- }, cs = (t, e) => {
3220
- const n = t.indexOf(e);
3221
- n >= 0 && (t[n] = t[t.length - 1], t.length--);
3222
- }, gs = (t, e) => {
3223
- const n = us(t, e);
3224
- return n.use(as()), n;
3225
- };
3226
3130
  export {
3227
- ds as N,
3228
- fs as X,
3229
- ps as Z,
3230
- gs as c,
3231
- ms as e,
3232
- lr as n
3131
+ ns as N,
3132
+ rs as X,
3133
+ ss as Z,
3134
+ is as e,
3135
+ sr as g,
3136
+ ar as n
3233
3137
  };