@evelan/jexity-widget 0.2.0 → 0.3.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.
Files changed (90) hide show
  1. package/README.md +162 -16
  2. package/dist/index.mjs +1046 -731
  3. package/dist/index.mjs.map +1 -1
  4. package/dist/react.mjs +20 -11
  5. package/dist/react.mjs.map +1 -1
  6. package/dist/types/entries/esm.d.ts +4 -0
  7. package/dist/types/entries/esm.d.ts.map +1 -0
  8. package/dist/types/{react.d.ts → entries/react.d.ts} +1 -1
  9. package/dist/types/entries/react.d.ts.map +1 -0
  10. package/dist/types/features/chat/components/BotMessage.d.ts +6 -0
  11. package/dist/types/features/chat/components/BotMessage.d.ts.map +1 -0
  12. package/dist/types/features/chat/components/ChatInput.d.ts +3 -0
  13. package/dist/types/features/chat/components/ChatInput.d.ts.map +1 -0
  14. package/dist/types/features/chat/components/ChatScreen.d.ts +8 -0
  15. package/dist/types/features/chat/components/ChatScreen.d.ts.map +1 -0
  16. package/dist/types/features/chat/components/MessageList.d.ts +3 -0
  17. package/dist/types/features/chat/components/MessageList.d.ts.map +1 -0
  18. package/dist/types/features/chat/components/TypingIndicator.d.ts +2 -0
  19. package/dist/types/features/chat/components/TypingIndicator.d.ts.map +1 -0
  20. package/dist/types/features/chat/components/UserMessage.d.ts +6 -0
  21. package/dist/types/features/chat/components/UserMessage.d.ts.map +1 -0
  22. package/dist/types/features/chat/lib/chat.d.ts +13 -0
  23. package/dist/types/features/chat/lib/chat.d.ts.map +1 -0
  24. package/dist/types/features/home/components/HomeScreen.d.ts +14 -0
  25. package/dist/types/features/home/components/HomeScreen.d.ts.map +1 -0
  26. package/dist/types/features/selection/components/SelectionScreen.d.ts +7 -0
  27. package/dist/types/features/selection/components/SelectionScreen.d.ts.map +1 -0
  28. package/dist/types/features/ticket/components/ConfirmationScreen.d.ts +7 -0
  29. package/dist/types/features/ticket/components/ConfirmationScreen.d.ts.map +1 -0
  30. package/dist/types/features/ticket/components/FormScreen.d.ts +3 -0
  31. package/dist/types/features/ticket/components/FormScreen.d.ts.map +1 -0
  32. package/dist/types/i18n/config.d.ts +10 -0
  33. package/dist/types/i18n/config.d.ts.map +1 -0
  34. package/dist/types/i18n/index.d.ts +6 -1
  35. package/dist/types/i18n/index.d.ts.map +1 -1
  36. package/dist/types/i18n/locales/de.d.ts.map +1 -1
  37. package/dist/types/i18n/locales/en.d.ts +19 -0
  38. package/dist/types/i18n/locales/en.d.ts.map +1 -1
  39. package/dist/types/i18n/resolve-widget-locale.d.ts +10 -7
  40. package/dist/types/i18n/resolve-widget-locale.d.ts.map +1 -1
  41. package/dist/types/module/screens/ScreenRouter.d.ts +8 -0
  42. package/dist/types/module/screens/ScreenRouter.d.ts.map +1 -0
  43. package/dist/types/module/screens/screens.state.d.ts +26 -0
  44. package/dist/types/module/screens/screens.state.d.ts.map +1 -0
  45. package/dist/types/module/shell/AppShell.d.ts +8 -0
  46. package/dist/types/module/shell/AppShell.d.ts.map +1 -0
  47. package/dist/types/module/shell/mount.d.ts +13 -0
  48. package/dist/types/module/shell/mount.d.ts.map +1 -0
  49. package/dist/types/module/shell/shell.state.d.ts +2 -0
  50. package/dist/types/module/shell/shell.state.d.ts.map +1 -0
  51. package/dist/types/module/visitor/visitor.state.d.ts +21 -0
  52. package/dist/types/module/visitor/visitor.state.d.ts.map +1 -0
  53. package/dist/types/shared/icons/BotIcon.d.ts +4 -0
  54. package/dist/types/shared/icons/BotIcon.d.ts.map +1 -0
  55. package/dist/types/shared/icons/CloseIcon.d.ts +4 -0
  56. package/dist/types/shared/icons/CloseIcon.d.ts.map +1 -0
  57. package/dist/types/shared/icons/MessageIcon.d.ts +4 -0
  58. package/dist/types/shared/icons/MessageIcon.d.ts.map +1 -0
  59. package/dist/types/shared/icons/SendIcon.d.ts +4 -0
  60. package/dist/types/shared/icons/SendIcon.d.ts.map +1 -0
  61. package/dist/types/shared/icons/SparklesIcon.d.ts +5 -0
  62. package/dist/types/shared/icons/SparklesIcon.d.ts.map +1 -0
  63. package/dist/types/shared/icons/ZapIcon.d.ts +4 -0
  64. package/dist/types/shared/icons/ZapIcon.d.ts.map +1 -0
  65. package/dist/types/shared/theme/build-theme.d.ts +5 -0
  66. package/dist/types/shared/theme/build-theme.d.ts.map +1 -0
  67. package/dist/types/shared/theme/inject-styles.d.ts +10 -0
  68. package/dist/types/shared/theme/inject-styles.d.ts.map +1 -0
  69. package/dist/types/shared/ui/ErrorScreen.d.ts +9 -0
  70. package/dist/types/shared/ui/ErrorScreen.d.ts.map +1 -0
  71. package/dist/types/shared/ui/FAB.d.ts +9 -0
  72. package/dist/types/shared/ui/FAB.d.ts.map +1 -0
  73. package/dist/types/shared/ui/Footer.d.ts +3 -0
  74. package/dist/types/shared/ui/Footer.d.ts.map +1 -0
  75. package/dist/types/shared/ui/Header.d.ts +7 -0
  76. package/dist/types/shared/ui/Header.d.ts.map +1 -0
  77. package/dist/types/shared/ui/LoadingScreen.d.ts +7 -0
  78. package/dist/types/shared/ui/LoadingScreen.d.ts.map +1 -0
  79. package/dist/types/types.d.ts +11 -1
  80. package/dist/types/types.d.ts.map +1 -1
  81. package/dist/widget.js +1 -2
  82. package/dist/widget.js.map +1 -1
  83. package/package.json +6 -4
  84. package/dist/types/app.d.ts +0 -6
  85. package/dist/types/app.d.ts.map +0 -1
  86. package/dist/types/index.d.ts +0 -4
  87. package/dist/types/index.d.ts.map +0 -1
  88. package/dist/types/react.d.ts.map +0 -1
  89. package/dist/types/widget-state.d.ts +0 -7
  90. package/dist/types/widget-state.d.ts.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,703 +1,592 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.jex-widget{--jex-primary: #115A62;--jex-primary-hover: #0e4e55;--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: #1693a0;--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9)}@media(prefers-color-scheme:dark){:root:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: #1693a0;--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9)}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}.jex-floating-button{width:56px;height:56px;border-radius:28px;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:380px;height:600px;max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:24px;box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message{max-width:80%;padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{align-self:flex-start;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275)}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005}.dark .jex-widget .jex-widget-footer,.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:root:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.dark .jex-widget .jex-locale-select:hover,.dark .jex-widget .jex-locale-select:focus-visible,.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.dark .jex-widget .jex-locale-select option,.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:root:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:root:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:root:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}')),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- var oe, v, Be, qe, L, $e, ze, Re, Ge, ye, ce, fe, q = {}, Ve = [], pt = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, V = Array.isArray;
3
- function N(t, e) {
4
- for (var n in e) t[n] = e[n];
1
+ var fe, v, Ye, Je, H, He, Ze, Ke, Xe, Se, ge, me, Z = {}, Qe = [], St = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, he = Array.isArray;
2
+ function A(t, e) {
3
+ for (var r in e) t[r] = e[r];
5
4
  return t;
6
5
  }
7
- function me(t) {
6
+ function Ce(t) {
8
7
  t && t.parentNode && t.parentNode.removeChild(t);
9
8
  }
10
- function z(t, e, n) {
11
- var i, r, o, s = {};
12
- for (o in e) o == "key" ? i = e[o] : o == "ref" ? r = e[o] : s[o] = e[o];
13
- if (arguments.length > 2 && (s.children = arguments.length > 3 ? oe.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (o in t.defaultProps) s[o] === void 0 && (s[o] = t.defaultProps[o]);
14
- return ee(t, s, i, r, null);
9
+ function Ct(t, e, r) {
10
+ var n, i, o, l = {};
11
+ for (o in e) o == "key" ? n = e[o] : o == "ref" ? i = e[o] : l[o] = e[o];
12
+ if (arguments.length > 2 && (l.children = arguments.length > 3 ? fe.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null) for (o in t.defaultProps) l[o] === void 0 && (l[o] = t.defaultProps[o]);
13
+ return oe(t, l, n, i, null);
15
14
  }
16
- function ee(t, e, n, i, r) {
17
- var o = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++Be, __i: -1, __u: 0 };
18
- return r == null && v.vnode != null && v.vnode(o), o;
15
+ function oe(t, e, r, n, i) {
16
+ var o = { type: t, props: e, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++Ye, __i: -1, __u: 0 };
17
+ return i == null && v.vnode != null && v.vnode(o), o;
19
18
  }
20
- function Z(t) {
19
+ function W(t) {
21
20
  return t.children;
22
21
  }
23
- function W(t, e) {
22
+ function V(t, e) {
24
23
  this.props = t, this.context = e;
25
24
  }
26
- function U(t, e) {
27
- if (e == null) return t.__ ? U(t.__, t.__i + 1) : null;
28
- for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
29
- return typeof t.type == "function" ? U(t) : null;
25
+ function D(t, e) {
26
+ if (e == null) return t.__ ? D(t.__, t.__i + 1) : null;
27
+ for (var r; e < t.__k.length; e++) if ((r = t.__k[e]) != null && r.__e != null) return r.__e;
28
+ return typeof t.type == "function" ? D(t) : null;
30
29
  }
31
- function Ze(t) {
32
- var e, n;
30
+ function et(t) {
31
+ var e, r;
33
32
  if ((t = t.__) != null && t.__c != null) {
34
- for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
35
- t.__e = t.__c.base = n.__e;
33
+ for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((r = t.__k[e]) != null && r.__e != null) {
34
+ t.__e = t.__c.base = r.__e;
36
35
  break;
37
36
  }
38
- return Ze(t);
37
+ return et(t);
39
38
  }
40
39
  }
41
- function Se(t) {
42
- (!t.__d && (t.__d = !0) && L.push(t) && !ne.__r++ || $e != v.debounceRendering) && (($e = v.debounceRendering) || ze)(ne);
40
+ function Ie(t) {
41
+ (!t.__d && (t.__d = !0) && H.push(t) && !se.__r++ || He != v.debounceRendering) && ((He = v.debounceRendering) || Ze)(se);
43
42
  }
44
- function ne() {
45
- for (var t, e, n, i, r, o, s, l = 1; L.length; ) L.length > l && L.sort(Re), t = L.shift(), l = L.length, t.__d && (n = void 0, i = void 0, r = (i = (e = t).__v).__e, o = [], s = [], e.__P && ((n = N({}, i)).__v = i.__v + 1, v.vnode && v.vnode(n), ge(e.__P, n, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, o, r ?? U(i), !!(32 & i.__u), s), n.__v = i.__v, n.__.__k[n.__i] = n, Ye(o, n, s), i.__e = i.__ = null, n.__e != r && Ze(n)));
46
- ne.__r = 0;
43
+ function se() {
44
+ for (var t, e, r, n, i, o, l, c = 1; H.length; ) H.length > c && H.sort(Ke), t = H.shift(), c = H.length, t.__d && (r = void 0, n = void 0, i = (n = (e = t).__v).__e, o = [], l = [], e.__P && ((r = A({}, n)).__v = n.__v + 1, v.vnode && v.vnode(r), $e(e.__P, r, n, e.__n, e.__P.namespaceURI, 32 & n.__u ? [i] : null, o, i ?? D(n), !!(32 & n.__u), l), r.__v = n.__v, r.__.__k[r.__i] = r, nt(o, r, l), n.__e = n.__ = null, r.__e != i && et(r)));
45
+ se.__r = 0;
47
46
  }
48
- function Je(t, e, n, i, r, o, s, l, u, a, h) {
49
- var _, f, c, b, $, x, y, m = i && i.__k || Ve, j = e.length;
50
- for (u = yt(n, e, m, u, j), _ = 0; _ < j; _++) (c = n.__k[_]) != null && (f = c.__i == -1 ? q : m[c.__i] || q, c.__i = _, x = ge(t, c, f, r, o, s, l, u, a, h), b = c.__e, c.ref && f.ref != c.ref && (f.ref && be(f.ref, null, c), h.push(c.ref, c.__c || b, c)), $ == null && b != null && ($ = b), (y = !!(4 & c.__u)) || f.__k === c.__k ? u = Ke(c, u, t, y) : typeof c.type == "function" && x !== void 0 ? u = x : b && (u = b.nextSibling), c.__u &= -7);
51
- return n.__e = $, u;
47
+ function tt(t, e, r, n, i, o, l, c, d, u, h) {
48
+ var s, p, f, j, k, m, g, _ = n && n.__k || Qe, C = e.length;
49
+ for (d = $t(r, e, _, d, C), s = 0; s < C; s++) (f = r.__k[s]) != null && (p = f.__i == -1 ? Z : _[f.__i] || Z, f.__i = s, m = $e(t, f, p, i, o, l, c, d, u, h), j = f.__e, f.ref && p.ref != f.ref && (p.ref && Ee(p.ref, null, f), h.push(f.ref, f.__c || j, f)), k == null && j != null && (k = j), (g = !!(4 & f.__u)) || p.__k === f.__k ? d = rt(f, d, t, g) : typeof f.type == "function" && m !== void 0 ? d = m : j && (d = j.nextSibling), f.__u &= -7);
50
+ return r.__e = k, d;
52
51
  }
53
- function yt(t, e, n, i, r) {
54
- var o, s, l, u, a, h = n.length, _ = h, f = 0;
55
- for (t.__k = new Array(r), o = 0; o < r; o++) (s = e[o]) != null && typeof s != "boolean" && typeof s != "function" ? (u = o + f, (s = t.__k[o] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? ee(null, s, null, null, null) : V(s) ? ee(Z, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? ee(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = t, s.__b = t.__b + 1, l = null, (a = s.__i = mt(s, n, u, _)) != -1 && (_--, (l = n[a]) && (l.__u |= 2)), l == null || l.__v == null ? (a == -1 && (r > h ? f-- : r < h && f++), typeof s.type != "function" && (s.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, s.__u |= 4))) : t.__k[o] = null;
56
- if (_) for (o = 0; o < h; o++) (l = n[o]) != null && (2 & l.__u) == 0 && (l.__e == i && (i = U(l)), et(l, l));
57
- return i;
52
+ function $t(t, e, r, n, i) {
53
+ var o, l, c, d, u, h = r.length, s = h, p = 0;
54
+ for (t.__k = new Array(i), o = 0; o < i; o++) (l = e[o]) != null && typeof l != "boolean" && typeof l != "function" ? (d = o + p, (l = t.__k[o] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? oe(null, l, null, null, null) : he(l) ? oe(W, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? oe(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = t, l.__b = t.__b + 1, c = null, (u = l.__i = Et(l, r, d, s)) != -1 && (s--, (c = r[u]) && (c.__u |= 2)), c == null || c.__v == null ? (u == -1 && (i > h ? p-- : i < h && p++), typeof l.type != "function" && (l.__u |= 4)) : u != d && (u == d - 1 ? p-- : u == d + 1 ? p++ : (u > d ? p-- : p++, l.__u |= 4))) : t.__k[o] = null;
55
+ if (s) for (o = 0; o < h; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n = D(c)), ot(c, c));
56
+ return n;
58
57
  }
59
- function Ke(t, e, n, i) {
60
- var r, o;
58
+ function rt(t, e, r, n) {
59
+ var i, o;
61
60
  if (typeof t.type == "function") {
62
- for (r = t.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = t, e = Ke(r[o], e, n, i));
61
+ for (i = t.__k, o = 0; i && o < i.length; o++) i[o] && (i[o].__ = t, e = rt(i[o], e, r, n));
63
62
  return e;
64
63
  }
65
- t.__e != e && (i && (e && t.type && !e.parentNode && (e = U(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
64
+ t.__e != e && (n && (e && t.type && !e.parentNode && (e = D(t)), r.insertBefore(t.__e, e || null)), e = t.__e);
66
65
  do
67
66
  e = e && e.nextSibling;
68
67
  while (e != null && e.nodeType == 8);
69
68
  return e;
70
69
  }
71
- function Qe(t, e) {
72
- return e = e || [], t == null || typeof t == "boolean" || (V(t) ? t.some(function(n) {
73
- Qe(n, e);
74
- }) : e.push(t)), e;
75
- }
76
- function mt(t, e, n, i) {
77
- var r, o, s, l = t.key, u = t.type, a = e[n], h = a != null && (2 & a.__u) == 0;
78
- if (a === null && t.key == null || h && l == a.key && u == a.type) return n;
79
- if (i > (h ? 1 : 0)) {
80
- for (r = n - 1, o = n + 1; r >= 0 || o < e.length; ) if ((a = e[s = r >= 0 ? r-- : o++]) != null && (2 & a.__u) == 0 && l == a.key && u == a.type) return s;
70
+ function Et(t, e, r, n) {
71
+ var i, o, l, c = t.key, d = t.type, u = e[r], h = u != null && (2 & u.__u) == 0;
72
+ if (u === null && t.key == null || h && c == u.key && d == u.type) return r;
73
+ if (n > (h ? 1 : 0)) {
74
+ for (i = r - 1, o = r + 1; i >= 0 || o < e.length; ) if ((u = e[l = i >= 0 ? i-- : o++]) != null && (2 & u.__u) == 0 && c == u.key && d == u.type) return l;
81
75
  }
82
76
  return -1;
83
77
  }
84
- function Ce(t, e, n) {
85
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || pt.test(e) ? n : n + "px";
78
+ function Re(t, e, r) {
79
+ e[0] == "-" ? t.setProperty(e, r ?? "") : t[e] = r == null ? "" : typeof r != "number" || St.test(e) ? r : r + "px";
86
80
  }
87
- function Y(t, e, n, i, r) {
88
- var o, s;
89
- e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
81
+ function ne(t, e, r, n, i) {
82
+ var o, l;
83
+ e: if (e == "style") if (typeof r == "string") t.style.cssText = r;
90
84
  else {
91
- if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n || Ce(t.style, e, "");
92
- if (n) for (e in n) i && n[e] == i[e] || Ce(t.style, e, n[e]);
85
+ if (typeof n == "string" && (t.style.cssText = n = ""), n) for (e in n) r && e in r || Re(t.style, e, "");
86
+ if (r) for (e in r) n && r[e] == n[e] || Re(t.style, e, r[e]);
93
87
  }
94
- else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(Ge, "$1")), s = e.toLowerCase(), e = s in t || e == "onFocusOut" || e == "onFocusIn" ? s.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + o] = n, n ? i ? n.u = i.u : (n.u = ye, t.addEventListener(e, o ? fe : ce, o)) : t.removeEventListener(e, o ? fe : ce, o);
88
+ else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(Xe, "$1")), l = e.toLowerCase(), e = l in t || e == "onFocusOut" || e == "onFocusIn" ? l.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + o] = r, r ? n ? r.u = n.u : (r.u = Se, t.addEventListener(e, o ? me : ge, o)) : t.removeEventListener(e, o ? me : ge, o);
95
89
  else {
96
- if (r == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
90
+ if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
97
91
  else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
98
- t[e] = n ?? "";
92
+ t[e] = r ?? "";
99
93
  break e;
100
94
  } catch {
101
95
  }
102
- typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
96
+ typeof r == "function" || (r == null || r === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && r == 1 ? "" : r));
103
97
  }
104
98
  }
105
- function Ne(t) {
99
+ function Pe(t) {
106
100
  return function(e) {
107
101
  if (this.l) {
108
- var n = this.l[e.type + t];
109
- if (e.t == null) e.t = ye++;
110
- else if (e.t < n.u) return;
111
- return n(v.event ? v.event(e) : e);
102
+ var r = this.l[e.type + t];
103
+ if (e.t == null) e.t = Se++;
104
+ else if (e.t < r.u) return;
105
+ return r(v.event ? v.event(e) : e);
112
106
  }
113
107
  };
114
108
  }
115
- function ge(t, e, n, i, r, o, s, l, u, a) {
116
- var h, _, f, c, b, $, x, y, m, j, E, K, D, ke, Q, I, ae, C = e.type;
109
+ function $e(t, e, r, n, i, o, l, c, d, u) {
110
+ var h, s, p, f, j, k, m, g, _, C, z, te, F, Le, re, q, _e, $ = e.type;
117
111
  if (e.constructor != null) return null;
118
- 128 & n.__u && (u = !!(32 & n.__u), o = [l = e.__e = n.__e]), (h = v.__b) && h(e);
119
- e: if (typeof C == "function") try {
120
- if (y = e.props, m = "prototype" in C && C.prototype.render, j = (h = C.contextType) && i[h.__c], E = h ? j ? j.props.value : h.__ : i, n.__c ? x = (_ = e.__c = n.__c).__ = _.__E : (m ? e.__c = _ = new C(y, E) : (e.__c = _ = new W(y, E), _.constructor = C, _.render = bt), j && j.sub(_), _.props = y, _.state || (_.state = {}), _.context = E, _.__n = i, f = _.__d = !0, _.__h = [], _._sb = []), m && _.__s == null && (_.__s = _.state), m && C.getDerivedStateFromProps != null && (_.__s == _.state && (_.__s = N({}, _.__s)), N(_.__s, C.getDerivedStateFromProps(y, _.__s))), c = _.props, b = _.state, _.__v = e, f) m && C.getDerivedStateFromProps == null && _.componentWillMount != null && _.componentWillMount(), m && _.componentDidMount != null && _.__h.push(_.componentDidMount);
112
+ 128 & r.__u && (d = !!(32 & r.__u), o = [c = e.__e = r.__e]), (h = v.__b) && h(e);
113
+ e: if (typeof $ == "function") try {
114
+ if (g = e.props, _ = "prototype" in $ && $.prototype.render, C = (h = $.contextType) && n[h.__c], z = h ? C ? C.props.value : h.__ : n, r.__c ? m = (s = e.__c = r.__c).__ = s.__E : (_ ? e.__c = s = new $(g, z) : (e.__c = s = new V(g, z), s.constructor = $, s.render = Nt), C && C.sub(s), s.props = g, s.state || (s.state = {}), s.context = z, s.__n = n, p = s.__d = !0, s.__h = [], s._sb = []), _ && s.__s == null && (s.__s = s.state), _ && $.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = A({}, s.__s)), A(s.__s, $.getDerivedStateFromProps(g, s.__s))), f = s.props, j = s.state, s.__v = e, p) _ && $.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), _ && s.componentDidMount != null && s.__h.push(s.componentDidMount);
121
115
  else {
122
- if (m && C.getDerivedStateFromProps == null && y !== c && _.componentWillReceiveProps != null && _.componentWillReceiveProps(y, E), !_.__e && _.shouldComponentUpdate != null && _.shouldComponentUpdate(y, _.__s, E) === !1 || e.__v == n.__v) {
123
- for (e.__v != n.__v && (_.props = y, _.state = _.__s, _.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(T) {
124
- T && (T.__ = e);
125
- }), K = 0; K < _._sb.length; K++) _.__h.push(_._sb[K]);
126
- _._sb = [], _.__h.length && s.push(_);
116
+ if (_ && $.getDerivedStateFromProps == null && g !== f && s.componentWillReceiveProps != null && s.componentWillReceiveProps(g, z), !s.__e && s.shouldComponentUpdate != null && s.shouldComponentUpdate(g, s.__s, z) === !1 || e.__v == r.__v) {
117
+ for (e.__v != r.__v && (s.props = g, s.state = s.__s, s.__d = !1), e.__e = r.__e, e.__k = r.__k, e.__k.some(function(P) {
118
+ P && (P.__ = e);
119
+ }), te = 0; te < s._sb.length; te++) s.__h.push(s._sb[te]);
120
+ s._sb = [], s.__h.length && l.push(s);
127
121
  break e;
128
122
  }
129
- _.componentWillUpdate != null && _.componentWillUpdate(y, _.__s, E), m && _.componentDidUpdate != null && _.__h.push(function() {
130
- _.componentDidUpdate(c, b, $);
123
+ s.componentWillUpdate != null && s.componentWillUpdate(g, s.__s, z), _ && s.componentDidUpdate != null && s.__h.push(function() {
124
+ s.componentDidUpdate(f, j, k);
131
125
  });
132
126
  }
133
- if (_.context = E, _.props = y, _.__P = t, _.__e = !1, D = v.__r, ke = 0, m) {
134
- for (_.state = _.__s, _.__d = !1, D && D(e), h = _.render(_.props, _.state, _.context), Q = 0; Q < _._sb.length; Q++) _.__h.push(_._sb[Q]);
135
- _._sb = [];
127
+ if (s.context = z, s.props = g, s.__P = t, s.__e = !1, F = v.__r, Le = 0, _) {
128
+ for (s.state = s.__s, s.__d = !1, F && F(e), h = s.render(s.props, s.state, s.context), re = 0; re < s._sb.length; re++) s.__h.push(s._sb[re]);
129
+ s._sb = [];
136
130
  } else do
137
- _.__d = !1, D && D(e), h = _.render(_.props, _.state, _.context), _.state = _.__s;
138
- while (_.__d && ++ke < 25);
139
- _.state = _.__s, _.getChildContext != null && (i = N(N({}, i), _.getChildContext())), m && !f && _.getSnapshotBeforeUpdate != null && ($ = _.getSnapshotBeforeUpdate(c, b)), I = h, h != null && h.type === Z && h.key == null && (I = Xe(h.props.children)), l = Je(t, V(I) ? I : [I], e, n, i, r, o, s, l, u, a), _.base = e.__e, e.__u &= -161, _.__h.length && s.push(_), x && (_.__E = _.__ = null);
140
- } catch (T) {
141
- if (e.__v = null, u || o != null) if (T.then) {
142
- for (e.__u |= u ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
143
- o[o.indexOf(l)] = null, e.__e = l;
131
+ s.__d = !1, F && F(e), h = s.render(s.props, s.state, s.context), s.state = s.__s;
132
+ while (s.__d && ++Le < 25);
133
+ s.state = s.__s, s.getChildContext != null && (n = A(A({}, n), s.getChildContext())), _ && !p && s.getSnapshotBeforeUpdate != null && (k = s.getSnapshotBeforeUpdate(f, j)), q = h, h != null && h.type === W && h.key == null && (q = it(h.props.children)), c = tt(t, he(q) ? q : [q], e, r, n, i, o, l, c, d, u), s.base = e.__e, e.__u &= -161, s.__h.length && l.push(s), m && (s.__E = s.__ = null);
134
+ } catch (P) {
135
+ if (e.__v = null, d || o != null) if (P.then) {
136
+ for (e.__u |= d ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
137
+ o[o.indexOf(c)] = null, e.__e = c;
144
138
  } else {
145
- for (ae = o.length; ae--; ) me(o[ae]);
146
- he(e);
139
+ for (_e = o.length; _e--; ) Ce(o[_e]);
140
+ be(e);
147
141
  }
148
- else e.__e = n.__e, e.__k = n.__k, T.then || he(e);
149
- v.__e(T, e, n);
142
+ else e.__e = r.__e, e.__k = r.__k, P.then || be(e);
143
+ v.__e(P, e, r);
150
144
  }
151
- else o == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = gt(n.__e, e, n, i, r, o, s, u, a);
152
- return (h = v.diffed) && h(e), 128 & e.__u ? void 0 : l;
145
+ else o == null && e.__v == r.__v ? (e.__k = r.__k, e.__e = r.__e) : c = e.__e = At(r.__e, e, r, n, i, o, l, d, u);
146
+ return (h = v.diffed) && h(e), 128 & e.__u ? void 0 : c;
153
147
  }
154
- function he(t) {
155
- t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(he);
148
+ function be(t) {
149
+ t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(be);
156
150
  }
157
- function Ye(t, e, n) {
158
- for (var i = 0; i < n.length; i++) be(n[i], n[++i], n[++i]);
159
- v.__c && v.__c(e, t), t.some(function(r) {
151
+ function nt(t, e, r) {
152
+ for (var n = 0; n < r.length; n++) Ee(r[n], r[++n], r[++n]);
153
+ v.__c && v.__c(e, t), t.some(function(i) {
160
154
  try {
161
- t = r.__h, r.__h = [], t.some(function(o) {
162
- o.call(r);
155
+ t = i.__h, i.__h = [], t.some(function(o) {
156
+ o.call(i);
163
157
  });
164
158
  } catch (o) {
165
- v.__e(o, r.__v);
159
+ v.__e(o, i.__v);
166
160
  }
167
161
  });
168
162
  }
169
- function Xe(t) {
170
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : V(t) ? t.map(Xe) : N({}, t);
163
+ function it(t) {
164
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : he(t) ? t.map(it) : A({}, t);
171
165
  }
172
- function gt(t, e, n, i, r, o, s, l, u) {
173
- var a, h, _, f, c, b, $, x = n.props, y = e.props, m = e.type;
174
- if (m == "svg" ? r = "http://www.w3.org/2000/svg" : m == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), o != null) {
175
- for (a = 0; a < o.length; a++) if ((c = o[a]) && "setAttribute" in c == !!m && (m ? c.localName == m : c.nodeType == 3)) {
176
- t = c, o[a] = null;
166
+ function At(t, e, r, n, i, o, l, c, d) {
167
+ var u, h, s, p, f, j, k, m = r.props, g = e.props, _ = e.type;
168
+ if (_ == "svg" ? i = "http://www.w3.org/2000/svg" : _ == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), o != null) {
169
+ for (u = 0; u < o.length; u++) if ((f = o[u]) && "setAttribute" in f == !!_ && (_ ? f.localName == _ : f.nodeType == 3)) {
170
+ t = f, o[u] = null;
177
171
  break;
178
172
  }
179
173
  }
180
174
  if (t == null) {
181
- if (m == null) return document.createTextNode(y);
182
- t = document.createElementNS(r, m, y.is && y), l && (v.__m && v.__m(e, o), l = !1), o = null;
175
+ if (_ == null) return document.createTextNode(g);
176
+ t = document.createElementNS(i, _, g.is && g), c && (v.__m && v.__m(e, o), c = !1), o = null;
183
177
  }
184
- if (m == null) x === y || l && t.data == y || (t.data = y);
178
+ if (_ == null) m === g || c && t.data == g || (t.data = g);
185
179
  else {
186
- if (o = o && oe.call(t.childNodes), x = n.props || q, !l && o != null) for (x = {}, a = 0; a < t.attributes.length; a++) x[(c = t.attributes[a]).name] = c.value;
187
- for (a in x) if (c = x[a], a != "children") {
188
- if (a == "dangerouslySetInnerHTML") _ = c;
189
- else if (!(a in y)) {
190
- if (a == "value" && "defaultValue" in y || a == "checked" && "defaultChecked" in y) continue;
191
- Y(t, a, null, c, r);
180
+ if (o = o && fe.call(t.childNodes), m = r.props || Z, !c && o != null) for (m = {}, u = 0; u < t.attributes.length; u++) m[(f = t.attributes[u]).name] = f.value;
181
+ for (u in m) if (f = m[u], u != "children") {
182
+ if (u == "dangerouslySetInnerHTML") s = f;
183
+ else if (!(u in g)) {
184
+ if (u == "value" && "defaultValue" in g || u == "checked" && "defaultChecked" in g) continue;
185
+ ne(t, u, null, f, i);
192
186
  }
193
187
  }
194
- for (a in y) c = y[a], a == "children" ? f = c : a == "dangerouslySetInnerHTML" ? h = c : a == "value" ? b = c : a == "checked" ? $ = c : l && typeof c != "function" || x[a] === c || Y(t, a, c, x[a], r);
195
- if (h) l || _ && (h.__html == _.__html || h.__html == t.innerHTML) || (t.innerHTML = h.__html), e.__k = [];
196
- else if (_ && (t.innerHTML = ""), Je(e.type == "template" ? t.content : t, V(f) ? f : [f], e, n, i, m == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, o, s, o ? o[0] : n.__k && U(n, 0), l, u), o != null) for (a = o.length; a--; ) me(o[a]);
197
- l || (a = "value", m == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[a] || m == "progress" && !b || m == "option" && b != x[a]) && Y(t, a, b, x[a], r), a = "checked", $ != null && $ != t[a] && Y(t, a, $, x[a], r));
188
+ for (u in g) f = g[u], u == "children" ? p = f : u == "dangerouslySetInnerHTML" ? h = f : u == "value" ? j = f : u == "checked" ? k = f : c && typeof f != "function" || m[u] === f || ne(t, u, f, m[u], i);
189
+ if (h) c || s && (h.__html == s.__html || h.__html == t.innerHTML) || (t.innerHTML = h.__html), e.__k = [];
190
+ else if (s && (t.innerHTML = ""), tt(e.type == "template" ? t.content : t, he(p) ? p : [p], e, r, n, _ == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, o, l, o ? o[0] : r.__k && D(r, 0), c, d), o != null) for (u = o.length; u--; ) Ce(o[u]);
191
+ c || (u = "value", _ == "progress" && j == null ? t.removeAttribute("value") : j != null && (j !== t[u] || _ == "progress" && !j || _ == "option" && j != m[u]) && ne(t, u, j, m[u], i), u = "checked", k != null && k != t[u] && ne(t, u, k, m[u], i));
198
192
  }
199
193
  return t;
200
194
  }
201
- function be(t, e, n) {
195
+ function Ee(t, e, r) {
202
196
  try {
203
197
  if (typeof t == "function") {
204
- var i = typeof t.__u == "function";
205
- i && t.__u(), i && e == null || (t.__u = t(e));
198
+ var n = typeof t.__u == "function";
199
+ n && t.__u(), n && e == null || (t.__u = t(e));
206
200
  } else t.current = e;
207
- } catch (r) {
208
- v.__e(r, n);
201
+ } catch (i) {
202
+ v.__e(i, r);
209
203
  }
210
204
  }
211
- function et(t, e, n) {
212
- var i, r;
213
- if (v.unmount && v.unmount(t), (i = t.ref) && (i.current && i.current != t.__e || be(i, null, e)), (i = t.__c) != null) {
214
- if (i.componentWillUnmount) try {
215
- i.componentWillUnmount();
205
+ function ot(t, e, r) {
206
+ var n, i;
207
+ if (v.unmount && v.unmount(t), (n = t.ref) && (n.current && n.current != t.__e || Ee(n, null, e)), (n = t.__c) != null) {
208
+ if (n.componentWillUnmount) try {
209
+ n.componentWillUnmount();
216
210
  } catch (o) {
217
211
  v.__e(o, e);
218
212
  }
219
- i.base = i.__P = null;
213
+ n.base = n.__P = null;
220
214
  }
221
- if (i = t.__k) for (r = 0; r < i.length; r++) i[r] && et(i[r], e, n || typeof t.type != "function");
222
- n || me(t.__e), t.__c = t.__ = t.__e = void 0;
215
+ if (n = t.__k) for (i = 0; i < n.length; i++) n[i] && ot(n[i], e, r || typeof t.type != "function");
216
+ r || Ce(t.__e), t.__c = t.__ = t.__e = void 0;
223
217
  }
224
- function bt(t, e, n) {
225
- return this.constructor(t, n);
218
+ function Nt(t, e, r) {
219
+ return this.constructor(t, r);
226
220
  }
227
- function je(t, e, n) {
228
- var i, r, o, s;
229
- e == document && (e = document.documentElement), v.__ && v.__(t, e), r = (i = !1) ? null : e.__k, o = [], s = [], ge(e, t = e.__k = z(Z, null, [t]), r || q, q, e.namespaceURI, r ? null : e.firstChild ? oe.call(e.childNodes) : null, o, r ? r.__e : e.firstChild, i, s), Ye(o, t, s);
221
+ function Me(t, e, r) {
222
+ var n, i, o, l;
223
+ e == document && (e = document.documentElement), v.__ && v.__(t, e), i = (n = !1) ? null : e.__k, o = [], l = [], $e(e, t = e.__k = Ct(W, null, [t]), i || Z, Z, e.namespaceURI, i ? null : e.firstChild ? fe.call(e.childNodes) : null, o, i ? i.__e : e.firstChild, n, l), nt(o, t, l);
230
224
  }
231
- oe = Ve.slice, v = { __e: function(t, e, n, i) {
232
- for (var r, o, s; e = e.__; ) if ((r = e.__c) && !r.__) try {
233
- if ((o = r.constructor) && o.getDerivedStateFromError != null && (r.setState(o.getDerivedStateFromError(t)), s = r.__d), r.componentDidCatch != null && (r.componentDidCatch(t, i || {}), s = r.__d), s) return r.__E = r;
234
- } catch (l) {
235
- t = l;
225
+ fe = Qe.slice, v = { __e: function(t, e, r, n) {
226
+ for (var i, o, l; e = e.__; ) if ((i = e.__c) && !i.__) try {
227
+ if ((o = i.constructor) && o.getDerivedStateFromError != null && (i.setState(o.getDerivedStateFromError(t)), l = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, n || {}), l = i.__d), l) return i.__E = i;
228
+ } catch (c) {
229
+ t = c;
236
230
  }
237
231
  throw t;
238
- } }, Be = 0, qe = function(t) {
232
+ } }, Ye = 0, Je = function(t) {
239
233
  return t != null && t.constructor == null;
240
- }, W.prototype.setState = function(t, e) {
241
- var n;
242
- n = this.__s != null && this.__s != this.state ? this.__s : this.__s = N({}, this.state), typeof t == "function" && (t = t(N({}, n), this.props)), t && N(n, t), t != null && this.__v && (e && this._sb.push(e), Se(this));
243
- }, W.prototype.forceUpdate = function(t) {
244
- this.__v && (this.__e = !0, t && this.__h.push(t), Se(this));
245
- }, W.prototype.render = Z, L = [], ze = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Re = function(t, e) {
234
+ }, V.prototype.setState = function(t, e) {
235
+ var r;
236
+ r = this.__s != null && this.__s != this.state ? this.__s : this.__s = A({}, this.state), typeof t == "function" && (t = t(A({}, r), this.props)), t && A(r, t), t != null && this.__v && (e && this._sb.push(e), Ie(this));
237
+ }, V.prototype.forceUpdate = function(t) {
238
+ this.__v && (this.__e = !0, t && this.__h.push(t), Ie(this));
239
+ }, V.prototype.render = W, H = [], Ze = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ke = function(t, e) {
246
240
  return t.__v.__b - e.__v.__b;
247
- }, ne.__r = 0, Ge = /(PointerCapture)$|Capture$/i, ye = 0, ce = Ne(!1), fe = Ne(!0);
248
- var wt = 0;
249
- function p(t, e, n, i, r, o) {
241
+ }, se.__r = 0, Xe = /(PointerCapture)$|Capture$/i, Se = 0, ge = Pe(!1), me = Pe(!0);
242
+ var Tt = 0;
243
+ function a(t, e, r, n, i, o) {
250
244
  e || (e = {});
251
- var s, l, u = e;
252
- if ("ref" in u) for (l in u = {}, e) l == "ref" ? s = e[l] : u[l] = e[l];
253
- var a = { type: t, props: u, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --wt, __i: -1, __u: 0, __source: r, __self: o };
254
- if (typeof t == "function" && (s = t.defaultProps)) for (l in s) u[l] === void 0 && (u[l] = s[l]);
255
- return v.vnode && v.vnode(a), a;
256
- }
257
- var R, g, le, Ee, de = 0, tt = [], w = v, Ae = w.__b, Le = w.__r, Pe = w.diffed, Te = w.__c, Ue = w.unmount, He = w.__;
258
- function we(t, e) {
259
- w.__h && w.__h(g, t, de || e), de = 0;
260
- var n = g.__H || (g.__H = { __: [], __h: [] });
261
- return t >= n.__.length && n.__.push({}), n.__[t];
262
- }
263
- function Me(t) {
264
- return de = 1, xt(rt, t);
265
- }
266
- function xt(t, e, n) {
267
- var i = we(R++, 2);
268
- if (i.t = t, !i.__c && (i.__ = [rt(void 0, e), function(l) {
269
- var u = i.__N ? i.__N[0] : i.__[0], a = i.t(u, l);
270
- u !== a && (i.__N = [a, i.__[1]], i.__c.setState({}));
271
- }], i.__c = g, !g.__f)) {
272
- var r = function(l, u, a) {
273
- if (!i.__c.__H) return !0;
274
- var h = i.__c.__H.__.filter(function(f) {
275
- return !!f.__c;
245
+ var l, c, d = e;
246
+ if ("ref" in d) for (c in d = {}, e) c == "ref" ? l = e[c] : d[c] = e[c];
247
+ var u = { type: t, props: d, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Tt, __i: -1, __u: 0, __source: i, __self: o };
248
+ if (typeof t == "function" && (l = t.defaultProps)) for (c in l) d[c] === void 0 && (d[c] = l[c]);
249
+ return v.vnode && v.vnode(u), u;
250
+ }
251
+ var K, b, xe, Ue, le = 0, at = [], y = v, De = y.__b, We = y.__r, Be = y.diffed, Oe = y.__c, Fe = y.unmount, qe = y.__;
252
+ function Ae(t, e) {
253
+ y.__h && y.__h(b, t, le || e), le = 0;
254
+ var r = b.__H || (b.__H = { __: [], __h: [] });
255
+ return t >= r.__.length && r.__.push({}), r.__[t];
256
+ }
257
+ function U(t) {
258
+ return le = 1, zt(lt, t);
259
+ }
260
+ function zt(t, e, r) {
261
+ var n = Ae(K++, 2);
262
+ if (n.t = t, !n.__c && (n.__ = [lt(void 0, e), function(c) {
263
+ var d = n.__N ? n.__N[0] : n.__[0], u = n.t(d, c);
264
+ d !== u && (n.__N = [u, n.__[1]], n.__c.setState({}));
265
+ }], n.__c = b, !b.__f)) {
266
+ var i = function(c, d, u) {
267
+ if (!n.__c.__H) return !0;
268
+ var h = n.__c.__H.__.filter(function(p) {
269
+ return !!p.__c;
276
270
  });
277
- if (h.every(function(f) {
278
- return !f.__N;
279
- })) return !o || o.call(this, l, u, a);
280
- var _ = i.__c.props !== l;
281
- return h.forEach(function(f) {
282
- if (f.__N) {
283
- var c = f.__[0];
284
- f.__ = f.__N, f.__N = void 0, c !== f.__[0] && (_ = !0);
271
+ if (h.every(function(p) {
272
+ return !p.__N;
273
+ })) return !o || o.call(this, c, d, u);
274
+ var s = n.__c.props !== c;
275
+ return h.forEach(function(p) {
276
+ if (p.__N) {
277
+ var f = p.__[0];
278
+ p.__ = p.__N, p.__N = void 0, f !== p.__[0] && (s = !0);
285
279
  }
286
- }), o && o.call(this, l, u, a) || _;
280
+ }), o && o.call(this, c, d, u) || s;
287
281
  };
288
- g.__f = !0;
289
- var o = g.shouldComponentUpdate, s = g.componentWillUpdate;
290
- g.componentWillUpdate = function(l, u, a) {
282
+ b.__f = !0;
283
+ var o = b.shouldComponentUpdate, l = b.componentWillUpdate;
284
+ b.componentWillUpdate = function(c, d, u) {
291
285
  if (this.__e) {
292
286
  var h = o;
293
- o = void 0, r(l, u, a), o = h;
287
+ o = void 0, i(c, d, u), o = h;
294
288
  }
295
- s && s.call(this, l, u, a);
296
- }, g.shouldComponentUpdate = r;
289
+ l && l.call(this, c, d, u);
290
+ }, b.shouldComponentUpdate = i;
297
291
  }
298
- return i.__N || i.__;
292
+ return n.__N || n.__;
293
+ }
294
+ function M(t, e) {
295
+ var r = Ae(K++, 3);
296
+ !y.__s && st(r.__H, e) && (r.__ = t, r.u = e, b.__H.__h.push(r));
299
297
  }
300
- function Oe(t, e) {
301
- var n = we(R++, 3);
302
- !w.__s && it(n.__H, e) && (n.__ = t, n.u = e, g.__H.__h.push(n));
298
+ function Lt(t) {
299
+ return le = 5, Ne(function() {
300
+ return { current: t };
301
+ }, []);
303
302
  }
304
- function nt(t, e) {
305
- var n = we(R++, 7);
306
- return it(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
303
+ function Ne(t, e) {
304
+ var r = Ae(K++, 7);
305
+ return st(r.__H, e) && (r.__ = t(), r.__H = e, r.__h = t), r.__;
307
306
  }
308
- function kt() {
309
- for (var t; t = tt.shift(); ) if (t.__P && t.__H) try {
310
- t.__H.__h.forEach(te), t.__H.__h.forEach(ve), t.__H.__h = [];
307
+ function Ht() {
308
+ for (var t; t = at.shift(); ) if (t.__P && t.__H) try {
309
+ t.__H.__h.forEach(ae), t.__H.__h.forEach(je), t.__H.__h = [];
311
310
  } catch (e) {
312
- t.__H.__h = [], w.__e(e, t.__v);
311
+ t.__H.__h = [], y.__e(e, t.__v);
313
312
  }
314
313
  }
315
- w.__b = function(t) {
316
- g = null, Ae && Ae(t);
317
- }, w.__ = function(t, e) {
318
- t && e.__k && e.__k.__m && (t.__m = e.__k.__m), He && He(t, e);
319
- }, w.__r = function(t) {
320
- Le && Le(t), R = 0;
321
- var e = (g = t.__c).__H;
322
- e && (le === g ? (e.__h = [], g.__h = [], e.__.forEach(function(n) {
323
- n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
324
- })) : (e.__h.forEach(te), e.__h.forEach(ve), e.__h = [], R = 0)), le = g;
325
- }, w.diffed = function(t) {
326
- Pe && Pe(t);
314
+ y.__b = function(t) {
315
+ b = null, De && De(t);
316
+ }, y.__ = function(t, e) {
317
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), qe && qe(t, e);
318
+ }, y.__r = function(t) {
319
+ We && We(t), K = 0;
320
+ var e = (b = t.__c).__H;
321
+ e && (xe === b ? (e.__h = [], b.__h = [], e.__.forEach(function(r) {
322
+ r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
323
+ })) : (e.__h.forEach(ae), e.__h.forEach(je), e.__h = [], K = 0)), xe = b;
324
+ }, y.diffed = function(t) {
325
+ Be && Be(t);
327
326
  var e = t.__c;
328
- e && e.__H && (e.__H.__h.length && (tt.push(e) !== 1 && Ee === w.requestAnimationFrame || ((Ee = w.requestAnimationFrame) || $t)(kt)), e.__H.__.forEach(function(n) {
329
- n.u && (n.__H = n.u), n.u = void 0;
330
- })), le = g = null;
331
- }, w.__c = function(t, e) {
332
- e.some(function(n) {
327
+ e && e.__H && (e.__H.__h.length && (at.push(e) !== 1 && Ue === y.requestAnimationFrame || ((Ue = y.requestAnimationFrame) || It)(Ht)), e.__H.__.forEach(function(r) {
328
+ r.u && (r.__H = r.u), r.u = void 0;
329
+ })), xe = b = null;
330
+ }, y.__c = function(t, e) {
331
+ e.some(function(r) {
333
332
  try {
334
- n.__h.forEach(te), n.__h = n.__h.filter(function(i) {
335
- return !i.__ || ve(i);
333
+ r.__h.forEach(ae), r.__h = r.__h.filter(function(n) {
334
+ return !n.__ || je(n);
336
335
  });
337
- } catch (i) {
338
- e.some(function(r) {
339
- r.__h && (r.__h = []);
340
- }), e = [], w.__e(i, n.__v);
336
+ } catch (n) {
337
+ e.some(function(i) {
338
+ i.__h && (i.__h = []);
339
+ }), e = [], y.__e(n, r.__v);
341
340
  }
342
- }), Te && Te(t, e);
343
- }, w.unmount = function(t) {
344
- Ue && Ue(t);
345
- var e, n = t.__c;
346
- n && n.__H && (n.__H.__.forEach(function(i) {
341
+ }), Oe && Oe(t, e);
342
+ }, y.unmount = function(t) {
343
+ Fe && Fe(t);
344
+ var e, r = t.__c;
345
+ r && r.__H && (r.__H.__.forEach(function(n) {
347
346
  try {
348
- te(i);
349
- } catch (r) {
350
- e = r;
347
+ ae(n);
348
+ } catch (i) {
349
+ e = i;
351
350
  }
352
- }), n.__H = void 0, e && w.__e(e, n.__v));
351
+ }), r.__H = void 0, e && y.__e(e, r.__v));
353
352
  };
354
- var De = typeof requestAnimationFrame == "function";
355
- function $t(t) {
356
- var e, n = function() {
357
- clearTimeout(i), De && cancelAnimationFrame(e), setTimeout(t);
358
- }, i = setTimeout(n, 35);
359
- De && (e = requestAnimationFrame(n));
360
- }
361
- function te(t) {
362
- var e = g, n = t.__c;
363
- typeof n == "function" && (t.__c = void 0, n()), g = e;
364
- }
365
- function ve(t) {
366
- var e = g;
367
- t.__c = t.__(), g = e;
368
- }
369
- function it(t, e) {
370
- return !t || t.length !== e.length || e.some(function(n, i) {
371
- return n !== t[i];
353
+ var Ge = typeof requestAnimationFrame == "function";
354
+ function It(t) {
355
+ var e, r = function() {
356
+ clearTimeout(n), Ge && cancelAnimationFrame(e), setTimeout(t);
357
+ }, n = setTimeout(r, 35);
358
+ Ge && (e = requestAnimationFrame(r));
359
+ }
360
+ function ae(t) {
361
+ var e = b, r = t.__c;
362
+ typeof r == "function" && (t.__c = void 0, r()), b = e;
363
+ }
364
+ function je(t) {
365
+ var e = b;
366
+ t.__c = t.__(), b = e;
367
+ }
368
+ function st(t, e) {
369
+ return !t || t.length !== e.length || e.some(function(r, n) {
370
+ return r !== t[n];
372
371
  });
373
372
  }
374
- function rt(t, e) {
373
+ function lt(t, e) {
375
374
  return typeof e == "function" ? e(t) : e;
376
375
  }
377
- const St = (...t) => t.filter((e, n, i) => !!e && e.trim() !== "" && i.indexOf(e) === n).join(" ").trim();
378
- const Ie = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
379
- const Ct = (t) => t.replace(
380
- /^([A-Z])|[\s-_]+(\w)/g,
381
- (e, n, i) => i ? i.toUpperCase() : n.toLowerCase()
382
- );
383
- const Fe = (t) => {
384
- const e = Ct(t);
385
- return e.charAt(0).toUpperCase() + e.slice(1);
386
- };
387
- var Nt = {
388
- xmlns: "http://www.w3.org/2000/svg",
389
- width: 24,
390
- height: 24,
391
- viewBox: "0 0 24 24",
392
- fill: "none",
393
- stroke: "currentColor",
394
- "stroke-width": "2",
395
- "stroke-linecap": "round",
396
- "stroke-linejoin": "round"
397
- };
398
- const jt = (t) => {
399
- for (const e in t)
400
- if (e.startsWith("aria-") || e === "role" || e === "title")
401
- return !0;
402
- return !1;
403
- };
404
- const Et = ({
405
- color: t = "currentColor",
406
- size: e = 24,
407
- strokeWidth: n = 2,
408
- absoluteStrokeWidth: i,
409
- children: r,
410
- iconNode: o,
411
- class: s = "",
412
- ...l
413
- }) => z(
414
- "svg",
415
- {
416
- ...Nt,
417
- width: String(e),
418
- height: e,
419
- stroke: t,
420
- "stroke-width": i ? Number(n) * 24 / Number(e) : n,
421
- class: ["lucide", s].join(" "),
422
- ...!r && !jt(l) && { "aria-hidden": "true" },
423
- ...l
424
- },
425
- [...o.map(([u, a]) => z(u, a)), ...Qe(r)]
426
- );
427
- const H = (t, e) => {
428
- const n = ({ class: i = "", className: r = "", children: o, ...s }) => z(
429
- Et,
430
- {
431
- ...s,
432
- iconNode: e,
433
- class: St(
434
- `lucide-${Ie(Fe(t))}`,
435
- `lucide-${Ie(t)}`,
436
- i,
437
- r
438
- )
439
- },
440
- o
441
- );
442
- return n.displayName = Fe(t), n;
443
- };
444
- const At = H("bot", [
445
- ["path", { d: "M12 8V4H8", key: "hb8ula" }],
446
- ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
447
- ["path", { d: "M2 14h2", key: "vft8re" }],
448
- ["path", { d: "M20 14h2", key: "4cs60a" }],
449
- ["path", { d: "M15 13v2", key: "1xurst" }],
450
- ["path", { d: "M9 13v2", key: "rq6x2g" }]
451
- ]);
452
- const Lt = H("chevron-down", [
453
- ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
454
- ]);
455
- const Pt = H("message-circle", [
456
- [
457
- "path",
458
- {
459
- d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
460
- key: "1sd12s"
461
- }
462
- ]
463
- ]);
464
- const Tt = H("send", [
465
- [
466
- "path",
467
- {
468
- d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
469
- key: "1ffxy3"
470
- }
471
- ],
472
- ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
473
- ]);
474
- const Ut = H("x", [
475
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
476
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
477
- ]);
478
- const Ht = H("zap", [
479
- [
480
- "path",
481
- {
482
- d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
483
- key: "1xq2db"
484
- }
485
- ]
486
- ]);
487
- var Mt = /* @__PURE__ */ Symbol.for("preact-signals");
488
- function _e() {
489
- if (A > 1)
490
- A--;
376
+ var Rt = /* @__PURE__ */ Symbol.for("preact-signals");
377
+ function pe() {
378
+ if (L > 1)
379
+ L--;
491
380
  else {
492
- for (var t, e = !1; B !== void 0; ) {
493
- var n = B;
494
- for (B = void 0, pe++; n !== void 0; ) {
495
- var i = n.o;
496
- if (n.o = void 0, n.f &= -3, !(8 & n.f) && st(n)) try {
497
- n.c();
498
- } catch (r) {
499
- e || (t = r, e = !0);
381
+ for (var t, e = !1; Y !== void 0; ) {
382
+ var r = Y;
383
+ for (Y = void 0, ye++; r !== void 0; ) {
384
+ var n = r.o;
385
+ if (r.o = void 0, r.f &= -3, !(8 & r.f) && dt(r)) try {
386
+ r.c();
387
+ } catch (i) {
388
+ e || (t = i, e = !0);
500
389
  }
501
- n = i;
390
+ r = n;
502
391
  }
503
392
  }
504
- if (pe = 0, A--, e) throw t;
393
+ if (ye = 0, L--, e) throw t;
505
394
  }
506
395
  }
507
- function Ot(t) {
508
- if (A > 0) return t();
509
- A++;
396
+ function Pt(t) {
397
+ if (L > 0) return t();
398
+ L++;
510
399
  try {
511
400
  return t();
512
401
  } finally {
513
- _e();
402
+ pe();
514
403
  }
515
404
  }
516
- var d = void 0;
517
- function ot(t) {
518
- var e = d;
519
- d = void 0;
405
+ var x = void 0;
406
+ function ct(t) {
407
+ var e = x;
408
+ x = void 0;
520
409
  try {
521
410
  return t();
522
411
  } finally {
523
- d = e;
412
+ x = e;
524
413
  }
525
414
  }
526
- var B = void 0, A = 0, pe = 0, ie = 0;
527
- function _t(t) {
528
- if (d !== void 0) {
415
+ var Y = void 0, L = 0, ye = 0, ce = 0;
416
+ function ut(t) {
417
+ if (x !== void 0) {
529
418
  var e = t.n;
530
- if (e === void 0 || e.t !== d)
531
- return e = { i: 0, S: t, p: d.s, n: void 0, t: d, e: void 0, x: void 0, r: e }, d.s !== void 0 && (d.s.n = e), d.s = e, t.n = e, 32 & d.f && t.S(e), e;
419
+ if (e === void 0 || e.t !== x)
420
+ return e = { i: 0, S: t, p: x.s, n: void 0, t: x, e: void 0, x: void 0, r: e }, x.s !== void 0 && (x.s.n = e), x.s = e, t.n = e, 32 & x.f && t.S(e), e;
532
421
  if (e.i === -1)
533
- return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = d.s, e.n = void 0, d.s.n = e, d.s = e), e;
422
+ return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = x.s, e.n = void 0, x.s.n = e, x.s = e), e;
534
423
  }
535
424
  }
536
- function k(t, e) {
425
+ function w(t, e) {
537
426
  this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
538
427
  }
539
- k.prototype.brand = Mt;
540
- k.prototype.h = function() {
428
+ w.prototype.brand = Rt;
429
+ w.prototype.h = function() {
541
430
  return !0;
542
431
  };
543
- k.prototype.S = function(t) {
544
- var e = this, n = this.t;
545
- n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : ot(function() {
546
- var i;
547
- (i = e.W) == null || i.call(e);
432
+ w.prototype.S = function(t) {
433
+ var e = this, r = this.t;
434
+ r !== t && t.e === void 0 && (t.x = r, this.t = t, r !== void 0 ? r.e = t : ct(function() {
435
+ var n;
436
+ (n = e.W) == null || n.call(e);
548
437
  }));
549
438
  };
550
- k.prototype.U = function(t) {
439
+ w.prototype.U = function(t) {
551
440
  var e = this;
552
441
  if (this.t !== void 0) {
553
- var n = t.e, i = t.x;
554
- n !== void 0 && (n.x = i, t.e = void 0), i !== void 0 && (i.e = n, t.x = void 0), t === this.t && (this.t = i, i === void 0 && ot(function() {
555
- var r;
556
- (r = e.Z) == null || r.call(e);
442
+ var r = t.e, n = t.x;
443
+ r !== void 0 && (r.x = n, t.e = void 0), n !== void 0 && (n.e = r, t.x = void 0), t === this.t && (this.t = n, n === void 0 && ct(function() {
444
+ var i;
445
+ (i = e.Z) == null || i.call(e);
557
446
  }));
558
447
  }
559
448
  };
560
- k.prototype.subscribe = function(t) {
449
+ w.prototype.subscribe = function(t) {
561
450
  var e = this;
562
- return J(function() {
563
- var n = e.value, i = d;
564
- d = void 0;
451
+ return ee(function() {
452
+ var r = e.value, n = x;
453
+ x = void 0;
565
454
  try {
566
- t(n);
455
+ t(r);
567
456
  } finally {
568
- d = i;
457
+ x = n;
569
458
  }
570
459
  }, { name: "sub" });
571
460
  };
572
- k.prototype.valueOf = function() {
461
+ w.prototype.valueOf = function() {
573
462
  return this.value;
574
463
  };
575
- k.prototype.toString = function() {
464
+ w.prototype.toString = function() {
576
465
  return this.value + "";
577
466
  };
578
- k.prototype.toJSON = function() {
467
+ w.prototype.toJSON = function() {
579
468
  return this.value;
580
469
  };
581
- k.prototype.peek = function() {
582
- var t = d;
583
- d = void 0;
470
+ w.prototype.peek = function() {
471
+ var t = x;
472
+ x = void 0;
584
473
  try {
585
474
  return this.value;
586
475
  } finally {
587
- d = t;
476
+ x = t;
588
477
  }
589
478
  };
590
- Object.defineProperty(k.prototype, "value", { get: function() {
591
- var t = _t(this);
479
+ Object.defineProperty(w.prototype, "value", { get: function() {
480
+ var t = ut(this);
592
481
  return t !== void 0 && (t.i = this.i), this.v;
593
482
  }, set: function(t) {
594
483
  if (t !== this.v) {
595
- if (pe > 100) throw new Error("Cycle detected");
596
- this.v = t, this.i++, ie++, A++;
484
+ if (ye > 100) throw new Error("Cycle detected");
485
+ this.v = t, this.i++, ce++, L++;
597
486
  try {
598
487
  for (var e = this.t; e !== void 0; e = e.x) e.t.N();
599
488
  } finally {
600
- _e();
489
+ pe();
601
490
  }
602
491
  }
603
492
  } });
604
- function se(t, e) {
605
- return new k(t, e);
493
+ function E(t, e) {
494
+ return new w(t, e);
606
495
  }
607
- function st(t) {
496
+ function dt(t) {
608
497
  for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
609
498
  return !1;
610
499
  }
611
- function at(t) {
500
+ function ft(t) {
612
501
  for (var e = t.s; e !== void 0; e = e.n) {
613
- var n = e.S.n;
614
- if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
502
+ var r = e.S.n;
503
+ if (r !== void 0 && (e.r = r), e.S.n = e, e.i = -1, e.n === void 0) {
615
504
  t.s = e;
616
505
  break;
617
506
  }
618
507
  }
619
508
  }
620
- function lt(t) {
621
- for (var e = t.s, n = void 0; e !== void 0; ) {
622
- var i = e.p;
623
- e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
509
+ function ht(t) {
510
+ for (var e = t.s, r = void 0; e !== void 0; ) {
511
+ var n = e.p;
512
+ e.i === -1 ? (e.S.U(e), n !== void 0 && (n.n = e.n), e.n !== void 0 && (e.n.p = n)) : r = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = n;
624
513
  }
625
- t.s = n;
514
+ t.s = r;
626
515
  }
627
- function P(t, e) {
628
- k.call(this, void 0), this.x = t, this.s = void 0, this.g = ie - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
516
+ function I(t, e) {
517
+ w.call(this, void 0), this.x = t, this.s = void 0, this.g = ce - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
629
518
  }
630
- P.prototype = new k();
631
- P.prototype.h = function() {
519
+ I.prototype = new w();
520
+ I.prototype.h = function() {
632
521
  if (this.f &= -3, 1 & this.f) return !1;
633
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === ie)) return !0;
634
- if (this.g = ie, this.f |= 1, this.i > 0 && !st(this))
522
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === ce)) return !0;
523
+ if (this.g = ce, this.f |= 1, this.i > 0 && !dt(this))
635
524
  return this.f &= -2, !0;
636
- var t = d;
525
+ var t = x;
637
526
  try {
638
- at(this), d = this;
527
+ ft(this), x = this;
639
528
  var e = this.x();
640
529
  (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
641
- } catch (n) {
642
- this.v = n, this.f |= 16, this.i++;
530
+ } catch (r) {
531
+ this.v = r, this.f |= 16, this.i++;
643
532
  }
644
- return d = t, lt(this), this.f &= -2, !0;
533
+ return x = t, ht(this), this.f &= -2, !0;
645
534
  };
646
- P.prototype.S = function(t) {
535
+ I.prototype.S = function(t) {
647
536
  if (this.t === void 0) {
648
537
  this.f |= 36;
649
538
  for (var e = this.s; e !== void 0; e = e.n) e.S.S(e);
650
539
  }
651
- k.prototype.S.call(this, t);
540
+ w.prototype.S.call(this, t);
652
541
  };
653
- P.prototype.U = function(t) {
654
- if (this.t !== void 0 && (k.prototype.U.call(this, t), this.t === void 0)) {
542
+ I.prototype.U = function(t) {
543
+ if (this.t !== void 0 && (w.prototype.U.call(this, t), this.t === void 0)) {
655
544
  this.f &= -33;
656
545
  for (var e = this.s; e !== void 0; e = e.n) e.S.U(e);
657
546
  }
658
547
  };
659
- P.prototype.N = function() {
548
+ I.prototype.N = function() {
660
549
  if (!(2 & this.f)) {
661
550
  this.f |= 6;
662
551
  for (var t = this.t; t !== void 0; t = t.x) t.t.N();
663
552
  }
664
553
  };
665
- Object.defineProperty(P.prototype, "value", { get: function() {
554
+ Object.defineProperty(I.prototype, "value", { get: function() {
666
555
  if (1 & this.f) throw new Error("Cycle detected");
667
- var t = _t(this);
556
+ var t = ut(this);
668
557
  if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
669
558
  return this.v;
670
559
  } });
671
- function We(t, e) {
672
- return new P(t, e);
560
+ function Ve(t, e) {
561
+ return new I(t, e);
673
562
  }
674
- function ut(t) {
563
+ function pt(t) {
675
564
  var e = t.u;
676
565
  if (t.u = void 0, typeof e == "function") {
677
- A++;
678
- var n = d;
679
- d = void 0;
566
+ L++;
567
+ var r = x;
568
+ x = void 0;
680
569
  try {
681
570
  e();
682
- } catch (i) {
683
- throw t.f &= -2, t.f |= 8, xe(t), i;
571
+ } catch (n) {
572
+ throw t.f &= -2, t.f |= 8, Te(t), n;
684
573
  } finally {
685
- d = n, _e();
574
+ x = r, pe();
686
575
  }
687
576
  }
688
577
  }
689
- function xe(t) {
578
+ function Te(t) {
690
579
  for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
691
- t.x = void 0, t.s = void 0, ut(t);
580
+ t.x = void 0, t.s = void 0, pt(t);
692
581
  }
693
- function Dt(t) {
694
- if (d !== this) throw new Error("Out-of-order effect");
695
- lt(this), d = t, this.f &= -2, 8 & this.f && xe(this), _e();
582
+ function Mt(t) {
583
+ if (x !== this) throw new Error("Out-of-order effect");
584
+ ht(this), x = t, this.f &= -2, 8 & this.f && Te(this), pe();
696
585
  }
697
- function M(t, e) {
586
+ function B(t, e) {
698
587
  this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
699
588
  }
700
- M.prototype.c = function() {
589
+ B.prototype.c = function() {
701
590
  var t = this.S();
702
591
  try {
703
592
  if (8 & this.f || this.x === void 0) return;
@@ -707,212 +596,220 @@ M.prototype.c = function() {
707
596
  t();
708
597
  }
709
598
  };
710
- M.prototype.S = function() {
599
+ B.prototype.S = function() {
711
600
  if (1 & this.f) throw new Error("Cycle detected");
712
- this.f |= 1, this.f &= -9, ut(this), at(this), A++;
713
- var t = d;
714
- return d = this, Dt.bind(this, t);
601
+ this.f |= 1, this.f &= -9, pt(this), ft(this), L++;
602
+ var t = x;
603
+ return x = this, Mt.bind(this, t);
715
604
  };
716
- M.prototype.N = function() {
717
- 2 & this.f || (this.f |= 2, this.o = B, B = this);
605
+ B.prototype.N = function() {
606
+ 2 & this.f || (this.f |= 2, this.o = Y, Y = this);
718
607
  };
719
- M.prototype.d = function() {
720
- this.f |= 8, 1 & this.f || xe(this);
608
+ B.prototype.d = function() {
609
+ this.f |= 8, 1 & this.f || Te(this);
721
610
  };
722
- M.prototype.dispose = function() {
611
+ B.prototype.dispose = function() {
723
612
  this.d();
724
613
  };
725
- function J(t, e) {
726
- var n = new M(t, e);
614
+ function ee(t, e) {
615
+ var r = new B(t, e);
727
616
  try {
728
- n.c();
729
- } catch (r) {
730
- throw n.d(), r;
617
+ r.c();
618
+ } catch (i) {
619
+ throw r.d(), i;
731
620
  }
732
- var i = n.d.bind(n);
733
- return i[Symbol.dispose] = i, i;
621
+ var n = r.d.bind(r);
622
+ return n[Symbol.dispose] = n, n;
734
623
  }
735
- var ct, X, It = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, ft = [];
736
- J(function() {
737
- ct = this.N;
624
+ var _t, ie, Ut = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, xt = [];
625
+ ee(function() {
626
+ _t = this.N;
738
627
  })();
739
628
  function O(t, e) {
740
629
  v[t] = e.bind(null, v[t] || function() {
741
630
  });
742
631
  }
743
- function re(t) {
744
- if (X) {
745
- var e = X;
746
- X = void 0, e();
632
+ function ue(t) {
633
+ if (ie) {
634
+ var e = ie;
635
+ ie = void 0, e();
747
636
  }
748
- X = t && t.S();
749
- }
750
- function ht(t) {
751
- var e = this, n = t.data, i = Wt(n);
752
- i.value = n;
753
- var r = nt(function() {
754
- for (var l = e, u = e.__v; u = u.__; ) if (u.__c) {
755
- u.__c.__$f |= 4;
637
+ ie = t && t.S();
638
+ }
639
+ function vt(t) {
640
+ var e = this, r = t.data, n = gt(r);
641
+ n.value = r;
642
+ var i = Ne(function() {
643
+ for (var c = e, d = e.__v; d = d.__; ) if (d.__c) {
644
+ d.__c.__$f |= 4;
756
645
  break;
757
646
  }
758
- var a = We(function() {
759
- var c = i.value.value;
760
- return c === 0 ? 0 : c === !0 ? "" : c || "";
761
- }), h = We(function() {
762
- return !Array.isArray(a.value) && !qe(a.value);
763
- }), _ = J(function() {
764
- if (this.N = dt, h.value) {
765
- var c = a.value;
766
- l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = c);
647
+ var u = Ve(function() {
648
+ var f = n.value.value;
649
+ return f === 0 ? 0 : f === !0 ? "" : f || "";
650
+ }), h = Ve(function() {
651
+ return !Array.isArray(u.value) && !Je(u.value);
652
+ }), s = ee(function() {
653
+ if (this.N = mt, h.value) {
654
+ var f = u.value;
655
+ c.__v && c.__v.__e && c.__v.__e.nodeType === 3 && (c.__v.__e.data = f);
767
656
  }
768
- }), f = e.__$u.d;
657
+ }), p = e.__$u.d;
769
658
  return e.__$u.d = function() {
770
- _(), f.call(this);
771
- }, [h, a];
772
- }, []), o = r[0], s = r[1];
773
- return o.value ? s.peek() : s.value;
659
+ s(), p.call(this);
660
+ }, [h, u];
661
+ }, []), o = i[0], l = i[1];
662
+ return o.value ? l.peek() : l.value;
774
663
  }
775
- ht.displayName = "ReactiveTextNode";
776
- Object.defineProperties(k.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: ht }, props: { configurable: !0, get: function() {
664
+ vt.displayName = "ReactiveTextNode";
665
+ Object.defineProperties(w.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: vt }, props: { configurable: !0, get: function() {
777
666
  return { data: this };
778
667
  } }, __b: { configurable: !0, value: 1 } });
779
668
  O("__b", function(t, e) {
780
669
  if (typeof e.type == "string") {
781
- var n, i = e.props;
782
- for (var r in i) if (r !== "children") {
783
- var o = i[r];
784
- o instanceof k && (n || (e.__np = n = {}), n[r] = o, i[r] = o.peek());
670
+ var r, n = e.props;
671
+ for (var i in n) if (i !== "children") {
672
+ var o = n[i];
673
+ o instanceof w && (r || (e.__np = r = {}), r[i] = o, n[i] = o.peek());
785
674
  }
786
675
  }
787
676
  t(e);
788
677
  });
789
678
  O("__r", function(t, e) {
790
- if (t(e), e.type !== Z) {
791
- re();
792
- var n, i = e.__c;
793
- i && (i.__$f &= -2, (n = i.__$u) === void 0 && (i.__$u = n = (function(r, o) {
794
- var s;
795
- return J(function() {
796
- s = this;
797
- }, { name: o }), s.c = r, s;
679
+ if (t(e), e.type !== W) {
680
+ ue();
681
+ var r, n = e.__c;
682
+ n && (n.__$f &= -2, (r = n.__$u) === void 0 && (n.__$u = r = (function(i, o) {
683
+ var l;
684
+ return ee(function() {
685
+ l = this;
686
+ }, { name: o }), l.c = i, l;
798
687
  })(function() {
799
- var r;
800
- It && ((r = n.y) == null || r.call(n)), i.__$f |= 1, i.setState({});
801
- }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), re(n);
688
+ var i;
689
+ Ut && ((i = r.y) == null || i.call(r)), n.__$f |= 1, n.setState({});
690
+ }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), ue(r);
802
691
  }
803
692
  });
804
- O("__e", function(t, e, n, i) {
805
- re(), t(e, n, i);
693
+ O("__e", function(t, e, r, n) {
694
+ ue(), t(e, r, n);
806
695
  });
807
696
  O("diffed", function(t, e) {
808
- re();
809
- var n;
810
- if (typeof e.type == "string" && (n = e.__e)) {
811
- var i = e.__np, r = e.props;
812
- if (i) {
813
- var o = n.U;
814
- if (o) for (var s in o) {
815
- var l = o[s];
816
- l !== void 0 && !(s in i) && (l.d(), o[s] = void 0);
697
+ ue();
698
+ var r;
699
+ if (typeof e.type == "string" && (r = e.__e)) {
700
+ var n = e.__np, i = e.props;
701
+ if (n) {
702
+ var o = r.U;
703
+ if (o) for (var l in o) {
704
+ var c = o[l];
705
+ c !== void 0 && !(l in n) && (c.d(), o[l] = void 0);
817
706
  }
818
707
  else
819
- o = {}, n.U = o;
820
- for (var u in i) {
821
- var a = o[u], h = i[u];
822
- a === void 0 ? (a = Ft(n, u, h, r), o[u] = a) : a.o(h, r);
708
+ o = {}, r.U = o;
709
+ for (var d in n) {
710
+ var u = o[d], h = n[d];
711
+ u === void 0 ? (u = Dt(r, d, h, i), o[d] = u) : u.o(h, i);
823
712
  }
824
713
  }
825
714
  }
826
715
  t(e);
827
716
  });
828
- function Ft(t, e, n, i) {
829
- var r = e in t && t.ownerSVGElement === void 0, o = se(n);
830
- return { o: function(s, l) {
831
- o.value = s, i = l;
832
- }, d: J(function() {
833
- this.N = dt;
834
- var s = o.value.value;
835
- i[e] !== s && (i[e] = s, r ? t[e] = s : s != null && (s !== !1 || e[4] === "-") ? t.setAttribute(e, s) : t.removeAttribute(e));
717
+ function Dt(t, e, r, n) {
718
+ var i = e in t && t.ownerSVGElement === void 0, o = E(r);
719
+ return { o: function(l, c) {
720
+ o.value = l, n = c;
721
+ }, d: ee(function() {
722
+ this.N = mt;
723
+ var l = o.value.value;
724
+ n[e] !== l && (n[e] = l, i ? t[e] = l : l != null && (l !== !1 || e[4] === "-") ? t.setAttribute(e, l) : t.removeAttribute(e));
836
725
  }) };
837
726
  }
838
727
  O("unmount", function(t, e) {
839
728
  if (typeof e.type == "string") {
840
- var n = e.__e;
841
- if (n) {
842
- var i = n.U;
843
- if (i) {
844
- n.U = void 0;
845
- for (var r in i) {
846
- var o = i[r];
729
+ var r = e.__e;
730
+ if (r) {
731
+ var n = r.U;
732
+ if (n) {
733
+ r.U = void 0;
734
+ for (var i in n) {
735
+ var o = n[i];
847
736
  o && o.d();
848
737
  }
849
738
  }
850
739
  }
851
740
  } else {
852
- var s = e.__c;
853
- if (s) {
854
- var l = s.__$u;
855
- l && (s.__$u = void 0, l.d());
741
+ var l = e.__c;
742
+ if (l) {
743
+ var c = l.__$u;
744
+ c && (l.__$u = void 0, c.d());
856
745
  }
857
746
  }
858
747
  t(e);
859
748
  });
860
- O("__h", function(t, e, n, i) {
861
- (i < 3 || i === 9) && (e.__$f |= 2), t(e, n, i);
749
+ O("__h", function(t, e, r, n) {
750
+ (n < 3 || n === 9) && (e.__$f |= 2), t(e, r, n);
862
751
  });
863
- W.prototype.shouldComponentUpdate = function(t, e) {
752
+ V.prototype.shouldComponentUpdate = function(t, e) {
864
753
  if (this.__R) return !0;
865
- var n = this.__$u, i = n && n.s !== void 0;
866
- for (var r in e) return !0;
754
+ var r = this.__$u, n = r && r.s !== void 0;
755
+ for (var i in e) return !0;
867
756
  if (this.__f || typeof this.u == "boolean" && this.u === !0) {
868
757
  var o = 2 & this.__$f;
869
- if (!(i || o || 4 & this.__$f) || 1 & this.__$f) return !0;
870
- } else if (!(i || 4 & this.__$f) || 3 & this.__$f) return !0;
871
- for (var s in t) if (s !== "__source" && t[s] !== this.props[s]) return !0;
872
- for (var l in this.props) if (!(l in t)) return !0;
758
+ if (!(n || o || 4 & this.__$f) || 1 & this.__$f) return !0;
759
+ } else if (!(n || 4 & this.__$f) || 3 & this.__$f) return !0;
760
+ for (var l in t) if (l !== "__source" && t[l] !== this.props[l]) return !0;
761
+ for (var c in this.props) if (!(c in t)) return !0;
873
762
  return !1;
874
763
  };
875
- function Wt(t, e) {
876
- return nt(function() {
877
- return se(t, e);
764
+ function gt(t, e) {
765
+ return Ne(function() {
766
+ return E(t, e);
878
767
  }, []);
879
768
  }
880
- var Bt = function(t) {
769
+ var Wt = function(t) {
881
770
  queueMicrotask(function() {
882
771
  queueMicrotask(t);
883
772
  });
884
773
  };
885
- function qt() {
886
- Ot(function() {
887
- for (var t; t = ft.shift(); ) ct.call(t);
774
+ function Bt() {
775
+ Pt(function() {
776
+ for (var t; t = xt.shift(); ) _t.call(t);
888
777
  });
889
778
  }
890
- function dt() {
891
- ft.push(this) === 1 && (v.requestAnimationFrame || Bt)(qt);
779
+ function mt() {
780
+ xt.push(this) === 1 && (v.requestAnimationFrame || Wt)(Bt);
892
781
  }
893
- const S = se(!1), G = se("de"), zt = ["en", "de"], Rt = "de", Gt = "jex-locale";
894
- function ue(t) {
895
- if (!t)
896
- return null;
897
- const e = (t.split("-")[0] ?? "").toLowerCase();
898
- return zt.includes(e) ? e : null;
782
+ const S = E(!1), bt = "jex-session-ref", ze = "jex-session-active", X = E(null), de = E(!1);
783
+ function Ot() {
784
+ return "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
899
785
  }
900
- function Vt(t) {
786
+ function Ft() {
901
787
  try {
902
- const n = ue(localStorage.getItem(Gt));
903
- if (n)
904
- return n;
788
+ const t = sessionStorage.getItem(bt), e = sessionStorage.getItem(ze);
789
+ X.value = t ?? null, de.value = t !== null && e === "true";
905
790
  } catch {
791
+ X.value = null, de.value = !1;
906
792
  }
907
- if (typeof navigator < "u") {
908
- const n = ue(navigator.language);
909
- if (n)
910
- return n;
793
+ }
794
+ function qt() {
795
+ const t = Ot();
796
+ X.value = t, de.value = !1;
797
+ try {
798
+ sessionStorage.setItem(bt, t), sessionStorage.removeItem(ze);
799
+ } catch {
911
800
  }
912
- const e = ue(t);
913
- return e || Rt;
801
+ return t;
914
802
  }
915
- const vt = {
803
+ function Gt() {
804
+ if (X.value) {
805
+ de.value = !0;
806
+ try {
807
+ sessionStorage.setItem(ze, "true");
808
+ } catch {
809
+ }
810
+ }
811
+ }
812
+ const jt = {
916
813
  title: "Assistant",
917
814
  statusOnline: "Online · Responds in seconds",
918
815
  inputPlaceholder: "Type a message…",
@@ -922,8 +819,27 @@ const vt = {
922
819
  errorNetwork: "Network error. Please try again.",
923
820
  errorQuota: "Message limit reached. Please try again later.",
924
821
  localeLabelDe: "DE",
925
- localeLabelEn: "EN"
926
- }, Zt = {
822
+ localeLabelEn: "EN",
823
+ resumeConversation: "Resume conversation",
824
+ startNewConversation: "Start new conversation",
825
+ chatWith: "Chat with {title}",
826
+ haveReferenceNumber: "Have a reference number?",
827
+ referencePlaceholder: "e.g. JEX-A3B7C2",
828
+ resume: "Resume",
829
+ howCanWeHelp: "How can we help?",
830
+ getInstantHelp: "Get instant help",
831
+ submitTicket: "Submit a ticket",
832
+ replyByEmail: "We'll reply by email",
833
+ ticketSubmitted: "Ticket submitted",
834
+ yourReferenceNumber: "Your reference number:",
835
+ sentToEmailHint: "We've sent it to your email. Use this number to follow up.",
836
+ done: "Done",
837
+ submittingTicket: "Submitting your ticket…",
838
+ yourName: "Your name",
839
+ yourEmail: "Your email",
840
+ submit: "Submit",
841
+ back: "Go back"
842
+ }, Vt = {
927
843
  title: "Assistent",
928
844
  statusOnline: "Online · Antwortet in Sekunden",
929
845
  inputPlaceholder: "Nachricht eingeben…",
@@ -933,159 +849,547 @@ const vt = {
933
849
  errorNetwork: "Netzwerkfehler. Bitte versuche es erneut.",
934
850
  errorQuota: "Nachrichtenlimit erreicht. Bitte versuche es später erneut.",
935
851
  localeLabelDe: "DE",
936
- localeLabelEn: "EN"
937
- }, Jt = { en: vt, de: Zt };
938
- function Kt() {
939
- return Jt[G.value] ?? vt;
852
+ localeLabelEn: "EN",
853
+ resumeConversation: "Gespräch fortsetzen",
854
+ startNewConversation: "Neues Gespräch beginnen",
855
+ chatWith: "Chatte mit {title}",
856
+ haveReferenceNumber: "Hast du eine Referenznummer?",
857
+ referencePlaceholder: "z.B. JEX-A3B7C2",
858
+ resume: "Fortsetzen",
859
+ howCanWeHelp: "Wie können wir helfen?",
860
+ getInstantHelp: "Soforthilfe erhalten",
861
+ submitTicket: "Ticket einreichen",
862
+ replyByEmail: "Wir antworten per E-Mail",
863
+ ticketSubmitted: "Ticket eingereicht",
864
+ yourReferenceNumber: "Deine Referenznummer:",
865
+ sentToEmailHint: "Wir haben sie an deine E-Mail gesendet. Verwende diese Nummer für Rückfragen.",
866
+ done: "Fertig",
867
+ submittingTicket: "Dein Ticket wird übermittelt…",
868
+ yourName: "Dein Name",
869
+ yourEmail: "Deine E-Mail",
870
+ submit: "Absenden",
871
+ back: "Zurück"
872
+ }, yt = [
873
+ { value: "de", label: "Deutsch", flag: "🇩🇪" },
874
+ { value: "en", label: "English", flag: "🇬🇧" }
875
+ ], Yt = "de", Jt = "jex-locale", we = E("de"), Zt = { en: jt, de: Vt };
876
+ function R() {
877
+ return Zt[we.value] ?? jt;
878
+ }
879
+ function ve(t) {
880
+ if (!t)
881
+ return null;
882
+ const e = (t.split("-")[0] ?? "").toLowerCase();
883
+ return yt.some((n) => n.value === e) ? e : null;
940
884
  }
941
- function Qt(t) {
942
- G.value = t;
885
+ function Kt(t) {
886
+ const e = ve(t);
887
+ if (e)
888
+ return e;
943
889
  try {
944
- localStorage.setItem("jex-locale", t);
890
+ const r = ve(localStorage.getItem(Jt));
891
+ if (r)
892
+ return r;
945
893
  } catch {
946
894
  }
895
+ if (typeof navigator < "u") {
896
+ const r = ve(navigator.language);
897
+ if (r)
898
+ return r;
899
+ }
900
+ return Yt;
947
901
  }
948
- function Yt(t) {
949
- const e = {}, { primaryColor: n, theme: i } = t;
950
- if (n && (e["--jex-primary"] = n, e["--jex-bg-trigger"] = n, e["--jex-bg-header"] = n, e["--jex-bg-msg-user"] = n, e["--jex-bg-send-btn"] = n), i?.bg) {
951
- const r = i.bg;
952
- r.trigger && (e["--jex-bg-trigger"] = r.trigger), r.header && (e["--jex-bg-header"] = r.header), r.msgUser && (e["--jex-bg-msg-user"] = r.msgUser), r.msgBot && (e["--jex-bg-msg-bot"] = r.msgBot), r.window && (e["--jex-bg-window"] = r.window), r.sendBtn && (e["--jex-bg-send-btn"] = r.sendBtn);
902
+ function Xt(t) {
903
+ const e = {}, { primaryColor: r, theme: n } = t;
904
+ if (r && (e["--jex-primary"] = r, e["--jex-bg-trigger"] = r, e["--jex-bg-header"] = r, e["--jex-bg-msg-user"] = r, e["--jex-bg-send-btn"] = r), t.accentColor && (e["--jex-accent"] = t.accentColor), n?.bg) {
905
+ const i = n.bg;
906
+ i.trigger && (e["--jex-bg-trigger"] = i.trigger), i.header && (e["--jex-bg-header"] = i.header), i.msgUser && (e["--jex-bg-msg-user"] = i.msgUser), i.msgBot && (e["--jex-bg-msg-bot"] = i.msgBot), i.window && (e["--jex-bg-window"] = i.window), i.sendBtn && (e["--jex-bg-send-btn"] = i.sendBtn);
953
907
  }
954
- if (i?.text) {
955
- const r = i.text;
956
- r.header && (e["--jex-text-header"] = r.header), r.msgUser && (e["--jex-text-msg-user"] = r.msgUser), r.msgBot && (e["--jex-text-msg-bot"] = r.msgBot), r.main && (e["--jex-text-main"] = r.main), r.muted && (e["--jex-text-muted"] = r.muted);
908
+ if (n?.text) {
909
+ const i = n.text;
910
+ i.header && (e["--jex-text-header"] = i.header), i.msgUser && (e["--jex-text-msg-user"] = i.msgUser), i.msgBot && (e["--jex-text-msg-bot"] = i.msgBot), i.main && (e["--jex-text-main"] = i.main), i.muted && (e["--jex-text-muted"] = i.muted);
957
911
  }
958
- if (i?.border) {
959
- const r = i.border;
960
- r.window && (e["--jex-border-window"] = r.window), r.input && (e["--jex-border-input"] = r.input);
912
+ if (n?.border) {
913
+ const i = n.border;
914
+ i.window && (e["--jex-border-window"] = i.window), i.input && (e["--jex-border-input"] = i.input);
961
915
  }
962
- return Object.keys(e).length > 0 ? e : void 0;
916
+ return t.fontFamily && (e["--jex-font-family"] = t.fontFamily), t.fontSize && (e["--jex-font-size"] = `${t.fontSize}px`), t.borderRadius && (e["--jex-radius"] = t.borderRadius), t.windowWidth && (e["--jex-window-width"] = `${t.windowWidth}px`), t.windowHeight && (e["--jex-window-height"] = `${t.windowHeight}px`), Object.keys(e).length > 0 ? e : void 0;
917
+ }
918
+ const T = E([{ id: "home" }]);
919
+ function J(t) {
920
+ T.value = [...T.value, t];
921
+ }
922
+ function wt() {
923
+ T.value.length > 1 && (T.value = T.value.slice(0, -1));
924
+ }
925
+ function ke(t) {
926
+ T.value = [...T.value.slice(0, -1), t];
927
+ }
928
+ function kt({ size: t = 24 }) {
929
+ return /* @__PURE__ */ a("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
930
+ /* @__PURE__ */ a("path", { d: "M12 8V4H8" }),
931
+ /* @__PURE__ */ a("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
932
+ /* @__PURE__ */ a("path", { d: "M2 14h2" }),
933
+ /* @__PURE__ */ a("path", { d: "M20 14h2" }),
934
+ /* @__PURE__ */ a("path", { d: "M15 13v2" }),
935
+ /* @__PURE__ */ a("path", { d: "M9 13v2" })
936
+ ] });
963
937
  }
964
- function Xt() {
965
- return /* @__PURE__ */ p("div", { className: "jex-widget-footer", children: [
966
- /* @__PURE__ */ p(
967
- "a",
938
+ function Qt({ title: t }) {
939
+ const e = R(), r = T.value.length > 1;
940
+ return /* @__PURE__ */ a("header", { class: "jex-chat-header", children: [
941
+ r && /* @__PURE__ */ a(
942
+ "button",
968
943
  {
969
- href: "https://jexity.com",
970
- target: "_blank",
971
- rel: "noopener noreferrer",
972
- className: "jex-branding",
973
- children: [
974
- /* @__PURE__ */ p(Ht, { size: 14, className: "jex-branding-icon" }),
975
- /* @__PURE__ */ p("span", { children: [
976
- "Powered by ",
977
- /* @__PURE__ */ p("strong", { children: "Jexity" })
978
- ] })
979
- ]
944
+ class: "jex-header-back",
945
+ onClick: wt,
946
+ "aria-label": e.back || "Go back",
947
+ children: /* @__PURE__ */ a("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m15 18-6-6 6-6" }) })
980
948
  }
981
949
  ),
982
- /* @__PURE__ */ p("div", { className: "jex-locale-select-wrapper", children: [
983
- /* @__PURE__ */ p(
984
- "select",
950
+ !r && /* @__PURE__ */ a(kt, { size: 24 }),
951
+ /* @__PURE__ */ a("div", { class: "jex-header-info", children: [
952
+ /* @__PURE__ */ a("h3", { children: t }),
953
+ /* @__PURE__ */ a("p", { children: e.statusOnline })
954
+ ] })
955
+ ] });
956
+ }
957
+ function er({ size: t = 14 }) {
958
+ return /* @__PURE__ */ a("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" }) });
959
+ }
960
+ function tr() {
961
+ return /* @__PURE__ */ a("div", { class: "jex-widget-footer", children: /* @__PURE__ */ a(
962
+ "a",
963
+ {
964
+ href: "https://jexity.com",
965
+ target: "_blank",
966
+ rel: "noopener noreferrer",
967
+ class: "jex-branding",
968
+ children: [
969
+ /* @__PURE__ */ a(er, { size: 14 }),
970
+ /* @__PURE__ */ a("span", { children: [
971
+ "Powered by ",
972
+ /* @__PURE__ */ a("strong", { children: "Jexity" })
973
+ ] })
974
+ ]
975
+ }
976
+ ) });
977
+ }
978
+ function rr({ size: t = 28 }) {
979
+ return /* @__PURE__ */ a("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
980
+ }
981
+ function nr({ size: t = 28 }) {
982
+ return /* @__PURE__ */ a("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
983
+ /* @__PURE__ */ a("path", { d: "M18 6 6 18" }),
984
+ /* @__PURE__ */ a("path", { d: "m6 6 12 12" })
985
+ ] });
986
+ }
987
+ function ir({ size: t = 24, ...e }) {
988
+ return /* @__PURE__ */ a(
989
+ "svg",
990
+ {
991
+ width: t,
992
+ height: t,
993
+ viewBox: "0 0 24 24",
994
+ fill: "none",
995
+ stroke: "currentColor",
996
+ "stroke-width": "2",
997
+ "stroke-linecap": "round",
998
+ "stroke-linejoin": "round",
999
+ ...e,
1000
+ children: /* @__PURE__ */ a("path", { d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" })
1001
+ }
1002
+ );
1003
+ }
1004
+ const or = {
1005
+ chat: /* @__PURE__ */ a(rr, { size: 28 }),
1006
+ bot: /* @__PURE__ */ a(kt, { size: 28 }),
1007
+ sparkles: /* @__PURE__ */ a(ir, { size: 28 })
1008
+ }, ar = {
1009
+ none: "0px",
1010
+ sm: "0.5rem",
1011
+ md: "0.75rem",
1012
+ lg: "1.25rem",
1013
+ full: "9999px"
1014
+ };
1015
+ function sr({ radius: t = "full", iconOption: e = "chat", label: r = "Chatte mit uns" }) {
1016
+ const n = R(), i = r !== "";
1017
+ return /* @__PURE__ */ a(
1018
+ "button",
1019
+ {
1020
+ class: `jex-floating-button ${!S.value && i ? "jex-has-label" : ""}`,
1021
+ style: { borderRadius: ar[t] ?? "9999px" },
1022
+ onClick: () => {
1023
+ S.value = !S.value;
1024
+ },
1025
+ "aria-label": S.value ? n.closeChatAriaLabel : n.openChatAriaLabel,
1026
+ children: S.value ? /* @__PURE__ */ a(nr, { size: 28 }) : /* @__PURE__ */ a("div", { class: "jex-fab-inner", children: [
1027
+ or[e],
1028
+ i && /* @__PURE__ */ a("span", { class: "jex-fab-label", children: r })
1029
+ ] })
1030
+ }
1031
+ );
1032
+ }
1033
+ const N = E([]), Q = E(!1), lr = E(null);
1034
+ function cr() {
1035
+ N.value = [], Q.value = !1, lr.value = null;
1036
+ }
1037
+ function ur({ greeting: t, title: e }) {
1038
+ const r = R(), n = X.value, [i, o] = U(!1), [l, c] = U("");
1039
+ function d() {
1040
+ qt(), cr(), J({ id: "chat" });
1041
+ }
1042
+ function u() {
1043
+ J({ id: "chat" });
1044
+ }
1045
+ function h(s) {
1046
+ s.preventDefault(), l.trim() && J({ id: "chat" });
1047
+ }
1048
+ return /* @__PURE__ */ a("div", { class: "jex-home", children: [
1049
+ /* @__PURE__ */ a("div", { class: "jex-home-greeting", children: t }),
1050
+ n ? (
1051
+ // Same-tab session exists in sessionStorage
1052
+ /* @__PURE__ */ a("div", { class: "jex-home-actions", children: [
1053
+ /* @__PURE__ */ a("button", { class: "jex-home-start-btn", onClick: u, children: r.resumeConversation }),
1054
+ /* @__PURE__ */ a("button", { class: "jex-home-new-btn", onClick: d, children: r.startNewConversation })
1055
+ ] })
1056
+ ) : (
1057
+ // Fresh session or tab was closed
1058
+ /* @__PURE__ */ a("div", { class: "jex-home-actions", children: [
1059
+ /* @__PURE__ */ a("button", { class: "jex-home-start-btn", onClick: d, children: r.chatWith.replace("{title}", e) }),
1060
+ !i && /* @__PURE__ */ a(
1061
+ "button",
1062
+ {
1063
+ class: "jex-home-lookup-link",
1064
+ onClick: () => {
1065
+ o(!0);
1066
+ },
1067
+ children: r.haveReferenceNumber
1068
+ }
1069
+ ),
1070
+ i && /* @__PURE__ */ a("form", { class: "jex-home-lookup", onSubmit: h, children: [
1071
+ /* @__PURE__ */ a(
1072
+ "input",
1073
+ {
1074
+ class: "jex-home-lookup-input",
1075
+ type: "text",
1076
+ placeholder: r.referencePlaceholder,
1077
+ value: l,
1078
+ autoFocus: !0,
1079
+ onInput: (s) => {
1080
+ c(s.currentTarget.value);
1081
+ }
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ a("button", { class: "jex-home-lookup-submit", type: "submit", children: r.resume })
1085
+ ] })
1086
+ ] })
1087
+ )
1088
+ ] });
1089
+ }
1090
+ function dr({ title: t }) {
1091
+ const e = R();
1092
+ return /* @__PURE__ */ a("div", { class: "jex-selection", children: [
1093
+ /* @__PURE__ */ a("h2", { class: "jex-selection-title", children: e.howCanWeHelp }),
1094
+ /* @__PURE__ */ a("div", { class: "jex-selection-options", children: [
1095
+ /* @__PURE__ */ a(
1096
+ "button",
985
1097
  {
986
- className: "jex-locale-select",
987
- value: G.value,
988
- onChange: (t) => Qt(t.currentTarget.value),
989
- "aria-label": "Select language",
1098
+ class: "jex-selection-option",
1099
+ onClick: () => J({ id: "chat" }),
990
1100
  children: [
991
- /* @__PURE__ */ p("option", { value: "de", children: "🇩🇪 Deutsch" }),
992
- /* @__PURE__ */ p("option", { value: "en", children: "🇬🇧 English" })
1101
+ /* @__PURE__ */ a("span", { class: "jex-selection-icon", children: "💬" }),
1102
+ /* @__PURE__ */ a("span", { class: "jex-selection-label", children: e.chatWith.replace("{title}", t) }),
1103
+ /* @__PURE__ */ a("span", { class: "jex-selection-sub", children: e.getInstantHelp })
993
1104
  ]
994
1105
  }
995
1106
  ),
996
- /* @__PURE__ */ p(Lt, { size: 14, className: "jex-locale-chevron" })
1107
+ /* @__PURE__ */ a(
1108
+ "button",
1109
+ {
1110
+ class: "jex-selection-option",
1111
+ onClick: () => J({ id: "form" }),
1112
+ children: [
1113
+ /* @__PURE__ */ a("span", { class: "jex-selection-icon", children: "📝" }),
1114
+ /* @__PURE__ */ a("span", { class: "jex-selection-label", children: e.submitTicket }),
1115
+ /* @__PURE__ */ a("span", { class: "jex-selection-sub", children: e.replyByEmail })
1116
+ ]
1117
+ }
1118
+ )
997
1119
  ] })
998
1120
  ] });
999
1121
  }
1000
- function en({ options: t }) {
1001
- const e = Kt(), [n, i] = Me(""), [r, o] = Me([
1002
- {
1003
- id: 1,
1004
- text: t.greeting ?? `Hi there! This is ${t.orgId} assistant. How can I help you today?`,
1005
- sender: "bot"
1006
- }
1007
- ]), s = t.position === "bottom-left", l = t.locale;
1008
- Oe(() => {
1009
- G.value = Vt(l);
1010
- }, [l]), Oe(() => {
1011
- function f(c) {
1012
- const b = t.parentOrigin ?? window.location.origin;
1013
- if (c.origin !== b || c.data?.type !== "jexity:config")
1014
- return;
1015
- const { locale: $ } = c.data.payload;
1016
- ($ === "en" || $ === "de") && (G.value = $);
1017
- }
1018
- return window.addEventListener("message", f), () => window.removeEventListener("message", f);
1019
- }, [t.parentOrigin]);
1020
- const u = () => {
1021
- if (!n.trim())
1022
- return;
1023
- const f = { id: Date.now(), text: n, sender: "user" };
1024
- o([...r, f]), i(""), setTimeout(() => {
1025
- o((c) => [
1026
- ...c,
1122
+ function fr({ text: t }) {
1123
+ return /* @__PURE__ */ a("div", { class: "jex-message bot", children: t });
1124
+ }
1125
+ function hr({ text: t }) {
1126
+ return /* @__PURE__ */ a("div", { class: "jex-message user", children: t });
1127
+ }
1128
+ function pr() {
1129
+ return /* @__PURE__ */ a("div", { class: "jex-typing", children: [
1130
+ /* @__PURE__ */ a("span", {}),
1131
+ /* @__PURE__ */ a("span", {}),
1132
+ /* @__PURE__ */ a("span", {})
1133
+ ] });
1134
+ }
1135
+ function _r() {
1136
+ const t = Lt(null);
1137
+ return M(() => {
1138
+ t.current?.scrollIntoView({ behavior: "smooth" });
1139
+ }, [N.value.length, Q.value]), /* @__PURE__ */ a("div", { class: "jex-chat-messages", children: [
1140
+ N.value.map(
1141
+ (e) => e.sender === "bot" ? /* @__PURE__ */ a(fr, { text: e.text }, e.id) : /* @__PURE__ */ a(hr, { text: e.text }, e.id)
1142
+ ),
1143
+ Q.value && /* @__PURE__ */ a(pr, {}),
1144
+ /* @__PURE__ */ a("div", { ref: t })
1145
+ ] });
1146
+ }
1147
+ function xr({ size: t = 18 }) {
1148
+ return /* @__PURE__ */ a("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
1149
+ /* @__PURE__ */ a("path", { d: "M22 2 11 13" }),
1150
+ /* @__PURE__ */ a("path", { d: "M22 2 15 22 11 13 2 9l20-7z" })
1151
+ ] });
1152
+ }
1153
+ function vr() {
1154
+ const t = R(), e = gt("");
1155
+ function r() {
1156
+ const n = e.value.trim();
1157
+ n && (Gt(), N.value = [
1158
+ ...N.value,
1159
+ { id: Date.now(), text: n, sender: "user" }
1160
+ ], e.value = "", Q.value = !0, setTimeout(() => {
1161
+ Q.value = !1, N.value = [
1162
+ ...N.value,
1027
1163
  {
1028
1164
  id: Date.now() + 1,
1029
1165
  text: `You said: "${n}". This is a demo of the Jexity Chat Widget!`,
1030
1166
  sender: "bot"
1031
1167
  }
1032
- ]);
1033
- }, 1e3);
1034
- }, a = Yt(t), h = t.colorScheme;
1035
- return /* @__PURE__ */ p("div", { className: `jex-widget ${h === "dark" || h === "light" ? h : ""}`.trim(), style: a, children: /* @__PURE__ */ p("div", { className: `jex-container${s ? " jex-pos-left" : ""}`, children: [
1036
- S.value && /* @__PURE__ */ p("div", { className: "jex-chat-window", children: [
1037
- /* @__PURE__ */ p("header", { className: "jex-chat-header", children: [
1038
- /* @__PURE__ */ p(At, { size: 24 }),
1039
- /* @__PURE__ */ p("div", { className: "jex-header-info", children: [
1040
- /* @__PURE__ */ p("h3", { children: t.title ?? e.title }),
1041
- /* @__PURE__ */ p("p", { children: e.statusOnline })
1042
- ] })
1043
- ] }),
1044
- /* @__PURE__ */ p("div", { className: "jex-chat-messages", children: r.map((f) => /* @__PURE__ */ p("div", { className: `jex-message ${f.sender}`, children: f.text }, f.id)) }),
1045
- /* @__PURE__ */ p("div", { className: "jex-chat-input", children: [
1046
- /* @__PURE__ */ p(
1047
- "input",
1048
- {
1049
- type: "text",
1050
- placeholder: e.inputPlaceholder,
1051
- value: n,
1052
- onInput: (f) => i(f.currentTarget.value),
1053
- onKeyDown: (f) => f.key === "Enter" && u()
1168
+ ];
1169
+ }, 1e3));
1170
+ }
1171
+ return /* @__PURE__ */ a("div", { class: "jex-chat-input", children: [
1172
+ /* @__PURE__ */ a(
1173
+ "input",
1174
+ {
1175
+ type: "text",
1176
+ "aria-label": t.inputPlaceholder,
1177
+ placeholder: t.inputPlaceholder,
1178
+ value: e.value,
1179
+ onInput: (n) => {
1180
+ e.value = n.currentTarget.value;
1181
+ },
1182
+ onKeyDown: (n) => {
1183
+ n.key === "Enter" && r();
1184
+ }
1185
+ }
1186
+ ),
1187
+ /* @__PURE__ */ a(
1188
+ "button",
1189
+ {
1190
+ class: "jex-send-btn",
1191
+ onClick: r,
1192
+ "aria-label": t.sendAriaLabel,
1193
+ children: /* @__PURE__ */ a(xr, { size: 18 })
1194
+ }
1195
+ )
1196
+ ] });
1197
+ }
1198
+ function gr({ greeting: t }) {
1199
+ return M(() => {
1200
+ N.value.length === 0 && (N.value = [{ id: Date.now(), text: t, sender: "bot" }]);
1201
+ }, [t]), /* @__PURE__ */ a(W, { children: [
1202
+ /* @__PURE__ */ a(_r, {}),
1203
+ /* @__PURE__ */ a(vr, {})
1204
+ ] });
1205
+ }
1206
+ function mr() {
1207
+ const t = R(), [e, r] = U(""), [n, i] = U(""), [o, l] = U("");
1208
+ async function c(d) {
1209
+ d.preventDefault(), ke({ id: "loading", message: t.submittingTicket }), await new Promise((h) => {
1210
+ setTimeout(h, 1200);
1211
+ });
1212
+ const u = "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
1213
+ ke({ id: "confirmation", ref: u });
1214
+ }
1215
+ return /* @__PURE__ */ a("div", { class: "jex-form-screen", children: [
1216
+ /* @__PURE__ */ a("h2", { class: "jex-form-title", children: t.submitTicket }),
1217
+ /* @__PURE__ */ a("form", { class: "jex-form", onSubmit: (d) => {
1218
+ c(d);
1219
+ }, children: [
1220
+ /* @__PURE__ */ a(
1221
+ "input",
1222
+ {
1223
+ class: "jex-form-input",
1224
+ type: "text",
1225
+ placeholder: t.yourName,
1226
+ value: e,
1227
+ required: !0,
1228
+ onInput: (d) => {
1229
+ r(d.currentTarget.value);
1054
1230
  }
1055
- ),
1056
- /* @__PURE__ */ p(
1057
- "button",
1058
- {
1059
- className: "jex-send-btn",
1060
- onClick: u,
1061
- "aria-label": e.sendAriaLabel,
1062
- children: /* @__PURE__ */ p(Tt, { size: 18 })
1231
+ }
1232
+ ),
1233
+ /* @__PURE__ */ a(
1234
+ "input",
1235
+ {
1236
+ class: "jex-form-input",
1237
+ type: "email",
1238
+ placeholder: t.yourEmail,
1239
+ value: n,
1240
+ required: !0,
1241
+ onInput: (d) => {
1242
+ i(d.currentTarget.value);
1063
1243
  }
1064
- )
1065
- ] }),
1066
- /* @__PURE__ */ p(Xt, {})
1067
- ] }),
1068
- /* @__PURE__ */ p(
1244
+ }
1245
+ ),
1246
+ /* @__PURE__ */ a(
1247
+ "textarea",
1248
+ {
1249
+ class: "jex-form-textarea",
1250
+ placeholder: t.howCanWeHelp,
1251
+ value: o,
1252
+ required: !0,
1253
+ onInput: (d) => {
1254
+ l(d.currentTarget.value);
1255
+ }
1256
+ }
1257
+ ),
1258
+ /* @__PURE__ */ a("button", { class: "jex-form-submit", type: "submit", children: t.submit })
1259
+ ] })
1260
+ ] });
1261
+ }
1262
+ function br({ ticketRef: t }) {
1263
+ const e = R();
1264
+ return /* @__PURE__ */ a("div", { class: "jex-confirmation", children: [
1265
+ /* @__PURE__ */ a("div", { class: "jex-confirmation-icon", "aria-hidden": "true", children: "✓" }),
1266
+ /* @__PURE__ */ a("h2", { class: "jex-confirmation-title", children: e.ticketSubmitted }),
1267
+ /* @__PURE__ */ a("p", { class: "jex-confirmation-body", children: e.yourReferenceNumber }),
1268
+ /* @__PURE__ */ a("div", { class: "jex-confirmation-ref", children: t }),
1269
+ /* @__PURE__ */ a("p", { class: "jex-confirmation-hint", children: e.sentToEmailHint }),
1270
+ /* @__PURE__ */ a(
1069
1271
  "button",
1070
1272
  {
1071
- className: "jex-floating-button",
1072
- onClick: () => S.value = !S.value,
1073
- "aria-label": S.value ? e.closeChatAriaLabel : e.openChatAriaLabel,
1074
- children: S.value ? /* @__PURE__ */ p(Ut, { size: 28 }) : /* @__PURE__ */ p(Pt, { size: 28 })
1273
+ class: "jex-confirmation-done",
1274
+ onClick: () => {
1275
+ S.value = !1;
1276
+ },
1277
+ children: e.done
1075
1278
  }
1076
1279
  )
1077
- ] }) });
1280
+ ] });
1078
1281
  }
1079
- let F = null;
1080
- function tn(t) {
1081
- F && F.shutdown();
1082
- let e;
1083
- t.container ? e = typeof t.container == "string" ? document.querySelector(t.container) : t.container : (e = document.createElement("div"), e.id = "jexity-chat-widget", document.body.appendChild(e)), je(z(en, { options: t }), e);
1084
- const n = /* @__PURE__ */ new Set(), i = S.subscribe((o) => {
1085
- for (const s of n) s(o);
1086
- }), r = {
1282
+ function jr({ message: t }) {
1283
+ return /* @__PURE__ */ a("div", { class: "jex-overlay jex-loading", children: [
1284
+ /* @__PURE__ */ a("div", { class: "jex-loading-spinner", "aria-hidden": "true" }),
1285
+ t && /* @__PURE__ */ a("p", { class: "jex-loading-message", children: t })
1286
+ ] });
1287
+ }
1288
+ function yr({ message: t, onRetry: e, onBack: r }) {
1289
+ return /* @__PURE__ */ a("div", { class: "jex-overlay jex-error", children: [
1290
+ /* @__PURE__ */ a("p", { class: "jex-error-message", children: t }),
1291
+ /* @__PURE__ */ a("div", { class: "jex-error-actions", children: [
1292
+ e && /* @__PURE__ */ a("button", { class: "jex-error-retry", onClick: e, children: "Try again" }),
1293
+ r && /* @__PURE__ */ a("button", { class: "jex-error-back", onClick: r, children: "Go back" })
1294
+ ] })
1295
+ ] });
1296
+ }
1297
+ function wr({ greeting: t, title: e }) {
1298
+ const r = T.value, n = r[r.length - 1], i = r.findLast(
1299
+ (o) => o.id === "confirmation"
1300
+ );
1301
+ return /* @__PURE__ */ a("div", { class: "jex-screen-container", children: [
1302
+ n.id === "home" && /* @__PURE__ */ a(ur, { greeting: t, title: e }),
1303
+ n.id === "selection" && /* @__PURE__ */ a(dr, { title: e }),
1304
+ n.id === "form" && /* @__PURE__ */ a(mr, {}),
1305
+ n.id === "confirmation" && i && /* @__PURE__ */ a(br, { ticketRef: i.ref }),
1306
+ n.id === "chat" && /* @__PURE__ */ a(gr, { greeting: t }),
1307
+ n.id === "loading" && /* @__PURE__ */ a(jr, { message: n.message }),
1308
+ n.id === "error" && /* @__PURE__ */ a(
1309
+ yr,
1310
+ {
1311
+ message: n.message,
1312
+ onRetry: () => ke({ id: "loading" }),
1313
+ onBack: wt
1314
+ }
1315
+ )
1316
+ ] });
1317
+ }
1318
+ function kr({ options: t }) {
1319
+ const [e, r] = U(null);
1320
+ M(() => {
1321
+ }, [t.orgSlug]);
1322
+ const n = t.title ?? e?.title ?? "Assistant", i = t.greeting ?? e?.welcomeMessage ?? `Hi! I'm ${n}. How can I help?`, o = t.locale ?? e?.locale, l = t.position ?? e?.position, c = t.colorScheme ?? e?.colorScheme, d = t.hideBranding ?? e?.hideBranding ?? !1, u = t.triggerIcon ?? e?.triggerIcon ?? "chat", h = t.triggerRadius ?? e?.triggerRadius ?? "full", s = t.triggerLabel ?? e?.triggerLabel ?? "Chatte mit uns", p = l === "bottom-left", f = c === "dark" || c === "light" ? c : "", j = Xt({
1323
+ ...t,
1324
+ primaryColor: t.primaryColor ?? e?.primaryColor,
1325
+ accentColor: t.accentColor ?? e?.accentColor,
1326
+ fontFamily: t.fontFamily ?? e?.fontFamily,
1327
+ fontSize: t.fontSize ?? e?.fontSize,
1328
+ borderRadius: t.borderRadius ?? e?.borderRadius,
1329
+ windowWidth: t.windowWidth ?? e?.windowWidth,
1330
+ windowHeight: t.windowHeight ?? e?.windowHeight
1331
+ });
1332
+ return M(() => {
1333
+ Ft();
1334
+ }, []), M(() => {
1335
+ we.value = Kt(o);
1336
+ }, [o]), M(() => {
1337
+ function k(m) {
1338
+ const g = t.parentOrigin ?? window.location.origin;
1339
+ if (m.origin !== g || m.data?.type !== "jexity:config")
1340
+ return;
1341
+ const { locale: _ } = m.data.payload;
1342
+ _ && yt.some((C) => C.value === _) && (we.value = _);
1343
+ }
1344
+ return window.addEventListener("message", k), () => {
1345
+ window.removeEventListener("message", k);
1346
+ };
1347
+ }, [t.parentOrigin]), /* @__PURE__ */ a(
1348
+ "div",
1349
+ {
1350
+ class: `jex-widget ${f}`.trim(),
1351
+ style: j,
1352
+ children: /* @__PURE__ */ a("div", { class: `jex-container${p ? " jex-pos-left" : ""}`, children: [
1353
+ S.value && /* @__PURE__ */ a("div", { class: "jex-chat-window", children: [
1354
+ /* @__PURE__ */ a(Qt, { title: n }),
1355
+ /* @__PURE__ */ a(wr, { greeting: i, title: n }),
1356
+ !d && /* @__PURE__ */ a(tr, {})
1357
+ ] }),
1358
+ /* @__PURE__ */ a(
1359
+ sr,
1360
+ {
1361
+ iconOption: u,
1362
+ radius: h,
1363
+ label: s
1364
+ }
1365
+ )
1366
+ ] })
1367
+ }
1368
+ );
1369
+ }
1370
+ const Sr = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9)}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9)}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:16px;padding:20px;font-size:15px;line-height:1.5;color:var(--jex-text-main)}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s;width:100%}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px)}.jex-home-start-btn:active{transform:translateY(0)}.jex-home-actions{display:flex;flex-direction:column;gap:8px}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message{max-width:80%;padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{align-self:flex-start;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:6px;width:100%}.jex-home-lookup-input{flex:1;padding:8px 10px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:13px;outline:none}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:8px 14px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer}';
1371
+ function Cr(t) {
1372
+ const e = document.createElement("style");
1373
+ e.textContent = Sr, t.appendChild(e);
1374
+ }
1375
+ function $r(t, e) {
1376
+ const r = t.shadowRoot ?? t.attachShadow({ mode: "open" });
1377
+ for (; r.firstChild; )
1378
+ r.removeChild(r.firstChild);
1379
+ Cr(r);
1380
+ const n = document.createElement("div");
1381
+ return r.appendChild(n), Me(/* @__PURE__ */ a(kr, { options: e }), n), function() {
1382
+ Me(null, n), S.value = !1;
1383
+ };
1384
+ }
1385
+ function Er(t, e, r) {
1386
+ const n = $r(t, e), i = /* @__PURE__ */ new Set(), o = S.subscribe((c) => {
1387
+ for (const d of i)
1388
+ d(c);
1389
+ });
1390
+ return {
1087
1391
  shutdown() {
1088
- i(), n.clear(), je(null, e), t.container || e.remove(), F === r && (F = null);
1392
+ o(), i.clear(), n(), r && r();
1089
1393
  },
1090
1394
  open() {
1091
1395
  S.value = !0;
@@ -1099,13 +1403,24 @@ function tn(t) {
1099
1403
  get isOpen() {
1100
1404
  return S.value;
1101
1405
  },
1102
- subscribe(o) {
1103
- return n.add(o), () => n.delete(o);
1406
+ subscribe(c) {
1407
+ return i.add(c), () => {
1408
+ i.delete(c);
1409
+ };
1104
1410
  }
1105
1411
  };
1106
- return F = r, r;
1412
+ }
1413
+ let G = null;
1414
+ function Ar(t) {
1415
+ G && G.shutdown();
1416
+ let e;
1417
+ t.container ? e = typeof t.container == "string" ? document.querySelector(t.container) : t.container : (e = document.createElement("div"), e.id = "jexity-chat-widget", document.body.appendChild(e));
1418
+ const r = Er(e, t, () => {
1419
+ t.container || e.remove(), G === r && (G = null);
1420
+ });
1421
+ return G = r, r;
1107
1422
  }
1108
1423
  export {
1109
- tn as JexityChat
1424
+ Ar as JexityChat
1110
1425
  };
1111
1426
  //# sourceMappingURL=index.mjs.map