@calcom/atoms 1.0.3

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 (134) hide show
  1. package/README.md +5 -0
  2. package/dist/AddressInput-Ci02wr5C.js +33 -0
  3. package/dist/AlbyPriceComponent-NqN1MEov.js +967 -0
  4. package/dist/Card-6fRR5Hwj.js +185 -0
  5. package/dist/DatePicker-9pbCidOU.js +27 -0
  6. package/dist/PhoneInput-ysQbrvjy.js +1405 -0
  7. package/dist/PoweredBy-AY0Afi6V.js +31 -0
  8. package/dist/UnpublishedEntity-epeaNFkK.js +23 -0
  9. package/dist/availability/AvailabilitySettings.d.ts +58 -0
  10. package/dist/availability/AvailabilitySettings.d.ts.map +1 -0
  11. package/dist/availability/index.d.ts +4 -0
  12. package/dist/availability/index.d.ts.map +1 -0
  13. package/dist/availability/types.d.ts +22 -0
  14. package/dist/availability/types.d.ts.map +1 -0
  15. package/dist/availability/wrappers/PlatformAvailabilitySettingsWrapper.d.ts +18 -0
  16. package/dist/availability/wrappers/PlatformAvailabilitySettingsWrapper.d.ts.map +1 -0
  17. package/dist/availability/wrappers/WebAvailabilitySettingsWrapper.d.ts +2 -0
  18. package/dist/availability/wrappers/WebAvailabilitySettingsWrapper.d.ts.map +1 -0
  19. package/dist/booker/Booker.stories.d.ts +7 -0
  20. package/dist/booker/Booker.stories.d.ts.map +1 -0
  21. package/dist/booker/BookerPlatformWrapper.d.ts +24 -0
  22. package/dist/booker/BookerPlatformWrapper.d.ts.map +1 -0
  23. package/dist/booker/BookerWebWrapper.d.ts +5 -0
  24. package/dist/booker/BookerWebWrapper.d.ts.map +1 -0
  25. package/dist/booker/export.d.ts +4 -0
  26. package/dist/booker/export.d.ts.map +1 -0
  27. package/dist/booker/index.d.ts +3 -0
  28. package/dist/booker/index.d.ts.map +1 -0
  29. package/dist/cal-atoms.js +9 -0
  30. package/dist/cal-atoms.umd.cjs +577 -0
  31. package/dist/cal-provider/BaseCalProvider.d.ts +4 -0
  32. package/dist/cal-provider/BaseCalProvider.d.ts.map +1 -0
  33. package/dist/cal-provider/CalProvider.d.ts +14 -0
  34. package/dist/cal-provider/CalProvider.d.ts.map +1 -0
  35. package/dist/cal-provider/index.d.ts +2 -0
  36. package/dist/cal-provider/index.d.ts.map +1 -0
  37. package/dist/framer-features-Zr_i_7k0.js +443 -0
  38. package/dist/gcal-connect/GcalConnect.d.ts +9 -0
  39. package/dist/gcal-connect/GcalConnect.d.ts.map +1 -0
  40. package/dist/gcal-connect/index.d.ts +2 -0
  41. package/dist/gcal-connect/index.d.ts.map +1 -0
  42. package/dist/globals.min.css +1 -0
  43. package/dist/hooks/useApiKeys.d.ts +10 -0
  44. package/dist/hooks/useApiKeys.d.ts.map +1 -0
  45. package/dist/hooks/useAtomsContext.d.ts +31 -0
  46. package/dist/hooks/useAtomsContext.d.ts.map +1 -0
  47. package/dist/hooks/useAvailableSlots.d.ts +6 -0
  48. package/dist/hooks/useAvailableSlots.d.ts.map +1 -0
  49. package/dist/hooks/useBookings.d.ts +3 -0
  50. package/dist/hooks/useBookings.d.ts.map +1 -0
  51. package/dist/hooks/useCalendarsBusyTimes.d.ts +10 -0
  52. package/dist/hooks/useCalendarsBusyTimes.d.ts.map +1 -0
  53. package/dist/hooks/useClientSchedule.d.ts +8 -0
  54. package/dist/hooks/useClientSchedule.d.ts.map +1 -0
  55. package/dist/hooks/useConnectedCalendars.d.ts +3 -0
  56. package/dist/hooks/useConnectedCalendars.d.ts.map +1 -0
  57. package/dist/hooks/useCreateBooking.d.ts +169 -0
  58. package/dist/hooks/useCreateBooking.d.ts.map +1 -0
  59. package/dist/hooks/useCreateInstantBooking.d.ts +169 -0
  60. package/dist/hooks/useCreateInstantBooking.d.ts.map +1 -0
  61. package/dist/hooks/useCreateRecurringBooking.d.ts +154 -0
  62. package/dist/hooks/useCreateRecurringBooking.d.ts.map +1 -0
  63. package/dist/hooks/useDeleteSchedule.d.ts +11 -0
  64. package/dist/hooks/useDeleteSchedule.d.ts.map +1 -0
  65. package/dist/hooks/useDeleteSelectedSlot.d.ts +8 -0
  66. package/dist/hooks/useDeleteSelectedSlot.d.ts.map +1 -0
  67. package/dist/hooks/useGcal.d.ts +9 -0
  68. package/dist/hooks/useGcal.d.ts.map +1 -0
  69. package/dist/hooks/useGetCityTimezones.d.ts +6 -0
  70. package/dist/hooks/useGetCityTimezones.d.ts.map +1 -0
  71. package/dist/hooks/useHandleBookEvent.d.ts +15 -0
  72. package/dist/hooks/useHandleBookEvent.d.ts.map +1 -0
  73. package/dist/hooks/useIsPlatform.d.ts +2 -0
  74. package/dist/hooks/useIsPlatform.d.ts.map +1 -0
  75. package/dist/hooks/useMe.d.ts +12 -0
  76. package/dist/hooks/useMe.d.ts.map +1 -0
  77. package/dist/hooks/useOAuthClient.d.ts +11 -0
  78. package/dist/hooks/useOAuthClient.d.ts.map +1 -0
  79. package/dist/hooks/useOAuthFlow.d.ts +12 -0
  80. package/dist/hooks/useOAuthFlow.d.ts.map +1 -0
  81. package/dist/hooks/usePublicEvent.d.ts +958 -0
  82. package/dist/hooks/usePublicEvent.d.ts.map +1 -0
  83. package/dist/hooks/useReserveSlot.d.ts +8 -0
  84. package/dist/hooks/useReserveSlot.d.ts.map +1 -0
  85. package/dist/hooks/useSlots.d.ts +11 -0
  86. package/dist/hooks/useSlots.d.ts.map +1 -0
  87. package/dist/hooks/useTimezone.d.ts +2 -0
  88. package/dist/hooks/useTimezone.d.ts.map +1 -0
  89. package/dist/hooks/useUpdateSchedule.d.ts +9 -0
  90. package/dist/hooks/useUpdateSchedule.d.ts.map +1 -0
  91. package/dist/hooks/useUpdateUserTimezone.d.ts +15 -0
  92. package/dist/hooks/useUpdateUserTimezone.d.ts.map +1 -0
  93. package/dist/index--Pb54wx_.js +4 -0
  94. package/dist/index-3sgDY24S.js +5 -0
  95. package/dist/index-GttMIx74.js +65366 -0
  96. package/dist/index-RcPlEXh-.js +220 -0
  97. package/dist/index-rUbdQ7Zu.js +1256 -0
  98. package/dist/index-uuiJumv6.js +76 -0
  99. package/dist/index.d.ts +7 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/isSupportedCountry-WVb-DZDd.js +487 -0
  102. package/dist/lib/getQueryParam.d.ts +3 -0
  103. package/dist/lib/getQueryParam.d.ts.map +1 -0
  104. package/dist/lib/http.d.ts +18 -0
  105. package/dist/lib/http.d.ts.map +1 -0
  106. package/dist/lib/setQueryParam.d.ts +3 -0
  107. package/dist/lib/setQueryParam.d.ts.map +1 -0
  108. package/dist/monorepo.d.ts +9 -0
  109. package/dist/monorepo.d.ts.map +1 -0
  110. package/dist/server.browser-yA5s9iMO.js +9859 -0
  111. package/dist/src/components/ui/button.d.ts +12 -0
  112. package/dist/src/components/ui/button.d.ts.map +1 -0
  113. package/dist/src/components/ui/confirmation-dialog-content.d.ts +4 -0
  114. package/dist/src/components/ui/confirmation-dialog-content.d.ts.map +1 -0
  115. package/dist/src/components/ui/dialog.d.ts +20 -0
  116. package/dist/src/components/ui/dialog.d.ts.map +1 -0
  117. package/dist/src/components/ui/shell.d.ts +3 -0
  118. package/dist/src/components/ui/shell.d.ts.map +1 -0
  119. package/dist/src/components/ui/toast.d.ts +16 -0
  120. package/dist/src/components/ui/toast.d.ts.map +1 -0
  121. package/dist/src/components/ui/toaster.d.ts +3 -0
  122. package/dist/src/components/ui/toaster.d.ts.map +1 -0
  123. package/dist/src/components/ui/use-toast.d.ts +45 -0
  124. package/dist/src/components/ui/use-toast.d.ts.map +1 -0
  125. package/dist/src/lib/utils.d.ts +3 -0
  126. package/dist/src/lib/utils.d.ts.map +1 -0
  127. package/dist/style.css +1 -0
  128. package/dist/timezone/index.d.ts +4 -0
  129. package/dist/timezone/index.d.ts.map +1 -0
  130. package/dist/types.d.ts +8 -0
  131. package/dist/types.d.ts.map +1 -0
  132. package/dist/vite.config.d.ts +3 -0
  133. package/dist/vite.config.d.ts.map +1 -0
  134. package/package.json +56 -0
@@ -0,0 +1,967 @@
1
+ import { aD as ee, aE as F, aF as re, ai as K, $ as ne, aj as te, aG as oe } from "./index-GttMIx74.js";
2
+ import J from "react";
3
+ var ie = { exports: {} }, D = { exports: {} };
4
+ const ae = {}, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
+ __proto__: null,
6
+ default: ae
7
+ }, Symbol.toStringTag, { value: "Module" })), ce = /* @__PURE__ */ ee(se);
8
+ var Q;
9
+ function Z() {
10
+ return Q || (Q = 1, function(o, v) {
11
+ (function(l, w) {
12
+ o.exports = w();
13
+ })(F, function() {
14
+ var l = l || function(w, m) {
15
+ var b;
16
+ if (typeof window < "u" && window.crypto && (b = window.crypto), typeof self < "u" && self.crypto && (b = self.crypto), typeof globalThis < "u" && globalThis.crypto && (b = globalThis.crypto), !b && typeof window < "u" && window.msCrypto && (b = window.msCrypto), !b && typeof F < "u" && F.crypto && (b = F.crypto), !b && typeof re == "function")
17
+ try {
18
+ b = ce;
19
+ } catch {
20
+ }
21
+ var N = function() {
22
+ if (b) {
23
+ if (typeof b.getRandomValues == "function")
24
+ try {
25
+ return b.getRandomValues(new Uint32Array(1))[0];
26
+ } catch {
27
+ }
28
+ if (typeof b.randomBytes == "function")
29
+ try {
30
+ return b.randomBytes(4).readInt32LE();
31
+ } catch {
32
+ }
33
+ }
34
+ throw new Error("Native crypto module could not be used to get secure random number.");
35
+ }, I = Object.create || /* @__PURE__ */ function() {
36
+ function t() {
37
+ }
38
+ return function(i) {
39
+ var f;
40
+ return t.prototype = i, f = new t(), t.prototype = null, f;
41
+ };
42
+ }(), j = {}, H = j.lib = {}, U = H.Base = /* @__PURE__ */ function() {
43
+ return {
44
+ /**
45
+ * Creates a new object that inherits from this object.
46
+ *
47
+ * @param {Object} overrides Properties to copy into the new object.
48
+ *
49
+ * @return {Object} The new object.
50
+ *
51
+ * @static
52
+ *
53
+ * @example
54
+ *
55
+ * var MyType = CryptoJS.lib.Base.extend({
56
+ * field: 'value',
57
+ *
58
+ * method: function () {
59
+ * }
60
+ * });
61
+ */
62
+ extend: function(t) {
63
+ var i = I(this);
64
+ return t && i.mixIn(t), (!i.hasOwnProperty("init") || this.init === i.init) && (i.init = function() {
65
+ i.$super.init.apply(this, arguments);
66
+ }), i.init.prototype = i, i.$super = this, i;
67
+ },
68
+ /**
69
+ * Extends this object and runs the init method.
70
+ * Arguments to create() will be passed to init().
71
+ *
72
+ * @return {Object} The new object.
73
+ *
74
+ * @static
75
+ *
76
+ * @example
77
+ *
78
+ * var instance = MyType.create();
79
+ */
80
+ create: function() {
81
+ var t = this.extend();
82
+ return t.init.apply(t, arguments), t;
83
+ },
84
+ /**
85
+ * Initializes a newly created object.
86
+ * Override this method to add some logic when your objects are created.
87
+ *
88
+ * @example
89
+ *
90
+ * var MyType = CryptoJS.lib.Base.extend({
91
+ * init: function () {
92
+ * // ...
93
+ * }
94
+ * });
95
+ */
96
+ init: function() {
97
+ },
98
+ /**
99
+ * Copies properties into this object.
100
+ *
101
+ * @param {Object} properties The properties to mix in.
102
+ *
103
+ * @example
104
+ *
105
+ * MyType.mixIn({
106
+ * field: 'value'
107
+ * });
108
+ */
109
+ mixIn: function(t) {
110
+ for (var i in t)
111
+ t.hasOwnProperty(i) && (this[i] = t[i]);
112
+ t.hasOwnProperty("toString") && (this.toString = t.toString);
113
+ },
114
+ /**
115
+ * Creates a copy of this object.
116
+ *
117
+ * @return {Object} The clone.
118
+ *
119
+ * @example
120
+ *
121
+ * var clone = instance.clone();
122
+ */
123
+ clone: function() {
124
+ return this.init.prototype.extend(this);
125
+ }
126
+ };
127
+ }(), B = H.WordArray = U.extend({
128
+ /**
129
+ * Initializes a newly created word array.
130
+ *
131
+ * @param {Array} words (Optional) An array of 32-bit words.
132
+ * @param {number} sigBytes (Optional) The number of significant bytes in the words.
133
+ *
134
+ * @example
135
+ *
136
+ * var wordArray = CryptoJS.lib.WordArray.create();
137
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
138
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
139
+ */
140
+ init: function(t, i) {
141
+ t = this.words = t || [], i != m ? this.sigBytes = i : this.sigBytes = t.length * 4;
142
+ },
143
+ /**
144
+ * Converts this word array to a string.
145
+ *
146
+ * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
147
+ *
148
+ * @return {string} The stringified word array.
149
+ *
150
+ * @example
151
+ *
152
+ * var string = wordArray + '';
153
+ * var string = wordArray.toString();
154
+ * var string = wordArray.toString(CryptoJS.enc.Utf8);
155
+ */
156
+ toString: function(t) {
157
+ return (t || $).stringify(this);
158
+ },
159
+ /**
160
+ * Concatenates a word array to this word array.
161
+ *
162
+ * @param {WordArray} wordArray The word array to append.
163
+ *
164
+ * @return {WordArray} This word array.
165
+ *
166
+ * @example
167
+ *
168
+ * wordArray1.concat(wordArray2);
169
+ */
170
+ concat: function(t) {
171
+ var i = this.words, f = t.words, d = this.sigBytes, E = t.sigBytes;
172
+ if (this.clamp(), d % 4)
173
+ for (var p = 0; p < E; p++) {
174
+ var _ = f[p >>> 2] >>> 24 - p % 4 * 8 & 255;
175
+ i[d + p >>> 2] |= _ << 24 - (d + p) % 4 * 8;
176
+ }
177
+ else
178
+ for (var A = 0; A < E; A += 4)
179
+ i[d + A >>> 2] = f[A >>> 2];
180
+ return this.sigBytes += E, this;
181
+ },
182
+ /**
183
+ * Removes insignificant bits.
184
+ *
185
+ * @example
186
+ *
187
+ * wordArray.clamp();
188
+ */
189
+ clamp: function() {
190
+ var t = this.words, i = this.sigBytes;
191
+ t[i >>> 2] &= 4294967295 << 32 - i % 4 * 8, t.length = w.ceil(i / 4);
192
+ },
193
+ /**
194
+ * Creates a copy of this word array.
195
+ *
196
+ * @return {WordArray} The clone.
197
+ *
198
+ * @example
199
+ *
200
+ * var clone = wordArray.clone();
201
+ */
202
+ clone: function() {
203
+ var t = U.clone.call(this);
204
+ return t.words = this.words.slice(0), t;
205
+ },
206
+ /**
207
+ * Creates a word array filled with random bytes.
208
+ *
209
+ * @param {number} nBytes The number of random bytes to generate.
210
+ *
211
+ * @return {WordArray} The random word array.
212
+ *
213
+ * @static
214
+ *
215
+ * @example
216
+ *
217
+ * var wordArray = CryptoJS.lib.WordArray.random(16);
218
+ */
219
+ random: function(t) {
220
+ for (var i = [], f = 0; f < t; f += 4)
221
+ i.push(N());
222
+ return new B.init(i, t);
223
+ }
224
+ }), S = j.enc = {}, $ = S.Hex = {
225
+ /**
226
+ * Converts a word array to a hex string.
227
+ *
228
+ * @param {WordArray} wordArray The word array.
229
+ *
230
+ * @return {string} The hex string.
231
+ *
232
+ * @static
233
+ *
234
+ * @example
235
+ *
236
+ * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
237
+ */
238
+ stringify: function(t) {
239
+ for (var i = t.words, f = t.sigBytes, d = [], E = 0; E < f; E++) {
240
+ var p = i[E >>> 2] >>> 24 - E % 4 * 8 & 255;
241
+ d.push((p >>> 4).toString(16)), d.push((p & 15).toString(16));
242
+ }
243
+ return d.join("");
244
+ },
245
+ /**
246
+ * Converts a hex string to a word array.
247
+ *
248
+ * @param {string} hexStr The hex string.
249
+ *
250
+ * @return {WordArray} The word array.
251
+ *
252
+ * @static
253
+ *
254
+ * @example
255
+ *
256
+ * var wordArray = CryptoJS.enc.Hex.parse(hexString);
257
+ */
258
+ parse: function(t) {
259
+ for (var i = t.length, f = [], d = 0; d < i; d += 2)
260
+ f[d >>> 3] |= parseInt(t.substr(d, 2), 16) << 24 - d % 8 * 4;
261
+ return new B.init(f, i / 2);
262
+ }
263
+ }, C = S.Latin1 = {
264
+ /**
265
+ * Converts a word array to a Latin1 string.
266
+ *
267
+ * @param {WordArray} wordArray The word array.
268
+ *
269
+ * @return {string} The Latin1 string.
270
+ *
271
+ * @static
272
+ *
273
+ * @example
274
+ *
275
+ * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
276
+ */
277
+ stringify: function(t) {
278
+ for (var i = t.words, f = t.sigBytes, d = [], E = 0; E < f; E++) {
279
+ var p = i[E >>> 2] >>> 24 - E % 4 * 8 & 255;
280
+ d.push(String.fromCharCode(p));
281
+ }
282
+ return d.join("");
283
+ },
284
+ /**
285
+ * Converts a Latin1 string to a word array.
286
+ *
287
+ * @param {string} latin1Str The Latin1 string.
288
+ *
289
+ * @return {WordArray} The word array.
290
+ *
291
+ * @static
292
+ *
293
+ * @example
294
+ *
295
+ * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
296
+ */
297
+ parse: function(t) {
298
+ for (var i = t.length, f = [], d = 0; d < i; d++)
299
+ f[d >>> 2] |= (t.charCodeAt(d) & 255) << 24 - d % 4 * 8;
300
+ return new B.init(f, i);
301
+ }
302
+ }, h = S.Utf8 = {
303
+ /**
304
+ * Converts a word array to a UTF-8 string.
305
+ *
306
+ * @param {WordArray} wordArray The word array.
307
+ *
308
+ * @return {string} The UTF-8 string.
309
+ *
310
+ * @static
311
+ *
312
+ * @example
313
+ *
314
+ * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
315
+ */
316
+ stringify: function(t) {
317
+ try {
318
+ return decodeURIComponent(escape(C.stringify(t)));
319
+ } catch {
320
+ throw new Error("Malformed UTF-8 data");
321
+ }
322
+ },
323
+ /**
324
+ * Converts a UTF-8 string to a word array.
325
+ *
326
+ * @param {string} utf8Str The UTF-8 string.
327
+ *
328
+ * @return {WordArray} The word array.
329
+ *
330
+ * @static
331
+ *
332
+ * @example
333
+ *
334
+ * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
335
+ */
336
+ parse: function(t) {
337
+ return C.parse(unescape(encodeURIComponent(t)));
338
+ }
339
+ }, g = H.BufferedBlockAlgorithm = U.extend({
340
+ /**
341
+ * Resets this block algorithm's data buffer to its initial state.
342
+ *
343
+ * @example
344
+ *
345
+ * bufferedBlockAlgorithm.reset();
346
+ */
347
+ reset: function() {
348
+ this._data = new B.init(), this._nDataBytes = 0;
349
+ },
350
+ /**
351
+ * Adds new data to this block algorithm's buffer.
352
+ *
353
+ * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
354
+ *
355
+ * @example
356
+ *
357
+ * bufferedBlockAlgorithm._append('data');
358
+ * bufferedBlockAlgorithm._append(wordArray);
359
+ */
360
+ _append: function(t) {
361
+ typeof t == "string" && (t = h.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes;
362
+ },
363
+ /**
364
+ * Processes available data blocks.
365
+ *
366
+ * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
367
+ *
368
+ * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
369
+ *
370
+ * @return {WordArray} The processed data.
371
+ *
372
+ * @example
373
+ *
374
+ * var processedData = bufferedBlockAlgorithm._process();
375
+ * var processedData = bufferedBlockAlgorithm._process(!!'flush');
376
+ */
377
+ _process: function(t) {
378
+ var i, f = this._data, d = f.words, E = f.sigBytes, p = this.blockSize, _ = p * 4, A = E / _;
379
+ t ? A = w.ceil(A) : A = w.max((A | 0) - this._minBufferSize, 0);
380
+ var O = A * p, e = w.min(O * 4, E);
381
+ if (O) {
382
+ for (var r = 0; r < O; r += p)
383
+ this._doProcessBlock(d, r);
384
+ i = d.splice(0, O), f.sigBytes -= e;
385
+ }
386
+ return new B.init(i, e);
387
+ },
388
+ /**
389
+ * Creates a copy of this object.
390
+ *
391
+ * @return {Object} The clone.
392
+ *
393
+ * @example
394
+ *
395
+ * var clone = bufferedBlockAlgorithm.clone();
396
+ */
397
+ clone: function() {
398
+ var t = U.clone.call(this);
399
+ return t._data = this._data.clone(), t;
400
+ },
401
+ _minBufferSize: 0
402
+ });
403
+ H.Hasher = g.extend({
404
+ /**
405
+ * Configuration options.
406
+ */
407
+ cfg: U.extend(),
408
+ /**
409
+ * Initializes a newly created hasher.
410
+ *
411
+ * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
412
+ *
413
+ * @example
414
+ *
415
+ * var hasher = CryptoJS.algo.SHA256.create();
416
+ */
417
+ init: function(t) {
418
+ this.cfg = this.cfg.extend(t), this.reset();
419
+ },
420
+ /**
421
+ * Resets this hasher to its initial state.
422
+ *
423
+ * @example
424
+ *
425
+ * hasher.reset();
426
+ */
427
+ reset: function() {
428
+ g.reset.call(this), this._doReset();
429
+ },
430
+ /**
431
+ * Updates this hasher with a message.
432
+ *
433
+ * @param {WordArray|string} messageUpdate The message to append.
434
+ *
435
+ * @return {Hasher} This hasher.
436
+ *
437
+ * @example
438
+ *
439
+ * hasher.update('message');
440
+ * hasher.update(wordArray);
441
+ */
442
+ update: function(t) {
443
+ return this._append(t), this._process(), this;
444
+ },
445
+ /**
446
+ * Finalizes the hash computation.
447
+ * Note that the finalize operation is effectively a destructive, read-once operation.
448
+ *
449
+ * @param {WordArray|string} messageUpdate (Optional) A final message update.
450
+ *
451
+ * @return {WordArray} The hash.
452
+ *
453
+ * @example
454
+ *
455
+ * var hash = hasher.finalize();
456
+ * var hash = hasher.finalize('message');
457
+ * var hash = hasher.finalize(wordArray);
458
+ */
459
+ finalize: function(t) {
460
+ t && this._append(t);
461
+ var i = this._doFinalize();
462
+ return i;
463
+ },
464
+ blockSize: 16,
465
+ /**
466
+ * Creates a shortcut function to a hasher's object interface.
467
+ *
468
+ * @param {Hasher} hasher The hasher to create a helper for.
469
+ *
470
+ * @return {Function} The shortcut function.
471
+ *
472
+ * @static
473
+ *
474
+ * @example
475
+ *
476
+ * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
477
+ */
478
+ _createHelper: function(t) {
479
+ return function(i, f) {
480
+ return new t.init(f).finalize(i);
481
+ };
482
+ },
483
+ /**
484
+ * Creates a shortcut function to the HMAC's object interface.
485
+ *
486
+ * @param {Hasher} hasher The hasher to use in this HMAC helper.
487
+ *
488
+ * @return {Function} The shortcut function.
489
+ *
490
+ * @static
491
+ *
492
+ * @example
493
+ *
494
+ * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
495
+ */
496
+ _createHmacHelper: function(t) {
497
+ return function(i, f) {
498
+ return new k.HMAC.init(t, f).finalize(i);
499
+ };
500
+ }
501
+ });
502
+ var k = j.algo = {};
503
+ return j;
504
+ }(Math);
505
+ return l;
506
+ });
507
+ }(D)), D.exports;
508
+ }
509
+ (function(o, v) {
510
+ (function(l, w) {
511
+ o.exports = w(Z());
512
+ })(F, function(l) {
513
+ return l.enc.Hex;
514
+ });
515
+ })(ie);
516
+ var fe = { exports: {} };
517
+ (function(o, v) {
518
+ (function(l, w) {
519
+ o.exports = w(Z());
520
+ })(F, function(l) {
521
+ return function(w) {
522
+ var m = l, b = m.lib, N = b.WordArray, I = b.Hasher, j = m.algo, H = [], U = [];
523
+ (function() {
524
+ function $(k) {
525
+ for (var t = w.sqrt(k), i = 2; i <= t; i++)
526
+ if (!(k % i))
527
+ return !1;
528
+ return !0;
529
+ }
530
+ function C(k) {
531
+ return (k - (k | 0)) * 4294967296 | 0;
532
+ }
533
+ for (var h = 2, g = 0; g < 64; )
534
+ $(h) && (g < 8 && (H[g] = C(w.pow(h, 1 / 2))), U[g] = C(w.pow(h, 1 / 3)), g++), h++;
535
+ })();
536
+ var B = [], S = j.SHA256 = I.extend({
537
+ _doReset: function() {
538
+ this._hash = new N.init(H.slice(0));
539
+ },
540
+ _doProcessBlock: function($, C) {
541
+ for (var h = this._hash.words, g = h[0], k = h[1], t = h[2], i = h[3], f = h[4], d = h[5], E = h[6], p = h[7], _ = 0; _ < 64; _++) {
542
+ if (_ < 16)
543
+ B[_] = $[C + _] | 0;
544
+ else {
545
+ var A = B[_ - 15], O = (A << 25 | A >>> 7) ^ (A << 14 | A >>> 18) ^ A >>> 3, e = B[_ - 2], r = (e << 15 | e >>> 17) ^ (e << 13 | e >>> 19) ^ e >>> 10;
546
+ B[_] = O + B[_ - 7] + r + B[_ - 16];
547
+ }
548
+ var n = f & d ^ ~f & E, c = g & k ^ g & t ^ k & t, a = (g << 30 | g >>> 2) ^ (g << 19 | g >>> 13) ^ (g << 10 | g >>> 22), s = (f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25), u = p + s + n + U[_] + B[_], T = a + c;
549
+ p = E, E = d, d = f, f = i + u | 0, i = t, t = k, k = g, g = u + T | 0;
550
+ }
551
+ h[0] = h[0] + g | 0, h[1] = h[1] + k | 0, h[2] = h[2] + t | 0, h[3] = h[3] + i | 0, h[4] = h[4] + f | 0, h[5] = h[5] + d | 0, h[6] = h[6] + E | 0, h[7] = h[7] + p | 0;
552
+ },
553
+ _doFinalize: function() {
554
+ var $ = this._data, C = $.words, h = this._nDataBytes * 8, g = $.sigBytes * 8;
555
+ return C[g >>> 5] |= 128 << 24 - g % 32, C[(g + 64 >>> 9 << 4) + 14] = w.floor(h / 4294967296), C[(g + 64 >>> 9 << 4) + 15] = h, $.sigBytes = C.length * 4, this._process(), this._hash;
556
+ },
557
+ clone: function() {
558
+ var $ = I.clone.call(this);
559
+ return $._hash = this._hash.clone(), $;
560
+ }
561
+ });
562
+ m.SHA256 = I._createHelper(S), m.HmacSHA256 = I._createHmacHelper(S);
563
+ }(Math), l.SHA256;
564
+ });
565
+ })(fe);
566
+ var ue = {};
567
+ (function(o) {
568
+ /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
569
+ Object.defineProperty(o, "__esModule", { value: !0 }), o.bytes = o.stringToBytes = o.str = o.bytesToString = o.hex = o.utf8 = o.bech32m = o.bech32 = o.base58check = o.base58xmr = o.base58xrp = o.base58flickr = o.base58 = o.base64url = o.base64 = o.base32crockford = o.base32hex = o.base32 = o.base16 = o.utils = o.assertNumber = void 0;
570
+ function v(e) {
571
+ if (!Number.isSafeInteger(e))
572
+ throw new Error(`Wrong integer: ${e}`);
573
+ }
574
+ o.assertNumber = v;
575
+ function l(...e) {
576
+ const r = (a, s) => (u) => a(s(u)), n = Array.from(e).reverse().reduce((a, s) => a ? r(a, s.encode) : s.encode, void 0), c = e.reduce((a, s) => a ? r(a, s.decode) : s.decode, void 0);
577
+ return { encode: n, decode: c };
578
+ }
579
+ function w(e) {
580
+ return {
581
+ encode: (r) => {
582
+ if (!Array.isArray(r) || r.length && typeof r[0] != "number")
583
+ throw new Error("alphabet.encode input should be an array of numbers");
584
+ return r.map((n) => {
585
+ if (v(n), n < 0 || n >= e.length)
586
+ throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);
587
+ return e[n];
588
+ });
589
+ },
590
+ decode: (r) => {
591
+ if (!Array.isArray(r) || r.length && typeof r[0] != "string")
592
+ throw new Error("alphabet.decode input should be array of strings");
593
+ return r.map((n) => {
594
+ if (typeof n != "string")
595
+ throw new Error(`alphabet.decode: not string element=${n}`);
596
+ const c = e.indexOf(n);
597
+ if (c === -1)
598
+ throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);
599
+ return c;
600
+ });
601
+ }
602
+ };
603
+ }
604
+ function m(e = "") {
605
+ if (typeof e != "string")
606
+ throw new Error("join separator should be string");
607
+ return {
608
+ encode: (r) => {
609
+ if (!Array.isArray(r) || r.length && typeof r[0] != "string")
610
+ throw new Error("join.encode input should be array of strings");
611
+ for (let n of r)
612
+ if (typeof n != "string")
613
+ throw new Error(`join.encode: non-string input=${n}`);
614
+ return r.join(e);
615
+ },
616
+ decode: (r) => {
617
+ if (typeof r != "string")
618
+ throw new Error("join.decode input should be string");
619
+ return r.split(e);
620
+ }
621
+ };
622
+ }
623
+ function b(e, r = "=") {
624
+ if (v(e), typeof r != "string")
625
+ throw new Error("padding chr should be string");
626
+ return {
627
+ encode(n) {
628
+ if (!Array.isArray(n) || n.length && typeof n[0] != "string")
629
+ throw new Error("padding.encode input should be array of strings");
630
+ for (let c of n)
631
+ if (typeof c != "string")
632
+ throw new Error(`padding.encode: non-string input=${c}`);
633
+ for (; n.length * e % 8; )
634
+ n.push(r);
635
+ return n;
636
+ },
637
+ decode(n) {
638
+ if (!Array.isArray(n) || n.length && typeof n[0] != "string")
639
+ throw new Error("padding.encode input should be array of strings");
640
+ for (let a of n)
641
+ if (typeof a != "string")
642
+ throw new Error(`padding.decode: non-string input=${a}`);
643
+ let c = n.length;
644
+ if (c * e % 8)
645
+ throw new Error("Invalid padding: string should have whole number of bytes");
646
+ for (; c > 0 && n[c - 1] === r; c--)
647
+ if (!((c - 1) * e % 8))
648
+ throw new Error("Invalid padding: string has too much padding");
649
+ return n.slice(0, c);
650
+ }
651
+ };
652
+ }
653
+ function N(e) {
654
+ if (typeof e != "function")
655
+ throw new Error("normalize fn should be function");
656
+ return { encode: (r) => r, decode: (r) => e(r) };
657
+ }
658
+ function I(e, r, n) {
659
+ if (r < 2)
660
+ throw new Error(`convertRadix: wrong from=${r}, base cannot be less than 2`);
661
+ if (n < 2)
662
+ throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);
663
+ if (!Array.isArray(e))
664
+ throw new Error("convertRadix: data should be array");
665
+ if (!e.length)
666
+ return [];
667
+ let c = 0;
668
+ const a = [], s = Array.from(e);
669
+ for (s.forEach((u) => {
670
+ if (v(u), u < 0 || u >= r)
671
+ throw new Error(`Wrong integer: ${u}`);
672
+ }); ; ) {
673
+ let u = 0, T = !0;
674
+ for (let x = c; x < s.length; x++) {
675
+ const P = s[x], y = r * u + P;
676
+ if (!Number.isSafeInteger(y) || r * u / r !== u || y - P !== r * u)
677
+ throw new Error("convertRadix: carry overflow");
678
+ if (u = y % n, s[x] = Math.floor(y / n), !Number.isSafeInteger(s[x]) || s[x] * n + u !== y)
679
+ throw new Error("convertRadix: carry overflow");
680
+ if (T)
681
+ s[x] ? T = !1 : c = x;
682
+ else
683
+ continue;
684
+ }
685
+ if (a.push(u), T)
686
+ break;
687
+ }
688
+ for (let u = 0; u < e.length - 1 && e[u] === 0; u++)
689
+ a.push(0);
690
+ return a.reverse();
691
+ }
692
+ const j = (e, r) => r ? j(r, e % r) : e, H = (e, r) => e + (r - j(e, r));
693
+ function U(e, r, n, c) {
694
+ if (!Array.isArray(e))
695
+ throw new Error("convertRadix2: data should be array");
696
+ if (r <= 0 || r > 32)
697
+ throw new Error(`convertRadix2: wrong from=${r}`);
698
+ if (n <= 0 || n > 32)
699
+ throw new Error(`convertRadix2: wrong to=${n}`);
700
+ if (H(r, n) > 32)
701
+ throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${H(r, n)}`);
702
+ let a = 0, s = 0;
703
+ const u = 2 ** n - 1, T = [];
704
+ for (const x of e) {
705
+ if (v(x), x >= 2 ** r)
706
+ throw new Error(`convertRadix2: invalid data word=${x} from=${r}`);
707
+ if (a = a << r | x, s + r > 32)
708
+ throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);
709
+ for (s += r; s >= n; s -= n)
710
+ T.push((a >> s - n & u) >>> 0);
711
+ a &= 2 ** s - 1;
712
+ }
713
+ if (a = a << n - s & u, !c && s >= r)
714
+ throw new Error("Excess padding");
715
+ if (!c && a)
716
+ throw new Error(`Non-zero padding: ${a}`);
717
+ return c && s > 0 && T.push(a >>> 0), T;
718
+ }
719
+ function B(e) {
720
+ return v(e), {
721
+ encode: (r) => {
722
+ if (!(r instanceof Uint8Array))
723
+ throw new Error("radix.encode input should be Uint8Array");
724
+ return I(Array.from(r), 2 ** 8, e);
725
+ },
726
+ decode: (r) => {
727
+ if (!Array.isArray(r) || r.length && typeof r[0] != "number")
728
+ throw new Error("radix.decode input should be array of strings");
729
+ return Uint8Array.from(I(r, e, 2 ** 8));
730
+ }
731
+ };
732
+ }
733
+ function S(e, r = !1) {
734
+ if (v(e), e <= 0 || e > 32)
735
+ throw new Error("radix2: bits should be in (0..32]");
736
+ if (H(8, e) > 32 || H(e, 8) > 32)
737
+ throw new Error("radix2: carry overflow");
738
+ return {
739
+ encode: (n) => {
740
+ if (!(n instanceof Uint8Array))
741
+ throw new Error("radix2.encode input should be Uint8Array");
742
+ return U(Array.from(n), 8, e, !r);
743
+ },
744
+ decode: (n) => {
745
+ if (!Array.isArray(n) || n.length && typeof n[0] != "number")
746
+ throw new Error("radix2.decode input should be array of strings");
747
+ return Uint8Array.from(U(n, e, 8, r));
748
+ }
749
+ };
750
+ }
751
+ function $(e) {
752
+ if (typeof e != "function")
753
+ throw new Error("unsafeWrapper fn should be function");
754
+ return function(...r) {
755
+ try {
756
+ return e.apply(null, r);
757
+ } catch {
758
+ }
759
+ };
760
+ }
761
+ function C(e, r) {
762
+ if (v(e), typeof r != "function")
763
+ throw new Error("checksum fn should be function");
764
+ return {
765
+ encode(n) {
766
+ if (!(n instanceof Uint8Array))
767
+ throw new Error("checksum.encode: input should be Uint8Array");
768
+ const c = r(n).slice(0, e), a = new Uint8Array(n.length + e);
769
+ return a.set(n), a.set(c, n.length), a;
770
+ },
771
+ decode(n) {
772
+ if (!(n instanceof Uint8Array))
773
+ throw new Error("checksum.decode: input should be Uint8Array");
774
+ const c = n.slice(0, -e), a = r(c).slice(0, e), s = n.slice(-e);
775
+ for (let u = 0; u < e; u++)
776
+ if (a[u] !== s[u])
777
+ throw new Error("Invalid checksum");
778
+ return c;
779
+ }
780
+ };
781
+ }
782
+ o.utils = { alphabet: w, chain: l, checksum: C, radix: B, radix2: S, join: m, padding: b }, o.base16 = l(S(4), w("0123456789ABCDEF"), m("")), o.base32 = l(S(5), w("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), b(5), m("")), o.base32hex = l(S(5), w("0123456789ABCDEFGHIJKLMNOPQRSTUV"), b(5), m("")), o.base32crockford = l(S(5), w("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), m(""), N((e) => e.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1"))), o.base64 = l(S(6), w("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), b(6), m("")), o.base64url = l(S(6), w("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), b(6), m(""));
783
+ const h = (e) => l(B(58), w(e), m(""));
784
+ o.base58 = h("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"), o.base58flickr = h("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"), o.base58xrp = h("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");
785
+ const g = [0, 2, 3, 5, 6, 7, 9, 10, 11];
786
+ o.base58xmr = {
787
+ encode(e) {
788
+ let r = "";
789
+ for (let n = 0; n < e.length; n += 8) {
790
+ const c = e.subarray(n, n + 8);
791
+ r += o.base58.encode(c).padStart(g[c.length], "1");
792
+ }
793
+ return r;
794
+ },
795
+ decode(e) {
796
+ let r = [];
797
+ for (let n = 0; n < e.length; n += 11) {
798
+ const c = e.slice(n, n + 11), a = g.indexOf(c.length), s = o.base58.decode(c);
799
+ for (let u = 0; u < s.length - a; u++)
800
+ if (s[u] !== 0)
801
+ throw new Error("base58xmr: wrong padding");
802
+ r = r.concat(Array.from(s.slice(s.length - a)));
803
+ }
804
+ return Uint8Array.from(r);
805
+ }
806
+ };
807
+ const k = (e) => l(C(4, (r) => e(e(r))), o.base58);
808
+ o.base58check = k;
809
+ const t = l(w("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), m("")), i = [996825010, 642813549, 513874426, 1027748829, 705979059];
810
+ function f(e) {
811
+ const r = e >> 25;
812
+ let n = (e & 33554431) << 5;
813
+ for (let c = 0; c < i.length; c++)
814
+ (r >> c & 1) === 1 && (n ^= i[c]);
815
+ return n;
816
+ }
817
+ function d(e, r, n = 1) {
818
+ const c = e.length;
819
+ let a = 1;
820
+ for (let s = 0; s < c; s++) {
821
+ const u = e.charCodeAt(s);
822
+ if (u < 33 || u > 126)
823
+ throw new Error(`Invalid prefix (${e})`);
824
+ a = f(a) ^ u >> 5;
825
+ }
826
+ a = f(a);
827
+ for (let s = 0; s < c; s++)
828
+ a = f(a) ^ e.charCodeAt(s) & 31;
829
+ for (let s of r)
830
+ a = f(a) ^ s;
831
+ for (let s = 0; s < 6; s++)
832
+ a = f(a);
833
+ return a ^= n, t.encode(U([a % 2 ** 30], 30, 5, !1));
834
+ }
835
+ function E(e) {
836
+ const r = e === "bech32" ? 1 : 734539939, n = S(5), c = n.decode, a = n.encode, s = $(c);
837
+ function u(y, R, L = 90) {
838
+ if (typeof y != "string")
839
+ throw new Error(`bech32.encode prefix should be string, not ${typeof y}`);
840
+ if (!Array.isArray(R) || R.length && typeof R[0] != "number")
841
+ throw new Error(`bech32.encode words should be array of numbers, not ${typeof R}`);
842
+ const W = y.length + 7 + R.length;
843
+ if (L !== !1 && W > L)
844
+ throw new TypeError(`Length ${W} exceeds limit ${L}`);
845
+ return y = y.toLowerCase(), `${y}1${t.encode(R)}${d(y, R, r)}`;
846
+ }
847
+ function T(y, R = 90) {
848
+ if (typeof y != "string")
849
+ throw new Error(`bech32.decode input should be string, not ${typeof y}`);
850
+ if (y.length < 8 || R !== !1 && y.length > R)
851
+ throw new TypeError(`Wrong string length: ${y.length} (${y}). Expected (8..${R})`);
852
+ const L = y.toLowerCase();
853
+ if (y !== L && y !== y.toUpperCase())
854
+ throw new Error("String must be lowercase or uppercase");
855
+ y = L;
856
+ const W = y.lastIndexOf("1");
857
+ if (W === 0 || W === -1)
858
+ throw new Error('Letter "1" must be present between prefix and data only');
859
+ const G = y.slice(0, W), z = y.slice(W + 1);
860
+ if (z.length < 6)
861
+ throw new Error("Data must be at least 6 characters long");
862
+ const q = t.decode(z).slice(0, -6), M = d(G, q, r);
863
+ if (!z.endsWith(M))
864
+ throw new Error(`Invalid checksum in ${y}: expected "${M}"`);
865
+ return { prefix: G, words: q };
866
+ }
867
+ const x = $(T);
868
+ function P(y) {
869
+ const { prefix: R, words: L } = T(y, !1);
870
+ return { prefix: R, words: L, bytes: c(L) };
871
+ }
872
+ return { encode: u, decode: T, decodeToBytes: P, decodeUnsafe: x, fromWords: c, fromWordsUnsafe: s, toWords: a };
873
+ }
874
+ o.bech32 = E("bech32"), o.bech32m = E("bech32m"), o.utf8 = {
875
+ encode: (e) => new TextDecoder().decode(e),
876
+ decode: (e) => new TextEncoder().encode(e)
877
+ }, o.hex = l(S(4), w("0123456789abcdef"), m(""), N((e) => {
878
+ if (typeof e != "string" || e.length % 2)
879
+ throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);
880
+ return e.toLowerCase();
881
+ }));
882
+ const p = {
883
+ utf8: o.utf8,
884
+ hex: o.hex,
885
+ base16: o.base16,
886
+ base32: o.base32,
887
+ base64: o.base64,
888
+ base64url: o.base64url,
889
+ base58: o.base58,
890
+ base58xmr: o.base58xmr
891
+ }, _ = `Invalid encoding type. Available types: ${Object.keys(p).join(", ")}`, A = (e, r) => {
892
+ if (typeof e != "string" || !p.hasOwnProperty(e))
893
+ throw new TypeError(_);
894
+ if (!(r instanceof Uint8Array))
895
+ throw new TypeError("bytesToString() expects Uint8Array");
896
+ return p[e].encode(r);
897
+ };
898
+ o.bytesToString = A, o.str = o.bytesToString;
899
+ const O = (e, r) => {
900
+ if (!p.hasOwnProperty(e))
901
+ throw new TypeError(_);
902
+ if (typeof r != "string")
903
+ throw new TypeError("stringToBytes() expects string");
904
+ return p[e].decode(r);
905
+ };
906
+ o.stringToBytes = O, o.bytes = o.stringToBytes;
907
+ })(ue);
908
+ BigInt(1e3), BigInt(1e6), BigInt(1e9), BigInt(1e12);
909
+ BigInt("2100000000000000000");
910
+ BigInt(1e11);
911
+ const X = {
912
+ payment_hash: 1,
913
+ payment_secret: 16,
914
+ description: 13,
915
+ payee: 19,
916
+ description_hash: 23,
917
+ // commit to longer descriptions (used by lnurl-pay)
918
+ expiry: 6,
919
+ // default: 3600 (1 hour)
920
+ min_final_cltv_expiry: 24,
921
+ // default: 9
922
+ fallback_address: 9,
923
+ route_hint: 3,
924
+ // for extra routing info (private etc.)
925
+ feature_bits: 5,
926
+ metadata: 27
927
+ };
928
+ for (let o = 0, v = Object.keys(X); o < v.length; o++)
929
+ v[o], X[v[o]].toString();
930
+ const V = async (o) => {
931
+ const v = "https://getalby.com/api/rates/" + o.toLowerCase() + ".json";
932
+ return (await (await fetch(v)).json()).rate_float / 1e8;
933
+ }, Y = async ({ satoshi: o, currency: v }) => {
934
+ const l = await V(v);
935
+ return Number(o) * l;
936
+ };
937
+ var he = { __proto__: null, getFiatBtcRate: V, getFiatValue: Y, getSatoshiValue: async ({ amount: o, currency: v }) => {
938
+ const l = await V(v);
939
+ return Math.floor(Number(o) / l);
940
+ }, getFormattedFiatValue: async ({ satoshi: o, currency: v, locale: l }) => (l || (l = "en"), (await Y({ satoshi: o, currency: v })).toLocaleString(l, { style: "currency", currency: v })) };
941
+ function ye({
942
+ displaySymbol: o,
943
+ price: v,
944
+ formattedPrice: l
945
+ }) {
946
+ const [w, m] = J.useState("loading...");
947
+ return J.useEffect(() => {
948
+ (async () => {
949
+ const b = await he.getFiatValue({
950
+ satoshi: v,
951
+ currency: "USD"
952
+ });
953
+ m(`$${b.toFixed(2)}`);
954
+ })();
955
+ }, [v]), /* @__PURE__ */ K(ne, {
956
+ content: w,
957
+ children: /* @__PURE__ */ te("div", {
958
+ className: "inline-flex items-center justify-center",
959
+ children: [o && /* @__PURE__ */ K(oe, {
960
+ className: "h-4 w-4"
961
+ }), l]
962
+ })
963
+ });
964
+ }
965
+ export {
966
+ ye as AlbyPriceComponent
967
+ };