l-min-components 1.8.474 → 1.8.476
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{formatDuration.-bee1154e.js → formatDuration.-ac7eeadf.js} +231 -203
- package/dist/chunks/{formatDuration.-bee1154e.js.map → formatDuration.-ac7eeadf.js.map} +1 -1
- package/dist/chunks/{useCustomNavigate-bf4735c1.js → useCustomNavigate-055330f4.js} +1162 -2304
- package/dist/chunks/useCustomNavigate-055330f4.js.map +1 -0
- package/dist/components.js +14 -14
- package/dist/hooks.js +5 -5
- package/dist/index.js +5 -5
- package/dist/utils.js +146 -146
- package/package.json +4 -4
- package/dist/chunks/axios-7e873420.js +0 -1801
- package/dist/chunks/axios-7e873420.js.map +0 -1
- package/dist/chunks/useCustomNavigate-bf4735c1.js.map +0 -1
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import T, { forwardRef as Te, useEffect as U, useReducer as Ee, useState as
|
|
2
|
-
if (typeof
|
|
3
|
-
var
|
|
1
|
+
import T, { forwardRef as Te, useEffect as U, useReducer as Ee, useState as ie, useRef as F, isValidElement as H, cloneElement as ce, useLayoutEffect as Ce } from "react";
|
|
2
|
+
if (typeof ae > "u")
|
|
3
|
+
var ae = window;
|
|
4
|
+
var ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof ae < "u" ? ae : typeof self < "u" ? self : {};
|
|
5
|
+
function Se(e) {
|
|
6
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7
|
+
}
|
|
8
|
+
function Ue(e) {
|
|
9
|
+
if (e.__esModule)
|
|
10
|
+
return e;
|
|
11
|
+
var t = e.default;
|
|
12
|
+
if (typeof t == "function") {
|
|
13
|
+
var s = function a() {
|
|
14
|
+
return this instanceof a ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
s.prototype = t.prototype;
|
|
17
|
+
} else
|
|
18
|
+
s = {};
|
|
19
|
+
return Object.defineProperty(s, "__esModule", { value: !0 }), Object.keys(e).forEach(function(a) {
|
|
20
|
+
var r = Object.getOwnPropertyDescriptor(e, a);
|
|
21
|
+
Object.defineProperty(s, a, r.get ? r : {
|
|
22
|
+
enumerable: !0,
|
|
23
|
+
get: function() {
|
|
24
|
+
return e[a];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}), s;
|
|
28
|
+
}
|
|
4
29
|
/*! js-cookie v3.0.5 | MIT */
|
|
5
30
|
function X(e) {
|
|
6
31
|
for (var t = 1; t < arguments.length; t++) {
|
|
7
|
-
var
|
|
8
|
-
for (var a in
|
|
9
|
-
e[a] =
|
|
32
|
+
var s = arguments[t];
|
|
33
|
+
for (var a in s)
|
|
34
|
+
e[a] = s[a];
|
|
10
35
|
}
|
|
11
36
|
return e;
|
|
12
37
|
}
|
|
@@ -21,48 +46,48 @@ var be = {
|
|
|
21
46
|
);
|
|
22
47
|
}
|
|
23
48
|
};
|
|
24
|
-
function
|
|
25
|
-
function r
|
|
49
|
+
function le(e, t) {
|
|
50
|
+
function s(r, o, n) {
|
|
26
51
|
if (!(typeof document > "u")) {
|
|
27
|
-
n = X({}, t, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()),
|
|
52
|
+
n = X({}, t, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
28
53
|
var i = "";
|
|
29
54
|
for (var g in n)
|
|
30
55
|
n[g] && (i += "; " + g, n[g] !== !0 && (i += "=" + n[g].split(";")[0]));
|
|
31
|
-
return document.cookie =
|
|
56
|
+
return document.cookie = r + "=" + e.write(o, r) + i;
|
|
32
57
|
}
|
|
33
58
|
}
|
|
34
|
-
function a(
|
|
35
|
-
if (!(typeof document > "u" || arguments.length && !
|
|
59
|
+
function a(r) {
|
|
60
|
+
if (!(typeof document > "u" || arguments.length && !r)) {
|
|
36
61
|
for (var o = document.cookie ? document.cookie.split("; ") : [], n = {}, i = 0; i < o.length; i++) {
|
|
37
62
|
var g = o[i].split("="), h = g.slice(1).join("=");
|
|
38
63
|
try {
|
|
39
64
|
var p = decodeURIComponent(g[0]);
|
|
40
|
-
if (n[p] = e.read(h, p),
|
|
65
|
+
if (n[p] = e.read(h, p), r === p)
|
|
41
66
|
break;
|
|
42
67
|
} catch {
|
|
43
68
|
}
|
|
44
69
|
}
|
|
45
|
-
return
|
|
70
|
+
return r ? n[r] : n;
|
|
46
71
|
}
|
|
47
72
|
}
|
|
48
73
|
return Object.create(
|
|
49
74
|
{
|
|
50
|
-
set:
|
|
75
|
+
set: s,
|
|
51
76
|
get: a,
|
|
52
|
-
remove: function(
|
|
53
|
-
|
|
54
|
-
|
|
77
|
+
remove: function(r, o) {
|
|
78
|
+
s(
|
|
79
|
+
r,
|
|
55
80
|
"",
|
|
56
81
|
X({}, o, {
|
|
57
82
|
expires: -1
|
|
58
83
|
})
|
|
59
84
|
);
|
|
60
85
|
},
|
|
61
|
-
withAttributes: function(
|
|
62
|
-
return
|
|
86
|
+
withAttributes: function(r) {
|
|
87
|
+
return le(this.converter, X({}, this.attributes, r));
|
|
63
88
|
},
|
|
64
|
-
withConverter: function(
|
|
65
|
-
return
|
|
89
|
+
withConverter: function(r) {
|
|
90
|
+
return le(X({}, this.converter, r), this.attributes);
|
|
66
91
|
}
|
|
67
92
|
},
|
|
68
93
|
{
|
|
@@ -71,67 +96,67 @@ function ce(e, t) {
|
|
|
71
96
|
}
|
|
72
97
|
);
|
|
73
98
|
}
|
|
74
|
-
var
|
|
75
|
-
const
|
|
76
|
-
var
|
|
77
|
-
const t = (
|
|
78
|
-
return `${(n = window == null ? void 0 : window.location) == null ? void 0 : n.protocol}//${t}${
|
|
79
|
-
},
|
|
80
|
-
function
|
|
81
|
-
var t,
|
|
99
|
+
var Fe = le(be, { path: "/" });
|
|
100
|
+
const we = (e) => {
|
|
101
|
+
var r, o, n;
|
|
102
|
+
const t = (r = window == null ? void 0 : window.location) == null ? void 0 : r.hostname, s = (o = window == null ? void 0 : window.location) != null && o.port ? `:${window.location.port}` : "";
|
|
103
|
+
return `${(n = window == null ? void 0 : window.location) == null ? void 0 : n.protocol}//${t}${s}${e}`;
|
|
104
|
+
}, je = we;
|
|
105
|
+
function me(e) {
|
|
106
|
+
var t, s, a = "";
|
|
82
107
|
if (typeof e == "string" || typeof e == "number")
|
|
83
108
|
a += e;
|
|
84
109
|
else if (typeof e == "object")
|
|
85
110
|
if (Array.isArray(e))
|
|
86
111
|
for (t = 0; t < e.length; t++)
|
|
87
|
-
e[t] && (
|
|
112
|
+
e[t] && (s = me(e[t])) && (a && (a += " "), a += s);
|
|
88
113
|
else
|
|
89
114
|
for (t in e)
|
|
90
115
|
e[t] && (a && (a += " "), a += t);
|
|
91
116
|
return a;
|
|
92
117
|
}
|
|
93
|
-
function
|
|
94
|
-
for (var e, t,
|
|
95
|
-
(e = arguments[
|
|
118
|
+
function k() {
|
|
119
|
+
for (var e, t, s = 0, a = ""; s < arguments.length; )
|
|
120
|
+
(e = arguments[s++]) && (t = me(e)) && (a && (a += " "), a += t);
|
|
96
121
|
return a;
|
|
97
122
|
}
|
|
98
|
-
const Q = (e) => typeof e == "number" && !isNaN(e),
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
const { scrollHeight: a, style:
|
|
123
|
+
const Q = (e) => typeof e == "number" && !isNaN(e), j = (e) => typeof e == "string", O = (e) => typeof e == "function", Z = (e) => j(e) || O(e) ? e : null, oe = (e) => H(e) || j(e) || O(e) || Q(e);
|
|
124
|
+
function Ie(e, t, s) {
|
|
125
|
+
s === void 0 && (s = 300);
|
|
126
|
+
const { scrollHeight: a, style: r } = e;
|
|
102
127
|
requestAnimationFrame(() => {
|
|
103
|
-
|
|
104
|
-
|
|
128
|
+
r.minHeight = "initial", r.height = a + "px", r.transition = `all ${s}ms`, requestAnimationFrame(() => {
|
|
129
|
+
r.height = "0", r.padding = "0", r.margin = "0", setTimeout(t, s);
|
|
105
130
|
});
|
|
106
131
|
});
|
|
107
132
|
}
|
|
108
133
|
function te(e) {
|
|
109
|
-
let { enter: t, exit:
|
|
134
|
+
let { enter: t, exit: s, appendPosition: a = !1, collapse: r = !0, collapseDuration: o = 300 } = e;
|
|
110
135
|
return function(n) {
|
|
111
136
|
let { children: i, position: g, preventExitTransition: h, done: p, nodeRef: m, isIn: b } = n;
|
|
112
|
-
const u = a ? `${t}--${g}` : t, c = a ? `${
|
|
137
|
+
const u = a ? `${t}--${g}` : t, c = a ? `${s}--${g}` : s, f = F(0);
|
|
113
138
|
return Ce(() => {
|
|
114
|
-
const l = m.current, d = u.split(" "), C = (
|
|
115
|
-
|
|
139
|
+
const l = m.current, d = u.split(" "), C = (I) => {
|
|
140
|
+
I.target === m.current && (l.dispatchEvent(new Event("d")), l.removeEventListener("animationend", C), l.removeEventListener("animationcancel", C), f.current === 0 && I.type !== "animationcancel" && l.classList.remove(...d));
|
|
116
141
|
};
|
|
117
142
|
l.classList.add(...d), l.addEventListener("animationend", C), l.addEventListener("animationcancel", C);
|
|
118
143
|
}, []), U(() => {
|
|
119
144
|
const l = m.current, d = () => {
|
|
120
|
-
l.removeEventListener("animationend", d),
|
|
145
|
+
l.removeEventListener("animationend", d), r ? Ie(l, p, o) : p();
|
|
121
146
|
};
|
|
122
147
|
b || (h ? d() : (f.current = 1, l.className += ` ${c}`, l.addEventListener("animationend", d)));
|
|
123
148
|
}, [b]), T.createElement(T.Fragment, null, i);
|
|
124
149
|
};
|
|
125
150
|
}
|
|
126
|
-
function
|
|
151
|
+
function fe(e, t) {
|
|
127
152
|
return e != null ? { content: e.content, containerId: e.props.containerId, id: e.props.toastId, theme: e.props.theme, type: e.props.type, data: e.props.data || {}, isLoading: e.props.isLoading, icon: e.props.icon, status: t } : {};
|
|
128
153
|
}
|
|
129
|
-
const
|
|
154
|
+
const _ = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e, t) {
|
|
130
155
|
return this.list.has(e) || this.list.set(e, []), this.list.get(e).push(t), this;
|
|
131
156
|
}, off(e, t) {
|
|
132
157
|
if (t) {
|
|
133
|
-
const
|
|
134
|
-
return this.list.set(e,
|
|
158
|
+
const s = this.list.get(e).filter((a) => a !== t);
|
|
159
|
+
return this.list.set(e, s), this;
|
|
135
160
|
}
|
|
136
161
|
return this.list.delete(e), this;
|
|
137
162
|
}, cancelEmit(e) {
|
|
@@ -139,14 +164,14 @@ const A = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(
|
|
|
139
164
|
return t && (t.forEach(clearTimeout), this.emitQueue.delete(e)), this;
|
|
140
165
|
}, emit(e) {
|
|
141
166
|
this.list.has(e) && this.list.get(e).forEach((t) => {
|
|
142
|
-
const
|
|
167
|
+
const s = setTimeout(() => {
|
|
143
168
|
t(...[].slice.call(arguments, 1));
|
|
144
169
|
}, 0);
|
|
145
|
-
this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(
|
|
170
|
+
this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(s);
|
|
146
171
|
});
|
|
147
172
|
} }, Y = (e) => {
|
|
148
|
-
let { theme: t, type:
|
|
149
|
-
return T.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${
|
|
173
|
+
let { theme: t, type: s, ...a } = e;
|
|
174
|
+
return T.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${s})`, ...a });
|
|
150
175
|
}, se = { info: function(e) {
|
|
151
176
|
return T.createElement(Y, { ...e }, T.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
|
|
152
177
|
}, warning: function(e) {
|
|
@@ -158,8 +183,8 @@ const A = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(
|
|
|
158
183
|
}, spinner: function() {
|
|
159
184
|
return T.createElement("div", { className: "Toastify__spinner" });
|
|
160
185
|
} };
|
|
161
|
-
function
|
|
162
|
-
const [, t] = Ee((u) => u + 1, 0), [
|
|
186
|
+
function Oe(e) {
|
|
187
|
+
const [, t] = Ee((u) => u + 1, 0), [s, a] = ie([]), r = F(null), o = F(/* @__PURE__ */ new Map()).current, n = (u) => s.indexOf(u) !== -1, i = F({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: n, getToast: (u) => o.get(u) }).current;
|
|
163
188
|
function g(u) {
|
|
164
189
|
let { containerId: c } = u;
|
|
165
190
|
const { limit: f } = i.props;
|
|
@@ -175,24 +200,24 @@ function Le(e) {
|
|
|
175
200
|
function m(u, c) {
|
|
176
201
|
let { delay: f, staleId: l, ...d } = c;
|
|
177
202
|
if (!oe(u) || function(x) {
|
|
178
|
-
return !
|
|
203
|
+
return !r.current || i.props.enableMultiContainer && x.containerId !== i.props.containerId || o.has(x.toastId) && x.updateId == null;
|
|
179
204
|
}(d))
|
|
180
205
|
return;
|
|
181
|
-
const { toastId: C, updateId:
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
let [
|
|
185
|
-
return
|
|
186
|
-
})), toastId: C, updateId:
|
|
187
|
-
const x =
|
|
188
|
-
o.delete(C),
|
|
189
|
-
const
|
|
190
|
-
if (i.count = C == null ? i.count - i.displayedToast : i.count - 1, i.count < 0 && (i.count = 0),
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
206
|
+
const { toastId: C, updateId: I, data: y } = d, { props: v } = i, N = () => h(C), $ = I == null;
|
|
207
|
+
$ && i.count++;
|
|
208
|
+
const w = { ...v, style: v.toastStyle, key: i.toastKey++, ...Object.fromEntries(Object.entries(d).filter((x) => {
|
|
209
|
+
let [A, L] = x;
|
|
210
|
+
return L != null;
|
|
211
|
+
})), toastId: C, updateId: I, data: y, closeToast: N, isIn: !1, className: Z(d.className || v.toastClassName), bodyClassName: Z(d.bodyClassName || v.bodyClassName), progressClassName: Z(d.progressClassName || v.progressClassName), autoClose: !d.isLoading && (B = d.autoClose, q = v.autoClose, B === !1 || Q(B) && B > 0 ? B : q), deleteToast() {
|
|
212
|
+
const x = fe(o.get(C), "removed");
|
|
213
|
+
o.delete(C), _.emit(4, x);
|
|
214
|
+
const A = i.queue.length;
|
|
215
|
+
if (i.count = C == null ? i.count - i.displayedToast : i.count - 1, i.count < 0 && (i.count = 0), A > 0) {
|
|
216
|
+
const L = C == null ? i.props.limit : 1;
|
|
217
|
+
if (A === 1 || L === 1)
|
|
193
218
|
i.displayedToast++, p();
|
|
194
219
|
else {
|
|
195
|
-
const P =
|
|
220
|
+
const P = L > A ? A : L;
|
|
196
221
|
i.displayedToast = P;
|
|
197
222
|
for (let R = 0; R < P; R++)
|
|
198
223
|
p();
|
|
@@ -200,244 +225,244 @@ function Le(e) {
|
|
|
200
225
|
} else
|
|
201
226
|
t();
|
|
202
227
|
} };
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
let { theme:
|
|
206
|
-
const z = { theme:
|
|
207
|
-
return R === !1 || (
|
|
208
|
-
}(
|
|
228
|
+
var B, q;
|
|
229
|
+
w.iconOut = function(x) {
|
|
230
|
+
let { theme: A, type: L, isLoading: P, icon: R } = x, M = null;
|
|
231
|
+
const z = { theme: A, type: L };
|
|
232
|
+
return R === !1 || (O(R) ? M = R(z) : H(R) ? M = ce(R, z) : j(R) || Q(R) ? M = R : P ? M = se.spinner() : ((G) => G in se)(L) && (M = se[L](z))), M;
|
|
233
|
+
}(w), O(d.onOpen) && (w.onOpen = d.onOpen), O(d.onClose) && (w.onClose = d.onClose), w.closeButton = v.closeButton, d.closeButton === !1 || oe(d.closeButton) ? w.closeButton = d.closeButton : d.closeButton === !0 && (w.closeButton = !oe(v.closeButton) || v.closeButton);
|
|
209
234
|
let D = u;
|
|
210
|
-
|
|
211
|
-
b(D,
|
|
212
|
-
}, f) : b(D,
|
|
235
|
+
H(u) && !j(u.type) ? D = ce(u, { closeToast: N, toastProps: w, data: y }) : O(u) && (D = u({ closeToast: N, toastProps: w, data: y })), v.limit && v.limit > 0 && i.count > v.limit && $ ? i.queue.push({ toastContent: D, toastProps: w, staleId: l }) : Q(f) ? setTimeout(() => {
|
|
236
|
+
b(D, w, l);
|
|
237
|
+
}, f) : b(D, w, l);
|
|
213
238
|
}
|
|
214
239
|
function b(u, c, f) {
|
|
215
240
|
const { toastId: l } = c;
|
|
216
241
|
f && o.delete(f);
|
|
217
242
|
const d = { content: u, props: c };
|
|
218
|
-
o.set(l, d), a((C) => [...C, l].filter((
|
|
243
|
+
o.set(l, d), a((C) => [...C, l].filter((I) => I !== f)), _.emit(4, fe(d, d.props.updateId == null ? "added" : "updated"));
|
|
219
244
|
}
|
|
220
|
-
return U(() => (i.containerId = e.containerId,
|
|
221
|
-
o.clear(),
|
|
245
|
+
return U(() => (i.containerId = e.containerId, _.cancelEmit(3).on(0, m).on(1, (u) => r.current && h(u)).on(5, g).emit(2, i), () => {
|
|
246
|
+
o.clear(), _.emit(3, i);
|
|
222
247
|
}), []), U(() => {
|
|
223
|
-
i.props = e, i.isToastActive = n, i.displayedToast =
|
|
248
|
+
i.props = e, i.isToastActive = n, i.displayedToast = s.length;
|
|
224
249
|
}), { getToastToRender: function(u) {
|
|
225
250
|
const c = /* @__PURE__ */ new Map(), f = Array.from(o.values());
|
|
226
251
|
return e.newestOnTop && f.reverse(), f.forEach((l) => {
|
|
227
252
|
const { position: d } = l.props;
|
|
228
253
|
c.has(d) || c.set(d, []), c.get(d).push(l);
|
|
229
254
|
}), Array.from(c, (l) => u(l[0], l[1]));
|
|
230
|
-
}, containerRef:
|
|
255
|
+
}, containerRef: r, isToastActive: n };
|
|
231
256
|
}
|
|
232
|
-
function
|
|
257
|
+
function pe(e) {
|
|
233
258
|
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
|
|
234
259
|
}
|
|
235
|
-
function
|
|
260
|
+
function ge(e) {
|
|
236
261
|
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
|
|
237
262
|
}
|
|
238
|
-
function
|
|
239
|
-
const [t,
|
|
240
|
-
function u(
|
|
263
|
+
function Le(e) {
|
|
264
|
+
const [t, s] = ie(!1), [a, r] = ie(!1), o = F(null), n = F({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, i = F(e), { autoClose: g, pauseOnHover: h, closeToast: p, onClick: m, closeOnClick: b } = e;
|
|
265
|
+
function u(y) {
|
|
241
266
|
if (e.draggable) {
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
n.canCloseOnClick = !0, n.canDrag = !0, n.boundingRect =
|
|
267
|
+
y.nativeEvent.type === "touchstart" && y.nativeEvent.preventDefault(), n.didMove = !1, document.addEventListener("mousemove", d), document.addEventListener("mouseup", C), document.addEventListener("touchmove", d), document.addEventListener("touchend", C);
|
|
268
|
+
const v = o.current;
|
|
269
|
+
n.canCloseOnClick = !0, n.canDrag = !0, n.boundingRect = v.getBoundingClientRect(), v.style.transition = "", n.x = pe(y.nativeEvent), n.y = ge(y.nativeEvent), e.draggableDirection === "x" ? (n.start = n.x, n.removalDistance = v.offsetWidth * (e.draggablePercent / 100)) : (n.start = n.y, n.removalDistance = v.offsetHeight * (e.draggablePercent === 80 ? 1.5 * e.draggablePercent : e.draggablePercent / 100));
|
|
245
270
|
}
|
|
246
271
|
}
|
|
247
|
-
function c(
|
|
272
|
+
function c(y) {
|
|
248
273
|
if (n.boundingRect) {
|
|
249
|
-
const { top:
|
|
250
|
-
|
|
274
|
+
const { top: v, bottom: N, left: $, right: w } = n.boundingRect;
|
|
275
|
+
y.nativeEvent.type !== "touchend" && e.pauseOnHover && n.x >= $ && n.x <= w && n.y >= v && n.y <= N ? l() : f();
|
|
251
276
|
}
|
|
252
277
|
}
|
|
253
278
|
function f() {
|
|
254
|
-
|
|
279
|
+
s(!0);
|
|
255
280
|
}
|
|
256
281
|
function l() {
|
|
257
|
-
|
|
282
|
+
s(!1);
|
|
258
283
|
}
|
|
259
|
-
function d(
|
|
260
|
-
const
|
|
261
|
-
n.canDrag &&
|
|
284
|
+
function d(y) {
|
|
285
|
+
const v = o.current;
|
|
286
|
+
n.canDrag && v && (n.didMove = !0, t && l(), n.x = pe(y), n.y = ge(y), n.delta = e.draggableDirection === "x" ? n.x - n.start : n.y - n.start, n.start !== n.x && (n.canCloseOnClick = !1), v.style.transform = `translate${e.draggableDirection}(${n.delta}px)`, v.style.opacity = "" + (1 - Math.abs(n.delta / n.removalDistance)));
|
|
262
287
|
}
|
|
263
288
|
function C() {
|
|
264
289
|
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", C), document.removeEventListener("touchmove", d), document.removeEventListener("touchend", C);
|
|
265
|
-
const
|
|
266
|
-
if (n.canDrag && n.didMove &&
|
|
290
|
+
const y = o.current;
|
|
291
|
+
if (n.canDrag && n.didMove && y) {
|
|
267
292
|
if (n.canDrag = !1, Math.abs(n.delta) > n.removalDistance)
|
|
268
|
-
return
|
|
269
|
-
|
|
293
|
+
return r(!0), void e.closeToast();
|
|
294
|
+
y.style.transition = "transform 0.2s, opacity 0.2s", y.style.transform = `translate${e.draggableDirection}(0)`, y.style.opacity = "1";
|
|
270
295
|
}
|
|
271
296
|
}
|
|
272
297
|
U(() => {
|
|
273
298
|
i.current = e;
|
|
274
|
-
}), U(() => (o.current && o.current.addEventListener("d", f, { once: !0 }),
|
|
275
|
-
const
|
|
276
|
-
|
|
299
|
+
}), U(() => (o.current && o.current.addEventListener("d", f, { once: !0 }), O(e.onOpen) && e.onOpen(H(e.children) && e.children.props), () => {
|
|
300
|
+
const y = i.current;
|
|
301
|
+
O(y.onClose) && y.onClose(H(y.children) && y.children.props);
|
|
277
302
|
}), []), U(() => (e.pauseOnFocusLoss && (document.hasFocus() || l(), window.addEventListener("focus", f), window.addEventListener("blur", l)), () => {
|
|
278
303
|
e.pauseOnFocusLoss && (window.removeEventListener("focus", f), window.removeEventListener("blur", l));
|
|
279
304
|
}), [e.pauseOnFocusLoss]);
|
|
280
|
-
const
|
|
281
|
-
return g && h && (
|
|
282
|
-
m && m(
|
|
283
|
-
}), { playToast: f, pauseToast: l, isRunning: t, preventExitTransition: a, toastRef: o, eventHandlers:
|
|
305
|
+
const I = { onMouseDown: u, onTouchStart: u, onMouseUp: c, onTouchEnd: c };
|
|
306
|
+
return g && h && (I.onMouseEnter = l, I.onMouseLeave = f), b && (I.onClick = (y) => {
|
|
307
|
+
m && m(y), n.canCloseOnClick && p();
|
|
308
|
+
}), { playToast: f, pauseToast: l, isRunning: t, preventExitTransition: a, toastRef: o, eventHandlers: I };
|
|
284
309
|
}
|
|
285
|
-
function
|
|
286
|
-
let { closeToast: t, theme:
|
|
287
|
-
return T.createElement("button", { className: `Toastify__close-button Toastify__close-button--${
|
|
288
|
-
|
|
310
|
+
function ye(e) {
|
|
311
|
+
let { closeToast: t, theme: s, ariaLabel: a = "close" } = e;
|
|
312
|
+
return T.createElement("button", { className: `Toastify__close-button Toastify__close-button--${s}`, type: "button", onClick: (r) => {
|
|
313
|
+
r.stopPropagation(), t(r);
|
|
289
314
|
}, "aria-label": a }, T.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, T.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
|
|
290
315
|
}
|
|
291
316
|
function Re(e) {
|
|
292
|
-
let { delay: t, isRunning:
|
|
293
|
-
const u = o || g && h === 0, c = { ...i, animationDuration: `${t}ms`, animationPlayState:
|
|
317
|
+
let { delay: t, isRunning: s, closeToast: a, type: r = "default", hide: o, className: n, style: i, controlledProgress: g, progress: h, rtl: p, isIn: m, theme: b } = e;
|
|
318
|
+
const u = o || g && h === 0, c = { ...i, animationDuration: `${t}ms`, animationPlayState: s ? "running" : "paused", opacity: u ? 0 : 1 };
|
|
294
319
|
g && (c.transform = `scaleX(${h})`);
|
|
295
|
-
const f =
|
|
320
|
+
const f = k("Toastify__progress-bar", g ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${b}`, `Toastify__progress-bar--${r}`, { "Toastify__progress-bar--rtl": p }), l = O(n) ? n({ rtl: p, type: r, defaultClassName: f }) : k(f, n);
|
|
296
321
|
return T.createElement("div", { role: "progressbar", "aria-hidden": u ? "true" : "false", "aria-label": "notification timer", className: l, style: c, [g && h >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: g && h < 1 ? null : () => {
|
|
297
322
|
m && a();
|
|
298
323
|
} });
|
|
299
324
|
}
|
|
300
325
|
const xe = (e) => {
|
|
301
|
-
const { isRunning: t, preventExitTransition:
|
|
326
|
+
const { isRunning: t, preventExitTransition: s, toastRef: a, eventHandlers: r } = Le(e), { closeButton: o, children: n, autoClose: i, onClick: g, type: h, hideProgressBar: p, closeToast: m, transition: b, position: u, className: c, style: f, bodyClassName: l, bodyStyle: d, progressClassName: C, progressStyle: I, updateId: y, role: v, progress: N, rtl: $, toastId: w, deleteToast: B, isIn: q, isLoading: D, iconOut: x, closeOnClick: A, theme: L } = e, P = k("Toastify__toast", `Toastify__toast-theme--${L}`, `Toastify__toast--${h}`, { "Toastify__toast--rtl": $ }, { "Toastify__toast--close-on-click": A }), R = O(c) ? c({ rtl: $, position: u, type: h, defaultClassName: P }) : k(P, c), M = !!N || !i, z = { closeToast: m, type: h, theme: L };
|
|
302
327
|
let G = null;
|
|
303
|
-
return o === !1 || (G =
|
|
328
|
+
return o === !1 || (G = O(o) ? o(z) : H(o) ? ce(o, z) : ye(z)), T.createElement(b, { isIn: q, done: B, position: u, preventExitTransition: s, nodeRef: a }, T.createElement("div", { id: w, onClick: g, className: R, ...r, style: f, ref: a }, T.createElement("div", { ...q && { role: v }, className: O(l) ? l({ type: h }) : k("Toastify__toast-body", l), style: d }, x != null && T.createElement("div", { className: k("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !D }) }, x), T.createElement("div", null, n)), G, T.createElement(Re, { ...y && !M ? { key: `pb-${y}` } : {}, rtl: $, theme: L, delay: i, isRunning: t, isIn: q, closeToast: m, hide: p, type: h, style: I, className: C, controlledProgress: M, progress: N || 0 })));
|
|
304
329
|
}, ne = function(e, t) {
|
|
305
330
|
return t === void 0 && (t = !1), { enter: `Toastify--animate Toastify__${e}-enter`, exit: `Toastify--animate Toastify__${e}-exit`, appendPosition: t };
|
|
306
|
-
},
|
|
331
|
+
}, _e = te(ne("bounce", !0));
|
|
307
332
|
te(ne("slide", !0));
|
|
308
333
|
te(ne("zoom"));
|
|
309
334
|
te(ne("flip"));
|
|
310
|
-
const
|
|
311
|
-
const { getToastToRender:
|
|
335
|
+
const he = Te((e, t) => {
|
|
336
|
+
const { getToastToRender: s, containerRef: a, isToastActive: r } = Oe(e), { className: o, style: n, rtl: i, containerId: g } = e;
|
|
312
337
|
function h(p) {
|
|
313
|
-
const m =
|
|
314
|
-
return
|
|
338
|
+
const m = k("Toastify__toast-container", `Toastify__toast-container--${p}`, { "Toastify__toast-container--rtl": i });
|
|
339
|
+
return O(o) ? o({ position: p, rtl: i, defaultClassName: m }) : k(m, Z(o));
|
|
315
340
|
}
|
|
316
341
|
return U(() => {
|
|
317
342
|
t && (t.current = a.current);
|
|
318
|
-
}, []), T.createElement("div", { ref: a, className: "Toastify", id: g },
|
|
343
|
+
}, []), T.createElement("div", { ref: a, className: "Toastify", id: g }, s((p, m) => {
|
|
319
344
|
const b = m.length ? { ...n } : { ...n, pointerEvents: "none" };
|
|
320
345
|
return T.createElement("div", { className: h(p), style: b, key: `container-${p}` }, m.map((u, c) => {
|
|
321
346
|
let { content: f, props: l } = u;
|
|
322
|
-
return T.createElement(xe, { ...l, isIn:
|
|
347
|
+
return T.createElement(xe, { ...l, isIn: r(l.toastId), style: { ...l.style, "--nth": c + 1, "--len": m.length }, key: `toast-${l.key}` }, f);
|
|
323
348
|
}));
|
|
324
349
|
}));
|
|
325
350
|
});
|
|
326
|
-
|
|
327
|
-
let re, S = /* @__PURE__ */ new Map(),
|
|
351
|
+
he.displayName = "ToastContainer", he.defaultProps = { position: "top-right", transition: _e, autoClose: 5e3, closeButton: ye, pauseOnHover: !0, pauseOnFocusLoss: !0, closeOnClick: !0, draggable: !0, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
|
|
352
|
+
let re, S = /* @__PURE__ */ new Map(), W = [], Ae = 1;
|
|
328
353
|
function ve() {
|
|
329
|
-
return "" +
|
|
354
|
+
return "" + Ae++;
|
|
330
355
|
}
|
|
331
|
-
function
|
|
332
|
-
return e && (
|
|
356
|
+
function Me(e) {
|
|
357
|
+
return e && (j(e.toastId) || Q(e.toastId)) ? e.toastId : ve();
|
|
333
358
|
}
|
|
334
359
|
function V(e, t) {
|
|
335
|
-
return S.size > 0 ?
|
|
360
|
+
return S.size > 0 ? _.emit(0, e, t) : W.push({ content: e, options: t }), t.toastId;
|
|
336
361
|
}
|
|
337
362
|
function ee(e, t) {
|
|
338
|
-
return { ...t, type: t && t.type || e, toastId:
|
|
363
|
+
return { ...t, type: t && t.type || e, toastId: Me(t) };
|
|
339
364
|
}
|
|
340
365
|
function K(e) {
|
|
341
|
-
return (t,
|
|
366
|
+
return (t, s) => V(t, ee(e, s));
|
|
342
367
|
}
|
|
343
368
|
function E(e, t) {
|
|
344
369
|
return V(e, ee("default", t));
|
|
345
370
|
}
|
|
346
|
-
E.loading = (e, t) => V(e, ee("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), E.promise = function(e, t,
|
|
347
|
-
let a, { pending:
|
|
348
|
-
|
|
371
|
+
E.loading = (e, t) => V(e, ee("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), E.promise = function(e, t, s) {
|
|
372
|
+
let a, { pending: r, error: o, success: n } = t;
|
|
373
|
+
r && (a = j(r) ? E.loading(r, s) : E.loading(r.render, { ...s, ...r }));
|
|
349
374
|
const i = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, g = (p, m, b) => {
|
|
350
375
|
if (m == null)
|
|
351
376
|
return void E.dismiss(a);
|
|
352
|
-
const u = { type: p, ...i, ...
|
|
377
|
+
const u = { type: p, ...i, ...s, data: b }, c = j(m) ? { render: m } : m;
|
|
353
378
|
return a ? E.update(a, { ...u, ...c }) : E(c.render, { ...u, ...c }), b;
|
|
354
|
-
}, h =
|
|
379
|
+
}, h = O(e) ? e() : e;
|
|
355
380
|
return h.then((p) => g("success", n, p)).catch((p) => g("error", o, p)), h;
|
|
356
381
|
}, E.success = K("success"), E.info = K("info"), E.error = K("error"), E.warning = K("warning"), E.warn = E.warning, E.dark = (e, t) => V(e, ee("default", { theme: "dark", ...t })), E.dismiss = (e) => {
|
|
357
|
-
S.size > 0 ?
|
|
382
|
+
S.size > 0 ? _.emit(1, e) : W = W.filter((t) => e != null && t.options.toastId !== e);
|
|
358
383
|
}, E.clearWaitingQueue = function(e) {
|
|
359
|
-
return e === void 0 && (e = {}),
|
|
384
|
+
return e === void 0 && (e = {}), _.emit(5, e);
|
|
360
385
|
}, E.isActive = (e) => {
|
|
361
386
|
let t = !1;
|
|
362
|
-
return S.forEach((
|
|
363
|
-
|
|
387
|
+
return S.forEach((s) => {
|
|
388
|
+
s.isToastActive && s.isToastActive(e) && (t = !0);
|
|
364
389
|
}), t;
|
|
365
390
|
}, E.update = function(e, t) {
|
|
366
391
|
t === void 0 && (t = {}), setTimeout(() => {
|
|
367
|
-
const
|
|
368
|
-
let { containerId: o } =
|
|
392
|
+
const s = function(a, r) {
|
|
393
|
+
let { containerId: o } = r;
|
|
369
394
|
const n = S.get(o || re);
|
|
370
395
|
return n && n.getToast(a);
|
|
371
396
|
}(e, t);
|
|
372
|
-
if (
|
|
373
|
-
const { props: a, content:
|
|
397
|
+
if (s) {
|
|
398
|
+
const { props: a, content: r } = s, o = { delay: 100, ...a, ...t, toastId: t.toastId || e, updateId: ve() };
|
|
374
399
|
o.toastId !== e && (o.staleId = e);
|
|
375
|
-
const n = o.render ||
|
|
400
|
+
const n = o.render || r;
|
|
376
401
|
delete o.render, V(n, o);
|
|
377
402
|
}
|
|
378
403
|
}, 0);
|
|
379
404
|
}, E.done = (e) => {
|
|
380
405
|
E.update(e, { progress: 1 });
|
|
381
|
-
}, E.onChange = (e) => (
|
|
382
|
-
|
|
383
|
-
}), E.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, E.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" },
|
|
384
|
-
re = e.containerId || e, S.set(re, e),
|
|
385
|
-
|
|
386
|
-
}),
|
|
406
|
+
}, E.onChange = (e) => (_.on(4, e), () => {
|
|
407
|
+
_.off(4, e);
|
|
408
|
+
}), E.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, E.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, _.on(2, (e) => {
|
|
409
|
+
re = e.containerId || e, S.set(re, e), W.forEach((t) => {
|
|
410
|
+
_.emit(0, t.content, t.options);
|
|
411
|
+
}), W = [];
|
|
387
412
|
}).on(3, (e) => {
|
|
388
|
-
S.delete(e.containerId || e), S.size === 0 &&
|
|
413
|
+
S.delete(e.containerId || e), S.size === 0 && _.off(0).off(1).off(5);
|
|
389
414
|
});
|
|
390
|
-
function
|
|
415
|
+
function qe(e) {
|
|
391
416
|
if (e) {
|
|
392
417
|
const t = Math.trunc(e * 10) / 10;
|
|
393
418
|
return t % 1 === 0 ? Math.trunc(t) : t;
|
|
394
419
|
}
|
|
395
420
|
return 0;
|
|
396
421
|
}
|
|
397
|
-
function
|
|
398
|
-
var
|
|
422
|
+
function ue(e) {
|
|
423
|
+
var s;
|
|
399
424
|
const t = e == null ? void 0 : e.Reference;
|
|
400
425
|
if (t) {
|
|
401
|
-
const a = Object.values(e["Word Phonetic Evaluation"]),
|
|
426
|
+
const a = Object.values(e["Word Phonetic Evaluation"]), r = (s = t == null ? void 0 : t.split(/\s+/)) == null ? void 0 : s.map((n, i) => {
|
|
402
427
|
var p;
|
|
403
428
|
const g = a[i], h = g["Word Score"];
|
|
404
429
|
return (n == null ? void 0 : n.toLowerCase()) === ((p = g.Word) == null ? void 0 : p.toLowerCase()) ? { text: n, highlight: h <= 45 } : { text: n };
|
|
405
430
|
});
|
|
406
431
|
let o = "<p>";
|
|
407
|
-
return
|
|
432
|
+
return r == null || r.forEach((n) => {
|
|
408
433
|
n != null && n.highlight ? o += `<span>${n == null ? void 0 : n.text}</span> ` : o += `${n == null ? void 0 : n.text} `;
|
|
409
434
|
}), o = (o == null ? void 0 : o.trim()) + "</p>", o;
|
|
410
435
|
}
|
|
411
436
|
return "";
|
|
412
437
|
}
|
|
413
|
-
const
|
|
438
|
+
const de = (e, t = {}) => {
|
|
414
439
|
if (e) {
|
|
415
|
-
const
|
|
416
|
-
return e != null && e.relevance &&
|
|
440
|
+
const s = [];
|
|
441
|
+
return e != null && e.relevance && s.push({ value: "relevance", label: "Relevance" }), e != null && e.speech_analysis && s.push({ value: "speech", label: "Speech analysis" }), e != null && e.grammar && s.push({ value: "grammar", label: "Grammar" }), { options: s, data: { ...e, ...t } };
|
|
417
442
|
}
|
|
418
443
|
return null;
|
|
419
|
-
},
|
|
444
|
+
}, Ne = (e) => {
|
|
420
445
|
var a;
|
|
421
446
|
if (!e)
|
|
422
447
|
return [];
|
|
423
448
|
const t = (a = e == null ? void 0 : e.data) == null ? void 0 : a.speech_analysis;
|
|
424
|
-
return t == null ? void 0 : t.map((
|
|
449
|
+
return t == null ? void 0 : t.map((r) => {
|
|
425
450
|
var n;
|
|
426
|
-
const o = (n = Object.values(
|
|
451
|
+
const o = (n = Object.values(r == null ? void 0 : r.attempt_data)) == null ? void 0 : n[0];
|
|
427
452
|
return {
|
|
428
453
|
data: o,
|
|
429
|
-
audioText:
|
|
430
|
-
setupAnalysis:
|
|
431
|
-
{ speech_analysis: [{ model_data:
|
|
454
|
+
audioText: r != null && r.model_data ? ue(r == null ? void 0 : r.model_data) : void 0,
|
|
455
|
+
setupAnalysis: r != null && r.model_data ? de(
|
|
456
|
+
{ speech_analysis: [{ model_data: r == null ? void 0 : r.model_data }] },
|
|
432
457
|
{ audio: o == null ? void 0 : o.recording }
|
|
433
458
|
) : void 0
|
|
434
459
|
};
|
|
435
460
|
});
|
|
436
|
-
},
|
|
437
|
-
var
|
|
461
|
+
}, $e = (e) => {
|
|
462
|
+
var r;
|
|
438
463
|
if (!e)
|
|
439
464
|
return [];
|
|
440
|
-
const t = (
|
|
465
|
+
const t = (r = e == null ? void 0 : e.data) == null ? void 0 : r.speech_analysis, s = (o) => {
|
|
441
466
|
var g;
|
|
442
467
|
if (!o)
|
|
443
468
|
return;
|
|
@@ -457,23 +482,23 @@ const ue = (e, t = {}) => {
|
|
|
457
482
|
const n = o == null ? void 0 : o.attempt_data;
|
|
458
483
|
return {
|
|
459
484
|
data: n,
|
|
460
|
-
audioText: o != null && o.model_data ?
|
|
461
|
-
setupAnalysis: o != null && o.model_data ?
|
|
485
|
+
audioText: o != null && o.model_data ? ue(o == null ? void 0 : o.model_data) : void 0,
|
|
486
|
+
setupAnalysis: o != null && o.model_data ? de(
|
|
462
487
|
{
|
|
463
488
|
speech_analysis: [{ model_data: o == null ? void 0 : o.model_data }],
|
|
464
|
-
grammar:
|
|
489
|
+
grammar: s((i = n == null ? void 0 : n.recording) == null ? void 0 : i.id)
|
|
465
490
|
},
|
|
466
491
|
{ audio: (n == null ? void 0 : n.recording) || n, student_text: n == null ? void 0 : n.text }
|
|
467
492
|
) : void 0
|
|
468
493
|
};
|
|
469
494
|
});
|
|
470
|
-
},
|
|
471
|
-
function J(e, t,
|
|
472
|
-
for (let a = 0; a <
|
|
473
|
-
e.setUint8(t + a,
|
|
495
|
+
}, ke = () => ({ setupAnalysis: de, getResponse: ue, getDialogueByModal: Ne, getQuizByModal: $e }), He = ke;
|
|
496
|
+
function J(e, t, s) {
|
|
497
|
+
for (let a = 0; a < s.length; a++)
|
|
498
|
+
e.setUint8(t + a, s.charCodeAt(a));
|
|
474
499
|
}
|
|
475
|
-
function
|
|
476
|
-
const t = e.numberOfChannels,
|
|
500
|
+
function Be(e) {
|
|
501
|
+
const t = e.numberOfChannels, s = e.sampleRate, a = 1, r = 16, o = r / 8, n = t * o, i = s * n, g = [];
|
|
477
502
|
for (let f = 0; f < t; f++)
|
|
478
503
|
g.push(e.getChannelData(f));
|
|
479
504
|
const h = g[0].length, p = h * t * o, m = new Int16Array(h * t);
|
|
@@ -484,43 +509,46 @@ function Ne(e) {
|
|
|
484
509
|
d = Math.max(-1, Math.min(1, d)), m[b++] = d < 0 ? d * 32768 : d * 32767;
|
|
485
510
|
}
|
|
486
511
|
const u = new ArrayBuffer(44 + p), c = new DataView(u);
|
|
487
|
-
return J(c, 0, "RIFF"), c.setUint32(4, 36 + p, !0), J(c, 8, "WAVE"), J(c, 12, "fmt "), c.setUint32(16, 16, !0), c.setUint16(20, a, !0), c.setUint16(22, t, !0), c.setUint32(24,
|
|
512
|
+
return J(c, 0, "RIFF"), c.setUint32(4, 36 + p, !0), J(c, 8, "WAVE"), J(c, 12, "fmt "), c.setUint32(16, 16, !0), c.setUint16(20, a, !0), c.setUint16(22, t, !0), c.setUint32(24, s, !0), c.setUint32(28, i, !0), c.setUint16(32, n, !0), c.setUint16(34, r, !0), J(c, 36, "data"), c.setUint32(40, p, !0), new Int16Array(u, 44).set(m), new Blob([c], { type: "audio/wav" });
|
|
488
513
|
}
|
|
489
|
-
async function
|
|
514
|
+
async function We(e) {
|
|
490
515
|
if (!e || e.size === 0)
|
|
491
516
|
throw new Error("Input blob is empty or null. Cannot convert to WAV.");
|
|
492
517
|
let t;
|
|
493
518
|
try {
|
|
494
519
|
t = new (window.AudioContext || window.webkitAudioContext)();
|
|
495
|
-
const
|
|
496
|
-
return
|
|
497
|
-
} catch (
|
|
498
|
-
throw console.error("Error during blob to WAV conversion:",
|
|
520
|
+
const s = await e.arrayBuffer(), a = await t.decodeAudioData(s);
|
|
521
|
+
return Be(a);
|
|
522
|
+
} catch (s) {
|
|
523
|
+
throw console.error("Error during blob to WAV conversion:", s), new Error(`Failed to convert blob to WAV: ${s.message}`);
|
|
499
524
|
} finally {
|
|
500
525
|
t && t.state !== "closed" && await t.close();
|
|
501
526
|
}
|
|
502
527
|
}
|
|
503
|
-
function
|
|
504
|
-
const
|
|
505
|
-
for (const a of
|
|
506
|
-
const [
|
|
507
|
-
if (
|
|
528
|
+
function Qe(e) {
|
|
529
|
+
const s = document.cookie.split("; ");
|
|
530
|
+
for (const a of s) {
|
|
531
|
+
const [r, o] = a.split("=");
|
|
532
|
+
if (r === e)
|
|
508
533
|
return decodeURIComponent(o);
|
|
509
534
|
}
|
|
510
535
|
return null;
|
|
511
536
|
}
|
|
512
537
|
const De = (e) => {
|
|
513
|
-
const t = Math.floor(e),
|
|
514
|
-
return `${
|
|
515
|
-
},
|
|
538
|
+
const t = Math.floor(e), s = Math.floor(t / 60), a = (t % 60).toString().padStart(2, "0");
|
|
539
|
+
return `${s}:${a} min`;
|
|
540
|
+
}, Ve = De;
|
|
516
541
|
export {
|
|
517
542
|
E as Q,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
543
|
+
Fe as a,
|
|
544
|
+
Ue as b,
|
|
545
|
+
ze as c,
|
|
546
|
+
Qe as d,
|
|
547
|
+
Ve as e,
|
|
548
|
+
qe as f,
|
|
549
|
+
Se as g,
|
|
550
|
+
We as h,
|
|
551
|
+
je as r,
|
|
552
|
+
He as u
|
|
525
553
|
};
|
|
526
|
-
//# sourceMappingURL=formatDuration.-
|
|
554
|
+
//# sourceMappingURL=formatDuration.-ac7eeadf.js.map
|