@tekibo/feedpulse-sdk 0.7.0 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.mjs CHANGED
@@ -1,116 +1,116 @@
1
- import ie, { useState as p, useEffect as G, useCallback as oe, useRef as H, useMemo as le, createContext as ce, useContext as de } from "react";
2
- import { CookieManager as K, FeedPulseTracker as ue } from "./index.mjs";
3
- import { S as fe } from "./struggle-detector-BqTHgw95.mjs";
4
- var q = { exports: {} }, W = {};
5
- var ee;
6
- function pe() {
7
- if (ee) return W;
8
- ee = 1;
9
- var o = /* @__PURE__ */ Symbol.for("react.transitional.element"), g = /* @__PURE__ */ Symbol.for("react.fragment");
10
- function a(h, s, i) {
1
+ import ge, { useState as c, useEffect as te, useCallback as be, useRef as X, useMemo as he, createContext as me, useContext as ye } from "react";
2
+ import { CookieManager as ce, CursorActor as ke, FeedPulseTracker as ve } from "./index.mjs";
3
+ import { S as we } from "./struggle-detector-BqTHgw95.mjs";
4
+ var ee = { exports: {} }, G = {};
5
+ var de;
6
+ function je() {
7
+ if (de) return G;
8
+ de = 1;
9
+ var s = /* @__PURE__ */ Symbol.for("react.transitional.element"), k = /* @__PURE__ */ Symbol.for("react.fragment");
10
+ function a(h, i, l) {
11
11
  var b = null;
12
- if (i !== void 0 && (b = "" + i), s.key !== void 0 && (b = "" + s.key), "key" in s) {
13
- i = {};
14
- for (var x in s)
15
- x !== "key" && (i[x] = s[x]);
16
- } else i = s;
17
- return s = i.ref, {
18
- $$typeof: o,
12
+ if (l !== void 0 && (b = "" + l), i.key !== void 0 && (b = "" + i.key), "key" in i) {
13
+ l = {};
14
+ for (var x in i)
15
+ x !== "key" && (l[x] = i[x]);
16
+ } else l = i;
17
+ return i = l.ref, {
18
+ $$typeof: s,
19
19
  type: h,
20
20
  key: b,
21
- ref: s !== void 0 ? s : null,
22
- props: i
21
+ ref: i !== void 0 ? i : null,
22
+ props: l
23
23
  };
24
24
  }
25
- return W.Fragment = g, W.jsx = a, W.jsxs = a, W;
25
+ return G.Fragment = k, G.jsx = a, G.jsxs = a, G;
26
26
  }
27
- var L = {};
28
- var te;
29
- function be() {
30
- return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
31
- function o(e) {
27
+ var H = {};
28
+ var ue;
29
+ function Se() {
30
+ return ue || (ue = 1, process.env.NODE_ENV !== "production" && (function() {
31
+ function s(e) {
32
32
  if (e == null) return null;
33
33
  if (typeof e == "function")
34
- return e.$$typeof === I ? null : e.displayName || e.name || null;
34
+ return e.$$typeof === Y ? null : e.displayName || e.name || null;
35
35
  if (typeof e == "string") return e;
36
36
  switch (e) {
37
- case D:
37
+ case T:
38
38
  return "Fragment";
39
- case Y:
39
+ case oe:
40
40
  return "Profiler";
41
- case X:
41
+ case ne:
42
42
  return "StrictMode";
43
- case M:
43
+ case se:
44
44
  return "Suspense";
45
- case B:
45
+ case ae:
46
46
  return "SuspenseList";
47
- case J:
47
+ case Q:
48
48
  return "Activity";
49
49
  }
50
50
  if (typeof e == "object")
51
51
  switch (typeof e.tag == "number" && console.error(
52
52
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
53
53
  ), e.$$typeof) {
54
- case A:
54
+ case re:
55
55
  return "Portal";
56
- case $:
57
- return e.displayName || "Context";
58
56
  case Z:
57
+ return e.displayName || "Context";
58
+ case L:
59
59
  return (e._context.displayName || "Context") + ".Consumer";
60
- case O:
60
+ case A:
61
61
  var r = e.render;
62
62
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
63
- case C:
64
- return r = e.displayName || null, r !== null ? r : o(e.type) || "Memo";
65
- case R:
63
+ case $:
64
+ return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
65
+ case B:
66
66
  r = e._payload, e = e._init;
67
67
  try {
68
- return o(e(r));
68
+ return s(e(r));
69
69
  } catch {
70
70
  }
71
71
  }
72
72
  return null;
73
73
  }
74
- function g(e) {
74
+ function k(e) {
75
75
  return "" + e;
76
76
  }
77
77
  function a(e) {
78
78
  try {
79
- g(e);
79
+ k(e);
80
80
  var r = !1;
81
81
  } catch {
82
82
  r = !0;
83
83
  }
84
84
  if (r) {
85
85
  r = console;
86
- var n = r.error, f = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
+ var n = r.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
87
87
  return n.call(
88
88
  r,
89
89
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
90
- f
91
- ), g(e);
90
+ u
91
+ ), k(e);
92
92
  }
93
93
  }
94
94
  function h(e) {
95
- if (e === D) return "<>";
96
- if (typeof e == "object" && e !== null && e.$$typeof === R)
95
+ if (e === T) return "<>";
96
+ if (typeof e == "object" && e !== null && e.$$typeof === B)
97
97
  return "<...>";
98
98
  try {
99
- var r = o(e);
99
+ var r = s(e);
100
100
  return r ? "<" + r + ">" : "<...>";
101
101
  } catch {
102
102
  return "<...>";
103
103
  }
104
104
  }
105
- function s() {
106
- var e = N.A;
105
+ function i() {
106
+ var e = C.A;
107
107
  return e === null ? null : e.getOwner();
108
108
  }
109
- function i() {
109
+ function l() {
110
110
  return Error("react-stack-top-frame");
111
111
  }
112
112
  function b(e) {
113
- if (S.call(e, "key")) {
113
+ if (J.call(e, "key")) {
114
114
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
115
115
  if (r && r.isReactWarning) return !1;
116
116
  }
@@ -128,23 +128,23 @@ function be() {
128
128
  configurable: !0
129
129
  });
130
130
  }
131
- function k() {
132
- var e = o(this.type);
133
- return V[e] || (V[e] = !0, console.error(
131
+ function g() {
132
+ var e = s(this.type);
133
+ return O[e] || (O[e] = !0, console.error(
134
134
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
135
135
  )), e = this.props.ref, e !== void 0 ? e : null;
136
136
  }
137
- function c(e, r, n, f, E, v) {
138
- var l = n.ref;
137
+ function o(e, r, n, u, D, W) {
138
+ var f = n.ref;
139
139
  return e = {
140
- $$typeof: w,
140
+ $$typeof: j,
141
141
  type: e,
142
142
  key: r,
143
143
  props: n,
144
- _owner: f
145
- }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
144
+ _owner: u
145
+ }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
146
146
  enumerable: !1,
147
- get: k
147
+ get: g
148
148
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
149
149
  configurable: !1,
150
150
  enumerable: !1,
@@ -159,132 +159,132 @@ function be() {
159
159
  configurable: !1,
160
160
  enumerable: !1,
161
161
  writable: !0,
162
- value: E
162
+ value: D
163
163
  }), Object.defineProperty(e, "_debugTask", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
166
166
  writable: !0,
167
- value: v
167
+ value: W
168
168
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
169
169
  }
170
- function u(e, r, n, f, E, v) {
171
- var l = r.children;
172
- if (l !== void 0)
173
- if (f)
174
- if (Q(l)) {
175
- for (f = 0; f < l.length; f++)
176
- y(l[f]);
177
- Object.freeze && Object.freeze(l);
170
+ function d(e, r, n, u, D, W) {
171
+ var f = r.children;
172
+ if (f !== void 0)
173
+ if (u)
174
+ if (P(f)) {
175
+ for (u = 0; u < f.length; u++)
176
+ m(f[u]);
177
+ Object.freeze && Object.freeze(f);
178
178
  } else
179
179
  console.error(
180
180
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
181
181
  );
182
- else y(l);
183
- if (S.call(r, "key")) {
184
- l = o(e);
185
- var _ = Object.keys(r).filter(function(se) {
186
- return se !== "key";
182
+ else m(f);
183
+ if (J.call(r, "key")) {
184
+ f = s(e);
185
+ var E = Object.keys(r).filter(function(ie) {
186
+ return ie !== "key";
187
187
  });
188
- f = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", P[l + f] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
188
+ u = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", I[f + u] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
189
189
  `A props object containing a "key" prop is being spread into JSX:
190
190
  let props = %s;
191
191
  <%s {...props} />
192
192
  React keys must be passed directly to JSX without using spread:
193
193
  let props = %s;
194
194
  <%s key={someKey} {...props} />`,
195
+ u,
195
196
  f,
196
- l,
197
- _,
198
- l
199
- ), P[l + f] = !0);
197
+ E,
198
+ f
199
+ ), I[f + u] = !0);
200
200
  }
201
- if (l = null, n !== void 0 && (a(n), l = "" + n), b(r) && (a(r.key), l = "" + r.key), "key" in r) {
201
+ if (f = null, n !== void 0 && (a(n), f = "" + n), b(r) && (a(r.key), f = "" + r.key), "key" in r) {
202
202
  n = {};
203
- for (var T in r)
204
- T !== "key" && (n[T] = r[T]);
203
+ for (var M in r)
204
+ M !== "key" && (n[M] = r[M]);
205
205
  } else n = r;
206
- return l && x(
206
+ return f && x(
207
207
  n,
208
208
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
209
- ), c(
209
+ ), o(
210
210
  e,
211
- l,
211
+ f,
212
212
  n,
213
- s(),
214
- E,
215
- v
213
+ i(),
214
+ D,
215
+ W
216
216
  );
217
217
  }
218
- function y(e) {
219
- j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === R && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
+ function m(e) {
219
+ w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === B && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
220
220
  }
221
- function j(e) {
222
- return typeof e == "object" && e !== null && e.$$typeof === w;
221
+ function w(e) {
222
+ return typeof e == "object" && e !== null && e.$$typeof === j;
223
223
  }
224
- var d = ie, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), D = /* @__PURE__ */ Symbol.for("react.fragment"), X = /* @__PURE__ */ Symbol.for("react.strict_mode"), Y = /* @__PURE__ */ Symbol.for("react.profiler"), Z = /* @__PURE__ */ Symbol.for("react.consumer"), $ = /* @__PURE__ */ Symbol.for("react.context"), O = /* @__PURE__ */ Symbol.for("react.forward_ref"), M = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), R = /* @__PURE__ */ Symbol.for("react.lazy"), J = /* @__PURE__ */ Symbol.for("react.activity"), I = /* @__PURE__ */ Symbol.for("react.client.reference"), N = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, Q = Array.isArray, F = console.createTask ? console.createTask : function() {
224
+ var p = ge, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), re = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), ne = /* @__PURE__ */ Symbol.for("react.strict_mode"), oe = /* @__PURE__ */ Symbol.for("react.profiler"), L = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), A = /* @__PURE__ */ Symbol.for("react.forward_ref"), se = /* @__PURE__ */ Symbol.for("react.suspense"), ae = /* @__PURE__ */ Symbol.for("react.suspense_list"), $ = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), Q = /* @__PURE__ */ Symbol.for("react.activity"), Y = /* @__PURE__ */ Symbol.for("react.client.reference"), C = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, P = Array.isArray, S = console.createTask ? console.createTask : function() {
225
225
  return null;
226
226
  };
227
- d = {
227
+ p = {
228
228
  react_stack_bottom_frame: function(e) {
229
229
  return e();
230
230
  }
231
231
  };
232
- var U, V = {}, m = d.react_stack_bottom_frame.bind(
233
- d,
234
- i
235
- )(), z = F(h(i)), P = {};
236
- L.Fragment = D, L.jsx = function(e, r, n) {
237
- var f = 1e4 > N.recentlyCreatedOwnerStacks++;
238
- return u(
232
+ var U, O = {}, V = p.react_stack_bottom_frame.bind(
233
+ p,
234
+ l
235
+ )(), R = S(h(l)), I = {};
236
+ H.Fragment = T, H.jsx = function(e, r, n) {
237
+ var u = 1e4 > C.recentlyCreatedOwnerStacks++;
238
+ return d(
239
239
  e,
240
240
  r,
241
241
  n,
242
242
  !1,
243
- f ? Error("react-stack-top-frame") : m,
244
- f ? F(h(e)) : z
243
+ u ? Error("react-stack-top-frame") : V,
244
+ u ? S(h(e)) : R
245
245
  );
246
- }, L.jsxs = function(e, r, n) {
247
- var f = 1e4 > N.recentlyCreatedOwnerStacks++;
248
- return u(
246
+ }, H.jsxs = function(e, r, n) {
247
+ var u = 1e4 > C.recentlyCreatedOwnerStacks++;
248
+ return d(
249
249
  e,
250
250
  r,
251
251
  n,
252
252
  !0,
253
- f ? Error("react-stack-top-frame") : m,
254
- f ? F(h(e)) : z
253
+ u ? Error("react-stack-top-frame") : V,
254
+ u ? S(h(e)) : R
255
255
  );
256
256
  };
257
- })()), L;
257
+ })()), H;
258
258
  }
259
- var re;
260
- function xe() {
261
- return re || (re = 1, process.env.NODE_ENV === "production" ? q.exports = pe() : q.exports = be()), q.exports;
259
+ var fe;
260
+ function Re() {
261
+ return fe || (fe = 1, process.env.NODE_ENV === "production" ? ee.exports = je() : ee.exports = Se()), ee.exports;
262
262
  }
263
- var t = xe();
264
- const ne = new K();
265
- function he({ onConsent: o }) {
266
- const [g, a] = p(!1), [h, s] = p(!1), [i, b] = p(!1), [x, k] = p(!1);
267
- G(() => {
268
- const d = ne.getConsent();
269
- a(!d || ne.isConsentExpired()), d && (b(d.analytics), k(d.marketing));
263
+ var t = Re();
264
+ const pe = new ce();
265
+ function Ee({ onConsent: s }) {
266
+ const [k, a] = c(!1), [h, i] = c(!1), [l, b] = c(!1), [x, g] = c(!1);
267
+ te(() => {
268
+ const p = pe.getConsent();
269
+ a(!p || pe.isConsentExpired()), p && (b(p.analytics), g(p.marketing));
270
270
  }, []);
271
- const c = () => {
272
- o({ analytics: !0, marketing: !0, action: "accept_all" }), a(!1);
273
- }, u = () => {
274
- o({ analytics: !1, marketing: !1, action: "reject_all" }), a(!1);
275
- }, y = () => {
276
- o({ analytics: i, marketing: x, action: "custom" }), a(!1);
277
- }, j = oe(() => {
278
- o({ analytics: !1, marketing: !1, action: "withdraw" }), b(!1), k(!1), a(!0);
279
- }, [o]);
280
- return G(() => {
281
- const d = () => {
282
- a(!0), s(!0);
271
+ const o = () => {
272
+ s({ analytics: !0, marketing: !0, action: "accept_all" }), a(!1);
273
+ }, d = () => {
274
+ s({ analytics: !1, marketing: !1, action: "reject_all" }), a(!1);
275
+ }, m = () => {
276
+ s({ analytics: l, marketing: x, action: "custom" }), a(!1);
277
+ }, w = be(() => {
278
+ s({ analytics: !1, marketing: !1, action: "withdraw" }), b(!1), g(!1), a(!0);
279
+ }, [s]);
280
+ return te(() => {
281
+ const p = () => {
282
+ a(!0), i(!0);
283
283
  };
284
- return window.addEventListener("feedpulse:open-consent", d), window.addEventListener("feedpulse:withdraw-consent", j), () => {
285
- window.removeEventListener("feedpulse:open-consent", d), window.removeEventListener("feedpulse:withdraw-consent", j);
284
+ return window.addEventListener("feedpulse:open-consent", p), window.addEventListener("feedpulse:withdraw-consent", w), () => {
285
+ window.removeEventListener("feedpulse:open-consent", p), window.removeEventListener("feedpulse:withdraw-consent", w);
286
286
  };
287
- }, [j]), g ? /* @__PURE__ */ t.jsx("div", { style: { position: "fixed", bottom: 0, left: 0, right: 0, zIndex: 99999, background: "#1a1a1a", color: "#fff", padding: "20px 24px", borderTop: "1px solid #333", fontFamily: "sans-serif" }, children: /* @__PURE__ */ t.jsxs("div", { style: { maxWidth: 900, margin: "0 auto" }, children: [
287
+ }, [w]), k ? /* @__PURE__ */ t.jsx("div", { style: { position: "fixed", bottom: 0, left: 0, right: 0, zIndex: 99999, background: "#1a1a1a", color: "#fff", padding: "20px 24px", borderTop: "1px solid #333", fontFamily: "sans-serif" }, children: /* @__PURE__ */ t.jsxs("div", { style: { maxWidth: 900, margin: "0 auto" }, children: [
288
288
  /* @__PURE__ */ t.jsxs("p", { style: { margin: "0 0 12px", fontSize: 14, lineHeight: 1.5 }, children: [
289
289
  "We use cookies to improve reliability and understand usage.",
290
290
  " ",
@@ -296,26 +296,26 @@ function he({ onConsent: o }) {
296
296
  "Necessary (always on)"
297
297
  ] }),
298
298
  /* @__PURE__ */ t.jsxs("label", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 6 }, children: [
299
- /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: i, onChange: (d) => b(d.target.checked) }),
299
+ /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: l, onChange: (p) => b(p.target.checked) }),
300
300
  "Analytics"
301
301
  ] }),
302
302
  /* @__PURE__ */ t.jsxs("label", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
303
- /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: x, onChange: (d) => k(d.target.checked) }),
303
+ /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: x, onChange: (p) => g(p.target.checked) }),
304
304
  "Marketing"
305
305
  ] })
306
306
  ] }),
307
307
  /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, flexWrap: "wrap", alignItems: "center" }, children: [
308
- /* @__PURE__ */ t.jsx("button", { type: "button", style: { width: 130, padding: "9px 12px", background: "#4f46e5", color: "#fff", border: "1px solid #4f46e5", borderRadius: 6, fontSize: 13, fontWeight: 600, cursor: "pointer" }, onClick: c, children: "Accept All" }),
309
- /* @__PURE__ */ t.jsx("button", { type: "button", style: { width: 130, padding: "9px 12px", background: "transparent", color: "#fff", border: "1px solid #555", borderRadius: 6, fontSize: 13, fontWeight: 600, cursor: "pointer" }, onClick: u, children: "Reject All" }),
310
- /* @__PURE__ */ t.jsx("button", { type: "button", style: { padding: "9px 16px", background: "transparent", color: "#aaa", border: "1px solid #333", borderRadius: 6, fontSize: 13, cursor: "pointer" }, onClick: () => h ? y() : s(!0), children: h ? "Save Preferences" : "Customize" })
308
+ /* @__PURE__ */ t.jsx("button", { type: "button", style: { width: 130, padding: "9px 12px", background: "#4f46e5", color: "#fff", border: "1px solid #4f46e5", borderRadius: 6, fontSize: 13, fontWeight: 600, cursor: "pointer" }, onClick: o, children: "Accept All" }),
309
+ /* @__PURE__ */ t.jsx("button", { type: "button", style: { width: 130, padding: "9px 12px", background: "transparent", color: "#fff", border: "1px solid #555", borderRadius: 6, fontSize: 13, fontWeight: 600, cursor: "pointer" }, onClick: d, children: "Reject All" }),
310
+ /* @__PURE__ */ t.jsx("button", { type: "button", style: { padding: "9px 16px", background: "transparent", color: "#aaa", border: "1px solid #333", borderRadius: 6, fontSize: 13, cursor: "pointer" }, onClick: () => h ? m() : i(!0), children: h ? "Save Preferences" : "Customize" })
311
311
  ] })
312
312
  ] }) }) : null;
313
313
  }
314
- function me() {
314
+ function _e() {
315
315
  if (typeof document > "u" || document.getElementById("fp-bot-animations"))
316
316
  return;
317
- const o = document.createElement("style");
318
- o.id = "fp-bot-animations", o.textContent = `
317
+ const s = document.createElement("style");
318
+ s.id = "fp-bot-animations", s.textContent = `
319
319
  @keyframes fp-bubble-in {
320
320
  0% { opacity: 0; transform: scale(0.8) translateY(6px); }
321
321
  100% { opacity: 1; transform: scale(1) translateY(0); }
@@ -334,126 +334,148 @@ function me() {
334
334
  50% { opacity: 1; transform: translateY(-3px); }
335
335
  100% { opacity: 0.2; transform: translateY(0); }
336
336
  }
337
- `, document.head.appendChild(o);
337
+ `, document.head.appendChild(s);
338
338
  }
339
- function we({
340
- faq: o = [],
341
- pageContext: g = "",
342
- systemPrompt: a = "",
343
- canNavigate: h = !1,
344
- canHelpForms: s = !1,
345
- escalateTo: i,
346
- initialMessage: b = "👋 Need help?",
347
- position: x = "bottom-right"
339
+ function Oe({
340
+ faq: s,
341
+ pageContext: k,
342
+ systemPrompt: a,
343
+ canNavigate: h,
344
+ navigableElements: i,
345
+ canHelpForms: l,
346
+ formGuide: b,
347
+ features: x,
348
+ escalateTo: g,
349
+ initialMessage: o = "👋 Need help?",
350
+ position: d = "bottom-right",
351
+ config: m,
352
+ configId: w
348
353
  }) {
349
- const k = H(new K()), [c, u] = p(!1), [y, j] = p(!1), [d, w] = p(!1), [A, D] = p(""), [X, Y] = p(null), [Z, $] = p(!1), [O, M] = p(!1), [B, C] = p([]), [R, J] = p(""), [I, N] = p(!1), S = H(null), Q = le(
350
- () => ({ faq: o, pageContext: g, systemPrompt: a, canNavigate: h, canHelpForms: s, escalateTo: i }),
351
- [o, g, a, h, s, i]
354
+ const p = X(new ce()), j = X(new ke()), [re, T] = c(!1), [ne, oe] = c(!1), [L, Z] = c(!1), [A, se] = c(""), [ae, $] = c(null), [B, Q] = c(!1), [Y, C] = c(!1), [J, P] = c([]), [S, U] = c(""), [O, V] = c(!1), [R, I] = c(null), [e, r] = c(null), n = X(null), [u, D] = c(""), W = he(
355
+ () => m ?? {
356
+ pageContext: k,
357
+ systemPrompt: a,
358
+ faq: s,
359
+ canNavigate: h,
360
+ navigableElements: i,
361
+ canHelpForms: l,
362
+ formGuide: b,
363
+ features: x,
364
+ escalateTo: g,
365
+ initialMessage: o
366
+ },
367
+ [l, h, m, g, s, x, b, o, i, k, a]
352
368
  );
353
- G(() => {
354
- me();
355
- const m = new fe({
356
- onTrigger: async (z, P) => {
357
- j(!0), u(!0), Y(null), $(!1), M(!1), S.current && clearTimeout(S.current), S.current = setTimeout(() => u(!1), 8e3);
369
+ te(() => {
370
+ _e(), D(window.location.pathname);
371
+ const y = new we({
372
+ onTrigger: async (F, q) => {
373
+ oe(!0), T(!0), $(null), Q(!1), C(!1), n.current && clearTimeout(n.current), n.current = setTimeout(() => T(!1), 8e3);
358
374
  try {
359
- const e = k.current.getAllData(!0), r = await fetch("/api/bot/session-proxy", {
375
+ const K = p.current.getAllData(!0), N = await fetch("/api/bot/session-proxy", {
360
376
  method: "POST",
361
377
  headers: { "content-type": "application/json" },
362
378
  body: JSON.stringify({
363
379
  page: window.location.pathname,
364
- triggerScore: z,
365
- triggerReasons: P,
366
- sessionId: e.sessionId,
367
- visitorId: e.userId,
380
+ triggerScore: F,
381
+ triggerReasons: q,
382
+ sessionId: K.sessionId,
383
+ visitorId: K.userId,
368
384
  device: navigator.userAgent
369
385
  })
370
386
  });
371
- if (r.status === 402) {
372
- M(!0);
387
+ if (N.status === 402) {
388
+ C(!0);
373
389
  return;
374
390
  }
375
- const n = await r.json().catch(() => null);
376
- n?.botSessionId && D(n.botSessionId);
391
+ const v = await N.json().catch(() => null);
392
+ v?.botSessionId && se(v.botSessionId);
377
393
  } catch {
378
394
  }
379
395
  }
380
396
  });
381
- return m.start(), () => {
382
- m.stop(), S.current && clearTimeout(S.current);
397
+ return y.start(), () => {
398
+ y.stop(), n.current && clearTimeout(n.current);
383
399
  };
384
400
  }, []);
385
- const F = {
401
+ const f = {
386
402
  position: "fixed",
387
403
  bottom: 24,
388
404
  zIndex: 1e4,
389
- ...x === "bottom-left" ? { left: 24 } : { right: 24 }
390
- }, U = (m) => {
391
- if (m.preventDefault(), !R.trim() || O || I || !A)
405
+ ...d === "bottom-left" ? { left: 24 } : { right: 24 }
406
+ }, E = (y) => {
407
+ if (y.preventDefault(), !S.trim() || Y || O || !A)
392
408
  return;
393
- const z = R.trim();
394
- J("");
395
- const P = { id: `user-${Date.now()}`, role: "user", content: z }, e = `assistant-${Date.now()}`;
396
- C((r) => [...r, P, { id: e, role: "assistant", content: "" }]), N(!0), (async () => {
409
+ const F = S.trim(), q = [
410
+ ...J.map((v) => ({ role: v.role, content: v.content })),
411
+ { role: "user", content: F }
412
+ ];
413
+ U("");
414
+ const K = { id: `user-${Date.now()}`, role: "user", content: F }, N = `assistant-${Date.now()}`;
415
+ P((v) => [...v, K, { id: N, role: "assistant", content: "" }]), V(!0), (async () => {
397
416
  try {
398
- const r = await fetch("/api/bot/chat-proxy", {
417
+ const v = await fetch("/api/bot/chat-proxy", {
399
418
  method: "POST",
400
419
  headers: { "content-type": "application/json" },
401
420
  body: JSON.stringify({
402
421
  botSessionId: A,
403
- config: Q,
404
- messages: [...B, P].map((v) => ({ role: v.role, content: v.content }))
422
+ config: JSON.parse(JSON.stringify(W)),
423
+ configId: w,
424
+ page: u,
425
+ messages: q
405
426
  })
406
427
  });
407
- if (r.status === 402) {
408
- M(!0), C((v) => v.map((l) => l.id === e ? { ...l, content: "Service temporarily unavailable." } : l));
428
+ if (v.status === 402) {
429
+ C(!0), P((le) => le.map((z) => z.id === N ? { ...z, content: "Service temporarily unavailable." } : z));
409
430
  return;
410
431
  }
411
- if (!r.ok)
432
+ if (!v.ok)
412
433
  throw new Error("chat failed");
413
- const n = r.body?.getReader();
414
- if (!n)
415
- throw new Error("no body");
416
- const f = new TextDecoder();
417
- let E = !1;
418
- for (; !E; ) {
419
- const v = await n.read();
420
- if (E = v.done, v.value) {
421
- const l = f.decode(v.value, { stream: !E });
422
- C((_) => _.map((T) => T.id === e ? { ...T, content: T.content + l } : T));
423
- }
424
- }
434
+ const _ = await v.json();
435
+ P((le) => le.map((z) => z.id === N ? { ...z, content: _.text || "" } : z)), _.action && I(_.action);
425
436
  } catch {
426
- C((r) => r.map((n) => n.id === e && !n.content ? { ...n, content: "Sorry, I couldn't process that. Please try again." } : n));
437
+ P((v) => v.map((_) => _.id === N && !_.content ? { ..._, content: "Sorry, I couldn't process that. Please try again." } : _));
427
438
  } finally {
428
- N(!1);
439
+ V(!1);
429
440
  }
430
441
  })();
431
- }, V = async () => {
432
- if (w(!1), !!A) {
442
+ }, M = async (y) => {
443
+ if (!R)
444
+ return;
445
+ if (!y) {
446
+ I(null), r("No problem! Let me know if you need anything else.");
447
+ return;
448
+ }
449
+ const F = R;
450
+ I(null);
451
+ const q = await j.current.perform(F);
452
+ r(q.message), window.setTimeout(() => r(null), 3e3);
453
+ }, ie = async () => {
454
+ if (Z(!1), !!A) {
433
455
  try {
434
456
  await fetch("/api/bot/session-end-proxy", {
435
457
  method: "POST",
436
458
  headers: { "content-type": "application/json" },
437
459
  body: JSON.stringify({
438
460
  botSessionId: A,
439
- wasHelpful: X,
440
- escalated: Z
461
+ wasHelpful: ae,
462
+ escalated: B
441
463
  })
442
464
  });
443
465
  } catch {
444
466
  }
445
- C([]);
467
+ P([]), I(null), r(null);
446
468
  }
447
469
  };
448
- return /* @__PURE__ */ t.jsxs("div", { style: F, children: [
449
- c && !d && /* @__PURE__ */ t.jsx(
470
+ return /* @__PURE__ */ t.jsxs("div", { style: f, children: [
471
+ re && !L && /* @__PURE__ */ t.jsx(
450
472
  "div",
451
473
  {
452
474
  style: {
453
475
  position: "absolute",
454
476
  bottom: 62,
455
- right: x === "bottom-right" ? 0 : void 0,
456
- left: x === "bottom-left" ? 0 : void 0,
477
+ right: d === "bottom-right" ? 0 : void 0,
478
+ left: d === "bottom-left" ? 0 : void 0,
457
479
  background: "#fff",
458
480
  border: "2px solid #6366f1",
459
481
  color: "#1f2937",
@@ -464,10 +486,10 @@ function we({
464
486
  boxShadow: "0 10px 22px rgba(0,0,0,0.16)",
465
487
  animation: "fp-bubble-in 300ms ease-out"
466
488
  },
467
- children: b
489
+ children: W.initialMessage || o
468
490
  }
469
491
  ),
470
- y && !d && /* @__PURE__ */ t.jsx(
492
+ ne && !L && /* @__PURE__ */ t.jsx(
471
493
  "button",
472
494
  {
473
495
  style: {
@@ -483,7 +505,7 @@ function we({
483
505
  animation: "fp-bounce 600ms ease-out"
484
506
  },
485
507
  onClick: () => {
486
- w(!0), u(!1);
508
+ Z(!0), T(!1);
487
509
  },
488
510
  children: /* @__PURE__ */ t.jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "white", strokeWidth: "2", children: [
489
511
  /* @__PURE__ */ t.jsx("rect", { x: "3", y: "8", width: "18", height: "13", rx: "2" }),
@@ -495,7 +517,7 @@ function we({
495
517
  ] })
496
518
  }
497
519
  ),
498
- d && !!A && /* @__PURE__ */ t.jsxs(
520
+ L && !!A && /* @__PURE__ */ t.jsxs(
499
521
  "div",
500
522
  {
501
523
  style: {
@@ -517,128 +539,146 @@ function we({
517
539
  /* @__PURE__ */ t.jsx("strong", { style: { fontSize: 14, color: "#fff" }, children: "Pulse Bot" }),
518
540
  /* @__PURE__ */ t.jsx("span", { style: { fontSize: 11, color: "#94a3b8" }, children: "Powered by FeedPulse AI" })
519
541
  ] }),
520
- /* @__PURE__ */ t.jsx("button", { style: { border: "none", background: "transparent", color: "#cbd5e1", cursor: "pointer", fontSize: 18 }, onClick: V, children: "×" })
542
+ /* @__PURE__ */ t.jsx("button", { style: { border: "none", background: "transparent", color: "#cbd5e1", cursor: "pointer", fontSize: 18 }, onClick: ie, children: "×" })
521
543
  ] }),
522
544
  /* @__PURE__ */ t.jsxs("div", { style: { flex: 1, overflowY: "auto", padding: 12, display: "grid", gap: 10 }, children: [
523
- B.map((m) => /* @__PURE__ */ t.jsxs("div", { style: { display: "grid", justifyItems: m.role === "user" ? "end" : "start", gap: 6 }, children: [
545
+ J.map((y) => /* @__PURE__ */ t.jsxs("div", { style: { display: "grid", justifyItems: y.role === "user" ? "end" : "start", gap: 6 }, children: [
524
546
  /* @__PURE__ */ t.jsx(
525
547
  "div",
526
548
  {
527
549
  style: {
528
550
  maxWidth: "85%",
529
551
  padding: "9px 11px",
530
- borderRadius: m.role === "user" ? "14px 14px 2px 14px" : "14px 14px 14px 2px",
531
- background: m.role === "user" ? "#4f46e5" : "#1f2937",
552
+ borderRadius: y.role === "user" ? "14px 14px 2px 14px" : "14px 14px 14px 2px",
553
+ background: y.role === "user" ? "#4f46e5" : "#1f2937",
532
554
  color: "#fff",
533
555
  fontSize: 13,
534
556
  whiteSpace: "pre-wrap"
535
557
  },
536
- children: m.content
558
+ children: y.content
537
559
  }
538
560
  ),
539
- m.role === "assistant" && /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
540
- /* @__PURE__ */ t.jsx("button", { style: { border: "1px solid #334155", background: "#0f172a", color: "#e2e8f0", borderRadius: 8, fontSize: 12, padding: "4px 8px", cursor: "pointer" }, onClick: () => Y(!0), children: "👍" }),
541
- /* @__PURE__ */ t.jsx("button", { style: { border: "1px solid #334155", background: "#0f172a", color: "#e2e8f0", borderRadius: 8, fontSize: 12, padding: "4px 8px", cursor: "pointer" }, onClick: () => Y(!1), children: "👎" })
561
+ y.role === "assistant" && /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
562
+ /* @__PURE__ */ t.jsx("button", { style: { border: "1px solid #334155", background: "#0f172a", color: "#e2e8f0", borderRadius: 8, fontSize: 12, padding: "4px 8px", cursor: "pointer" }, onClick: () => $(!0), children: "👍" }),
563
+ /* @__PURE__ */ t.jsx("button", { style: { border: "1px solid #334155", background: "#0f172a", color: "#e2e8f0", borderRadius: 8, fontSize: 12, padding: "4px 8px", cursor: "pointer" }, onClick: () => $(!1), children: "👎" })
542
564
  ] })
543
- ] }, m.id)),
544
- I && /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 5 }, children: [
565
+ ] }, y.id)),
566
+ O && /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 5 }, children: [
545
567
  /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, borderRadius: 999, background: "#94a3b8", animation: "fp-dot 1s infinite 0ms" } }),
546
568
  /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, borderRadius: 999, background: "#94a3b8", animation: "fp-dot 1s infinite 160ms" } }),
547
569
  /* @__PURE__ */ t.jsx("span", { style: { width: 8, height: 8, borderRadius: 999, background: "#94a3b8", animation: "fp-dot 1s infinite 320ms" } })
548
570
  ] }),
549
- O && /* @__PURE__ */ t.jsx("div", { style: { border: "1px solid #f59e0b", background: "#451a03", color: "#fde68a", borderRadius: 10, padding: 10, fontSize: 12 }, children: "Service temporarily unavailable." })
571
+ Y && /* @__PURE__ */ t.jsx("div", { style: { border: "1px solid #f59e0b", background: "#451a03", color: "#fde68a", borderRadius: 10, padding: 10, fontSize: 12 }, children: "Service temporarily unavailable." }),
572
+ R && /* @__PURE__ */ t.jsxs("div", { style: { margin: "8px 0", padding: 12, background: "#f0f0ff", border: "1px solid #c7d2fe", borderRadius: 10, fontSize: 13, color: "#111827" }, children: [
573
+ /* @__PURE__ */ t.jsxs("p", { style: { margin: "0 0 8px", fontWeight: 600 }, children: [
574
+ "Want me to ",
575
+ R.type,
576
+ ' "',
577
+ R.label,
578
+ '"?'
579
+ ] }),
580
+ /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
581
+ /* @__PURE__ */ t.jsx("button", { style: { padding: "6px 16px", background: "#6366f1", color: "#fff", border: "none", borderRadius: 6, cursor: "pointer", fontSize: 12 }, onClick: () => {
582
+ M(!0);
583
+ }, children: "✓ Yes, do it" }),
584
+ /* @__PURE__ */ t.jsx("button", { style: { padding: "6px 16px", background: "transparent", border: "1px solid #c7d2fe", borderRadius: 6, cursor: "pointer", fontSize: 12, color: "#111827" }, onClick: () => {
585
+ M(!1);
586
+ }, children: "No thanks" })
587
+ ] })
588
+ ] }),
589
+ e && /* @__PURE__ */ t.jsx("div", { style: { margin: "0 0 8px", padding: 10, background: "#ecfdf5", border: "1px solid #6ee7b7", borderRadius: 8, fontSize: 13, color: "#065f46" }, children: e })
550
590
  ] }),
551
- /* @__PURE__ */ t.jsxs("form", { style: { padding: 10, borderTop: "1px solid #374151", display: "grid", gap: 8 }, onSubmit: U, children: [
591
+ /* @__PURE__ */ t.jsxs("form", { style: { padding: 10, borderTop: "1px solid #374151", display: "grid", gap: 8 }, onSubmit: E, children: [
552
592
  /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
553
593
  /* @__PURE__ */ t.jsx(
554
594
  "input",
555
595
  {
556
- value: R,
557
- disabled: I || O,
558
- onChange: (m) => J(m.target.value),
596
+ value: S,
597
+ disabled: O || Y,
598
+ onChange: (y) => U(y.target.value),
559
599
  style: { flex: 1, borderRadius: 10, border: "1px solid #475569", background: "#0f172a", color: "#fff", fontSize: 13, padding: "8px 10px", outline: "none" },
560
600
  placeholder: "Ask a question..."
561
601
  }
562
602
  ),
563
- /* @__PURE__ */ t.jsx("button", { type: "submit", disabled: !R.trim() || I || O, style: { border: "none", borderRadius: 10, background: "#6366f1", color: "#fff", fontWeight: 600, fontSize: 12, padding: "0 14px", cursor: "pointer" }, children: "Send" })
603
+ /* @__PURE__ */ t.jsx("button", { type: "submit", disabled: !S.trim() || O || Y, style: { border: "none", borderRadius: 10, background: "#6366f1", color: "#fff", fontWeight: 600, fontSize: 12, padding: "0 14px", cursor: "pointer" }, children: "Send" })
564
604
  ] }),
565
- i && /* @__PURE__ */ t.jsx("a", { href: i.url, style: { color: "#c4b5fd", fontSize: 12, textDecoration: "none" }, onClick: () => $(!0), children: i.label })
605
+ g && /* @__PURE__ */ t.jsx("a", { href: g.url, style: { color: "#c4b5fd", fontSize: 12, textDecoration: "none" }, onClick: () => Q(!0), children: g.label })
566
606
  ] })
567
607
  ]
568
608
  }
569
609
  )
570
610
  ] });
571
611
  }
572
- const ae = ce({ tracker: null });
573
- function je({
574
- proxyEndpoint: o = "/api/fp-proxy",
575
- debug: g,
612
+ const xe = me({ tracker: null });
613
+ function Ie({
614
+ proxyEndpoint: s = "/api/fp-proxy",
615
+ debug: k,
576
616
  consentRequired: a = !0,
577
617
  children: h
578
618
  }) {
579
- const s = H(null), i = H(new K()), [b, x] = p(null), k = oe((c) => {
580
- const u = i.current, y = u.setConsent({
581
- analytics: c.analytics,
582
- marketing: c.marketing,
619
+ const i = X(null), l = X(new ce()), [b, x] = c(null), g = be((o) => {
620
+ const d = l.current, m = d.setConsent({
621
+ analytics: o.analytics,
622
+ marketing: o.marketing,
583
623
  version: "1.0"
584
624
  });
585
- c.analytics || u.clearAnalyticsCookies(), s.current?.updateCookieData(u.getAllData(c.analytics)), s.current?.track("consent", "__consent__", {
586
- analytics: c.analytics,
587
- marketing: c.marketing,
588
- action: c.action,
625
+ o.analytics || d.clearAnalyticsCookies(), i.current?.updateCookieData(d.getAllData(o.analytics)), i.current?.track("consent", "__consent__", {
626
+ analytics: o.analytics,
627
+ marketing: o.marketing,
628
+ action: o.action,
589
629
  userAgent: navigator.userAgent,
590
- version: y.version
630
+ version: m.version
591
631
  });
592
632
  }, []);
593
- return G(() => {
594
- const c = new ue({ proxyEndpoint: o, debug: g });
595
- s.current = c, x(c);
596
- const u = i.current, y = u.getConsent();
597
- return a ? y && !u.isConsentExpired() ? c.updateCookieData(u.getAllData(y.analytics)) : c.updateCookieData(u.getAllData(!1)) : (u.setConsent({ analytics: !0, marketing: !0, version: "1.0" }), c.updateCookieData(u.getAllData(!0))), c.init(), () => {
598
- c.destroy(), s.current = null, x(null);
633
+ return te(() => {
634
+ const o = new ve({ proxyEndpoint: s, debug: k });
635
+ i.current = o, x(o);
636
+ const d = l.current, m = d.getConsent();
637
+ return a ? m && !d.isConsentExpired() ? o.updateCookieData(d.getAllData(m.analytics)) : o.updateCookieData(d.getAllData(!1)) : (d.setConsent({ analytics: !0, marketing: !0, version: "1.0" }), o.updateCookieData(d.getAllData(!0))), o.init(), () => {
638
+ o.destroy(), i.current = null, x(null);
599
639
  };
600
- }, [o, g, a]), /* @__PURE__ */ t.jsxs(ae.Provider, { value: { tracker: b }, children: [
640
+ }, [s, k, a]), /* @__PURE__ */ t.jsxs(xe.Provider, { value: { tracker: b }, children: [
601
641
  h,
602
- a && /* @__PURE__ */ t.jsx(he, { onConsent: k })
642
+ a && /* @__PURE__ */ t.jsx(Ee, { onConsent: g })
603
643
  ] });
604
644
  }
605
- function ge() {
606
- return de(ae);
645
+ function Te() {
646
+ return ye(xe);
607
647
  }
608
- function Re({ id: o, placeholder: g, position: a = "bottom-right" }) {
609
- const { tracker: h } = ge(), [s, i] = p(a === "inline"), [b, x] = p(null), [k, c] = p(""), [u, y] = p(!1), j = () => {
610
- !b && !k.trim() || (h?.trackFeedback(o ?? null, b, k || null), y(!0), setTimeout(() => {
611
- i(a === "inline"), y(!1), x(null), c("");
648
+ function Ne({ id: s, placeholder: k, position: a = "bottom-right" }) {
649
+ const { tracker: h } = Te(), [i, l] = c(a === "inline"), [b, x] = c(null), [g, o] = c(""), [d, m] = c(!1), w = () => {
650
+ !b && !g.trim() || (h?.trackFeedback(s ?? null, b, g || null), m(!0), setTimeout(() => {
651
+ l(a === "inline"), m(!1), x(null), o("");
612
652
  }, 2e3));
613
- }, d = a !== "inline" ? { position: "fixed", bottom: 24, [a === "bottom-right" ? "right" : "left"]: 24, zIndex: 9999 } : {};
614
- return /* @__PURE__ */ t.jsxs("div", { style: d, children: [
653
+ }, p = a !== "inline" ? { position: "fixed", bottom: 24, [a === "bottom-right" ? "right" : "left"]: 24, zIndex: 9999 } : {};
654
+ return /* @__PURE__ */ t.jsxs("div", { style: p, children: [
615
655
  a !== "inline" && /* @__PURE__ */ t.jsx(
616
656
  "button",
617
657
  {
618
- onClick: () => i(!s),
658
+ onClick: () => l(!i),
619
659
  style: { background: "#6366f1", color: "#fff", border: "none", borderRadius: "50%", width: 48, height: 48, fontSize: 20, cursor: "pointer" },
620
660
  children: "💬"
621
661
  }
622
662
  ),
623
- s && /* @__PURE__ */ t.jsx("div", { style: { background: "#fff", border: "1px solid #e5e7eb", borderRadius: 12, padding: 16, width: 280, boxShadow: "0 10px 25px rgba(0,0,0,0.15)" }, children: u ? /* @__PURE__ */ t.jsxs("div", { style: { textAlign: "center", padding: 16 }, children: [
663
+ i && /* @__PURE__ */ t.jsx("div", { style: { background: "#fff", border: "1px solid #e5e7eb", borderRadius: 12, padding: 16, width: 280, boxShadow: "0 10px 25px rgba(0,0,0,0.15)" }, children: d ? /* @__PURE__ */ t.jsxs("div", { style: { textAlign: "center", padding: 16 }, children: [
624
664
  /* @__PURE__ */ t.jsx("p", { style: { fontSize: 28, margin: 0 }, children: "🎉" }),
625
665
  /* @__PURE__ */ t.jsx("p", { style: { margin: "8px 0 0", fontWeight: 600 }, children: "Thanks for your feedback!" })
626
666
  ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
627
- /* @__PURE__ */ t.jsx("p", { style: { margin: "0 0 12px", fontWeight: 600 }, children: g ?? "How was your experience?" }),
628
- /* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 6, marginBottom: 12 }, children: [1, 2, 3, 4, 5].map((w) => /* @__PURE__ */ t.jsx(
667
+ /* @__PURE__ */ t.jsx("p", { style: { margin: "0 0 12px", fontWeight: 600 }, children: k ?? "How was your experience?" }),
668
+ /* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 6, marginBottom: 12 }, children: [1, 2, 3, 4, 5].map((j) => /* @__PURE__ */ t.jsx(
629
669
  "button",
630
670
  {
631
- onClick: () => x(w),
632
- style: { background: "none", border: "none", cursor: "pointer", fontSize: 24, opacity: b !== null && w <= b ? 1 : 0.3 },
671
+ onClick: () => x(j),
672
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: 24, opacity: b !== null && j <= b ? 1 : 0.3 },
633
673
  children: "⭐"
634
674
  },
635
- w
675
+ j
636
676
  )) }),
637
677
  /* @__PURE__ */ t.jsx(
638
678
  "textarea",
639
679
  {
640
- value: k,
641
- onChange: (w) => c(w.target.value),
680
+ value: g,
681
+ onChange: (j) => o(j.target.value),
642
682
  placeholder: "Tell us more (optional)...",
643
683
  rows: 3,
644
684
  style: { width: "100%", padding: 8, border: "1px solid #d1d5db", borderRadius: 8, resize: "none", fontSize: 14 }
@@ -647,7 +687,7 @@ function Re({ id: o, placeholder: g, position: a = "bottom-right" }) {
647
687
  /* @__PURE__ */ t.jsx(
648
688
  "button",
649
689
  {
650
- onClick: j,
690
+ onClick: w,
651
691
  style: { marginTop: 10, width: "100%", background: "#6366f1", color: "#fff", border: "none", borderRadius: 8, padding: 10, fontWeight: 600, cursor: "pointer" },
652
692
  children: "Submit Feedback"
653
693
  }
@@ -656,9 +696,9 @@ function Re({ id: o, placeholder: g, position: a = "bottom-right" }) {
656
696
  ] });
657
697
  }
658
698
  export {
659
- he as ConsentBanner,
660
- we as FeedPulseBot,
661
- je as FeedPulseProvider,
662
- Re as FeedPulseWidget,
663
- ge as useFeedPulse
699
+ Ee as ConsentBanner,
700
+ Oe as FeedPulseBot,
701
+ Ie as FeedPulseProvider,
702
+ Ne as FeedPulseWidget,
703
+ Te as useFeedPulse
664
704
  };