@wandelbots/wandelbots-js-react-components 3.4.0-pr.feat-yaskawa-gp200s.437.5d50e5b → 3.4.0-pr.feat-add-yaskawa-gp200s.438.0503e4b

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 (165) hide show
  1. package/README.md +10 -61
  2. package/dist/auth0-spa-js.production.esm-1QXzndwB.js +950 -0
  3. package/dist/auth0-spa-js.production.esm-1QXzndwB.js.map +1 -0
  4. package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs +5 -0
  5. package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs.map +1 -0
  6. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +1 -1
  7. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts.map +1 -1
  8. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
  9. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts +1 -1
  10. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts.map +1 -1
  11. package/dist/components/3d-viewport/collider/ColliderElement.d.ts +1 -1
  12. package/dist/components/3d-viewport/collider/ColliderElement.d.ts.map +1 -1
  13. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts +1 -1
  14. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts.map +1 -1
  15. package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts +1 -1
  16. package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts.map +1 -1
  17. package/dist/components/ProgramStateIndicator.d.ts +3 -3
  18. package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
  19. package/dist/components/RobotCard.d.ts +3 -4
  20. package/dist/components/RobotCard.d.ts.map +1 -1
  21. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  22. package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
  23. package/dist/components/jogging/JoggingPanel.d.ts +1 -1
  24. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  25. package/dist/components/jogging/JoggingStore.d.ts +5 -10
  26. package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
  27. package/dist/components/jogging/PoseCartesianValues.d.ts +2 -2
  28. package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
  29. package/dist/components/jogging/PoseJointValues.d.ts +2 -1
  30. package/dist/components/jogging/PoseJointValues.d.ts.map +1 -1
  31. package/dist/components/robots/DHRobot.d.ts.map +1 -1
  32. package/dist/components/robots/Robot.d.ts +1 -1
  33. package/dist/components/robots/Robot.d.ts.map +1 -1
  34. package/dist/components/robots/RobotAnimator.d.ts +2 -2
  35. package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
  36. package/dist/components/robots/SupportedRobot.d.ts +3 -3
  37. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  38. package/dist/components/robots/manufacturerHomePositions.d.ts +1 -1
  39. package/dist/components/robots/manufacturerHomePositions.d.ts.map +1 -1
  40. package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -1
  41. package/dist/components/safetyBar/OperationModeIndicator.d.ts +2 -2
  42. package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
  43. package/dist/components/safetyBar/SafetyBar.d.ts +3 -3
  44. package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
  45. package/dist/components/safetyBar/SafetyStateIndicator.d.ts +2 -2
  46. package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
  47. package/dist/components/utils/errorHandling.d.ts.map +1 -1
  48. package/dist/index.cjs +155 -0
  49. package/dist/index.cjs.map +1 -0
  50. package/dist/index.d.ts +39 -3
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +34927 -0
  53. package/dist/index.js.map +1 -0
  54. package/package.json +21 -49
  55. package/src/components/3d-viewport/CoordinateSystemTransform.tsx +1 -1
  56. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +2 -1
  57. package/src/components/3d-viewport/collider/ColliderCollection.tsx +1 -1
  58. package/src/components/3d-viewport/collider/ColliderElement.tsx +1 -1
  59. package/src/components/3d-viewport/collider/CollisionSceneRenderer.tsx +1 -1
  60. package/src/components/3d-viewport/collider/colliderShapeToBufferGeometry.ts +1 -1
  61. package/src/components/AppHeader.md +1 -1
  62. package/src/components/ProgramStateIndicator.tsx +6 -3
  63. package/src/components/RobotCard.tsx +7 -4
  64. package/src/components/jogging/JoggingCartesianTab.tsx +11 -13
  65. package/src/components/jogging/JoggingJointLimitDetector.tsx +2 -2
  66. package/src/components/jogging/JoggingJointTab.tsx +4 -4
  67. package/src/components/jogging/JoggingOptions.tsx +5 -6
  68. package/src/components/jogging/JoggingPanel.tsx +3 -6
  69. package/src/components/jogging/JoggingStore.ts +39 -66
  70. package/src/components/jogging/PoseCartesianValues.tsx +4 -3
  71. package/src/components/jogging/PoseJointValues.tsx +4 -3
  72. package/src/components/robots/DHRobot.tsx +3 -2
  73. package/src/components/robots/Robot.tsx +1 -1
  74. package/src/components/robots/RobotAnimator.test.tsx +22 -7
  75. package/src/components/robots/RobotAnimator.tsx +13 -8
  76. package/src/components/robots/SupportedRobot.tsx +6 -3
  77. package/src/components/robots/manufacturerHomePositions.ts +1 -1
  78. package/src/components/safetyBar/ControllerTypeIndicator.tsx +2 -4
  79. package/src/components/safetyBar/OperationModeIndicator.tsx +5 -7
  80. package/src/components/safetyBar/SafetyBar.tsx +6 -3
  81. package/src/components/safetyBar/SafetyStateIndicator.tsx +7 -9
  82. package/src/components/utils/errorHandling.ts +0 -4
  83. package/src/i18n/locales/de/translations.json +0 -3
  84. package/src/i18n/locales/en/translations.json +0 -3
  85. package/src/index.ts +43 -4
  86. package/dist/3d.cjs.js +0 -2
  87. package/dist/3d.cjs.js.map +0 -1
  88. package/dist/3d.d.ts +0 -11
  89. package/dist/3d.d.ts.map +0 -1
  90. package/dist/3d.es.js +0 -16
  91. package/dist/3d.es.js.map +0 -1
  92. package/dist/LoadingCover-Dr9hDTku.js +0 -87
  93. package/dist/LoadingCover-Dr9hDTku.js.map +0 -1
  94. package/dist/LoadingCover-r2yhJZF9.cjs +0 -2
  95. package/dist/LoadingCover-r2yhJZF9.cjs.map +0 -1
  96. package/dist/WandelscriptEditor-Dj7TBCkF.cjs +0 -2
  97. package/dist/WandelscriptEditor-Dj7TBCkF.cjs.map +0 -1
  98. package/dist/WandelscriptEditor-DnJvITTA.js +0 -140
  99. package/dist/WandelscriptEditor-DnJvITTA.js.map +0 -1
  100. package/dist/auth0-spa-js.production.esm-9WdmjTxR.js +0 -1429
  101. package/dist/auth0-spa-js.production.esm-9WdmjTxR.js.map +0 -1
  102. package/dist/auth0-spa-js.production.esm-BcLLh1tx.cjs +0 -5
  103. package/dist/auth0-spa-js.production.esm-BcLLh1tx.cjs.map +0 -1
  104. package/dist/components/jogging/JoggingBlocked.d.ts +0 -7
  105. package/dist/components/jogging/JoggingBlocked.d.ts.map +0 -1
  106. package/dist/components/utils/errorHandling.test.d.ts +0 -2
  107. package/dist/components/utils/errorHandling.test.d.ts.map +0 -1
  108. package/dist/core.cjs.js +0 -2
  109. package/dist/core.cjs.js.map +0 -1
  110. package/dist/core.d.ts +0 -33
  111. package/dist/core.d.ts.map +0 -1
  112. package/dist/core.es.js +0 -54
  113. package/dist/core.es.js.map +0 -1
  114. package/dist/index-CAib4NKw.js +0 -2261
  115. package/dist/index-CAib4NKw.js.map +0 -1
  116. package/dist/index-CqMZL0FV.cjs +0 -2
  117. package/dist/index-CqMZL0FV.cjs.map +0 -1
  118. package/dist/index-CxasuX80.js +0 -5212
  119. package/dist/index-CxasuX80.js.map +0 -1
  120. package/dist/index-DxwppshT.cjs +0 -29
  121. package/dist/index-DxwppshT.cjs.map +0 -1
  122. package/dist/index.cjs.js +0 -2
  123. package/dist/index.cjs.js.map +0 -1
  124. package/dist/index.es.js +0 -69
  125. package/dist/index.es.js.map +0 -1
  126. package/dist/lib/ConnectedMotionGroup.d.ts +0 -90
  127. package/dist/lib/ConnectedMotionGroup.d.ts.map +0 -1
  128. package/dist/lib/JoggerConnection.d.ts +0 -113
  129. package/dist/lib/JoggerConnection.d.ts.map +0 -1
  130. package/dist/lib/JoggerConnection.test.d.ts +0 -2
  131. package/dist/lib/JoggerConnection.test.d.ts.map +0 -1
  132. package/dist/lib/MotionStreamConnection.d.ts +0 -24
  133. package/dist/lib/MotionStreamConnection.d.ts.map +0 -1
  134. package/dist/lib/MotionStreamConnection.test.d.ts +0 -2
  135. package/dist/lib/MotionStreamConnection.test.d.ts.map +0 -1
  136. package/dist/lib/motionStateUpdate.d.ts +0 -7
  137. package/dist/lib/motionStateUpdate.d.ts.map +0 -1
  138. package/dist/lib/motionStateUpdate.test.d.ts +0 -2
  139. package/dist/lib/motionStateUpdate.test.d.ts.map +0 -1
  140. package/dist/manufacturerHomePositions-Ca80ycLi.cjs +0 -2
  141. package/dist/manufacturerHomePositions-Ca80ycLi.cjs.map +0 -1
  142. package/dist/manufacturerHomePositions-CgaG5vaK.js +0 -976
  143. package/dist/manufacturerHomePositions-CgaG5vaK.js.map +0 -1
  144. package/dist/theming-BQcKj8Gp.cjs +0 -133
  145. package/dist/theming-BQcKj8Gp.cjs.map +0 -1
  146. package/dist/theming-Bafjg0Wg.js +0 -23460
  147. package/dist/theming-Bafjg0Wg.js.map +0 -1
  148. package/dist/wandelscript.cjs.js +0 -2
  149. package/dist/wandelscript.cjs.js.map +0 -1
  150. package/dist/wandelscript.d.ts +0 -2
  151. package/dist/wandelscript.d.ts.map +0 -1
  152. package/dist/wandelscript.es.js +0 -5
  153. package/dist/wandelscript.es.js.map +0 -1
  154. package/src/3d.ts +0 -15
  155. package/src/components/jogging/JoggingBlocked.tsx +0 -37
  156. package/src/components/utils/errorHandling.test.ts +0 -41
  157. package/src/core.ts +0 -33
  158. package/src/lib/ConnectedMotionGroup.ts +0 -444
  159. package/src/lib/JoggerConnection.test.ts +0 -120
  160. package/src/lib/JoggerConnection.ts +0 -674
  161. package/src/lib/MotionStreamConnection.test.ts +0 -23
  162. package/src/lib/MotionStreamConnection.ts +0 -189
  163. package/src/lib/motionStateUpdate.test.ts +0 -28
  164. package/src/lib/motionStateUpdate.ts +0 -117
  165. package/src/wandelscript.ts +0 -2
@@ -0,0 +1,950 @@
1
+ function I(r, e) {
2
+ var t = {};
3
+ for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && e.indexOf(i) < 0 && (t[i] = r[i]);
4
+ if (r != null && typeof Object.getOwnPropertySymbols == "function") {
5
+ var o = 0;
6
+ for (i = Object.getOwnPropertySymbols(r); o < i.length; o++) e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, i[o]) && (t[i[o]] = r[i[o]]);
7
+ }
8
+ return t;
9
+ }
10
+ var C = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
11
+ function J(r) {
12
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
13
+ }
14
+ function F(r, e) {
15
+ return r(e = { exports: {} }, e.exports), e.exports;
16
+ }
17
+ var j = F(function(r, e) {
18
+ Object.defineProperty(e, "__esModule", { value: !0 });
19
+ var t = function() {
20
+ function i() {
21
+ var o = this;
22
+ this.locked = /* @__PURE__ */ new Map(), this.addToLocked = function(n, u) {
23
+ var d = o.locked.get(n);
24
+ d === void 0 ? u === void 0 ? o.locked.set(n, []) : o.locked.set(n, [u]) : u !== void 0 && (d.unshift(u), o.locked.set(n, d));
25
+ }, this.isLocked = function(n) {
26
+ return o.locked.has(n);
27
+ }, this.lock = function(n) {
28
+ return new Promise(function(u, d) {
29
+ o.isLocked(n) ? o.addToLocked(n, u) : (o.addToLocked(n), u());
30
+ });
31
+ }, this.unlock = function(n) {
32
+ var u = o.locked.get(n);
33
+ if (u !== void 0 && u.length !== 0) {
34
+ var d = u.pop();
35
+ o.locked.set(n, u), d !== void 0 && setTimeout(d, 0);
36
+ } else o.locked.delete(n);
37
+ };
38
+ }
39
+ return i.getInstance = function() {
40
+ return i.instance === void 0 && (i.instance = new i()), i.instance;
41
+ }, i;
42
+ }();
43
+ e.default = function() {
44
+ return t.getInstance();
45
+ };
46
+ });
47
+ J(j);
48
+ var ce = J(F(function(r, e) {
49
+ var t = C && C.__awaiter || function(a, s, c, l) {
50
+ return new (c || (c = Promise))(function(h, w) {
51
+ function g(y) {
52
+ try {
53
+ v(l.next(y));
54
+ } catch (m) {
55
+ w(m);
56
+ }
57
+ }
58
+ function k(y) {
59
+ try {
60
+ v(l.throw(y));
61
+ } catch (m) {
62
+ w(m);
63
+ }
64
+ }
65
+ function v(y) {
66
+ y.done ? h(y.value) : new c(function(m) {
67
+ m(y.value);
68
+ }).then(g, k);
69
+ }
70
+ v((l = l.apply(a, s || [])).next());
71
+ });
72
+ }, i = C && C.__generator || function(a, s) {
73
+ var c, l, h, w, g = { label: 0, sent: function() {
74
+ if (1 & h[0]) throw h[1];
75
+ return h[1];
76
+ }, trys: [], ops: [] };
77
+ return w = { next: k(0), throw: k(1), return: k(2) }, typeof Symbol == "function" && (w[Symbol.iterator] = function() {
78
+ return this;
79
+ }), w;
80
+ function k(v) {
81
+ return function(y) {
82
+ return function(m) {
83
+ if (c) throw new TypeError("Generator is already executing.");
84
+ for (; g; ) try {
85
+ if (c = 1, l && (h = 2 & m[0] ? l.return : m[0] ? l.throw || ((h = l.return) && h.call(l), 0) : l.next) && !(h = h.call(l, m[1])).done) return h;
86
+ switch (l = 0, h && (m = [2 & m[0], h.value]), m[0]) {
87
+ case 0:
88
+ case 1:
89
+ h = m;
90
+ break;
91
+ case 4:
92
+ return g.label++, { value: m[1], done: !1 };
93
+ case 5:
94
+ g.label++, l = m[1], m = [0];
95
+ continue;
96
+ case 7:
97
+ m = g.ops.pop(), g.trys.pop();
98
+ continue;
99
+ default:
100
+ if (h = g.trys, !((h = h.length > 0 && h[h.length - 1]) || m[0] !== 6 && m[0] !== 2)) {
101
+ g = 0;
102
+ continue;
103
+ }
104
+ if (m[0] === 3 && (!h || m[1] > h[0] && m[1] < h[3])) {
105
+ g.label = m[1];
106
+ break;
107
+ }
108
+ if (m[0] === 6 && g.label < h[1]) {
109
+ g.label = h[1], h = m;
110
+ break;
111
+ }
112
+ if (h && g.label < h[2]) {
113
+ g.label = h[2], g.ops.push(m);
114
+ break;
115
+ }
116
+ h[2] && g.ops.pop(), g.trys.pop();
117
+ continue;
118
+ }
119
+ m = s.call(a, g);
120
+ } catch (_) {
121
+ m = [6, _], l = 0;
122
+ } finally {
123
+ c = h = 0;
124
+ }
125
+ if (5 & m[0]) throw m[1];
126
+ return { value: m[0] ? m[1] : void 0, done: !0 };
127
+ }([v, y]);
128
+ };
129
+ }
130
+ }, o = C;
131
+ Object.defineProperty(e, "__esModule", { value: !0 });
132
+ var n = "browser-tabs-lock-key", u = { key: function(a) {
133
+ return t(o, void 0, void 0, function() {
134
+ return i(this, function(s) {
135
+ throw new Error("Unsupported");
136
+ });
137
+ });
138
+ }, getItem: function(a) {
139
+ return t(o, void 0, void 0, function() {
140
+ return i(this, function(s) {
141
+ throw new Error("Unsupported");
142
+ });
143
+ });
144
+ }, clear: function() {
145
+ return t(o, void 0, void 0, function() {
146
+ return i(this, function(a) {
147
+ return [2, window.localStorage.clear()];
148
+ });
149
+ });
150
+ }, removeItem: function(a) {
151
+ return t(o, void 0, void 0, function() {
152
+ return i(this, function(s) {
153
+ throw new Error("Unsupported");
154
+ });
155
+ });
156
+ }, setItem: function(a, s) {
157
+ return t(o, void 0, void 0, function() {
158
+ return i(this, function(c) {
159
+ throw new Error("Unsupported");
160
+ });
161
+ });
162
+ }, keySync: function(a) {
163
+ return window.localStorage.key(a);
164
+ }, getItemSync: function(a) {
165
+ return window.localStorage.getItem(a);
166
+ }, clearSync: function() {
167
+ return window.localStorage.clear();
168
+ }, removeItemSync: function(a) {
169
+ return window.localStorage.removeItem(a);
170
+ }, setItemSync: function(a, s) {
171
+ return window.localStorage.setItem(a, s);
172
+ } };
173
+ function d(a) {
174
+ return new Promise(function(s) {
175
+ return setTimeout(s, a);
176
+ });
177
+ }
178
+ function p(a) {
179
+ for (var s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", c = "", l = 0; l < a; l++)
180
+ c += s[Math.floor(Math.random() * s.length)];
181
+ return c;
182
+ }
183
+ var f = function() {
184
+ function a(s) {
185
+ this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() + p(15), this.acquireLock = this.acquireLock.bind(this), this.releaseLock = this.releaseLock.bind(this), this.releaseLock__private__ = this.releaseLock__private__.bind(this), this.waitForSomethingToChange = this.waitForSomethingToChange.bind(this), this.refreshLockWhileAcquired = this.refreshLockWhileAcquired.bind(this), this.storageHandler = s, a.waiters === void 0 && (a.waiters = []);
186
+ }
187
+ return a.prototype.acquireLock = function(s, c) {
188
+ return c === void 0 && (c = 5e3), t(this, void 0, void 0, function() {
189
+ var l, h, w, g, k, v, y;
190
+ return i(this, function(m) {
191
+ switch (m.label) {
192
+ case 0:
193
+ l = Date.now() + p(4), h = Date.now() + c, w = n + "-" + s, g = this.storageHandler === void 0 ? u : this.storageHandler, m.label = 1;
194
+ case 1:
195
+ return Date.now() < h ? [4, d(30)] : [3, 8];
196
+ case 2:
197
+ return m.sent(), g.getItemSync(w) !== null ? [3, 5] : (k = this.id + "-" + s + "-" + l, [4, d(Math.floor(25 * Math.random()))]);
198
+ case 3:
199
+ return m.sent(), g.setItemSync(w, JSON.stringify({ id: this.id, iat: l, timeoutKey: k, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, d(30)];
200
+ case 4:
201
+ return m.sent(), (v = g.getItemSync(w)) !== null && (y = JSON.parse(v)).id === this.id && y.iat === l ? (this.acquiredIatSet.add(l), this.refreshLockWhileAcquired(w, l), [2, !0]) : [3, 7];
202
+ case 5:
203
+ return a.lockCorrector(this.storageHandler === void 0 ? u : this.storageHandler), [4, this.waitForSomethingToChange(h)];
204
+ case 6:
205
+ m.sent(), m.label = 7;
206
+ case 7:
207
+ return l = Date.now() + p(4), [3, 1];
208
+ case 8:
209
+ return [2, !1];
210
+ }
211
+ });
212
+ });
213
+ }, a.prototype.refreshLockWhileAcquired = function(s, c) {
214
+ return t(this, void 0, void 0, function() {
215
+ var l = this;
216
+ return i(this, function(h) {
217
+ return setTimeout(function() {
218
+ return t(l, void 0, void 0, function() {
219
+ var w, g, k;
220
+ return i(this, function(v) {
221
+ switch (v.label) {
222
+ case 0:
223
+ return [4, j.default().lock(c)];
224
+ case 1:
225
+ return v.sent(), this.acquiredIatSet.has(c) ? (w = this.storageHandler === void 0 ? u : this.storageHandler, (g = w.getItemSync(s)) === null ? (j.default().unlock(c), [2]) : ((k = JSON.parse(g)).timeRefreshed = Date.now(), w.setItemSync(s, JSON.stringify(k)), j.default().unlock(c), this.refreshLockWhileAcquired(s, c), [2])) : (j.default().unlock(c), [2]);
226
+ }
227
+ });
228
+ });
229
+ }, 1e3), [2];
230
+ });
231
+ });
232
+ }, a.prototype.waitForSomethingToChange = function(s) {
233
+ return t(this, void 0, void 0, function() {
234
+ return i(this, function(c) {
235
+ switch (c.label) {
236
+ case 0:
237
+ return [4, new Promise(function(l) {
238
+ var h = !1, w = Date.now(), g = !1;
239
+ function k() {
240
+ if (g || (window.removeEventListener("storage", k), a.removeFromWaiting(k), clearTimeout(v), g = !0), !h) {
241
+ h = !0;
242
+ var y = 50 - (Date.now() - w);
243
+ y > 0 ? setTimeout(l, y) : l(null);
244
+ }
245
+ }
246
+ window.addEventListener("storage", k), a.addToWaiting(k);
247
+ var v = setTimeout(k, Math.max(0, s - Date.now()));
248
+ })];
249
+ case 1:
250
+ return c.sent(), [2];
251
+ }
252
+ });
253
+ });
254
+ }, a.addToWaiting = function(s) {
255
+ this.removeFromWaiting(s), a.waiters !== void 0 && a.waiters.push(s);
256
+ }, a.removeFromWaiting = function(s) {
257
+ a.waiters !== void 0 && (a.waiters = a.waiters.filter(function(c) {
258
+ return c !== s;
259
+ }));
260
+ }, a.notifyWaiters = function() {
261
+ a.waiters !== void 0 && a.waiters.slice().forEach(function(s) {
262
+ return s();
263
+ });
264
+ }, a.prototype.releaseLock = function(s) {
265
+ return t(this, void 0, void 0, function() {
266
+ return i(this, function(c) {
267
+ switch (c.label) {
268
+ case 0:
269
+ return [4, this.releaseLock__private__(s)];
270
+ case 1:
271
+ return [2, c.sent()];
272
+ }
273
+ });
274
+ });
275
+ }, a.prototype.releaseLock__private__ = function(s) {
276
+ return t(this, void 0, void 0, function() {
277
+ var c, l, h, w;
278
+ return i(this, function(g) {
279
+ switch (g.label) {
280
+ case 0:
281
+ return c = this.storageHandler === void 0 ? u : this.storageHandler, l = n + "-" + s, (h = c.getItemSync(l)) === null ? [2] : (w = JSON.parse(h)).id !== this.id ? [3, 2] : [4, j.default().lock(w.iat)];
282
+ case 1:
283
+ g.sent(), this.acquiredIatSet.delete(w.iat), c.removeItemSync(l), j.default().unlock(w.iat), a.notifyWaiters(), g.label = 2;
284
+ case 2:
285
+ return [2];
286
+ }
287
+ });
288
+ });
289
+ }, a.lockCorrector = function(s) {
290
+ for (var c = Date.now() - 5e3, l = s, h = [], w = 0; ; ) {
291
+ var g = l.keySync(w);
292
+ if (g === null) break;
293
+ h.push(g), w++;
294
+ }
295
+ for (var k = !1, v = 0; v < h.length; v++) {
296
+ var y = h[v];
297
+ if (y.includes(n)) {
298
+ var m = l.getItemSync(y);
299
+ if (m !== null) {
300
+ var _ = JSON.parse(m);
301
+ (_.timeRefreshed === void 0 && _.timeAcquired < c || _.timeRefreshed !== void 0 && _.timeRefreshed < c) && (l.removeItemSync(y), k = !0);
302
+ }
303
+ }
304
+ }
305
+ k && a.notifyWaiters();
306
+ }, a.waiters = void 0, a;
307
+ }();
308
+ e.default = f;
309
+ }));
310
+ const ue = { timeoutInSeconds: 60 }, ie = { name: "auth0-spa-js", version: "2.1.3" }, oe = () => Date.now();
311
+ class b extends Error {
312
+ constructor(e, t) {
313
+ super(t), this.error = e, this.error_description = t, Object.setPrototypeOf(this, b.prototype);
314
+ }
315
+ static fromPayload({ error: e, error_description: t }) {
316
+ return new b(e, t);
317
+ }
318
+ }
319
+ class H extends b {
320
+ constructor(e, t, i, o = null) {
321
+ super(e, t), this.state = i, this.appState = o, Object.setPrototypeOf(this, H.prototype);
322
+ }
323
+ }
324
+ class Z extends b {
325
+ constructor() {
326
+ super("timeout", "Timeout"), Object.setPrototypeOf(this, Z.prototype);
327
+ }
328
+ }
329
+ class G extends Z {
330
+ constructor(e) {
331
+ super(), this.popup = e, Object.setPrototypeOf(this, G.prototype);
332
+ }
333
+ }
334
+ class Y extends b {
335
+ constructor(e) {
336
+ super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Y.prototype);
337
+ }
338
+ }
339
+ class M extends b {
340
+ constructor(e, t, i) {
341
+ super(e, t), this.mfa_token = i, Object.setPrototypeOf(this, M.prototype);
342
+ }
343
+ }
344
+ class R extends b {
345
+ constructor(e, t) {
346
+ super("missing_refresh_token", `Missing Refresh Token (audience: '${V(e, ["default"])}', scope: '${V(t)}')`), this.audience = e, this.scope = t, Object.setPrototypeOf(this, R.prototype);
347
+ }
348
+ }
349
+ function V(r, e = []) {
350
+ return r && !e.includes(r) ? r : "";
351
+ }
352
+ const W = () => window.crypto, U = () => {
353
+ const r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
354
+ let e = "";
355
+ return Array.from(W().getRandomValues(new Uint8Array(43))).forEach((t) => e += r[t % r.length]), e;
356
+ }, A = (r) => btoa(r), N = (r) => {
357
+ var { clientId: e } = r, t = I(r, ["clientId"]);
358
+ return new URLSearchParams(((i) => Object.keys(i).filter((o) => i[o] !== void 0).reduce((o, n) => Object.assign(Object.assign({}, o), { [n]: i[n] }), {}))(Object.assign({ client_id: e }, t))).toString();
359
+ }, B = (r) => ((e) => decodeURIComponent(atob(e).split("").map((t) => "%" + ("00" + t.charCodeAt(0).toString(16)).slice(-2)).join("")))(r.replace(/_/g, "/").replace(/-/g, "+")), de = async (r, e) => {
360
+ const t = await fetch(r, e);
361
+ return { ok: t.ok, json: await t.json() };
362
+ }, le = async (r, e, t) => {
363
+ const i = new AbortController();
364
+ let o;
365
+ return e.signal = i.signal, Promise.race([de(r, e), new Promise((n, u) => {
366
+ o = setTimeout(() => {
367
+ i.abort(), u(new Error("Timeout when executing 'fetch'"));
368
+ }, t);
369
+ })]).finally(() => {
370
+ clearTimeout(o);
371
+ });
372
+ }, he = async (r, e, t, i, o, n, u) => {
373
+ return d = { auth: { audience: e, scope: t }, timeout: o, fetchUrl: r, fetchOptions: i, useFormData: u }, p = n, new Promise(function(f, a) {
374
+ const s = new MessageChannel();
375
+ s.port1.onmessage = function(c) {
376
+ c.data.error ? a(new Error(c.data.error)) : f(c.data), s.port1.close();
377
+ }, p.postMessage(d, [s.port2]);
378
+ });
379
+ var d, p;
380
+ }, pe = async (r, e, t, i, o, n, u = 1e4) => o ? he(r, e, t, i, u, o, n) : le(r, i, u);
381
+ async function me(r, e) {
382
+ var { baseUrl: t, timeout: i, audience: o, scope: n, auth0Client: u, useFormData: d } = r, p = I(r, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
383
+ const f = d ? N(p) : JSON.stringify(p);
384
+ return await async function(a, s, c, l, h, w, g) {
385
+ let k, v = null;
386
+ for (let O = 0; O < 3; O++) try {
387
+ k = await pe(a, c, l, h, w, g, s), v = null;
388
+ break;
389
+ } catch (se) {
390
+ v = se;
391
+ }
392
+ if (v) throw v;
393
+ const y = k.json, { error: m, error_description: _ } = y, E = I(y, ["error", "error_description"]), { ok: T } = k;
394
+ if (!T) {
395
+ const O = _ || `HTTP error. Unable to fetch ${a}`;
396
+ throw m === "mfa_required" ? new M(m, O, E.mfa_token) : m === "missing_refresh_token" ? new R(c, l) : new b(m || "request_error", O);
397
+ }
398
+ return E;
399
+ }(`${t}/oauth/token`, i, o || "default", n, { method: "POST", body: f, headers: { "Content-Type": d ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(u || ie)) } }, e, d);
400
+ }
401
+ const K = (...r) => {
402
+ return (e = r.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
403
+ var e;
404
+ };
405
+ class S {
406
+ constructor(e, t = "@@auth0spajs@@", i) {
407
+ this.prefix = t, this.suffix = i, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
408
+ }
409
+ toKey() {
410
+ return [this.prefix, this.clientId, this.audience, this.scope, this.suffix].filter(Boolean).join("::");
411
+ }
412
+ static fromKey(e) {
413
+ const [t, i, o, n] = e.split("::");
414
+ return new S({ clientId: i, scope: n, audience: o }, t);
415
+ }
416
+ static fromCacheEntry(e) {
417
+ const { scope: t, audience: i, client_id: o } = e;
418
+ return new S({ scope: t, audience: i, clientId: o });
419
+ }
420
+ }
421
+ class fe {
422
+ set(e, t) {
423
+ localStorage.setItem(e, JSON.stringify(t));
424
+ }
425
+ get(e) {
426
+ const t = window.localStorage.getItem(e);
427
+ if (t) try {
428
+ return JSON.parse(t);
429
+ } catch {
430
+ return;
431
+ }
432
+ }
433
+ remove(e) {
434
+ localStorage.removeItem(e);
435
+ }
436
+ allKeys() {
437
+ return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
438
+ }
439
+ }
440
+ class ne {
441
+ constructor() {
442
+ this.enclosedCache = /* @__PURE__ */ function() {
443
+ let e = {};
444
+ return { set(t, i) {
445
+ e[t] = i;
446
+ }, get(t) {
447
+ const i = e[t];
448
+ if (i) return i;
449
+ }, remove(t) {
450
+ delete e[t];
451
+ }, allKeys: () => Object.keys(e) };
452
+ }();
453
+ }
454
+ }
455
+ class ge {
456
+ constructor(e, t, i) {
457
+ this.cache = e, this.keyManifest = t, this.nowProvider = i || oe;
458
+ }
459
+ async setIdToken(e, t, i) {
460
+ var o;
461
+ const n = this.getIdTokenCacheKey(e);
462
+ await this.cache.set(n, { id_token: t, decodedToken: i }), await ((o = this.keyManifest) === null || o === void 0 ? void 0 : o.add(n));
463
+ }
464
+ async getIdToken(e) {
465
+ const t = await this.cache.get(this.getIdTokenCacheKey(e.clientId));
466
+ if (!t && e.scope && e.audience) {
467
+ const i = await this.get(e);
468
+ return !i || !i.id_token || !i.decodedToken ? void 0 : { id_token: i.id_token, decodedToken: i.decodedToken };
469
+ }
470
+ if (t) return { id_token: t.id_token, decodedToken: t.decodedToken };
471
+ }
472
+ async get(e, t = 0) {
473
+ var i;
474
+ let o = await this.cache.get(e.toKey());
475
+ if (!o) {
476
+ const d = await this.getCacheKeys();
477
+ if (!d) return;
478
+ const p = this.matchExistingCacheKey(e, d);
479
+ p && (o = await this.cache.get(p));
480
+ }
481
+ if (!o) return;
482
+ const n = await this.nowProvider(), u = Math.floor(n / 1e3);
483
+ return o.expiresAt - t < u ? o.body.refresh_token ? (o.body = { refresh_token: o.body.refresh_token }, await this.cache.set(e.toKey(), o), o.body) : (await this.cache.remove(e.toKey()), void await ((i = this.keyManifest) === null || i === void 0 ? void 0 : i.remove(e.toKey()))) : o.body;
484
+ }
485
+ async set(e) {
486
+ var t;
487
+ const i = new S({ clientId: e.client_id, scope: e.scope, audience: e.audience }), o = await this.wrapCacheEntry(e);
488
+ await this.cache.set(i.toKey(), o), await ((t = this.keyManifest) === null || t === void 0 ? void 0 : t.add(i.toKey()));
489
+ }
490
+ async clear(e) {
491
+ var t;
492
+ const i = await this.getCacheKeys();
493
+ i && (await i.filter((o) => !e || o.includes(e)).reduce(async (o, n) => {
494
+ await o, await this.cache.remove(n);
495
+ }, Promise.resolve()), await ((t = this.keyManifest) === null || t === void 0 ? void 0 : t.clear()));
496
+ }
497
+ async wrapCacheEntry(e) {
498
+ const t = await this.nowProvider();
499
+ return { body: e, expiresAt: Math.floor(t / 1e3) + e.expires_in };
500
+ }
501
+ async getCacheKeys() {
502
+ var e;
503
+ return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
504
+ }
505
+ getIdTokenCacheKey(e) {
506
+ return new S({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
507
+ }
508
+ matchExistingCacheKey(e, t) {
509
+ return t.filter((i) => {
510
+ var o;
511
+ const n = S.fromKey(i), u = new Set(n.scope && n.scope.split(" ")), d = ((o = e.scope) === null || o === void 0 ? void 0 : o.split(" ")) || [], p = n.scope && d.reduce((f, a) => f && u.has(a), !0);
512
+ return n.prefix === "@@auth0spajs@@" && n.clientId === e.clientId && n.audience === e.audience && p;
513
+ })[0];
514
+ }
515
+ }
516
+ class we {
517
+ constructor(e, t, i) {
518
+ this.storage = e, this.clientId = t, this.cookieDomain = i, this.storageKey = `a0.spajs.txs.${this.clientId}`;
519
+ }
520
+ create(e) {
521
+ this.storage.save(this.storageKey, e, { daysUntilExpire: 1, cookieDomain: this.cookieDomain });
522
+ }
523
+ get() {
524
+ return this.storage.get(this.storageKey);
525
+ }
526
+ remove() {
527
+ this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
528
+ }
529
+ }
530
+ const x = (r) => typeof r == "number", ye = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], ke = (r) => {
531
+ if (!r.id_token) throw new Error("ID token is required but missing");
532
+ const e = ((n) => {
533
+ const u = n.split("."), [d, p, f] = u;
534
+ if (u.length !== 3 || !d || !p || !f) throw new Error("ID token could not be decoded");
535
+ const a = JSON.parse(B(p)), s = { __raw: n }, c = {};
536
+ return Object.keys(a).forEach((l) => {
537
+ s[l] = a[l], ye.includes(l) || (c[l] = a[l]);
538
+ }), { encoded: { header: d, payload: p, signature: f }, header: JSON.parse(B(d)), claims: s, user: c };
539
+ })(r.id_token);
540
+ if (!e.claims.iss) throw new Error("Issuer (iss) claim must be a string present in the ID token");
541
+ if (e.claims.iss !== r.iss) throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${r.iss}", found "${e.claims.iss}"`);
542
+ if (!e.user.sub) throw new Error("Subject (sub) claim must be a string present in the ID token");
543
+ if (e.header.alg !== "RS256") throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);
544
+ if (!e.claims.aud || typeof e.claims.aud != "string" && !Array.isArray(e.claims.aud)) throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");
545
+ if (Array.isArray(e.claims.aud)) {
546
+ if (!e.claims.aud.includes(r.aud)) throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but was not one of "${e.claims.aud.join(", ")}"`);
547
+ if (e.claims.aud.length > 1) {
548
+ if (!e.claims.azp) throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");
549
+ if (e.claims.azp !== r.aud) throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${r.aud}", found "${e.claims.azp}"`);
550
+ }
551
+ } else if (e.claims.aud !== r.aud) throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but found "${e.claims.aud}"`);
552
+ if (r.nonce) {
553
+ if (!e.claims.nonce) throw new Error("Nonce (nonce) claim must be a string present in the ID token");
554
+ if (e.claims.nonce !== r.nonce) throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${r.nonce}", found "${e.claims.nonce}"`);
555
+ }
556
+ if (r.max_age && !x(e.claims.auth_time)) throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
557
+ if (e.claims.exp == null || !x(e.claims.exp)) throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
558
+ if (!x(e.claims.iat)) throw new Error("Issued At (iat) claim must be a number present in the ID token");
559
+ const t = r.leeway || 60, i = new Date(r.now || Date.now()), o = /* @__PURE__ */ new Date(0);
560
+ if (o.setUTCSeconds(e.claims.exp + t), i > o) throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${i}) is after expiration time (${o})`);
561
+ if (e.claims.nbf != null && x(e.claims.nbf)) {
562
+ const n = /* @__PURE__ */ new Date(0);
563
+ if (n.setUTCSeconds(e.claims.nbf - t), i < n) throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${i}) is before ${n}`);
564
+ }
565
+ if (e.claims.auth_time != null && x(e.claims.auth_time)) {
566
+ const n = /* @__PURE__ */ new Date(0);
567
+ if (n.setUTCSeconds(parseInt(e.claims.auth_time) + r.max_age + t), i > n) throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${i}) is after last auth at ${n}`);
568
+ }
569
+ if (r.organization) {
570
+ const n = r.organization.trim();
571
+ if (n.startsWith("org_")) {
572
+ const u = n;
573
+ if (!e.claims.org_id) throw new Error("Organization ID (org_id) claim must be a string present in the ID token");
574
+ if (u !== e.claims.org_id) throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${u}", found "${e.claims.org_id}"`);
575
+ } else {
576
+ const u = n.toLowerCase();
577
+ if (!e.claims.org_name) throw new Error("Organization Name (org_name) claim must be a string present in the ID token");
578
+ if (u !== e.claims.org_name) throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${u}", found "${e.claims.org_name}"`);
579
+ }
580
+ }
581
+ return e;
582
+ };
583
+ var z = F(function(r, e) {
584
+ var t = C && C.__assign || function() {
585
+ return t = Object.assign || function(p) {
586
+ for (var f, a = 1, s = arguments.length; a < s; a++) for (var c in f = arguments[a]) Object.prototype.hasOwnProperty.call(f, c) && (p[c] = f[c]);
587
+ return p;
588
+ }, t.apply(this, arguments);
589
+ };
590
+ function i(p, f) {
591
+ if (!f) return "";
592
+ var a = "; " + p;
593
+ return f === !0 ? a : a + "=" + f;
594
+ }
595
+ function o(p, f, a) {
596
+ return encodeURIComponent(p).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/\(/g, "%28").replace(/\)/g, "%29") + "=" + encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent) + function(s) {
597
+ if (typeof s.expires == "number") {
598
+ var c = /* @__PURE__ */ new Date();
599
+ c.setMilliseconds(c.getMilliseconds() + 864e5 * s.expires), s.expires = c;
600
+ }
601
+ return i("Expires", s.expires ? s.expires.toUTCString() : "") + i("Domain", s.domain) + i("Path", s.path) + i("Secure", s.secure) + i("SameSite", s.sameSite);
602
+ }(a);
603
+ }
604
+ function n(p) {
605
+ for (var f = {}, a = p ? p.split("; ") : [], s = /(%[\dA-F]{2})+/gi, c = 0; c < a.length; c++) {
606
+ var l = a[c].split("="), h = l.slice(1).join("=");
607
+ h.charAt(0) === '"' && (h = h.slice(1, -1));
608
+ try {
609
+ f[l[0].replace(s, decodeURIComponent)] = h.replace(s, decodeURIComponent);
610
+ } catch {
611
+ }
612
+ }
613
+ return f;
614
+ }
615
+ function u() {
616
+ return n(document.cookie);
617
+ }
618
+ function d(p, f, a) {
619
+ document.cookie = o(p, f, t({ path: "/" }, a));
620
+ }
621
+ e.__esModule = !0, e.encode = o, e.parse = n, e.getAll = u, e.get = function(p) {
622
+ return u()[p];
623
+ }, e.set = d, e.remove = function(p, f) {
624
+ d(p, "", t(t({}, f), { expires: -1 }));
625
+ };
626
+ });
627
+ J(z), z.encode, z.parse, z.getAll;
628
+ var ve = z.get, re = z.set, ae = z.remove;
629
+ const P = { get(r) {
630
+ const e = ve(r);
631
+ if (e !== void 0) return JSON.parse(e);
632
+ }, save(r, e, t) {
633
+ let i = {};
634
+ window.location.protocol === "https:" && (i = { secure: !0, sameSite: "none" }), t != null && t.daysUntilExpire && (i.expires = t.daysUntilExpire), t != null && t.cookieDomain && (i.domain = t.cookieDomain), re(r, JSON.stringify(e), i);
635
+ }, remove(r, e) {
636
+ let t = {};
637
+ e != null && e.cookieDomain && (t.domain = e.cookieDomain), ae(r, t);
638
+ } }, be = { get(r) {
639
+ return P.get(r) || P.get(`_legacy_${r}`);
640
+ }, save(r, e, t) {
641
+ let i = {};
642
+ window.location.protocol === "https:" && (i = { secure: !0 }), t != null && t.daysUntilExpire && (i.expires = t.daysUntilExpire), t != null && t.cookieDomain && (i.domain = t.cookieDomain), re(`_legacy_${r}`, JSON.stringify(e), i), P.save(r, e, t);
643
+ }, remove(r, e) {
644
+ let t = {};
645
+ e != null && e.cookieDomain && (t.domain = e.cookieDomain), ae(r, t), P.remove(r, e), P.remove(`_legacy_${r}`, e);
646
+ } }, _e = { get(r) {
647
+ if (typeof sessionStorage > "u") return;
648
+ const e = sessionStorage.getItem(r);
649
+ return e != null ? JSON.parse(e) : void 0;
650
+ }, save(r, e) {
651
+ sessionStorage.setItem(r, JSON.stringify(e));
652
+ }, remove(r) {
653
+ sessionStorage.removeItem(r);
654
+ } };
655
+ function Ie(r, e, t) {
656
+ var i = e === void 0 ? null : e, o = function(p, f) {
657
+ var a = atob(p);
658
+ if (f) {
659
+ for (var s = new Uint8Array(a.length), c = 0, l = a.length; c < l; ++c) s[c] = a.charCodeAt(c);
660
+ return String.fromCharCode.apply(null, new Uint16Array(s.buffer));
661
+ }
662
+ return a;
663
+ }(r, t !== void 0 && t), n = o.indexOf(`
664
+ `, 10) + 1, u = o.substring(n) + (i ? "//# sourceMappingURL=" + i : ""), d = new Blob([u], { type: "application/javascript" });
665
+ return URL.createObjectURL(d);
666
+ }
667
+ var $, q, Q, L, Se = ($ = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", q = null, Q = !1, function(r) {
668
+ return L = L || Ie($, q, Q), new Worker(L, r);
669
+ });
670
+ const D = {};
671
+ class Te {
672
+ constructor(e, t) {
673
+ this.cache = e, this.clientId = t, this.manifestKey = this.createManifestKeyFrom(this.clientId);
674
+ }
675
+ async add(e) {
676
+ var t;
677
+ const i = new Set(((t = await this.cache.get(this.manifestKey)) === null || t === void 0 ? void 0 : t.keys) || []);
678
+ i.add(e), await this.cache.set(this.manifestKey, { keys: [...i] });
679
+ }
680
+ async remove(e) {
681
+ const t = await this.cache.get(this.manifestKey);
682
+ if (t) {
683
+ const i = new Set(t.keys);
684
+ return i.delete(e), i.size > 0 ? await this.cache.set(this.manifestKey, { keys: [...i] }) : await this.cache.remove(this.manifestKey);
685
+ }
686
+ }
687
+ get() {
688
+ return this.cache.get(this.manifestKey);
689
+ }
690
+ clear() {
691
+ return this.cache.remove(this.manifestKey);
692
+ }
693
+ createManifestKeyFrom(e) {
694
+ return `@@auth0spajs@@::${e}`;
695
+ }
696
+ }
697
+ const Oe = { memory: () => new ne().enclosedCache, localstorage: () => new fe() }, ee = (r) => Oe[r], te = (r) => {
698
+ const { openUrl: e, onRedirect: t } = r, i = I(r, ["openUrl", "onRedirect"]);
699
+ return Object.assign(Object.assign({}, i), { openUrl: e === !1 || e ? e : t });
700
+ }, X = new ce();
701
+ class je {
702
+ constructor(e) {
703
+ let t, i;
704
+ if (this.userCache = new ne().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
705
+ await X.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
706
+ }, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
707
+ if (!W()) throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
708
+ if (W().subtle === void 0) throw new Error(`
709
+ auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
710
+ `);
711
+ })(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache) i = e.cache;
712
+ else {
713
+ if (t = e.cacheLocation || "memory", !ee(t)) throw new Error(`Invalid cache location "${t}"`);
714
+ i = ee(t)();
715
+ }
716
+ this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? P : be, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((u) => `auth0.${u}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
717
+ const o = e.useCookiesForTransactions ? this.cookieStorage : _e;
718
+ var n;
719
+ this.scope = K("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new we(o, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || oe, this.cacheManager = new ge(i, i.allKeys ? void 0 : new Te(i, this.options.clientId), this.nowProvider), this.domainUrl = (n = this.options.domain, /^https?:\/\//.test(n) ? n : `https://${n}`), this.tokenIssuer = ((u, d) => u ? u.startsWith("https://") ? u : `https://${u}/` : `${d}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && t === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new Se());
720
+ }
721
+ _url(e) {
722
+ const t = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || ie)));
723
+ return `${this.domainUrl}${e}&auth0Client=${t}`;
724
+ }
725
+ _authorizeUrl(e) {
726
+ return this._url(`/authorize?${N(e)}`);
727
+ }
728
+ async _verifyIdToken(e, t, i) {
729
+ const o = await this.nowProvider();
730
+ return ke({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: t, organization: i, leeway: this.options.leeway, max_age: (n = this.options.authorizationParams.max_age, typeof n != "string" ? n : parseInt(n, 10) || void 0), now: o });
731
+ var n;
732
+ }
733
+ _processOrgHint(e) {
734
+ e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
735
+ }
736
+ async _prepareAuthorizeUrl(e, t, i) {
737
+ const o = A(U()), n = A(U()), u = U(), d = ((a) => {
738
+ const s = new Uint8Array(a);
739
+ return ((c) => {
740
+ const l = { "+": "-", "/": "_", "=": "" };
741
+ return c.replace(/[+/=]/g, (h) => l[h]);
742
+ })(window.btoa(String.fromCharCode(...Array.from(s))));
743
+ })(await (async (a) => await W().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(a)))(u)), p = ((a, s, c, l, h, w, g, k) => Object.assign(Object.assign(Object.assign({ client_id: a.clientId }, a.authorizationParams), c), { scope: K(s, c.scope), response_type: "code", response_mode: k || "query", state: l, nonce: h, redirect_uri: g || a.authorizationParams.redirect_uri, code_challenge: w, code_challenge_method: "S256" }))(this.options, this.scope, e, o, n, d, e.redirect_uri || this.options.authorizationParams.redirect_uri || i, t == null ? void 0 : t.response_mode), f = this._authorizeUrl(p);
744
+ return { nonce: n, code_verifier: u, scope: p.scope, audience: p.audience || "default", redirect_uri: p.redirect_uri, state: o, url: f };
745
+ }
746
+ async loginWithPopup(e, t) {
747
+ var i;
748
+ if (e = e || {}, !(t = t || {}).popup && (t.popup = ((d) => {
749
+ const p = window.screenX + (window.innerWidth - 400) / 2, f = window.screenY + (window.innerHeight - 600) / 2;
750
+ return window.open(d, "auth0:authorize:popup", `left=${p},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`);
751
+ })(""), !t.popup)) throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");
752
+ const o = await this._prepareAuthorizeUrl(e.authorizationParams || {}, { response_mode: "web_message" }, window.location.origin);
753
+ t.popup.location.href = o.url;
754
+ const n = await ((d) => new Promise((p, f) => {
755
+ let a;
756
+ const s = setInterval(() => {
757
+ d.popup && d.popup.closed && (clearInterval(s), clearTimeout(c), window.removeEventListener("message", a, !1), f(new Y(d.popup)));
758
+ }, 1e3), c = setTimeout(() => {
759
+ clearInterval(s), f(new G(d.popup)), window.removeEventListener("message", a, !1);
760
+ }, 1e3 * (d.timeoutInSeconds || 60));
761
+ a = function(l) {
762
+ if (l.data && l.data.type === "authorization_response") {
763
+ if (clearTimeout(c), clearInterval(s), window.removeEventListener("message", a, !1), d.popup.close(), l.data.response.error) return f(b.fromPayload(l.data.response));
764
+ p(l.data.response);
765
+ }
766
+ }, window.addEventListener("message", a);
767
+ }))(Object.assign(Object.assign({}, t), { timeoutInSeconds: t.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
768
+ if (o.state !== n.state) throw new b("state_mismatch", "Invalid state");
769
+ const u = ((i = e.authorizationParams) === null || i === void 0 ? void 0 : i.organization) || this.options.authorizationParams.organization;
770
+ await this._requestToken({ audience: o.audience, scope: o.scope, code_verifier: o.code_verifier, grant_type: "authorization_code", code: n.code, redirect_uri: o.redirect_uri }, { nonceIn: o.nonce, organization: u });
771
+ }
772
+ async getUser() {
773
+ var e;
774
+ const t = await this._getIdTokenFromCache();
775
+ return (e = t == null ? void 0 : t.decodedToken) === null || e === void 0 ? void 0 : e.user;
776
+ }
777
+ async getIdTokenClaims() {
778
+ var e;
779
+ const t = await this._getIdTokenFromCache();
780
+ return (e = t == null ? void 0 : t.decodedToken) === null || e === void 0 ? void 0 : e.claims;
781
+ }
782
+ async loginWithRedirect(e = {}) {
783
+ var t;
784
+ const i = te(e), { openUrl: o, fragment: n, appState: u } = i, d = I(i, ["openUrl", "fragment", "appState"]), p = ((t = d.authorizationParams) === null || t === void 0 ? void 0 : t.organization) || this.options.authorizationParams.organization, f = await this._prepareAuthorizeUrl(d.authorizationParams || {}), { url: a } = f, s = I(f, ["url"]);
785
+ this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, s), { appState: u }), p && { organization: p }));
786
+ const c = n ? `${a}#${n}` : a;
787
+ o ? await o(c) : window.location.assign(c);
788
+ }
789
+ async handleRedirectCallback(e = window.location.href) {
790
+ const t = e.split("?").slice(1);
791
+ if (t.length === 0) throw new Error("There are no query params available for parsing.");
792
+ const { state: i, code: o, error: n, error_description: u } = ((s) => {
793
+ s.indexOf("#") > -1 && (s = s.substring(0, s.indexOf("#")));
794
+ const c = new URLSearchParams(s);
795
+ return { state: c.get("state"), code: c.get("code") || void 0, error: c.get("error") || void 0, error_description: c.get("error_description") || void 0 };
796
+ })(t.join("")), d = this.transactionManager.get();
797
+ if (!d) throw new b("missing_transaction", "Invalid state");
798
+ if (this.transactionManager.remove(), n) throw new H(n, u || n, i, d.appState);
799
+ if (!d.code_verifier || d.state && d.state !== i) throw new b("state_mismatch", "Invalid state");
800
+ const p = d.organization, f = d.nonce, a = d.redirect_uri;
801
+ return await this._requestToken(Object.assign({ audience: d.audience, scope: d.scope, code_verifier: d.code_verifier, grant_type: "authorization_code", code: o }, a ? { redirect_uri: a } : {}), { nonceIn: f, organization: p }), { appState: d.appState };
802
+ }
803
+ async checkSession(e) {
804
+ if (!this.cookieStorage.get(this.isAuthenticatedCookieName)) {
805
+ if (!this.cookieStorage.get("auth0.is.authenticated")) return;
806
+ this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove("auth0.is.authenticated");
807
+ }
808
+ try {
809
+ await this.getTokenSilently(e);
810
+ } catch {
811
+ }
812
+ }
813
+ async getTokenSilently(e = {}) {
814
+ var t;
815
+ const i = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: K(this.scope, (t = e.authorizationParams) === null || t === void 0 ? void 0 : t.scope) }) }), o = await ((n, u) => {
816
+ let d = D[u];
817
+ return d || (d = n().finally(() => {
818
+ delete D[u], d = null;
819
+ }), D[u] = d), d;
820
+ })(() => this._getTokenSilently(i), `${this.options.clientId}::${i.authorizationParams.audience}::${i.authorizationParams.scope}`);
821
+ return e.detailedResponse ? o : o == null ? void 0 : o.access_token;
822
+ }
823
+ async _getTokenSilently(e) {
824
+ const { cacheMode: t } = e, i = I(e, ["cacheMode"]);
825
+ if (t !== "off") {
826
+ const o = await this._getEntryFromCache({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId });
827
+ if (o) return o;
828
+ }
829
+ if (t !== "cache-only") {
830
+ if (!await (async (o, n = 3) => {
831
+ for (let u = 0; u < n; u++) if (await o()) return !0;
832
+ return !1;
833
+ })(() => X.acquireLock("auth0.lock.getTokenSilently", 5e3), 10)) throw new Z();
834
+ try {
835
+ if (window.addEventListener("pagehide", this._releaseLockOnPageHide), t !== "off") {
836
+ const f = await this._getEntryFromCache({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId });
837
+ if (f) return f;
838
+ }
839
+ const o = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(i) : await this._getTokenFromIFrame(i), { id_token: n, access_token: u, oauthTokenScope: d, expires_in: p } = o;
840
+ return Object.assign(Object.assign({ id_token: n, access_token: u }, d ? { scope: d } : null), { expires_in: p });
841
+ } finally {
842
+ await X.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
843
+ }
844
+ }
845
+ }
846
+ async getTokenWithPopup(e = {}, t = {}) {
847
+ var i;
848
+ const o = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: K(this.scope, (i = e.authorizationParams) === null || i === void 0 ? void 0 : i.scope) }) });
849
+ return t = Object.assign(Object.assign({}, ue), t), await this.loginWithPopup(o, t), (await this.cacheManager.get(new S({ scope: o.authorizationParams.scope, audience: o.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
850
+ }
851
+ async isAuthenticated() {
852
+ return !!await this.getUser();
853
+ }
854
+ _buildLogoutUrl(e) {
855
+ e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
856
+ const t = e.logoutParams || {}, { federated: i } = t, o = I(t, ["federated"]), n = i ? "&federated" : "";
857
+ return this._url(`/v2/logout?${N(Object.assign({ clientId: e.clientId }, o))}`) + n;
858
+ }
859
+ async logout(e = {}) {
860
+ const t = te(e), { openUrl: i } = t, o = I(t, ["openUrl"]);
861
+ e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
862
+ const n = this._buildLogoutUrl(o);
863
+ i ? await i(n) : i !== !1 && window.location.assign(n);
864
+ }
865
+ async _getTokenFromIFrame(e) {
866
+ const t = Object.assign(Object.assign({}, e.authorizationParams), { prompt: "none" }), i = this.cookieStorage.get(this.orgHintCookieName);
867
+ i && !t.organization && (t.organization = i);
868
+ const { url: o, state: n, nonce: u, code_verifier: d, redirect_uri: p, scope: f, audience: a } = await this._prepareAuthorizeUrl(t, { response_mode: "web_message" }, window.location.origin);
869
+ try {
870
+ if (window.crossOriginIsolated) throw new b("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
871
+ const s = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, c = await ((h, w, g = 60) => new Promise((k, v) => {
872
+ const y = window.document.createElement("iframe");
873
+ y.setAttribute("width", "0"), y.setAttribute("height", "0"), y.style.display = "none";
874
+ const m = () => {
875
+ window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message", _, !1));
876
+ };
877
+ let _;
878
+ const E = setTimeout(() => {
879
+ v(new Z()), m();
880
+ }, 1e3 * g);
881
+ _ = function(T) {
882
+ if (T.origin != w || !T.data || T.data.type !== "authorization_response") return;
883
+ const O = T.source;
884
+ O && O.close(), T.data.response.error ? v(b.fromPayload(T.data.response)) : k(T.data.response), clearTimeout(E), window.removeEventListener("message", _, !1), setTimeout(m, 2e3);
885
+ }, window.addEventListener("message", _, !1), window.document.body.appendChild(y), y.setAttribute("src", h);
886
+ }))(o, this.domainUrl, s);
887
+ if (n !== c.state) throw new b("state_mismatch", "Invalid state");
888
+ const l = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: d, code: c.code, grant_type: "authorization_code", redirect_uri: p, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: u, organization: t.organization });
889
+ return Object.assign(Object.assign({}, l), { scope: f, oauthTokenScope: l.scope, audience: a });
890
+ } catch (s) {
891
+ throw s.error === "login_required" && this.logout({ openUrl: !1 }), s;
892
+ }
893
+ }
894
+ async _getTokenUsingRefreshToken(e) {
895
+ const t = await this.cacheManager.get(new S({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
896
+ if (!(t && t.refresh_token || this.worker)) {
897
+ if (this.options.useRefreshTokensFallback) return await this._getTokenFromIFrame(e);
898
+ throw new R(e.authorizationParams.audience || "default", e.authorizationParams.scope);
899
+ }
900
+ const i = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, o = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
901
+ try {
902
+ const n = await this._requestToken(Object.assign(Object.assign(Object.assign({}, e.authorizationParams), { grant_type: "refresh_token", refresh_token: t && t.refresh_token, redirect_uri: i }), o && { timeout: o }));
903
+ return Object.assign(Object.assign({}, n), { scope: e.authorizationParams.scope, oauthTokenScope: n.scope, audience: e.authorizationParams.audience || "default" });
904
+ } catch (n) {
905
+ if ((n.message.indexOf("Missing Refresh Token") > -1 || n.message && n.message.indexOf("invalid refresh token") > -1) && this.options.useRefreshTokensFallback) return await this._getTokenFromIFrame(e);
906
+ throw n;
907
+ }
908
+ }
909
+ async _saveEntryInCache(e) {
910
+ const { id_token: t, decodedToken: i } = e, o = I(e, ["id_token", "decodedToken"]);
911
+ this.userCache.set("@@user@@", { id_token: t, decodedToken: i }), await this.cacheManager.setIdToken(this.options.clientId, e.id_token, e.decodedToken), await this.cacheManager.set(o);
912
+ }
913
+ async _getIdTokenFromCache() {
914
+ const e = this.options.authorizationParams.audience || "default", t = await this.cacheManager.getIdToken(new S({ clientId: this.options.clientId, audience: e, scope: this.scope })), i = this.userCache.get("@@user@@");
915
+ return t && t.id_token === (i == null ? void 0 : i.id_token) ? i : (this.userCache.set("@@user@@", t), t);
916
+ }
917
+ async _getEntryFromCache({ scope: e, audience: t, clientId: i }) {
918
+ const o = await this.cacheManager.get(new S({ scope: e, audience: t, clientId: i }), 60);
919
+ if (o && o.access_token) {
920
+ const { access_token: n, oauthTokenScope: u, expires_in: d } = o, p = await this._getIdTokenFromCache();
921
+ return p && Object.assign(Object.assign({ id_token: p.id_token, access_token: n }, u ? { scope: u } : null), { expires_in: d });
922
+ }
923
+ }
924
+ async _requestToken(e, t) {
925
+ const { nonceIn: i, organization: o } = t || {}, n = await me(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), u = await this._verifyIdToken(n.id_token, i, o);
926
+ return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, n), { decodedToken: u, scope: e.scope, audience: e.audience || "default" }), n.scope ? { oauthTokenScope: n.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(o || u.claims.org_id), Object.assign(Object.assign({}, n), { decodedToken: u });
927
+ }
928
+ }
929
+ class Ce {
930
+ }
931
+ async function ze(r) {
932
+ const e = new je(r);
933
+ return await e.checkSession(), e;
934
+ }
935
+ export {
936
+ je as Auth0Client,
937
+ H as AuthenticationError,
938
+ S as CacheKey,
939
+ b as GenericError,
940
+ ne as InMemoryCache,
941
+ fe as LocalStorageCache,
942
+ M as MfaRequiredError,
943
+ R as MissingRefreshTokenError,
944
+ Y as PopupCancelledError,
945
+ G as PopupTimeoutError,
946
+ Z as TimeoutError,
947
+ Ce as User,
948
+ ze as createAuth0Client
949
+ };
950
+ //# sourceMappingURL=auth0-spa-js.production.esm-1QXzndwB.js.map