@metricshift/react 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Je, { useState as Y, useRef as Ue, useEffect as Ve, createContext as gr, useContext as vr } from "react";
|
|
2
|
+
var Pe = { exports: {} }, se = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,21 +9,21 @@ var Ee = { exports: {} }, te = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
12
|
+
var qe;
|
|
13
13
|
function hr() {
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
for (
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof:
|
|
14
|
+
if (qe) return se;
|
|
15
|
+
qe = 1;
|
|
16
|
+
var p = Je, m = Symbol.for("react.element"), C = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, b = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function R(x, g, j) {
|
|
18
|
+
var v, S = {}, T = null, F = null;
|
|
19
|
+
j !== void 0 && (T = "" + j), g.key !== void 0 && (T = "" + g.key), g.ref !== void 0 && (F = g.ref);
|
|
20
|
+
for (v in g) c.call(g, v) && !o.hasOwnProperty(v) && (S[v] = g[v]);
|
|
21
|
+
if (x && x.defaultProps) for (v in g = x.defaultProps, g) S[v] === void 0 && (S[v] = g[v]);
|
|
22
|
+
return { $$typeof: m, type: x, key: T, ref: F, props: S, _owner: b.current };
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return se.Fragment = C, se.jsx = R, se.jsxs = R, se;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var le = {};
|
|
27
27
|
/**
|
|
28
28
|
* @license React
|
|
29
29
|
* react-jsx-runtime.development.js
|
|
@@ -33,91 +33,91 @@ var ne = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
36
|
+
var He;
|
|
37
37
|
function xr() {
|
|
38
|
-
return
|
|
39
|
-
var
|
|
40
|
-
function
|
|
38
|
+
return He || (He = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var p = Je, m = Symbol.for("react.element"), C = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), x = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), B = Symbol.iterator, A = "@@iterator";
|
|
40
|
+
function q(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var r =
|
|
43
|
+
var r = B && e[B] || e[A];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
46
|
+
var I = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function f(e) {
|
|
48
48
|
{
|
|
49
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0),
|
|
50
|
-
t[
|
|
51
|
-
|
|
49
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
|
|
50
|
+
t[a - 1] = arguments[a];
|
|
51
|
+
re("error", e, t);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function re(e, r, t) {
|
|
55
55
|
{
|
|
56
|
-
var
|
|
56
|
+
var a = I.ReactDebugCurrentFrame, u = a.getStackAddendum();
|
|
57
57
|
u !== "" && (r += "%s", t = t.concat([u]));
|
|
58
|
-
var
|
|
58
|
+
var d = t.map(function(l) {
|
|
59
59
|
return String(l);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
d.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, d);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var i = !1,
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === c || e ===
|
|
64
|
+
var i = !1, _ = !1, ce = !1, ue = !1, fe = !1, te;
|
|
65
|
+
te = Symbol.for("react.module.reference");
|
|
66
|
+
function de(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === o || fe || e === b || e === j || e === v || ue || e === F || i || _ || ce || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === S || e.$$typeof === R || e.$$typeof === x || e.$$typeof === g || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === te || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
73
|
function pe(e, r, t) {
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
74
|
+
var a = e.displayName;
|
|
75
|
+
if (a)
|
|
76
|
+
return a;
|
|
77
77
|
var u = r.displayName || r.name || "";
|
|
78
78
|
return u !== "" ? t + "(" + u + ")" : t;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function be(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function O(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
|
-
if (typeof e.tag == "number" &&
|
|
86
|
+
if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
87
|
return e.displayName || e.name || null;
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
90
90
|
switch (e) {
|
|
91
91
|
case c:
|
|
92
92
|
return "Fragment";
|
|
93
|
-
case
|
|
93
|
+
case C:
|
|
94
94
|
return "Portal";
|
|
95
|
-
case
|
|
95
|
+
case o:
|
|
96
96
|
return "Profiler";
|
|
97
|
-
case
|
|
97
|
+
case b:
|
|
98
98
|
return "StrictMode";
|
|
99
|
-
case
|
|
99
|
+
case j:
|
|
100
100
|
return "Suspense";
|
|
101
|
-
case
|
|
101
|
+
case v:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
104
|
if (typeof e == "object")
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
106
|
+
case x:
|
|
107
107
|
var r = e;
|
|
108
|
-
return
|
|
109
|
-
case
|
|
108
|
+
return be(r) + ".Consumer";
|
|
109
|
+
case R:
|
|
110
110
|
var t = e;
|
|
111
|
-
return
|
|
112
|
-
case
|
|
111
|
+
return be(t._context) + ".Provider";
|
|
112
|
+
case g:
|
|
113
113
|
return pe(e, e.render, "ForwardRef");
|
|
114
|
-
case
|
|
115
|
-
var
|
|
116
|
-
return
|
|
117
|
-
case
|
|
118
|
-
var u = e,
|
|
114
|
+
case S:
|
|
115
|
+
var a = e.displayName || null;
|
|
116
|
+
return a !== null ? a : O(e.type) || "Memo";
|
|
117
|
+
case T: {
|
|
118
|
+
var u = e, d = u._payload, l = u._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return O(l(d));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function xr() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var M = Object.assign, L = 0, ge, ve, ne, he, H, xe, J;
|
|
129
|
+
function K() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
K.__reactDisabledLog = !0;
|
|
132
|
+
function N() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (L === 0) {
|
|
135
|
+
ge = console.log, ve = console.info, ne = console.warn, he = console.error, H = console.group, xe = console.groupCollapsed, J = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: K,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -149,77 +149,77 @@ function xr() {
|
|
|
149
149
|
groupEnd: e
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
L++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function ae() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (L--, L === 0) {
|
|
158
158
|
var e = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value:
|
|
164
|
+
log: M({}, e, {
|
|
165
|
+
value: ge
|
|
166
166
|
}),
|
|
167
|
-
info:
|
|
168
|
-
value:
|
|
167
|
+
info: M({}, e, {
|
|
168
|
+
value: ve
|
|
169
169
|
}),
|
|
170
|
-
warn:
|
|
171
|
-
value:
|
|
170
|
+
warn: M({}, e, {
|
|
171
|
+
value: ne
|
|
172
172
|
}),
|
|
173
|
-
error:
|
|
174
|
-
value:
|
|
173
|
+
error: M({}, e, {
|
|
174
|
+
value: he
|
|
175
175
|
}),
|
|
176
|
-
group:
|
|
177
|
-
value:
|
|
176
|
+
group: M({}, e, {
|
|
177
|
+
value: H
|
|
178
178
|
}),
|
|
179
|
-
groupCollapsed:
|
|
180
|
-
value:
|
|
179
|
+
groupCollapsed: M({}, e, {
|
|
180
|
+
value: xe
|
|
181
181
|
}),
|
|
182
|
-
groupEnd:
|
|
183
|
-
value:
|
|
182
|
+
groupEnd: M({}, e, {
|
|
183
|
+
value: J
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
L < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var W = I.ReactCurrentDispatcher, z;
|
|
191
|
+
function $(e, r, t) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (z === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
196
|
} catch (u) {
|
|
197
|
-
var
|
|
198
|
-
|
|
197
|
+
var a = u.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
z = a && a[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + z + e;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var oe = !1, ie;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
206
|
+
var Se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
ie = new Se();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
209
|
+
function ye(e, r) {
|
|
210
|
+
if (!e || oe)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var t =
|
|
213
|
+
var t = ie.get(e);
|
|
214
214
|
if (t !== void 0)
|
|
215
215
|
return t;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
218
|
-
|
|
217
|
+
var a;
|
|
218
|
+
oe = !0;
|
|
219
219
|
var u = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var d;
|
|
222
|
+
d = W.current, W.current = null, N();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
225
|
var l = function() {
|
|
@@ -232,119 +232,119 @@ function xr() {
|
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
234
|
Reflect.construct(l, []);
|
|
235
|
-
} catch (
|
|
236
|
-
|
|
235
|
+
} catch (w) {
|
|
236
|
+
a = w;
|
|
237
237
|
}
|
|
238
238
|
Reflect.construct(e, [], l);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
241
|
l.call();
|
|
242
|
-
} catch (
|
|
243
|
-
|
|
242
|
+
} catch (w) {
|
|
243
|
+
a = w;
|
|
244
244
|
}
|
|
245
245
|
e.call(l.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
|
|
250
|
+
} catch (w) {
|
|
251
|
+
a = w;
|
|
252
252
|
}
|
|
253
253
|
e();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var s =
|
|
258
|
-
`),
|
|
259
|
-
`),
|
|
255
|
+
} catch (w) {
|
|
256
|
+
if (w && a && typeof w.stack == "string") {
|
|
257
|
+
for (var s = w.stack.split(`
|
|
258
|
+
`), k = a.stack.split(`
|
|
259
|
+
`), h = s.length - 1, y = k.length - 1; h >= 1 && y >= 0 && s[h] !== k[y]; )
|
|
260
260
|
y--;
|
|
261
|
-
for (;
|
|
262
|
-
if (s[
|
|
263
|
-
if (
|
|
261
|
+
for (; h >= 1 && y >= 0; h--, y--)
|
|
262
|
+
if (s[h] !== k[y]) {
|
|
263
|
+
if (h !== 1 || y !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (
|
|
266
|
-
var
|
|
267
|
-
` + s[
|
|
268
|
-
return e.displayName &&
|
|
265
|
+
if (h--, y--, y < 0 || s[h] !== k[y]) {
|
|
266
|
+
var P = `
|
|
267
|
+
` + s[h].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && ie.set(e, P), P;
|
|
269
269
|
}
|
|
270
|
-
while (
|
|
270
|
+
while (h >= 1 && y >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
oe = !1, W.current = d, ae(), Error.prepareStackTrace = u;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof e == "function" &&
|
|
277
|
+
var ee = e ? e.displayName || e.name : "", V = ee ? $(ee) : "";
|
|
278
|
+
return typeof e == "function" && ie.set(e, V), V;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function ke(e, r, t) {
|
|
281
|
+
return ye(e, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Re(e) {
|
|
284
284
|
var r = e.prototype;
|
|
285
285
|
return !!(r && r.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function G(e, r, t) {
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
291
|
+
return ye(e, Re(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
|
-
return
|
|
293
|
+
return $(e);
|
|
294
294
|
switch (e) {
|
|
295
|
-
case
|
|
296
|
-
return
|
|
297
|
-
case
|
|
298
|
-
return
|
|
295
|
+
case j:
|
|
296
|
+
return $("Suspense");
|
|
297
|
+
case v:
|
|
298
|
+
return $("SuspenseList");
|
|
299
299
|
}
|
|
300
300
|
if (typeof e == "object")
|
|
301
301
|
switch (e.$$typeof) {
|
|
302
|
-
case
|
|
303
|
-
return
|
|
304
|
-
case
|
|
305
|
-
return
|
|
306
|
-
case
|
|
307
|
-
var
|
|
302
|
+
case g:
|
|
303
|
+
return ke(e.render);
|
|
304
|
+
case S:
|
|
305
|
+
return G(e.type, r, t);
|
|
306
|
+
case T: {
|
|
307
|
+
var a = e, u = a._payload, d = a._init;
|
|
308
308
|
try {
|
|
309
|
-
return
|
|
309
|
+
return G(d(u), r, t);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
316
|
+
var U = Object.prototype.hasOwnProperty, me = {}, Ee = I.ReactDebugCurrentFrame;
|
|
317
|
+
function X(e) {
|
|
318
318
|
if (e) {
|
|
319
|
-
var r = e._owner, t =
|
|
320
|
-
|
|
319
|
+
var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
|
|
320
|
+
Ee.setExtraStackFrame(t);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
Ee.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Oe(e, r, t, a, u) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
326
|
+
var d = Function.call.bind(U);
|
|
327
327
|
for (var l in e)
|
|
328
|
-
if (
|
|
328
|
+
if (d(e, l)) {
|
|
329
329
|
var s = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof e[l] != "function") {
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
332
|
+
var k = Error((a || "React class") + ": " + t + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw k.name = "Invariant Violation", k;
|
|
334
334
|
}
|
|
335
|
-
s = e[l](r, l,
|
|
336
|
-
} catch (
|
|
337
|
-
s =
|
|
335
|
+
s = e[l](r, l, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (h) {
|
|
337
|
+
s = h;
|
|
338
338
|
}
|
|
339
|
-
s && !(s instanceof Error) && (
|
|
339
|
+
s && !(s instanceof Error) && (X(u), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", t, l, typeof s), X(null)), s instanceof Error && !(s.message in me) && (me[s.message] = !0, X(u), f("Failed %s type: %s", t, s.message), X(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return
|
|
343
|
+
var E = Array.isArray;
|
|
344
|
+
function D(e) {
|
|
345
|
+
return E(e);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Q(e) {
|
|
348
348
|
{
|
|
349
349
|
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
350
|
return t;
|
|
@@ -352,26 +352,26 @@ function xr() {
|
|
|
352
352
|
}
|
|
353
353
|
function Ge(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return Fe(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Fe(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Ie(e) {
|
|
364
364
|
if (Ge(e))
|
|
365
|
-
return
|
|
365
|
+
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Q(e)), Fe(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var Me = I.ReactCurrentOwner, Xe = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
372
|
+
}, Ae, De;
|
|
373
373
|
function Qe(e) {
|
|
374
|
-
if (
|
|
374
|
+
if (U.call(e, "ref")) {
|
|
375
375
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
376
|
if (r && r.isReactWarning)
|
|
377
377
|
return !1;
|
|
@@ -379,7 +379,7 @@ function xr() {
|
|
|
379
379
|
return e.ref !== void 0;
|
|
380
380
|
}
|
|
381
381
|
function Ze(e) {
|
|
382
|
-
if (
|
|
382
|
+
if (U.call(e, "key")) {
|
|
383
383
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
384
|
if (r && r.isReactWarning)
|
|
385
385
|
return !1;
|
|
@@ -387,12 +387,12 @@ function xr() {
|
|
|
387
387
|
return e.key !== void 0;
|
|
388
388
|
}
|
|
389
389
|
function er(e, r) {
|
|
390
|
-
typeof e.ref == "string" &&
|
|
390
|
+
typeof e.ref == "string" && Me.current;
|
|
391
391
|
}
|
|
392
392
|
function rr(e, r) {
|
|
393
393
|
{
|
|
394
394
|
var t = function() {
|
|
395
|
-
|
|
395
|
+
Ae || (Ae = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
396
396
|
};
|
|
397
397
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
398
|
get: t,
|
|
@@ -403,7 +403,7 @@ function xr() {
|
|
|
403
403
|
function tr(e, r) {
|
|
404
404
|
{
|
|
405
405
|
var t = function() {
|
|
406
|
-
|
|
406
|
+
De || (De = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
407
407
|
};
|
|
408
408
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
409
|
get: t,
|
|
@@ -411,17 +411,17 @@ function xr() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var nr = function(e, r, t,
|
|
414
|
+
var nr = function(e, r, t, a, u, d, l) {
|
|
415
415
|
var s = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
-
$$typeof:
|
|
417
|
+
$$typeof: m,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: e,
|
|
420
420
|
key: r,
|
|
421
421
|
ref: t,
|
|
422
422
|
props: l,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
|
-
_owner:
|
|
424
|
+
_owner: d
|
|
425
425
|
};
|
|
426
426
|
return s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
@@ -432,7 +432,7 @@ function xr() {
|
|
|
432
432
|
configurable: !1,
|
|
433
433
|
enumerable: !1,
|
|
434
434
|
writable: !1,
|
|
435
|
-
value:
|
|
435
|
+
value: a
|
|
436
436
|
}), Object.defineProperty(s, "_source", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
@@ -440,41 +440,41 @@ function xr() {
|
|
|
440
440
|
value: u
|
|
441
441
|
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
442
442
|
};
|
|
443
|
-
function ar(e, r, t,
|
|
443
|
+
function ar(e, r, t, a, u) {
|
|
444
444
|
{
|
|
445
|
-
var
|
|
446
|
-
t !== void 0 && (
|
|
447
|
-
for (
|
|
448
|
-
|
|
445
|
+
var d, l = {}, s = null, k = null;
|
|
446
|
+
t !== void 0 && (Ie(t), s = "" + t), Ze(r) && (Ie(r.key), s = "" + r.key), Qe(r) && (k = r.ref, er(r, u));
|
|
447
|
+
for (d in r)
|
|
448
|
+
U.call(r, d) && !Xe.hasOwnProperty(d) && (l[d] = r[d]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
450
|
-
var
|
|
451
|
-
for (
|
|
452
|
-
l[
|
|
450
|
+
var h = e.defaultProps;
|
|
451
|
+
for (d in h)
|
|
452
|
+
l[d] === void 0 && (l[d] = h[d]);
|
|
453
453
|
}
|
|
454
|
-
if (s ||
|
|
454
|
+
if (s || k) {
|
|
455
455
|
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
-
s && rr(l, y),
|
|
456
|
+
s && rr(l, y), k && tr(l, y);
|
|
457
457
|
}
|
|
458
|
-
return nr(e, s,
|
|
458
|
+
return nr(e, s, k, u, a, Me.current, l);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
461
|
+
var je = I.ReactCurrentOwner, We = I.ReactDebugCurrentFrame;
|
|
462
|
+
function Z(e) {
|
|
463
463
|
if (e) {
|
|
464
|
-
var r = e._owner, t =
|
|
465
|
-
|
|
464
|
+
var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
|
|
465
|
+
We.setExtraStackFrame(t);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
We.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
472
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
469
|
+
var _e;
|
|
470
|
+
_e = !1;
|
|
471
|
+
function we(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === m;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ze() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var e =
|
|
476
|
+
if (je.current) {
|
|
477
|
+
var e = O(je.current.type);
|
|
478
478
|
if (e)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -486,10 +486,10 @@ Check the render method of \`` + e + "`.";
|
|
|
486
486
|
function or(e) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
489
|
+
var $e = {};
|
|
490
490
|
function ir(e) {
|
|
491
491
|
{
|
|
492
|
-
var r =
|
|
492
|
+
var r = ze();
|
|
493
493
|
if (!r) {
|
|
494
494
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
495
|
t && (r = `
|
|
@@ -499,35 +499,35 @@ Check the top-level render call using <` + t + ">.");
|
|
|
499
499
|
return r;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Ye(e, r) {
|
|
503
503
|
{
|
|
504
504
|
if (!e._store || e._store.validated || e.key != null)
|
|
505
505
|
return;
|
|
506
506
|
e._store.validated = !0;
|
|
507
507
|
var t = ir(r);
|
|
508
|
-
if (
|
|
508
|
+
if ($e[t])
|
|
509
509
|
return;
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
e && e._owner && e._owner !==
|
|
510
|
+
$e[t] = !0;
|
|
511
|
+
var a = "";
|
|
512
|
+
e && e._owner && e._owner !== je.current && (a = " It was passed a child from " + O(e._owner.type) + "."), Z(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), Z(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Be(e, r) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof e != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
519
|
+
if (D(e))
|
|
520
520
|
for (var t = 0; t < e.length; t++) {
|
|
521
|
-
var
|
|
522
|
-
|
|
521
|
+
var a = e[t];
|
|
522
|
+
we(a) && Ye(a, r);
|
|
523
523
|
}
|
|
524
|
-
else if (
|
|
524
|
+
else if (we(e))
|
|
525
525
|
e._store && (e._store.validated = !0);
|
|
526
526
|
else if (e) {
|
|
527
|
-
var u =
|
|
527
|
+
var u = q(e);
|
|
528
528
|
if (typeof u == "function" && u !== e.entries)
|
|
529
|
-
for (var
|
|
530
|
-
|
|
529
|
+
for (var d = u.call(e), l; !(l = d.next()).done; )
|
|
530
|
+
we(l.value) && Ye(l.value, r);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
@@ -539,149 +539,149 @@ Check the top-level render call using <` + t + ">.");
|
|
|
539
539
|
var t;
|
|
540
540
|
if (typeof r == "function")
|
|
541
541
|
t = r.propTypes;
|
|
542
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
542
|
+
else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here.
|
|
543
543
|
// Inner props are checked in the reconciler.
|
|
544
|
-
r.$$typeof ===
|
|
544
|
+
r.$$typeof === S))
|
|
545
545
|
t = r.propTypes;
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (t) {
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
} else if (r.PropTypes !== void 0 && !
|
|
552
|
-
|
|
553
|
-
var u =
|
|
554
|
-
|
|
549
|
+
var a = O(r);
|
|
550
|
+
Oe(t, e.props, "prop", a, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !_e) {
|
|
552
|
+
_e = !0;
|
|
553
|
+
var u = O(r);
|
|
554
|
+
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
555
555
|
}
|
|
556
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
function lr(e) {
|
|
560
560
|
{
|
|
561
561
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
562
|
-
var
|
|
563
|
-
if (
|
|
564
|
-
|
|
562
|
+
var a = r[t];
|
|
563
|
+
if (a !== "children" && a !== "key") {
|
|
564
|
+
Z(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), Z(null);
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
e.ref !== null && (
|
|
568
|
+
e.ref !== null && (Z(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
571
|
+
var Le = {};
|
|
572
|
+
function Ne(e, r, t, a, u, d) {
|
|
573
573
|
{
|
|
574
|
-
var l =
|
|
574
|
+
var l = de(e);
|
|
575
575
|
if (!l) {
|
|
576
576
|
var s = "";
|
|
577
577
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
-
var
|
|
579
|
-
|
|
580
|
-
var
|
|
581
|
-
e === null ?
|
|
578
|
+
var k = or();
|
|
579
|
+
k ? s += k : s += ze();
|
|
580
|
+
var h;
|
|
581
|
+
e === null ? h = "null" : D(e) ? h = "array" : e !== void 0 && e.$$typeof === m ? (h = "<" + (O(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, s);
|
|
582
582
|
}
|
|
583
|
-
var y = ar(e, r, t, u,
|
|
583
|
+
var y = ar(e, r, t, u, d);
|
|
584
584
|
if (y == null)
|
|
585
585
|
return y;
|
|
586
586
|
if (l) {
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
if (
|
|
590
|
-
if (
|
|
591
|
-
for (var
|
|
592
|
-
|
|
593
|
-
Object.freeze && Object.freeze(
|
|
587
|
+
var P = r.children;
|
|
588
|
+
if (P !== void 0)
|
|
589
|
+
if (a)
|
|
590
|
+
if (D(P)) {
|
|
591
|
+
for (var ee = 0; ee < P.length; ee++)
|
|
592
|
+
Be(P[ee], e);
|
|
593
|
+
Object.freeze && Object.freeze(P);
|
|
594
594
|
} else
|
|
595
|
-
|
|
595
|
+
f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
596
|
else
|
|
597
|
-
|
|
597
|
+
Be(P, e);
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
var V =
|
|
599
|
+
if (U.call(r, "key")) {
|
|
600
|
+
var V = O(e), w = Object.keys(r).filter(function(br) {
|
|
601
601
|
return br !== "key";
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
604
|
-
var pr =
|
|
605
|
-
|
|
602
|
+
}), Ce = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Le[V + Ce]) {
|
|
604
|
+
var pr = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
f(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, Ce, V, pr, V), Le[V + Ce] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
return e === c ? lr(y) : sr(y), y;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
function cr(e, r, t) {
|
|
617
|
-
return
|
|
617
|
+
return Ne(e, r, t, !0);
|
|
618
618
|
}
|
|
619
619
|
function ur(e, r, t) {
|
|
620
|
-
return
|
|
620
|
+
return Ne(e, r, t, !1);
|
|
621
621
|
}
|
|
622
622
|
var fr = ur, dr = cr;
|
|
623
|
-
|
|
624
|
-
}()),
|
|
623
|
+
le.Fragment = c, le.jsx = fr, le.jsxs = dr;
|
|
624
|
+
}()), le;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var
|
|
628
|
-
const
|
|
629
|
-
isOpen:
|
|
630
|
-
onClose:
|
|
631
|
-
onSubmit:
|
|
626
|
+
process.env.NODE_ENV === "production" ? Pe.exports = hr() : Pe.exports = xr();
|
|
627
|
+
var n = Pe.exports;
|
|
628
|
+
const yr = ({
|
|
629
|
+
isOpen: p,
|
|
630
|
+
onClose: m,
|
|
631
|
+
onSubmit: C
|
|
632
632
|
}) => {
|
|
633
|
-
const [c,
|
|
633
|
+
const [c, b] = Y({
|
|
634
634
|
text: "",
|
|
635
635
|
rating: void 0,
|
|
636
636
|
feedbackType: "general",
|
|
637
637
|
userEmail: "",
|
|
638
638
|
userName: ""
|
|
639
|
-
}), [
|
|
640
|
-
|
|
639
|
+
}), [o, R] = Y(!1), [x, g] = Y("idle"), [j, v] = Y(""), [S, T] = Y(!1), F = Ue(null), B = Ue(null);
|
|
640
|
+
Ve(() => (p ? (T(!0), document.body.style.overflow = "hidden", setTimeout(() => {
|
|
641
641
|
var i;
|
|
642
|
-
(i =
|
|
642
|
+
(i = B.current) == null || i.focus();
|
|
643
643
|
}, 150)) : document.body.style.overflow = "unset", () => {
|
|
644
644
|
document.body.style.overflow = "unset";
|
|
645
|
-
}), [
|
|
646
|
-
const i = (
|
|
647
|
-
|
|
645
|
+
}), [p]), Ve(() => {
|
|
646
|
+
const i = (_) => {
|
|
647
|
+
_.key === "Escape" && p && !o && A();
|
|
648
648
|
};
|
|
649
|
-
return
|
|
649
|
+
return p && document.addEventListener("keydown", i), () => {
|
|
650
650
|
document.removeEventListener("keydown", i);
|
|
651
651
|
};
|
|
652
|
-
}, [
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
652
|
+
}, [p, o]);
|
|
653
|
+
const A = () => {
|
|
654
|
+
T(!1), setTimeout(() => {
|
|
655
|
+
m(), setTimeout(() => {
|
|
656
|
+
b({
|
|
657
657
|
text: "",
|
|
658
658
|
rating: void 0,
|
|
659
659
|
feedbackType: "general",
|
|
660
660
|
userEmail: "",
|
|
661
661
|
userName: ""
|
|
662
|
-
}),
|
|
662
|
+
}), g("idle"), v("");
|
|
663
663
|
}, 100);
|
|
664
664
|
}, 200);
|
|
665
|
-
},
|
|
665
|
+
}, q = async (i) => {
|
|
666
666
|
if (i.preventDefault(), !c.text.trim()) {
|
|
667
|
-
|
|
667
|
+
v("Please enter your feedback");
|
|
668
668
|
return;
|
|
669
669
|
}
|
|
670
|
-
|
|
670
|
+
R(!0), v("");
|
|
671
671
|
try {
|
|
672
|
-
await
|
|
673
|
-
|
|
672
|
+
await C(c), g("success"), setTimeout(() => {
|
|
673
|
+
A();
|
|
674
674
|
}, 2e3);
|
|
675
|
-
} catch (
|
|
676
|
-
|
|
675
|
+
} catch (_) {
|
|
676
|
+
g("error"), v(_ instanceof Error ? _.message : "Failed to submit feedback");
|
|
677
677
|
} finally {
|
|
678
|
-
|
|
678
|
+
R(!1);
|
|
679
679
|
}
|
|
680
680
|
};
|
|
681
|
-
if (!
|
|
682
|
-
const
|
|
683
|
-
i.target === i.currentTarget && !
|
|
684
|
-
},
|
|
681
|
+
if (!p) return null;
|
|
682
|
+
const I = (i) => {
|
|
683
|
+
i.target === i.currentTarget && !o && A();
|
|
684
|
+
}, f = {
|
|
685
685
|
position: "fixed",
|
|
686
686
|
top: 0,
|
|
687
687
|
left: 0,
|
|
@@ -693,9 +693,9 @@ const mr = ({
|
|
|
693
693
|
justifyContent: "center",
|
|
694
694
|
zIndex: 1e4,
|
|
695
695
|
padding: "16px",
|
|
696
|
-
opacity:
|
|
696
|
+
opacity: S ? 1 : 0,
|
|
697
697
|
transition: "opacity 0.2s ease-in-out"
|
|
698
|
-
},
|
|
698
|
+
}, re = {
|
|
699
699
|
backgroundColor: "white",
|
|
700
700
|
borderRadius: "12px",
|
|
701
701
|
padding: "24px",
|
|
@@ -704,27 +704,27 @@ const mr = ({
|
|
|
704
704
|
maxHeight: "90vh",
|
|
705
705
|
overflowY: "auto",
|
|
706
706
|
boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
|
|
707
|
-
transform:
|
|
708
|
-
opacity:
|
|
707
|
+
transform: S ? "scale(1)" : "scale(0.95)",
|
|
708
|
+
opacity: S ? 1 : 0,
|
|
709
709
|
transition: "all 0.2s ease-in-out"
|
|
710
710
|
};
|
|
711
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ n.jsx(
|
|
712
712
|
"div",
|
|
713
713
|
{
|
|
714
|
-
onClick:
|
|
715
|
-
style:
|
|
714
|
+
onClick: I,
|
|
715
|
+
style: f,
|
|
716
716
|
role: "dialog",
|
|
717
717
|
"aria-modal": "true",
|
|
718
718
|
"aria-labelledby": "feedback-modal-title",
|
|
719
|
-
children: /* @__PURE__ */
|
|
719
|
+
children: /* @__PURE__ */ n.jsxs(
|
|
720
720
|
"div",
|
|
721
721
|
{
|
|
722
|
-
ref:
|
|
723
|
-
style:
|
|
722
|
+
ref: F,
|
|
723
|
+
style: re,
|
|
724
724
|
onClick: (i) => i.stopPropagation(),
|
|
725
725
|
children: [
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ n.jsxs("div", { style: { marginBottom: "24px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
727
|
+
/* @__PURE__ */ n.jsx(
|
|
728
728
|
"h2",
|
|
729
729
|
{
|
|
730
730
|
id: "feedback-modal-title",
|
|
@@ -732,30 +732,30 @@ const mr = ({
|
|
|
732
732
|
children: "Send Feedback"
|
|
733
733
|
}
|
|
734
734
|
),
|
|
735
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ n.jsx(
|
|
736
736
|
"button",
|
|
737
737
|
{
|
|
738
|
-
onClick:
|
|
739
|
-
disabled:
|
|
738
|
+
onClick: A,
|
|
739
|
+
disabled: o,
|
|
740
740
|
"aria-label": "Close feedback form",
|
|
741
741
|
style: {
|
|
742
742
|
background: "none",
|
|
743
743
|
border: "none",
|
|
744
744
|
fontSize: "24px",
|
|
745
|
-
cursor:
|
|
745
|
+
cursor: o ? "not-allowed" : "pointer",
|
|
746
746
|
color: "#6b7280",
|
|
747
747
|
padding: "0",
|
|
748
748
|
lineHeight: "1",
|
|
749
|
-
opacity:
|
|
749
|
+
opacity: o ? 0.5 : 1,
|
|
750
750
|
transition: "color 0.2s"
|
|
751
751
|
},
|
|
752
|
-
onMouseEnter: (i) => !
|
|
753
|
-
onMouseLeave: (i) => !
|
|
752
|
+
onMouseEnter: (i) => !o && (i.currentTarget.style.color = "#111827"),
|
|
753
|
+
onMouseLeave: (i) => !o && (i.currentTarget.style.color = "#6b7280"),
|
|
754
754
|
children: "×"
|
|
755
755
|
}
|
|
756
756
|
)
|
|
757
757
|
] }),
|
|
758
|
-
|
|
758
|
+
x === "success" && /* @__PURE__ */ n.jsxs(
|
|
759
759
|
"div",
|
|
760
760
|
{
|
|
761
761
|
style: {
|
|
@@ -773,12 +773,12 @@ const mr = ({
|
|
|
773
773
|
role: "status",
|
|
774
774
|
"aria-live": "polite",
|
|
775
775
|
children: [
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ n.jsx("span", { style: { fontSize: "18px" }, children: "✓" }),
|
|
777
|
+
/* @__PURE__ */ n.jsx("span", { children: "Thank you! Your feedback has been submitted." })
|
|
778
778
|
]
|
|
779
779
|
}
|
|
780
780
|
),
|
|
781
|
-
|
|
781
|
+
j && /* @__PURE__ */ n.jsxs(
|
|
782
782
|
"div",
|
|
783
783
|
{
|
|
784
784
|
style: {
|
|
@@ -795,14 +795,14 @@ const mr = ({
|
|
|
795
795
|
role: "alert",
|
|
796
796
|
"aria-live": "assertive",
|
|
797
797
|
children: [
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ n.jsx("span", { style: { fontSize: "18px" }, children: "⚠" }),
|
|
799
|
+
/* @__PURE__ */ n.jsx("span", { children: j })
|
|
800
800
|
]
|
|
801
801
|
}
|
|
802
802
|
),
|
|
803
|
-
/* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ n.jsxs("form", { onSubmit: q, children: [
|
|
804
|
+
/* @__PURE__ */ n.jsxs("div", { style: { marginBottom: "16px" }, children: [
|
|
805
|
+
/* @__PURE__ */ n.jsx(
|
|
806
806
|
"label",
|
|
807
807
|
{
|
|
808
808
|
htmlFor: "feedback-type",
|
|
@@ -810,13 +810,13 @@ const mr = ({
|
|
|
810
810
|
children: "Type"
|
|
811
811
|
}
|
|
812
812
|
),
|
|
813
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ n.jsxs(
|
|
814
814
|
"select",
|
|
815
815
|
{
|
|
816
816
|
id: "feedback-type",
|
|
817
817
|
value: c.feedbackType,
|
|
818
|
-
onChange: (i) =>
|
|
819
|
-
disabled:
|
|
818
|
+
onChange: (i) => b({ ...c, feedbackType: i.target.value }),
|
|
819
|
+
disabled: o,
|
|
820
820
|
style: {
|
|
821
821
|
width: "100%",
|
|
822
822
|
padding: "8px 12px",
|
|
@@ -824,69 +824,69 @@ const mr = ({
|
|
|
824
824
|
borderRadius: "6px",
|
|
825
825
|
fontSize: "14px",
|
|
826
826
|
backgroundColor: "white",
|
|
827
|
-
cursor:
|
|
828
|
-
opacity:
|
|
827
|
+
cursor: o ? "not-allowed" : "pointer",
|
|
828
|
+
opacity: o ? 0.6 : 1
|
|
829
829
|
},
|
|
830
830
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ n.jsx("option", { value: "general", children: "General Feedback" }),
|
|
832
|
+
/* @__PURE__ */ n.jsx("option", { value: "bug", children: "Bug Report" }),
|
|
833
|
+
/* @__PURE__ */ n.jsx("option", { value: "feature_request", children: "Feature Request" }),
|
|
834
|
+
/* @__PURE__ */ n.jsx("option", { value: "question", children: "Question" }),
|
|
835
|
+
/* @__PURE__ */ n.jsx("option", { value: "praise", children: "Praise" })
|
|
836
836
|
]
|
|
837
837
|
}
|
|
838
838
|
)
|
|
839
839
|
] }),
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ n.jsxs("div", { style: { marginBottom: "16px" }, children: [
|
|
841
|
+
/* @__PURE__ */ n.jsx("label", { style: { display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500", color: "#374151" }, children: "Rating (optional)" }),
|
|
842
|
+
/* @__PURE__ */ n.jsx("div", { style: { display: "flex", gap: "8px" }, role: "group", "aria-label": "Rating", children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ n.jsx(
|
|
843
843
|
"button",
|
|
844
844
|
{
|
|
845
845
|
type: "button",
|
|
846
|
-
onClick: () =>
|
|
847
|
-
disabled:
|
|
846
|
+
onClick: () => b({ ...c, rating: i }),
|
|
847
|
+
disabled: o,
|
|
848
848
|
"aria-label": `Rate ${i} stars`,
|
|
849
849
|
"aria-pressed": c.rating === i,
|
|
850
850
|
style: {
|
|
851
851
|
background: "none",
|
|
852
852
|
border: "none",
|
|
853
853
|
fontSize: "28px",
|
|
854
|
-
cursor:
|
|
854
|
+
cursor: o ? "not-allowed" : "pointer",
|
|
855
855
|
padding: "0",
|
|
856
856
|
color: c.rating && c.rating >= i ? "#fbbf24" : "#d1d5db",
|
|
857
857
|
transition: "all 0.2s",
|
|
858
|
-
opacity:
|
|
858
|
+
opacity: o ? 0.6 : 1,
|
|
859
859
|
transform: "scale(1)"
|
|
860
860
|
},
|
|
861
|
-
onMouseEnter: (
|
|
862
|
-
onMouseLeave: (
|
|
861
|
+
onMouseEnter: (_) => !o && (_.currentTarget.style.transform = "scale(1.2)"),
|
|
862
|
+
onMouseLeave: (_) => !o && (_.currentTarget.style.transform = "scale(1)"),
|
|
863
863
|
children: "★"
|
|
864
864
|
},
|
|
865
865
|
i
|
|
866
866
|
)) })
|
|
867
867
|
] }),
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
/* @__PURE__ */
|
|
868
|
+
/* @__PURE__ */ n.jsxs("div", { style: { marginBottom: "16px" }, children: [
|
|
869
|
+
/* @__PURE__ */ n.jsxs(
|
|
870
870
|
"label",
|
|
871
871
|
{
|
|
872
872
|
htmlFor: "feedback-text",
|
|
873
873
|
style: { display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500", color: "#374151" },
|
|
874
874
|
children: [
|
|
875
875
|
"Your Feedback ",
|
|
876
|
-
/* @__PURE__ */
|
|
876
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#ef4444" }, children: "*" })
|
|
877
877
|
]
|
|
878
878
|
}
|
|
879
879
|
),
|
|
880
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ n.jsx(
|
|
881
881
|
"textarea",
|
|
882
882
|
{
|
|
883
883
|
id: "feedback-text",
|
|
884
|
-
ref:
|
|
884
|
+
ref: B,
|
|
885
885
|
value: c.text,
|
|
886
|
-
onChange: (i) =>
|
|
886
|
+
onChange: (i) => b({ ...c, text: i.target.value }),
|
|
887
887
|
placeholder: "Tell us what you think...",
|
|
888
888
|
required: !0,
|
|
889
|
-
disabled:
|
|
889
|
+
disabled: o,
|
|
890
890
|
rows: 4,
|
|
891
891
|
"aria-required": "true",
|
|
892
892
|
style: {
|
|
@@ -897,14 +897,14 @@ const mr = ({
|
|
|
897
897
|
fontSize: "14px",
|
|
898
898
|
resize: "vertical",
|
|
899
899
|
fontFamily: "inherit",
|
|
900
|
-
opacity:
|
|
901
|
-
cursor:
|
|
900
|
+
opacity: o ? 0.6 : 1,
|
|
901
|
+
cursor: o ? "not-allowed" : "text"
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
] }),
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ n.jsxs("div", { style: { marginBottom: "16px" }, children: [
|
|
907
|
+
/* @__PURE__ */ n.jsx(
|
|
908
908
|
"label",
|
|
909
909
|
{
|
|
910
910
|
htmlFor: "feedback-name",
|
|
@@ -912,28 +912,28 @@ const mr = ({
|
|
|
912
912
|
children: "Name (optional)"
|
|
913
913
|
}
|
|
914
914
|
),
|
|
915
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ n.jsx(
|
|
916
916
|
"input",
|
|
917
917
|
{
|
|
918
918
|
id: "feedback-name",
|
|
919
919
|
type: "text",
|
|
920
920
|
value: c.userName,
|
|
921
|
-
onChange: (i) =>
|
|
921
|
+
onChange: (i) => b({ ...c, userName: i.target.value }),
|
|
922
922
|
placeholder: "Your name",
|
|
923
|
-
disabled:
|
|
923
|
+
disabled: o,
|
|
924
924
|
style: {
|
|
925
925
|
width: "100%",
|
|
926
926
|
padding: "8px 12px",
|
|
927
927
|
border: "1px solid #d1d5db",
|
|
928
928
|
borderRadius: "6px",
|
|
929
929
|
fontSize: "14px",
|
|
930
|
-
opacity:
|
|
930
|
+
opacity: o ? 0.6 : 1
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
)
|
|
934
934
|
] }),
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ n.jsxs("div", { style: { marginBottom: "24px" }, children: [
|
|
936
|
+
/* @__PURE__ */ n.jsx(
|
|
937
937
|
"label",
|
|
938
938
|
{
|
|
939
939
|
htmlFor: "feedback-email",
|
|
@@ -941,33 +941,33 @@ const mr = ({
|
|
|
941
941
|
children: "Email (optional)"
|
|
942
942
|
}
|
|
943
943
|
),
|
|
944
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ n.jsx(
|
|
945
945
|
"input",
|
|
946
946
|
{
|
|
947
947
|
id: "feedback-email",
|
|
948
948
|
type: "email",
|
|
949
949
|
value: c.userEmail,
|
|
950
|
-
onChange: (i) =>
|
|
950
|
+
onChange: (i) => b({ ...c, userEmail: i.target.value }),
|
|
951
951
|
placeholder: "your@email.com",
|
|
952
|
-
disabled:
|
|
952
|
+
disabled: o,
|
|
953
953
|
style: {
|
|
954
954
|
width: "100%",
|
|
955
955
|
padding: "8px 12px",
|
|
956
956
|
border: "1px solid #d1d5db",
|
|
957
957
|
borderRadius: "6px",
|
|
958
958
|
fontSize: "14px",
|
|
959
|
-
opacity:
|
|
959
|
+
opacity: o ? 0.6 : 1
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
)
|
|
963
963
|
] }),
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", gap: "12px", justifyContent: "flex-end" }, children: [
|
|
965
|
+
/* @__PURE__ */ n.jsx(
|
|
966
966
|
"button",
|
|
967
967
|
{
|
|
968
968
|
type: "button",
|
|
969
|
-
onClick:
|
|
970
|
-
disabled:
|
|
969
|
+
onClick: A,
|
|
970
|
+
disabled: o,
|
|
971
971
|
style: {
|
|
972
972
|
padding: "10px 20px",
|
|
973
973
|
border: "1px solid #d1d5db",
|
|
@@ -976,37 +976,37 @@ const mr = ({
|
|
|
976
976
|
color: "#374151",
|
|
977
977
|
fontSize: "14px",
|
|
978
978
|
fontWeight: "500",
|
|
979
|
-
cursor:
|
|
980
|
-
opacity:
|
|
979
|
+
cursor: o ? "not-allowed" : "pointer",
|
|
980
|
+
opacity: o ? 0.5 : 1,
|
|
981
981
|
transition: "all 0.2s"
|
|
982
982
|
},
|
|
983
|
-
onMouseEnter: (i) => !
|
|
984
|
-
onMouseLeave: (i) => !
|
|
983
|
+
onMouseEnter: (i) => !o && (i.currentTarget.style.backgroundColor = "#f9fafb"),
|
|
984
|
+
onMouseLeave: (i) => !o && (i.currentTarget.style.backgroundColor = "white"),
|
|
985
985
|
children: "Cancel"
|
|
986
986
|
}
|
|
987
987
|
),
|
|
988
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ n.jsxs(
|
|
989
989
|
"button",
|
|
990
990
|
{
|
|
991
991
|
type: "submit",
|
|
992
|
-
disabled:
|
|
992
|
+
disabled: o || x === "success",
|
|
993
993
|
style: {
|
|
994
994
|
padding: "10px 20px",
|
|
995
995
|
border: "none",
|
|
996
996
|
borderRadius: "6px",
|
|
997
|
-
backgroundColor:
|
|
997
|
+
backgroundColor: x === "success" ? "#10b981" : "#3b82f6",
|
|
998
998
|
color: "white",
|
|
999
999
|
fontSize: "14px",
|
|
1000
1000
|
fontWeight: "500",
|
|
1001
|
-
cursor:
|
|
1002
|
-
opacity:
|
|
1001
|
+
cursor: o || x === "success" ? "not-allowed" : "pointer",
|
|
1002
|
+
opacity: o ? 0.7 : 1,
|
|
1003
1003
|
transition: "all 0.2s",
|
|
1004
1004
|
display: "flex",
|
|
1005
1005
|
alignItems: "center",
|
|
1006
1006
|
gap: "8px"
|
|
1007
1007
|
},
|
|
1008
1008
|
children: [
|
|
1009
|
-
|
|
1009
|
+
o && /* @__PURE__ */ n.jsx(
|
|
1010
1010
|
"span",
|
|
1011
1011
|
{
|
|
1012
1012
|
style: {
|
|
@@ -1020,13 +1020,13 @@ const mr = ({
|
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
1022
|
),
|
|
1023
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ n.jsx("span", { children: o ? "Sending..." : x === "success" ? "✓ Sent!" : "Send Feedback" })
|
|
1024
1024
|
]
|
|
1025
1025
|
}
|
|
1026
1026
|
)
|
|
1027
1027
|
] })
|
|
1028
1028
|
] }),
|
|
1029
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ n.jsx("style", { children: `
|
|
1030
1030
|
@keyframes spin {
|
|
1031
1031
|
to { transform: rotate(360deg); }
|
|
1032
1032
|
}
|
|
@@ -1047,82 +1047,86 @@ const mr = ({
|
|
|
1047
1047
|
}
|
|
1048
1048
|
);
|
|
1049
1049
|
};
|
|
1050
|
-
async function
|
|
1050
|
+
async function mr(p, m, C) {
|
|
1051
1051
|
const c = {
|
|
1052
1052
|
"Content-Type": "application/json"
|
|
1053
1053
|
};
|
|
1054
|
-
|
|
1054
|
+
C && (c.Authorization = `Bearer ${C}`);
|
|
1055
1055
|
try {
|
|
1056
|
-
const
|
|
1056
|
+
const b = await fetch(`${p}/api/feedback`, {
|
|
1057
1057
|
method: "POST",
|
|
1058
1058
|
headers: c,
|
|
1059
|
-
body: JSON.stringify(
|
|
1059
|
+
body: JSON.stringify(m)
|
|
1060
1060
|
});
|
|
1061
|
-
if (!
|
|
1062
|
-
const
|
|
1063
|
-
throw new Error(
|
|
1061
|
+
if (!b.ok) {
|
|
1062
|
+
const o = await b.json().catch(() => ({}));
|
|
1063
|
+
throw new Error(o.message || `HTTP ${b.status}: ${b.statusText}`);
|
|
1064
1064
|
}
|
|
1065
|
-
return await
|
|
1066
|
-
} catch (
|
|
1067
|
-
throw
|
|
1065
|
+
return await b.json();
|
|
1066
|
+
} catch (b) {
|
|
1067
|
+
throw b instanceof Error ? b : new Error("Failed to submit feedback");
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
const Er = (
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1073
|
-
const c = parseInt(
|
|
1074
|
-
return `#${
|
|
1070
|
+
const Er = (p, m = 0.12) => {
|
|
1071
|
+
const C = /^#([0-9a-fA-F]{6})$/.exec(p);
|
|
1072
|
+
if (!C) return p;
|
|
1073
|
+
const c = parseInt(C[1], 16), b = Math.max(0, Math.min(255, Math.round((c >> 16 & 255) * (1 - m)))), o = Math.max(0, Math.min(255, Math.round((c >> 8 & 255) * (1 - m)))), R = Math.max(0, Math.min(255, Math.round((c & 255) * (1 - m)))), x = (g) => g.toString(16).padStart(2, "0");
|
|
1074
|
+
return `#${x(b)}${x(o)}${x(R)}`;
|
|
1075
1075
|
}, kr = ({
|
|
1076
|
-
projectId:
|
|
1077
|
-
apiKey:
|
|
1078
|
-
apiUrl:
|
|
1076
|
+
projectId: p,
|
|
1077
|
+
apiKey: m,
|
|
1078
|
+
apiUrl: C = "https://metricshift-sdk-be-production.up.railway.app",
|
|
1079
1079
|
// Text & display
|
|
1080
1080
|
buttonText: c = "Feedback",
|
|
1081
|
-
|
|
1082
|
-
|
|
1081
|
+
subtitleText: b,
|
|
1082
|
+
showIcon: o = !1,
|
|
1083
|
+
// Avatar
|
|
1084
|
+
avatarSrc: R,
|
|
1085
|
+
avatarAlt: x,
|
|
1086
|
+
avatarSize: g = 40,
|
|
1083
1087
|
// Position & size
|
|
1084
|
-
position:
|
|
1085
|
-
size:
|
|
1088
|
+
position: j = "bottom-right",
|
|
1089
|
+
size: v = "medium",
|
|
1086
1090
|
// Legacy styling / overrides
|
|
1087
|
-
buttonColor:
|
|
1088
|
-
buttonHoverColor:
|
|
1089
|
-
buttonTextColor:
|
|
1090
|
-
customStyles:
|
|
1091
|
-
customClassName:
|
|
1091
|
+
buttonColor: S,
|
|
1092
|
+
buttonHoverColor: T,
|
|
1093
|
+
buttonTextColor: F,
|
|
1094
|
+
customStyles: B,
|
|
1095
|
+
customClassName: A = "",
|
|
1092
1096
|
// New styling API
|
|
1093
|
-
variant:
|
|
1094
|
-
accentColor:
|
|
1097
|
+
variant: q = "outline",
|
|
1098
|
+
accentColor: I,
|
|
1095
1099
|
// Behavior
|
|
1096
|
-
disabled:
|
|
1097
|
-
autoOpen:
|
|
1100
|
+
disabled: f = !1,
|
|
1101
|
+
autoOpen: re = !1,
|
|
1098
1102
|
// Callbacks
|
|
1099
|
-
onOpen:
|
|
1100
|
-
onClose:
|
|
1101
|
-
onSuccess:
|
|
1102
|
-
onError:
|
|
1103
|
+
onOpen: i,
|
|
1104
|
+
onClose: _,
|
|
1105
|
+
onSuccess: ce,
|
|
1106
|
+
onError: ue
|
|
1103
1107
|
}) => {
|
|
1104
|
-
const [
|
|
1105
|
-
|
|
1106
|
-
},
|
|
1107
|
-
|
|
1108
|
-
},
|
|
1108
|
+
const [fe, te] = Y(re), [de, pe] = Y(!1), [be, O] = Y(!1), M = () => {
|
|
1109
|
+
f || (te(!0), i == null || i());
|
|
1110
|
+
}, L = () => {
|
|
1111
|
+
te(!1), _ == null || _();
|
|
1112
|
+
}, ge = async (E) => {
|
|
1109
1113
|
try {
|
|
1110
|
-
const
|
|
1111
|
-
...
|
|
1112
|
-
project_id:
|
|
1114
|
+
const D = {
|
|
1115
|
+
...E,
|
|
1116
|
+
project_id: p,
|
|
1113
1117
|
page_url: window.location.href,
|
|
1114
1118
|
page_title: document.title,
|
|
1115
1119
|
user_agent: navigator.userAgent,
|
|
1116
|
-
user_identifier:
|
|
1117
|
-
user_email:
|
|
1118
|
-
user_name:
|
|
1119
|
-
feedback_type:
|
|
1120
|
-
},
|
|
1121
|
-
|
|
1122
|
-
} catch (
|
|
1123
|
-
throw
|
|
1120
|
+
user_identifier: E.userEmail || "anonymous",
|
|
1121
|
+
user_email: E.userEmail,
|
|
1122
|
+
user_name: E.userName,
|
|
1123
|
+
feedback_type: E.feedbackType
|
|
1124
|
+
}, Q = await mr(C, D, m);
|
|
1125
|
+
ce && (Q != null && Q.id) && ce(Q.id);
|
|
1126
|
+
} catch (D) {
|
|
1127
|
+
throw ue && D instanceof Error && ue(D), D;
|
|
1124
1128
|
}
|
|
1125
|
-
},
|
|
1129
|
+
}, ve = {
|
|
1126
1130
|
small: {
|
|
1127
1131
|
padding: "6px 14px",
|
|
1128
1132
|
fontSize: "13px",
|
|
@@ -1138,124 +1142,180 @@ const Er = (d, E = 0.12) => {
|
|
|
1138
1142
|
fontSize: "17px",
|
|
1139
1143
|
iconSize: "22px"
|
|
1140
1144
|
}
|
|
1141
|
-
},
|
|
1142
|
-
if (
|
|
1145
|
+
}, ne = !!R, he = () => {
|
|
1146
|
+
if (j === "inline")
|
|
1143
1147
|
return {
|
|
1144
|
-
display: "inline-flex",
|
|
1145
1148
|
position: "relative"
|
|
1146
1149
|
};
|
|
1147
|
-
const
|
|
1150
|
+
const E = {
|
|
1148
1151
|
position: "fixed",
|
|
1149
1152
|
zIndex: 9999
|
|
1150
1153
|
};
|
|
1151
|
-
return
|
|
1152
|
-
},
|
|
1153
|
-
let
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1154
|
+
return j.includes("bottom") ? E.bottom = "20px" : E.top = "20px", j.includes("right") ? E.right = "20px" : E.left = "20px", E;
|
|
1155
|
+
}, H = ve[v], xe = he(), J = I ?? S ?? "#111827", K = j !== "inline" ? "0 12px 30px rgba(15, 23, 42, 0.12)" : "none";
|
|
1156
|
+
let N = "#ffffff", ae = "#f3f4f6", W = F || J, z = "rgba(15, 23, 42, 0.08)", $ = 1;
|
|
1157
|
+
q === "solid" ? (N = S || J, ae = T || Er(N, 0.12), W = F || "#ffffff", z = "transparent", $ = 0) : q === "ghost" && (N = "transparent", ae = "#f3f4f6", W = F || J, z = "transparent", $ = 0);
|
|
1158
|
+
const oe = {
|
|
1159
|
+
// hosts can override these via .ms-feedback-button selector
|
|
1160
|
+
"--ms-feedback-bg": N,
|
|
1161
|
+
"--ms-feedback-color": W,
|
|
1162
|
+
"--ms-feedback-border": z,
|
|
1163
|
+
"--ms-feedback-radius": "9999px",
|
|
1164
|
+
"--ms-feedback-shadow": K
|
|
1165
|
+
}, Se = ne ? {
|
|
1166
|
+
small: "8px 14px",
|
|
1167
|
+
medium: "12px 18px",
|
|
1168
|
+
large: "16px 24px"
|
|
1169
|
+
}[v] : H.padding, ye = {
|
|
1170
|
+
...oe,
|
|
1171
|
+
padding: Se,
|
|
1172
|
+
backgroundColor: de && !f ? ae : N,
|
|
1173
|
+
color: W,
|
|
1174
|
+
border: $ ? `1px solid ${z}` : "1px solid transparent",
|
|
1169
1175
|
borderRadius: "9999px",
|
|
1170
|
-
fontSize:
|
|
1176
|
+
fontSize: H.fontSize,
|
|
1171
1177
|
fontWeight: 600,
|
|
1172
|
-
cursor:
|
|
1178
|
+
cursor: f ? "not-allowed" : "pointer",
|
|
1173
1179
|
display: "flex",
|
|
1174
1180
|
alignItems: "center",
|
|
1175
1181
|
justifyContent: "center",
|
|
1176
1182
|
gap: "8px",
|
|
1177
|
-
boxShadow:
|
|
1183
|
+
boxShadow: be ? `${K}, 0 0 0 3px rgba(59,130,246,0.45)` : K,
|
|
1178
1184
|
transition: "all 0.2s ease",
|
|
1179
|
-
opacity:
|
|
1180
|
-
transform:
|
|
1185
|
+
opacity: f ? 0.6 : 1,
|
|
1186
|
+
transform: de && !f ? "translateY(-2px)" : "translateY(0)",
|
|
1181
1187
|
outline: "none",
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1188
|
+
position: "relative",
|
|
1189
|
+
...B
|
|
1190
|
+
}, ke = {
|
|
1191
|
+
fontSize: H.iconSize,
|
|
1185
1192
|
lineHeight: 1,
|
|
1186
1193
|
display: "flex",
|
|
1187
1194
|
alignItems: "center"
|
|
1195
|
+
}, Re = {
|
|
1196
|
+
display: "flex",
|
|
1197
|
+
flexDirection: "column",
|
|
1198
|
+
alignItems: "flex-start",
|
|
1199
|
+
lineHeight: 1.2
|
|
1200
|
+
}, G = {
|
|
1201
|
+
fontWeight: 600,
|
|
1202
|
+
fontSize: "inherit"
|
|
1203
|
+
}, U = {
|
|
1204
|
+
marginTop: "2px",
|
|
1205
|
+
fontWeight: 400,
|
|
1206
|
+
fontSize: "12px",
|
|
1207
|
+
opacity: 0.9
|
|
1208
|
+
}, me = {
|
|
1209
|
+
...xe,
|
|
1210
|
+
display: "inline-flex",
|
|
1211
|
+
alignItems: "center",
|
|
1212
|
+
justifyContent: "center"
|
|
1213
|
+
}, Ee = {
|
|
1214
|
+
position: "absolute",
|
|
1215
|
+
top: 0,
|
|
1216
|
+
left: "50%",
|
|
1217
|
+
transform: "translate(-50%, -75%)",
|
|
1218
|
+
// lifted higher
|
|
1219
|
+
width: g,
|
|
1220
|
+
height: g,
|
|
1221
|
+
borderRadius: "9999px",
|
|
1222
|
+
overflow: "hidden",
|
|
1223
|
+
boxShadow: "0 8px 22px rgba(15,23,42,0.22)",
|
|
1224
|
+
border: "2px solid #ffffff",
|
|
1225
|
+
backgroundColor: "#e5e7eb",
|
|
1226
|
+
display: "flex",
|
|
1227
|
+
alignItems: "center",
|
|
1228
|
+
justifyContent: "center",
|
|
1229
|
+
zIndex: 1,
|
|
1230
|
+
pointerEvents: "none"
|
|
1231
|
+
}, X = {
|
|
1232
|
+
width: "100%",
|
|
1233
|
+
height: "100%",
|
|
1234
|
+
objectFit: "cover"
|
|
1188
1235
|
};
|
|
1189
|
-
return /* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
"
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1236
|
+
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1237
|
+
/* @__PURE__ */ n.jsxs("div", { style: me, children: [
|
|
1238
|
+
ne && /* @__PURE__ */ n.jsx("div", { style: Ee, "aria-hidden": x ? void 0 : !0, children: R && /* @__PURE__ */ n.jsx(
|
|
1239
|
+
"img",
|
|
1240
|
+
{
|
|
1241
|
+
src: R,
|
|
1242
|
+
alt: x || "",
|
|
1243
|
+
style: X
|
|
1244
|
+
}
|
|
1245
|
+
) }),
|
|
1246
|
+
/* @__PURE__ */ n.jsxs(
|
|
1247
|
+
"button",
|
|
1248
|
+
{
|
|
1249
|
+
onClick: M,
|
|
1250
|
+
onMouseEnter: () => !f && pe(!0),
|
|
1251
|
+
onMouseLeave: () => !f && pe(!1),
|
|
1252
|
+
onFocus: () => O(!0),
|
|
1253
|
+
onBlur: () => O(!1),
|
|
1254
|
+
disabled: f,
|
|
1255
|
+
className: `ms-feedback-button ${A}`.trim(),
|
|
1256
|
+
style: ye,
|
|
1257
|
+
"aria-label": "Open feedback form",
|
|
1258
|
+
"aria-pressed": fe,
|
|
1259
|
+
"aria-disabled": f,
|
|
1260
|
+
role: "button",
|
|
1261
|
+
tabIndex: f ? -1 : 0,
|
|
1262
|
+
onKeyDown: (E) => {
|
|
1263
|
+
!f && (E.key === "Enter" || E.key === " ") && (E.preventDefault(), M());
|
|
1264
|
+
},
|
|
1265
|
+
children: [
|
|
1266
|
+
o && /* @__PURE__ */ n.jsx("span", { style: ke, "aria-hidden": "true", children: "💬" }),
|
|
1267
|
+
/* @__PURE__ */ n.jsxs("div", { style: Re, children: [
|
|
1268
|
+
/* @__PURE__ */ n.jsx("span", { style: G, children: c }),
|
|
1269
|
+
b && /* @__PURE__ */ n.jsx("span", { style: U, children: b })
|
|
1270
|
+
] })
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
)
|
|
1274
|
+
] }),
|
|
1275
|
+
/* @__PURE__ */ n.jsx(
|
|
1276
|
+
yr,
|
|
1217
1277
|
{
|
|
1218
|
-
isOpen:
|
|
1219
|
-
onClose:
|
|
1220
|
-
onSubmit:
|
|
1278
|
+
isOpen: fe,
|
|
1279
|
+
onClose: L,
|
|
1280
|
+
onSubmit: ge
|
|
1221
1281
|
}
|
|
1222
1282
|
)
|
|
1223
1283
|
] });
|
|
1224
|
-
},
|
|
1225
|
-
const
|
|
1226
|
-
if (!
|
|
1284
|
+
}, Ke = gr(null), Rr = () => {
|
|
1285
|
+
const p = vr(Ke);
|
|
1286
|
+
if (!p)
|
|
1227
1287
|
throw new Error("useMetricShift must be used within MetricShiftProvider");
|
|
1228
|
-
return
|
|
1229
|
-
},
|
|
1230
|
-
config:
|
|
1231
|
-
children:
|
|
1232
|
-
}) => /* @__PURE__ */
|
|
1233
|
-
let
|
|
1234
|
-
const
|
|
1288
|
+
return p;
|
|
1289
|
+
}, jr = ({
|
|
1290
|
+
config: p,
|
|
1291
|
+
children: m
|
|
1292
|
+
}) => /* @__PURE__ */ n.jsx(Ke.Provider, { value: p, children: m });
|
|
1293
|
+
let Te = null;
|
|
1294
|
+
const _r = {
|
|
1235
1295
|
/**
|
|
1236
1296
|
* Initialize the MetricShift SDK
|
|
1237
1297
|
* @param config - SDK configuration
|
|
1238
1298
|
*/
|
|
1239
|
-
init: (
|
|
1240
|
-
|
|
1299
|
+
init: (p) => {
|
|
1300
|
+
Te = {
|
|
1241
1301
|
apiUrl: "http://localhost:3000",
|
|
1242
|
-
...
|
|
1302
|
+
...p
|
|
1243
1303
|
}, console.log("✅ MetricShift SDK initialized", {
|
|
1244
|
-
projectId:
|
|
1245
|
-
apiUrl:
|
|
1304
|
+
projectId: p.projectId,
|
|
1305
|
+
apiUrl: Te.apiUrl
|
|
1246
1306
|
});
|
|
1247
1307
|
},
|
|
1248
1308
|
/**
|
|
1249
1309
|
* Get current SDK configuration
|
|
1250
1310
|
*/
|
|
1251
|
-
getConfig: () =>
|
|
1311
|
+
getConfig: () => Te
|
|
1252
1312
|
};
|
|
1253
1313
|
export {
|
|
1254
1314
|
kr as FeedbackButton,
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1315
|
+
yr as FeedbackModal,
|
|
1316
|
+
_r as MetricShift,
|
|
1317
|
+
jr as MetricShiftProvider,
|
|
1318
|
+
mr as submitFeedback,
|
|
1259
1319
|
Rr as useMetricShift
|
|
1260
1320
|
};
|
|
1261
1321
|
//# sourceMappingURL=index.esm.js.map
|