@sapia-ai/chatbot-v3 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{EmbeddedVideoPlayer-SaMMfDIW.js → EmbeddedVideoPlayer-CNcds-dW.js} +283 -282
  2. package/dist/Preview-Dmns6UWL.js +84 -0
  3. package/dist/api.js +1 -1
  4. package/dist/{dist-DGBYKC8c.js → dist-B9SbMqZU.js} +2693 -2693
  5. package/dist/embed/createChatbot.d.ts +2 -0
  6. package/dist/{fix-webm-duration-BW9Fbdzt.js → fix-webm-duration-BWL-ZRDX.js} +2 -2
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.js +15479 -2067
  9. package/dist/jsx-runtime-8QqjHL5t.js +24 -0
  10. package/dist/messages-Czlp86gl.js +1963 -0
  11. package/dist/react-B0K-sClg.js +295 -0
  12. package/dist/{react-Bujo1aK5.js → react-ChCcxVnw.js} +90 -89
  13. package/dist/{react-GXf8sbzf.js → react-DJysvNxz.js} +72 -71
  14. package/dist/{react-BVzcquey.js → react-Dbs-sPBo.js} +93 -92
  15. package/dist/{react-lp7yfM94.js → react-NauLB_WU.js} +91 -90
  16. package/dist/{react-BGJ7Szvq.js → react-QrtEtv1G.js} +76 -74
  17. package/dist/{react-BrCGR7Ca.js → react-be7q6yw_.js} +312 -310
  18. package/dist/{react-CRTg4gz8.js → react-czRIxT0g.js} +85 -84
  19. package/dist/{react-BMxM8TWJ.js → react-dE7BdGuR.js} +49 -48
  20. package/dist-umd/sapia-chatbot.umd.js +1 -1
  21. package/package.json +14 -25
  22. package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +0 -1
  23. package/dist/Preview-Db-hgkTh.js +0 -83
  24. package/dist/Preview-Db-hgkTh.js.map +0 -1
  25. package/dist/dash.all.min-DZ1yEcJk.js.map +0 -1
  26. package/dist/dist-BSi28_cP.js.map +0 -1
  27. package/dist/dist-DGBYKC8c.js.map +0 -1
  28. package/dist/dist-FvHBWiRa.js.map +0 -1
  29. package/dist/fix-webm-duration-BW9Fbdzt.js.map +0 -1
  30. package/dist/hls-mBncGwsE.js.map +0 -1
  31. package/dist/index.js.map +0 -1
  32. package/dist/max-Btet1snX.js.map +0 -1
  33. package/dist/messages-C4jqrtSG.js +0 -187
  34. package/dist/messages-C4jqrtSG.js.map +0 -1
  35. package/dist/react-BGJ7Szvq.js.map +0 -1
  36. package/dist/react-BMxM8TWJ.js.map +0 -1
  37. package/dist/react-BVzcquey.js.map +0 -1
  38. package/dist/react-BrCGR7Ca.js.map +0 -1
  39. package/dist/react-Bujo1aK5.js.map +0 -1
  40. package/dist/react-CRTg4gz8.js.map +0 -1
  41. package/dist/react-GXf8sbzf.js.map +0 -1
  42. package/dist/react-lp7yfM94.js.map +0 -1
  43. package/dist/sapia-chatbot.css +0 -3
  44. package/dist-umd/sapia-chatbot.umd.js.map +0 -1
@@ -1,9 +1,10 @@
1
- import { a as e, i as t, n, r, t as i } from "./classPrivateFieldSet2-DtQPURVD.js";
2
- import { t as a } from "./defineProperty-DiFpLzd2.js";
3
- import o from "react";
1
+ import { b as e } from "./messages-Czlp86gl.js";
2
+ import { t } from "./react-B0K-sClg.js";
3
+ import { a as n, i as r, n as i, r as a, t as o } from "./classPrivateFieldSet2-DtQPURVD.js";
4
+ import { t as s } from "./defineProperty-DiFpLzd2.js";
4
5
  //#region ../../node_modules/.pnpm/spotify-audio-element@1.0.4/node_modules/spotify-audio-element/dist/spotify-audio-element.js
5
- var s, c = "https://open.spotify.com", l = /open\.spotify\.com\/(\w+)\/(\w+)/i, u = "https://open.spotify.com/embed-podcast/iframe-api/v1", d = "SpotifyIframeApi", f = "onSpotifyIframeApiReady";
6
- function p(e, t = {}) {
6
+ var c = /* @__PURE__ */ e(t(), 1), l, u = "https://open.spotify.com", d = /open\.spotify\.com\/(\w+)\/(\w+)/i, f = "https://open.spotify.com/embed-podcast/iframe-api/v1", p = "SpotifyIframeApi", m = "onSpotifyIframeApiReady";
7
+ function h(e, t = {}) {
7
8
  return `
8
9
  <style>
9
10
  :host {
@@ -24,8 +25,8 @@ function p(e, t = {}) {
24
25
  display: none !important;
25
26
  }
26
27
  </style>
27
- <iframe${O({
28
- src: m(e, t),
28
+ <iframe${A({
29
+ src: g(e, t),
29
30
  scrolling: "no",
30
31
  frameborder: 0,
31
32
  width: "100%",
@@ -34,56 +35,56 @@ function p(e, t = {}) {
34
35
  })}></iframe>
35
36
  `;
36
37
  }
37
- function m(e, t) {
38
+ function g(e, t) {
38
39
  var n, r, i;
39
40
  if (!e.src) return;
40
- let a = e.src.match(l), o = a && a[1], s = a && a[2], u = {
41
+ let a = e.src.match(d), o = a && a[1], s = a && a[2], c = {
41
42
  t: (n = t.config) == null ? void 0 : n.startAt,
42
43
  theme: ((r = t.config) == null ? void 0 : r.theme) === "dark" ? "0" : null
43
44
  };
44
- return `${c}/embed/${o}/${s}${(i = t.config) != null && i.preferVideo ? "/video" : ""}?${k(u)}`;
45
+ return `${u}/embed/${o}/${s}${(i = t.config) != null && i.preferVideo ? "/video" : ""}?${j(c)}`;
45
46
  }
46
- var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakSet(), E = class extends ((s = globalThis.HTMLElement) == null ? class {} : s) {
47
+ var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakSet(), O = class extends ((l = globalThis.HTMLElement) == null ? class {} : l) {
47
48
  constructor() {
48
- super(), e(this, T), a(this, "loadComplete", new P()), t(this, h, void 0), t(this, g, void 0), t(this, _, void 0), t(this, v, !1), t(this, y, !1), t(this, b, !0), t(this, x, 0), t(this, S, NaN), t(this, C, !1), t(this, w, null), r(T, this, D).call(this, "config");
49
+ super(), n(this, D), s(this, "loadComplete", new I()), r(this, _, void 0), r(this, v, void 0), r(this, y, void 0), r(this, b, !1), r(this, x, !1), r(this, S, !0), r(this, C, 0), r(this, w, NaN), r(this, T, !1), r(this, E, null), a(D, this, k).call(this, "config");
49
50
  }
50
51
  async load() {
51
- var e, t, r;
52
- if (n(h, this)) return;
53
- n(g, this) && (this.loadComplete = new P()), i(g, this, !0), await i(h, this, Promise.resolve()), i(h, this, null), i(v, this, !1), i(y, this, !1), i(x, this, 0), i(S, this, NaN), i(C, this, !1), this.dispatchEvent(new Event("emptied"));
54
- let a = this.api;
52
+ var e, t, n;
53
+ if (i(_, this)) return;
54
+ i(v, this) && (this.loadComplete = new I()), o(v, this, !0), await o(_, this, Promise.resolve()), o(_, this, null), o(b, this, !1), o(x, this, !1), o(C, this, 0), o(w, this, NaN), o(T, this, !1), this.dispatchEvent(new Event("emptied"));
55
+ let r = this.api;
55
56
  if (this.api = null, !this.src) return;
56
57
  this.dispatchEvent(new Event("loadstart"));
57
- let o = {
58
+ let a = {
58
59
  t: (e = this.config) == null ? void 0 : e.startAt,
59
60
  theme: ((t = this.config) == null ? void 0 : t.theme) === "dark" ? "0" : null,
60
- preferVideo: (r = this.config) == null ? void 0 : r.preferVideo
61
+ preferVideo: (n = this.config) == null ? void 0 : n.preferVideo
61
62
  };
62
- if (n(_, this)) this.api = a, this.api.iframeElement.src = m(j(this.attributes), this);
63
+ if (i(y, this)) this.api = r, this.api.iframeElement.src = g(N(this.attributes), this);
63
64
  else {
64
- i(_, this, !0), this.shadowRoot || (this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = p(j(this.attributes), this));
65
- let e = this.shadowRoot.querySelector("iframe"), t = await N(u, d, f);
66
- this.api = await new Promise((n) => t.createController(e, o, n)), this.api.iframeElement = e, this.api.addListener("ready", () => {
65
+ o(y, this, !0), this.shadowRoot || (this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = h(N(this.attributes), this));
66
+ let e = this.shadowRoot.querySelector("iframe"), t = await F(f, p, m);
67
+ this.api = await new Promise((n) => t.createController(e, a, n)), this.api.iframeElement = e, this.api.addListener("ready", () => {
67
68
  this.dispatchEvent(new Event("loadedmetadata")), this.dispatchEvent(new Event("durationchange")), this.dispatchEvent(new Event("volumechange"));
68
69
  }), this.api.addListener("playback_update", (e) => {
69
- if (n(y, this) && n(b, this) && (e.data.isBuffering || !e.data.isPaused)) {
70
- i(y, this, !1), this.currentTime = 1;
70
+ if (i(x, this) && i(S, this) && (e.data.isBuffering || !e.data.isPaused)) {
71
+ o(x, this, !1), this.currentTime = 1;
71
72
  return;
72
73
  }
73
- if (e.data.duration / 1e3 !== n(S, this) && (i(y, this, !1), i(S, this, e.data.duration / 1e3), this.dispatchEvent(new Event("durationchange"))), e.data.position / 1e3 !== n(x, this) && (i(C, this, !1), i(y, this, !1), i(x, this, e.data.position / 1e3), this.dispatchEvent(new Event("timeupdate"))), !n(v, this) && !n(b, this) && e.data.isPaused) {
74
- i(b, this, !0), this.dispatchEvent(new Event("pause"));
74
+ if (e.data.duration / 1e3 !== i(w, this) && (o(x, this, !1), o(w, this, e.data.duration / 1e3), this.dispatchEvent(new Event("durationchange"))), e.data.position / 1e3 !== i(C, this) && (o(T, this, !1), o(x, this, !1), o(C, this, e.data.position / 1e3), this.dispatchEvent(new Event("timeupdate"))), !i(b, this) && !i(S, this) && e.data.isPaused) {
75
+ o(S, this, !0), this.dispatchEvent(new Event("pause"));
75
76
  return;
76
77
  }
77
- if (n(b, this) && (e.data.isBuffering || !e.data.isPaused)) {
78
- i(b, this, !1), this.dispatchEvent(new Event("play")), i(v, this, e.data.isBuffering), n(v, this) ? this.dispatchEvent(new Event("waiting")) : this.dispatchEvent(new Event("playing"));
78
+ if (i(S, this) && (e.data.isBuffering || !e.data.isPaused)) {
79
+ o(S, this, !1), this.dispatchEvent(new Event("play")), o(b, this, e.data.isBuffering), i(b, this) ? this.dispatchEvent(new Event("waiting")) : this.dispatchEvent(new Event("playing"));
79
80
  return;
80
81
  }
81
- if (n(v, this) && !e.data.isPaused) {
82
- i(v, this, !1), this.dispatchEvent(new Event("playing"));
82
+ if (i(b, this) && !e.data.isPaused) {
83
+ o(b, this, !1), this.dispatchEvent(new Event("playing"));
83
84
  return;
84
85
  }
85
- if (!this.paused && !this.seeking && !n(y, this) && Math.ceil(this.currentTime) >= this.duration) {
86
- if (i(y, this, !0), this.loop) {
86
+ if (!this.paused && !this.seeking && !i(x, this) && Math.ceil(this.currentTime) >= this.duration) {
87
+ if (o(x, this, !0), this.loop) {
87
88
  this.currentTime = 1;
88
89
  return;
89
90
  }
@@ -103,21 +104,21 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
103
104
  }
104
105
  async play() {
105
106
  var e;
106
- return i(b, this, !1), i(v, this, !0), this.dispatchEvent(new Event("play")), await this.loadComplete, (e = this.api) == null ? void 0 : e.resume();
107
+ return o(S, this, !1), o(b, this, !0), this.dispatchEvent(new Event("play")), await this.loadComplete, (e = this.api) == null ? void 0 : e.resume();
107
108
  }
108
109
  async pause() {
109
110
  var e;
110
111
  return await this.loadComplete, (e = this.api) == null ? void 0 : e.pause();
111
112
  }
112
113
  get config() {
113
- return n(w, this);
114
+ return i(E, this);
114
115
  }
115
116
  set config(e) {
116
- i(w, this, e);
117
+ o(E, this, e);
117
118
  }
118
119
  get paused() {
119
120
  var e;
120
- return (e = n(b, this)) == null ? !0 : e;
121
+ return (e = i(S, this)) == null ? !0 : e;
121
122
  }
122
123
  get muted() {
123
124
  return !1;
@@ -131,7 +132,7 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
131
132
  return Math.ceil(this.currentTime) >= this.duration;
132
133
  }
133
134
  get seeking() {
134
- return n(C, this);
135
+ return i(T, this);
135
136
  }
136
137
  get loop() {
137
138
  return this.hasAttribute("loop");
@@ -140,19 +141,19 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
140
141
  this.loop != e && this.toggleAttribute("loop", !!e);
141
142
  }
142
143
  get currentTime() {
143
- return n(x, this);
144
+ return i(C, this);
144
145
  }
145
146
  set currentTime(e) {
146
147
  if (this.currentTime == e) return;
147
- i(C, this, !0);
148
- let t = n(x, this);
149
- i(x, this, e), this.dispatchEvent(new Event("timeupdate")), i(x, this, t), this.loadComplete.then(() => {
148
+ o(T, this, !0);
149
+ let t = i(C, this);
150
+ o(C, this, e), this.dispatchEvent(new Event("timeupdate")), o(C, this, t), this.loadComplete.then(() => {
150
151
  var t;
151
152
  (t = this.api) == null || t.seek(e);
152
153
  });
153
154
  }
154
155
  get duration() {
155
- return n(S, this);
156
+ return i(w, this);
156
157
  }
157
158
  get src() {
158
159
  return this.getAttribute("src");
@@ -161,18 +162,18 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
161
162
  this.setAttribute("src", `${e}`);
162
163
  }
163
164
  };
164
- function D(e) {
165
+ function k(e) {
165
166
  if (Object.prototype.hasOwnProperty.call(this, e)) {
166
167
  let t = this[e];
167
168
  delete this[e], this[e] = t;
168
169
  }
169
170
  }
170
- a(E, "getTemplateHTML", p), a(E, "shadowRootOptions", { mode: "open" }), a(E, "observedAttributes", [
171
+ s(O, "getTemplateHTML", h), s(O, "shadowRootOptions", { mode: "open" }), s(O, "observedAttributes", [
171
172
  "controls",
172
173
  "loop",
173
174
  "src"
174
175
  ]);
175
- function O(e) {
176
+ function A(e) {
176
177
  let t = "";
177
178
  for (let n in e) {
178
179
  let r = e[n];
@@ -180,10 +181,10 @@ function O(e) {
180
181
  }
181
182
  return t;
182
183
  }
183
- function k(e) {
184
- return String(new URLSearchParams(A(e)));
184
+ function j(e) {
185
+ return String(new URLSearchParams(M(e)));
185
186
  }
186
- function A(e) {
187
+ function M(e) {
187
188
  let t = {};
188
189
  for (let n in e) {
189
190
  let r = e[n];
@@ -191,21 +192,21 @@ function A(e) {
191
192
  }
192
193
  return t;
193
194
  }
194
- function j(e) {
195
+ function N(e) {
195
196
  let t = {};
196
197
  for (let n of e) t[n.name] = n.value;
197
198
  return t;
198
199
  }
199
- var M = {};
200
- async function N(e, t, n) {
201
- return M[e] ? M[e] : t && self[t] ? Promise.resolve(self[t]) : M[e] = new Promise(function(t, r) {
200
+ var P = {};
201
+ async function F(e, t, n) {
202
+ return P[e] ? P[e] : t && self[t] ? Promise.resolve(self[t]) : P[e] = new Promise(function(t, r) {
202
203
  let i = document.createElement("script");
203
204
  i.src = e;
204
205
  let a = (e) => t(e);
205
206
  n && (self[n] = a), i.onload = () => !n && a(), i.onerror = r, document.head.append(i);
206
207
  });
207
208
  }
208
- var P = class extends Promise {
209
+ var I = class extends Promise {
209
210
  constructor(e = () => {}) {
210
211
  let t, n;
211
212
  super((r, i) => {
@@ -213,8 +214,8 @@ var P = class extends Promise {
213
214
  }), this.resolve = t, this.reject = n;
214
215
  }
215
216
  };
216
- globalThis.customElements && !globalThis.customElements.get("spotify-audio") && globalThis.customElements.define("spotify-audio", E);
217
- var F = E, I = /* @__PURE__ */ new Set([
217
+ globalThis.customElements && !globalThis.customElements.get("spotify-audio") && globalThis.customElements.define("spotify-audio", O);
218
+ var L = O, R = /* @__PURE__ */ new Set([
218
219
  "style",
219
220
  "children",
220
221
  "ref",
@@ -222,28 +223,28 @@ var F = E, I = /* @__PURE__ */ new Set([
222
223
  "suppressContentEditableWarning",
223
224
  "suppressHydrationWarning",
224
225
  "dangerouslySetInnerHTML"
225
- ]), L = {
226
+ ]), z = {
226
227
  className: "class",
227
228
  htmlFor: "for"
228
229
  };
229
- function R(e) {
230
+ function B(e) {
230
231
  return e.toLowerCase();
231
232
  }
232
- function z(e) {
233
+ function V(e) {
233
234
  if (typeof e == "boolean") return e ? "" : void 0;
234
235
  if (typeof e != "function" && !(typeof e == "object" && e)) return e;
235
236
  }
236
- function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = R, toAttributeValue: s = z }) {
237
+ function H({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = B, toAttributeValue: s = V }) {
237
238
  let c = Number.parseInt(e.version) >= 19, l = e.forwardRef((i, l) => {
238
239
  var u, d;
239
240
  let f = e.useRef(null), p = e.useRef(/* @__PURE__ */ new Map()), m = {}, h = {}, g = {}, _ = {};
240
241
  for (let [e, t] of Object.entries(i)) {
241
242
  var v, y;
242
- if (I.has(e)) {
243
+ if (R.has(e)) {
243
244
  g[e] = t;
244
245
  continue;
245
246
  }
246
- let r = o((v = L[e]) == null ? e : v);
247
+ let r = o((v = z[e]) == null ? e : v);
247
248
  if (n.prototype && e in n.prototype && !(e in ((y = (u = globalThis.HTMLElement) == null ? void 0 : u.prototype) == null ? {} : y)) && !((d = n.observedAttributes) != null && d.some((e) => e === r))) {
248
249
  _[e] = t;
249
250
  continue;
@@ -253,7 +254,7 @@ function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
253
254
  continue;
254
255
  }
255
256
  let i = s(t);
256
- r && i != null && (h[r] = String(i), c || (g[r] = i)), r && c && (i === z(t) ? g[r] = t : g[r] = i);
257
+ r && i != null && (h[r] = String(i), c || (g[r] = i)), r && c && (i === V(t) ? g[r] = t : g[r] = i);
257
258
  }
258
259
  if (typeof window < "u") {
259
260
  for (let t in m) {
@@ -269,8 +270,8 @@ function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
269
270
  e.useLayoutEffect(() => {
270
271
  if (f.current === null) return;
271
272
  let e = /* @__PURE__ */ new Map();
272
- for (let t in _) V(f.current, t, _[t]), p.current.delete(t), e.set(t, _[t]);
273
- for (let [e, t] of p.current) V(f.current, e, void 0);
273
+ for (let t in _) U(f.current, t, _[t]), p.current.delete(t), e.set(t, _[t]);
274
+ for (let [e, t] of p.current) U(f.current, e, void 0);
274
275
  p.current = e;
275
276
  });
276
277
  }
@@ -293,19 +294,19 @@ function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
293
294
  });
294
295
  return l.displayName = i == null ? n.name : i, l;
295
296
  }
296
- function V(e, t, n) {
297
+ function U(e, t, n) {
297
298
  var r, i;
298
299
  e[t] = n, n == null && t in ((r = (i = globalThis.HTMLElement) == null ? void 0 : i.prototype) == null ? {} : r) && e.removeAttribute(t);
299
300
  }
300
- var H = B({
301
- react: o,
301
+ var W = H({
302
+ react: c.default,
302
303
  tagName: "spotify-audio",
303
- elementClass: F,
304
+ elementClass: L,
304
305
  toAttributeName(e) {
305
- return e === "muted" ? "" : e === "defaultMuted" ? "muted" : R(e);
306
+ return e === "muted" ? "" : e === "defaultMuted" ? "muted" : B(e);
306
307
  }
307
308
  });
308
309
  //#endregion
309
- export { H as default };
310
+ export { W as default };
310
311
 
311
- //# sourceMappingURL=react-GXf8sbzf.js.map
312
+ //# sourceMappingURL=react-DJysvNxz.js.map