lulichat 1.0.4 → 1.0.6

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.
@@ -0,0 +1,1727 @@
1
+ var kt = Object.defineProperty;
2
+ var Ct = (n, s, l) => s in n ? kt(n, s, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[s] = l;
3
+ var F = (n, s, l) => Ct(n, typeof s != "symbol" ? s + "" : s, l);
4
+ import S, { useRef as U, useCallback as $e, useImperativeHandle as Et, useState as P, useEffect as ce } from "react";
5
+ import Rt, { clsx as St } from "clsx";
6
+ var ue = { exports: {} }, J = {};
7
+ /**
8
+ * @license React
9
+ * react-jsx-runtime.production.min.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var Me;
17
+ function _t() {
18
+ if (Me) return J;
19
+ Me = 1;
20
+ var n = S, s = Symbol.for("react.element"), l = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, v = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
21
+ function y(b, u, h) {
22
+ var p, E = {}, R = null, T = null;
23
+ h !== void 0 && (R = "" + h), u.key !== void 0 && (R = "" + u.key), u.ref !== void 0 && (T = u.ref);
24
+ for (p in u) i.call(u, p) && !d.hasOwnProperty(p) && (E[p] = u[p]);
25
+ if (b && b.defaultProps) for (p in u = b.defaultProps, u) E[p] === void 0 && (E[p] = u[p]);
26
+ return { $$typeof: s, type: b, key: R, ref: T, props: E, _owner: v.current };
27
+ }
28
+ return J.Fragment = l, J.jsx = y, J.jsxs = y, J;
29
+ }
30
+ var K = {};
31
+ /**
32
+ * @license React
33
+ * react-jsx-runtime.development.js
34
+ *
35
+ * Copyright (c) Facebook, Inc. and its affiliates.
36
+ *
37
+ * This source code is licensed under the MIT license found in the
38
+ * LICENSE file in the root directory of this source tree.
39
+ */
40
+ var Ie;
41
+ function Nt() {
42
+ return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var n = S, s = Symbol.for("react.element"), l = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), b = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, M = "@@iterator";
44
+ function j(e) {
45
+ if (e === null || typeof e != "object")
46
+ return null;
47
+ var r = A && e[A] || e[M];
48
+ return typeof r == "function" ? r : null;
49
+ }
50
+ var O = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function o(e) {
52
+ {
53
+ for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), c = 1; c < r; c++)
54
+ a[c - 1] = arguments[c];
55
+ w("error", e, a);
56
+ }
57
+ }
58
+ function w(e, r, a) {
59
+ {
60
+ var c = O.ReactDebugCurrentFrame, g = c.getStackAddendum();
61
+ g !== "" && (r += "%s", a = a.concat([g]));
62
+ var x = a.map(function(m) {
63
+ return String(m);
64
+ });
65
+ x.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, x);
66
+ }
67
+ }
68
+ var $ = !1, Ye = !1, Ue = !1, qe = !1, He = !1, fe;
69
+ fe = Symbol.for("react.module.reference");
70
+ function Je(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === d || He || e === v || e === h || e === p || qe || e === T || $ || Ye || Ue || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === E || e.$$typeof === y || e.$$typeof === b || e.$$typeof === u || // This needs to include all possible module reference object
72
+ // types supported by any Flight configuration anywhere since
73
+ // we don't know which Flight build this will end up being used
74
+ // with.
75
+ e.$$typeof === fe || e.getModuleId !== void 0));
76
+ }
77
+ function Ke(e, r, a) {
78
+ var c = e.displayName;
79
+ if (c)
80
+ return c;
81
+ var g = r.displayName || r.name || "";
82
+ return g !== "" ? a + "(" + g + ")" : a;
83
+ }
84
+ function de(e) {
85
+ return e.displayName || "Context";
86
+ }
87
+ function I(e) {
88
+ if (e == null)
89
+ return null;
90
+ if (typeof e.tag == "number" && o("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
+ return e.displayName || e.name || null;
92
+ if (typeof e == "string")
93
+ return e;
94
+ switch (e) {
95
+ case i:
96
+ return "Fragment";
97
+ case l:
98
+ return "Portal";
99
+ case d:
100
+ return "Profiler";
101
+ case v:
102
+ return "StrictMode";
103
+ case h:
104
+ return "Suspense";
105
+ case p:
106
+ return "SuspenseList";
107
+ }
108
+ if (typeof e == "object")
109
+ switch (e.$$typeof) {
110
+ case b:
111
+ var r = e;
112
+ return de(r) + ".Consumer";
113
+ case y:
114
+ var a = e;
115
+ return de(a._context) + ".Provider";
116
+ case u:
117
+ return Ke(e, e.render, "ForwardRef");
118
+ case E:
119
+ var c = e.displayName || null;
120
+ return c !== null ? c : I(e.type) || "Memo";
121
+ case R: {
122
+ var g = e, x = g._payload, m = g._init;
123
+ try {
124
+ return I(m(x));
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+ }
130
+ return null;
131
+ }
132
+ var L = Object.assign, q = 0, he, me, ve, pe, ge, xe, ye;
133
+ function be() {
134
+ }
135
+ be.__reactDisabledLog = !0;
136
+ function Ge() {
137
+ {
138
+ if (q === 0) {
139
+ he = console.log, me = console.info, ve = console.warn, pe = console.error, ge = console.group, xe = console.groupCollapsed, ye = console.groupEnd;
140
+ var e = {
141
+ configurable: !0,
142
+ enumerable: !0,
143
+ value: be,
144
+ writable: !0
145
+ };
146
+ Object.defineProperties(console, {
147
+ info: e,
148
+ log: e,
149
+ warn: e,
150
+ error: e,
151
+ group: e,
152
+ groupCollapsed: e,
153
+ groupEnd: e
154
+ });
155
+ }
156
+ q++;
157
+ }
158
+ }
159
+ function Ze() {
160
+ {
161
+ if (q--, q === 0) {
162
+ var e = {
163
+ configurable: !0,
164
+ enumerable: !0,
165
+ writable: !0
166
+ };
167
+ Object.defineProperties(console, {
168
+ log: L({}, e, {
169
+ value: he
170
+ }),
171
+ info: L({}, e, {
172
+ value: me
173
+ }),
174
+ warn: L({}, e, {
175
+ value: ve
176
+ }),
177
+ error: L({}, e, {
178
+ value: pe
179
+ }),
180
+ group: L({}, e, {
181
+ value: ge
182
+ }),
183
+ groupCollapsed: L({}, e, {
184
+ value: xe
185
+ }),
186
+ groupEnd: L({}, e, {
187
+ value: ye
188
+ })
189
+ });
190
+ }
191
+ q < 0 && o("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ }
193
+ }
194
+ var te = O.ReactCurrentDispatcher, re;
195
+ function G(e, r, a) {
196
+ {
197
+ if (re === void 0)
198
+ try {
199
+ throw Error();
200
+ } catch (g) {
201
+ var c = g.stack.trim().match(/\n( *(at )?)/);
202
+ re = c && c[1] || "";
203
+ }
204
+ return `
205
+ ` + re + e;
206
+ }
207
+ }
208
+ var ne = !1, Z;
209
+ {
210
+ var Xe = typeof WeakMap == "function" ? WeakMap : Map;
211
+ Z = new Xe();
212
+ }
213
+ function je(e, r) {
214
+ if (!e || ne)
215
+ return "";
216
+ {
217
+ var a = Z.get(e);
218
+ if (a !== void 0)
219
+ return a;
220
+ }
221
+ var c;
222
+ ne = !0;
223
+ var g = Error.prepareStackTrace;
224
+ Error.prepareStackTrace = void 0;
225
+ var x;
226
+ x = te.current, te.current = null, Ge();
227
+ try {
228
+ if (r) {
229
+ var m = function() {
230
+ throw Error();
231
+ };
232
+ if (Object.defineProperty(m.prototype, "props", {
233
+ set: function() {
234
+ throw Error();
235
+ }
236
+ }), typeof Reflect == "object" && Reflect.construct) {
237
+ try {
238
+ Reflect.construct(m, []);
239
+ } catch (N) {
240
+ c = N;
241
+ }
242
+ Reflect.construct(e, [], m);
243
+ } else {
244
+ try {
245
+ m.call();
246
+ } catch (N) {
247
+ c = N;
248
+ }
249
+ e.call(m.prototype);
250
+ }
251
+ } else {
252
+ try {
253
+ throw Error();
254
+ } catch (N) {
255
+ c = N;
256
+ }
257
+ e();
258
+ }
259
+ } catch (N) {
260
+ if (N && c && typeof N.stack == "string") {
261
+ for (var f = N.stack.split(`
262
+ `), _ = c.stack.split(`
263
+ `), k = f.length - 1, C = _.length - 1; k >= 1 && C >= 0 && f[k] !== _[C]; )
264
+ C--;
265
+ for (; k >= 1 && C >= 0; k--, C--)
266
+ if (f[k] !== _[C]) {
267
+ if (k !== 1 || C !== 1)
268
+ do
269
+ if (k--, C--, C < 0 || f[k] !== _[C]) {
270
+ var D = `
271
+ ` + f[k].replace(" at new ", " at ");
272
+ return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, D), D;
273
+ }
274
+ while (k >= 1 && C >= 0);
275
+ break;
276
+ }
277
+ }
278
+ } finally {
279
+ ne = !1, te.current = x, Ze(), Error.prepareStackTrace = g;
280
+ }
281
+ var B = e ? e.displayName || e.name : "", W = B ? G(B) : "";
282
+ return typeof e == "function" && Z.set(e, W), W;
283
+ }
284
+ function Qe(e, r, a) {
285
+ return je(e, !1);
286
+ }
287
+ function et(e) {
288
+ var r = e.prototype;
289
+ return !!(r && r.isReactComponent);
290
+ }
291
+ function X(e, r, a) {
292
+ if (e == null)
293
+ return "";
294
+ if (typeof e == "function")
295
+ return je(e, et(e));
296
+ if (typeof e == "string")
297
+ return G(e);
298
+ switch (e) {
299
+ case h:
300
+ return G("Suspense");
301
+ case p:
302
+ return G("SuspenseList");
303
+ }
304
+ if (typeof e == "object")
305
+ switch (e.$$typeof) {
306
+ case u:
307
+ return Qe(e.render);
308
+ case E:
309
+ return X(e.type, r, a);
310
+ case R: {
311
+ var c = e, g = c._payload, x = c._init;
312
+ try {
313
+ return X(x(g), r, a);
314
+ } catch {
315
+ }
316
+ }
317
+ }
318
+ return "";
319
+ }
320
+ var H = Object.prototype.hasOwnProperty, we = {}, ke = O.ReactDebugCurrentFrame;
321
+ function Q(e) {
322
+ if (e) {
323
+ var r = e._owner, a = X(e.type, e._source, r ? r.type : null);
324
+ ke.setExtraStackFrame(a);
325
+ } else
326
+ ke.setExtraStackFrame(null);
327
+ }
328
+ function tt(e, r, a, c, g) {
329
+ {
330
+ var x = Function.call.bind(H);
331
+ for (var m in e)
332
+ if (x(e, m)) {
333
+ var f = void 0;
334
+ try {
335
+ if (typeof e[m] != "function") {
336
+ var _ = Error((c || "React class") + ": " + a + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw _.name = "Invariant Violation", _;
338
+ }
339
+ f = e[m](r, m, c, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (k) {
341
+ f = k;
342
+ }
343
+ f && !(f instanceof Error) && (Q(g), o("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", a, m, typeof f), Q(null)), f instanceof Error && !(f.message in we) && (we[f.message] = !0, Q(g), o("Failed %s type: %s", a, f.message), Q(null));
344
+ }
345
+ }
346
+ }
347
+ var rt = Array.isArray;
348
+ function ae(e) {
349
+ return rt(e);
350
+ }
351
+ function nt(e) {
352
+ {
353
+ var r = typeof Symbol == "function" && Symbol.toStringTag, a = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
+ return a;
355
+ }
356
+ }
357
+ function at(e) {
358
+ try {
359
+ return Ce(e), !1;
360
+ } catch {
361
+ return !0;
362
+ }
363
+ }
364
+ function Ce(e) {
365
+ return "" + e;
366
+ }
367
+ function Ee(e) {
368
+ if (at(e))
369
+ return o("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nt(e)), Ce(e);
370
+ }
371
+ var Re = O.ReactCurrentOwner, st = {
372
+ key: !0,
373
+ ref: !0,
374
+ __self: !0,
375
+ __source: !0
376
+ }, Se, _e;
377
+ function ot(e) {
378
+ if (H.call(e, "ref")) {
379
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
380
+ if (r && r.isReactWarning)
381
+ return !1;
382
+ }
383
+ return e.ref !== void 0;
384
+ }
385
+ function it(e) {
386
+ if (H.call(e, "key")) {
387
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
388
+ if (r && r.isReactWarning)
389
+ return !1;
390
+ }
391
+ return e.key !== void 0;
392
+ }
393
+ function lt(e, r) {
394
+ typeof e.ref == "string" && Re.current;
395
+ }
396
+ function ct(e, r) {
397
+ {
398
+ var a = function() {
399
+ Se || (Se = !0, o("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
400
+ };
401
+ a.isReactWarning = !0, Object.defineProperty(e, "key", {
402
+ get: a,
403
+ configurable: !0
404
+ });
405
+ }
406
+ }
407
+ function ut(e, r) {
408
+ {
409
+ var a = function() {
410
+ _e || (_e = !0, o("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
411
+ };
412
+ a.isReactWarning = !0, Object.defineProperty(e, "ref", {
413
+ get: a,
414
+ configurable: !0
415
+ });
416
+ }
417
+ }
418
+ var ft = function(e, r, a, c, g, x, m) {
419
+ var f = {
420
+ // This tag allows us to uniquely identify this as a React Element
421
+ $$typeof: s,
422
+ // Built-in properties that belong on the element
423
+ type: e,
424
+ key: r,
425
+ ref: a,
426
+ props: m,
427
+ // Record the component responsible for creating this element.
428
+ _owner: x
429
+ };
430
+ return f._store = {}, Object.defineProperty(f._store, "validated", {
431
+ configurable: !1,
432
+ enumerable: !1,
433
+ writable: !0,
434
+ value: !1
435
+ }), Object.defineProperty(f, "_self", {
436
+ configurable: !1,
437
+ enumerable: !1,
438
+ writable: !1,
439
+ value: c
440
+ }), Object.defineProperty(f, "_source", {
441
+ configurable: !1,
442
+ enumerable: !1,
443
+ writable: !1,
444
+ value: g
445
+ }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
446
+ };
447
+ function dt(e, r, a, c, g) {
448
+ {
449
+ var x, m = {}, f = null, _ = null;
450
+ a !== void 0 && (Ee(a), f = "" + a), it(r) && (Ee(r.key), f = "" + r.key), ot(r) && (_ = r.ref, lt(r, g));
451
+ for (x in r)
452
+ H.call(r, x) && !st.hasOwnProperty(x) && (m[x] = r[x]);
453
+ if (e && e.defaultProps) {
454
+ var k = e.defaultProps;
455
+ for (x in k)
456
+ m[x] === void 0 && (m[x] = k[x]);
457
+ }
458
+ if (f || _) {
459
+ var C = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
460
+ f && ct(m, C), _ && ut(m, C);
461
+ }
462
+ return ft(e, f, _, g, c, Re.current, m);
463
+ }
464
+ }
465
+ var se = O.ReactCurrentOwner, Ne = O.ReactDebugCurrentFrame;
466
+ function V(e) {
467
+ if (e) {
468
+ var r = e._owner, a = X(e.type, e._source, r ? r.type : null);
469
+ Ne.setExtraStackFrame(a);
470
+ } else
471
+ Ne.setExtraStackFrame(null);
472
+ }
473
+ var oe;
474
+ oe = !1;
475
+ function ie(e) {
476
+ return typeof e == "object" && e !== null && e.$$typeof === s;
477
+ }
478
+ function Te() {
479
+ {
480
+ if (se.current) {
481
+ var e = I(se.current.type);
482
+ if (e)
483
+ return `
484
+
485
+ Check the render method of \`` + e + "`.";
486
+ }
487
+ return "";
488
+ }
489
+ }
490
+ function ht(e) {
491
+ return "";
492
+ }
493
+ var Oe = {};
494
+ function mt(e) {
495
+ {
496
+ var r = Te();
497
+ if (!r) {
498
+ var a = typeof e == "string" ? e : e.displayName || e.name;
499
+ a && (r = `
500
+
501
+ Check the top-level render call using <` + a + ">.");
502
+ }
503
+ return r;
504
+ }
505
+ }
506
+ function De(e, r) {
507
+ {
508
+ if (!e._store || e._store.validated || e.key != null)
509
+ return;
510
+ e._store.validated = !0;
511
+ var a = mt(r);
512
+ if (Oe[a])
513
+ return;
514
+ Oe[a] = !0;
515
+ var c = "";
516
+ e && e._owner && e._owner !== se.current && (c = " It was passed a child from " + I(e._owner.type) + "."), V(e), o('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, c), V(null);
517
+ }
518
+ }
519
+ function Pe(e, r) {
520
+ {
521
+ if (typeof e != "object")
522
+ return;
523
+ if (ae(e))
524
+ for (var a = 0; a < e.length; a++) {
525
+ var c = e[a];
526
+ ie(c) && De(c, r);
527
+ }
528
+ else if (ie(e))
529
+ e._store && (e._store.validated = !0);
530
+ else if (e) {
531
+ var g = j(e);
532
+ if (typeof g == "function" && g !== e.entries)
533
+ for (var x = g.call(e), m; !(m = x.next()).done; )
534
+ ie(m.value) && De(m.value, r);
535
+ }
536
+ }
537
+ }
538
+ function vt(e) {
539
+ {
540
+ var r = e.type;
541
+ if (r == null || typeof r == "string")
542
+ return;
543
+ var a;
544
+ if (typeof r == "function")
545
+ a = r.propTypes;
546
+ else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
547
+ // Inner props are checked in the reconciler.
548
+ r.$$typeof === E))
549
+ a = r.propTypes;
550
+ else
551
+ return;
552
+ if (a) {
553
+ var c = I(r);
554
+ tt(a, e.props, "prop", c, e);
555
+ } else if (r.PropTypes !== void 0 && !oe) {
556
+ oe = !0;
557
+ var g = I(r);
558
+ o("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", g || "Unknown");
559
+ }
560
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && o("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
561
+ }
562
+ }
563
+ function pt(e) {
564
+ {
565
+ for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
566
+ var c = r[a];
567
+ if (c !== "children" && c !== "key") {
568
+ V(e), o("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), V(null);
569
+ break;
570
+ }
571
+ }
572
+ e.ref !== null && (V(e), o("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
573
+ }
574
+ }
575
+ var Fe = {};
576
+ function Ae(e, r, a, c, g, x) {
577
+ {
578
+ var m = Je(e);
579
+ if (!m) {
580
+ var f = "";
581
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
582
+ var _ = ht();
583
+ _ ? f += _ : f += Te();
584
+ var k;
585
+ e === null ? k = "null" : ae(e) ? k = "array" : e !== void 0 && e.$$typeof === s ? (k = "<" + (I(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : k = typeof e, o("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, f);
586
+ }
587
+ var C = dt(e, r, a, g, x);
588
+ if (C == null)
589
+ return C;
590
+ if (m) {
591
+ var D = r.children;
592
+ if (D !== void 0)
593
+ if (c)
594
+ if (ae(D)) {
595
+ for (var B = 0; B < D.length; B++)
596
+ Pe(D[B], e);
597
+ Object.freeze && Object.freeze(D);
598
+ } else
599
+ o("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
600
+ else
601
+ Pe(D, e);
602
+ }
603
+ if (H.call(r, "key")) {
604
+ var W = I(e), N = Object.keys(r).filter(function(wt) {
605
+ return wt !== "key";
606
+ }), le = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
607
+ if (!Fe[W + le]) {
608
+ var jt = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
609
+ o(`A props object containing a "key" prop is being spread into JSX:
610
+ let props = %s;
611
+ <%s {...props} />
612
+ React keys must be passed directly to JSX without using spread:
613
+ let props = %s;
614
+ <%s key={someKey} {...props} />`, le, W, jt, W), Fe[W + le] = !0;
615
+ }
616
+ }
617
+ return e === i ? pt(C) : vt(C), C;
618
+ }
619
+ }
620
+ function gt(e, r, a) {
621
+ return Ae(e, r, a, !0);
622
+ }
623
+ function xt(e, r, a) {
624
+ return Ae(e, r, a, !1);
625
+ }
626
+ var yt = xt, bt = gt;
627
+ K.Fragment = i, K.jsx = yt, K.jsxs = bt;
628
+ }()), K;
629
+ }
630
+ process.env.NODE_ENV === "production" ? ue.exports = _t() : ue.exports = Nt();
631
+ var t = ue.exports;
632
+ class Tt {
633
+ constructor(s) {
634
+ F(this, "config");
635
+ F(this, "baseUrl");
636
+ this.config = s, this.baseUrl = s.baseUrl || "http://localhost:8000";
637
+ }
638
+ async getCompanyInfo() {
639
+ try {
640
+ const s = await fetch(`${this.baseUrl}/companies/e/info`, {
641
+ headers: {
642
+ Authorization: `Bearer ${this.config.apiKey}`,
643
+ "Content-Type": "application/json"
644
+ }
645
+ });
646
+ if (!s.ok)
647
+ throw new Error(`HTTP error! status: ${s.status}`);
648
+ return await s.json();
649
+ } catch (s) {
650
+ throw console.error("Failed to fetch company info:", s), s;
651
+ }
652
+ }
653
+ async submitContactInfo(s) {
654
+ try {
655
+ const l = await fetch(`${this.baseUrl}/companies/e/chat/init`, {
656
+ method: "POST",
657
+ headers: {
658
+ Authorization: `Bearer ${this.config.apiKey}`,
659
+ "Content-Type": "application/json"
660
+ },
661
+ body: JSON.stringify(s || {})
662
+ });
663
+ if (!l.ok)
664
+ throw new Error(`HTTP error! status: ${l.status}`);
665
+ return await l.json();
666
+ } catch (l) {
667
+ throw console.error("Failed to submit contact info:", l), l;
668
+ }
669
+ }
670
+ async startAnonymousChat() {
671
+ return this.submitContactInfo();
672
+ }
673
+ }
674
+ function Le(...n) {
675
+ return St(n);
676
+ }
677
+ const ee = S.forwardRef(
678
+ (n, s) => /* @__PURE__ */ t.jsx(
679
+ "input",
680
+ {
681
+ ...n,
682
+ autoComplete: n.autoComplete || n.name || "off",
683
+ ref: s,
684
+ className: Le("lulichat-input", n.className)
685
+ }
686
+ )
687
+ );
688
+ S.forwardRef(
689
+ (n, s) => /* @__PURE__ */ t.jsx("input", { className: "", ...n, ref: s })
690
+ );
691
+ const We = S.createContext(
692
+ void 0
693
+ ), Y = S.forwardRef(
694
+ ({ children: n, onValuesChange: s, initialValues: l, ...i }, v) => {
695
+ const d = U(l || {}), y = U(null), b = $e(
696
+ (h, p) => {
697
+ d.current[h] = p, s && s({ ...d.current });
698
+ },
699
+ [s]
700
+ ), u = {
701
+ getValues: () => d.current,
702
+ getFieldValue: (h) => {
703
+ var p;
704
+ return (p = d.current) == null ? void 0 : p[h];
705
+ },
706
+ elementRef: () => y.current,
707
+ setFieldValue: b
708
+ };
709
+ return Et(v, () => u), /* @__PURE__ */ t.jsx(We.Provider, { value: u, children: /* @__PURE__ */ t.jsx("form", { ...i, ref: y, onSubmit: i.onSubmit, children: n }) });
710
+ }
711
+ ), Ot = S.forwardRef(
712
+ ({ name: n, children: s, ...l }, i) => {
713
+ const v = S.useContext(We), d = function(u) {
714
+ var h, p;
715
+ v && n && v.setFieldValue(n, u.target.value), (p = (h = this.props).onChange) == null || p.call(h, u);
716
+ }, y = S.Children.map(s, (u) => {
717
+ if (S.isValidElement(u) && n && u.type === ee) {
718
+ let h = u;
719
+ return S.cloneElement(h, {
720
+ ...h.props,
721
+ name: n,
722
+ value: (v == null ? void 0 : v.getFieldValue(n)) ?? "",
723
+ onChange: d.bind(h),
724
+ required: l.required
725
+ });
726
+ }
727
+ return u;
728
+ }), b = Object.create(l);
729
+ return delete b.required, delete b.label, /* @__PURE__ */ t.jsxs("div", { className: "lulichat-form-item", ref: i, ...b, children: [
730
+ l.label && /* @__PURE__ */ t.jsx(ze, { htmlFor: n, required: l.required, children: l.label }),
731
+ y,
732
+ l.error && /* @__PURE__ */ t.jsx("p", { className: "error", children: l.error })
733
+ ] });
734
+ }
735
+ ), ze = S.forwardRef(
736
+ (n, s) => {
737
+ const l = n.required, i = n.children;
738
+ return /* @__PURE__ */ t.jsxs(
739
+ "label",
740
+ {
741
+ ...n,
742
+ className: Le("lulichat-form-label", n.className),
743
+ ref: s,
744
+ children: [
745
+ i,
746
+ l && /* @__PURE__ */ t.jsx("b", { style: { color: "red" }, children: "*" })
747
+ ]
748
+ }
749
+ );
750
+ }
751
+ ), Dt = (n) => {
752
+ const s = U(n || {}), l = U(null), i = $e(
753
+ (d, y) => {
754
+ s.current[d] = y;
755
+ },
756
+ []
757
+ );
758
+ return [{
759
+ getValues: () => s.current,
760
+ getFieldValue: (d) => {
761
+ var y;
762
+ return (y = s.current) == null ? void 0 : y[d];
763
+ },
764
+ elementRef: () => l.current,
765
+ setFieldValue: i
766
+ }];
767
+ };
768
+ Y.Item = Ot;
769
+ Y.Label = ze;
770
+ Y.useForm = Dt;
771
+ const Pt = (n) => /* @__PURE__ */ t.jsx(
772
+ "svg",
773
+ {
774
+ xmlns: "http://www.w3.org/2000/svg",
775
+ width: "48",
776
+ height: "48",
777
+ viewBox: "0 0 18 18",
778
+ ...n,
779
+ children: /* @__PURE__ */ t.jsx(
780
+ "path",
781
+ {
782
+ fill: "none",
783
+ stroke: "currentColor",
784
+ strokeDasharray: "10",
785
+ strokeDashoffset: "10",
786
+ strokeLinecap: "round",
787
+ strokeLinejoin: "round",
788
+ strokeWidth: "2",
789
+ d: "M12 15l-5 -5M12 15l5 -5",
790
+ children: /* @__PURE__ */ t.jsx(
791
+ "animate",
792
+ {
793
+ fill: "freeze",
794
+ attributeName: "stroke-dashoffset",
795
+ dur: "0.3s",
796
+ values: "10;0"
797
+ }
798
+ )
799
+ }
800
+ )
801
+ }
802
+ ), Ft = (n) => /* @__PURE__ */ t.jsxs(
803
+ "svg",
804
+ {
805
+ xmlns: "http://www.w3.org/2000/svg",
806
+ width: "48",
807
+ height: "48",
808
+ viewBox: "0 0 24 24",
809
+ ...n,
810
+ children: [
811
+ /* @__PURE__ */ t.jsx("mask", { id: "lineMdFileDocumentFilled0", children: /* @__PURE__ */ t.jsxs(
812
+ "g",
813
+ {
814
+ fill: "none",
815
+ stroke: "#fff",
816
+ strokeLinecap: "round",
817
+ strokeLinejoin: "round",
818
+ strokeWidth: "2",
819
+ children: [
820
+ /* @__PURE__ */ t.jsxs(
821
+ "path",
822
+ {
823
+ fill: "#fff",
824
+ fillOpacity: "0",
825
+ strokeDasharray: "64",
826
+ strokeDashoffset: "64",
827
+ d: "M13.5 3l5.5 5.5v11.5c0 0.55 -0.45 1 -1 1h-12c-0.55 0 -1 -0.45 -1 -1v-16c0 -0.55 0.45 -1 1 -1Z",
828
+ children: [
829
+ /* @__PURE__ */ t.jsx(
830
+ "animate",
831
+ {
832
+ fill: "freeze",
833
+ attributeName: "fill-opacity",
834
+ begin: "0.6s",
835
+ dur: "0.5s",
836
+ values: "0;1"
837
+ }
838
+ ),
839
+ /* @__PURE__ */ t.jsx(
840
+ "animate",
841
+ {
842
+ fill: "freeze",
843
+ attributeName: "stroke-dashoffset",
844
+ dur: "0.6s",
845
+ values: "64;0"
846
+ }
847
+ )
848
+ ]
849
+ }
850
+ ),
851
+ /* @__PURE__ */ t.jsx("path", { fill: "#000", stroke: "#000", d: "M14.5 3.5l0 4.5l4.5 0z", opacity: "0", children: /* @__PURE__ */ t.jsx("set", { fill: "freeze", attributeName: "opacity", begin: "0.6s", to: "1" }) }),
852
+ /* @__PURE__ */ t.jsx("path", { d: "M13.5 3l5.5 5.5", opacity: "0", children: /* @__PURE__ */ t.jsx("set", { fill: "freeze", attributeName: "opacity", begin: "0.6s", to: "1" }) }),
853
+ /* @__PURE__ */ t.jsx(
854
+ "path",
855
+ {
856
+ stroke: "#000",
857
+ strokeDasharray: "12",
858
+ strokeDashoffset: "12",
859
+ d: "M7 13h10",
860
+ children: /* @__PURE__ */ t.jsx(
861
+ "animate",
862
+ {
863
+ fill: "freeze",
864
+ attributeName: "stroke-dashoffset",
865
+ begin: "1.1s",
866
+ dur: "0.2s",
867
+ values: "12;0"
868
+ }
869
+ )
870
+ }
871
+ ),
872
+ /* @__PURE__ */ t.jsx(
873
+ "path",
874
+ {
875
+ stroke: "#000",
876
+ strokeDasharray: "8",
877
+ strokeDashoffset: "8",
878
+ d: "M7 17h7",
879
+ children: /* @__PURE__ */ t.jsx(
880
+ "animate",
881
+ {
882
+ fill: "freeze",
883
+ attributeName: "stroke-dashoffset",
884
+ begin: "1.3s",
885
+ dur: "0.2s",
886
+ values: "8;0"
887
+ }
888
+ )
889
+ }
890
+ )
891
+ ]
892
+ }
893
+ ) }),
894
+ /* @__PURE__ */ t.jsx(
895
+ "rect",
896
+ {
897
+ width: "24",
898
+ height: "24",
899
+ fill: "currentColor",
900
+ mask: "url(#lineMdFileDocumentFilled0)"
901
+ }
902
+ )
903
+ ]
904
+ }
905
+ ), At = (n) => /* @__PURE__ */ t.jsx(
906
+ "svg",
907
+ {
908
+ xmlns: "http://www.w3.org/2000/svg",
909
+ width: "48",
910
+ height: "48",
911
+ viewBox: "0 0 22 22",
912
+ ...n,
913
+ children: /* @__PURE__ */ t.jsx(
914
+ "path",
915
+ {
916
+ fill: "currentColor",
917
+ d: "M1.5 4v1.5c0 4.15 2.21 7.78 5.5 9.8V20h15v-2c0-2.66-5.33-4-8-4h-.25C9 14 5 10 5 5.5V4m9 0a4 4 0 0 0-4 4a4 4 0 0 0 4 4a4 4 0 0 0 4-4a4 4 0 0 0-4-4"
918
+ }
919
+ )
920
+ }
921
+ ), Mt = (n) => /* @__PURE__ */ t.jsx(
922
+ "svg",
923
+ {
924
+ xmlns: "http://www.w3.org/2000/svg",
925
+ width: "24",
926
+ height: "24",
927
+ viewBox: "0 0 24 24",
928
+ ...n,
929
+ children: /* @__PURE__ */ t.jsx(
930
+ "path",
931
+ {
932
+ fill: "currentColor",
933
+ d: "M12 2.25A9.75 9.75 0 0 0 2.25 12v5q0 .04.004.08v.05c-.003 1.278.602 2.682 1.963 3.25l.071.03c.11.044.22.12.362.25c.07.064.138.132.22.213l.008.008c.08.08.175.175.277.265c.204.183.474.388.83.506c.37.122.77.131 1.208.022c.723-.18 1.266-.752 1.469-1.454c.089-.309.089-.668.088-1.084v-4.094c0-.285 0-.528-.01-.728a2.3 2.3 0 0 0-.107-.627c-.23-.683-.786-1.223-1.504-1.377a2.25 2.25 0 0 0-1.264.065c-.37.133-.652.354-.87.558c-.12.11-.269.267-.391.396l-.164.17a1.8 1.8 0 0 1-.427.338q-.136.07-.263.152V12a8.25 8.25 0 1 1 16.5 0v1.864a3 3 0 0 0-.538-.274a1.2 1.2 0 0 1-.362-.25c-.07-.064-.138-.132-.22-.213l-.008-.008a7 7 0 0 0-.277-.265a2.4 2.4 0 0 0-.83-.506q-.553-.184-1.208-.022c-.723.18-1.266.752-1.469 1.454c-.089.309-.088.668-.088 1.085v4.093c0 .285 0 .528.01.728c.012.208.037.418.107.627c.23.683.786 1.223 1.504 1.377c.463.1.883.073 1.264-.065c.37-.133.652-.354.87-.558c.12-.11.269-.267.391-.395c.065-.069.123-.13.164-.17a1.8 1.8 0 0 1 .427-.34c1.11-.573 1.755-1.724 1.758-2.936v-.143L21.75 17v-5A9.75 9.75 0 0 0 12 2.25"
934
+ }
935
+ )
936
+ }
937
+ ), It = (n) => /* @__PURE__ */ t.jsx(
938
+ "svg",
939
+ {
940
+ xmlns: "http://www.w3.org/2000/svg",
941
+ width: "24",
942
+ height: "24",
943
+ viewBox: "0 0 24 24",
944
+ ...n,
945
+ children: /* @__PURE__ */ t.jsxs(
946
+ "g",
947
+ {
948
+ fill: "none",
949
+ stroke: "currentColor",
950
+ strokeDasharray: "28",
951
+ strokeDashoffset: "28",
952
+ strokeLinecap: "round",
953
+ strokeLinejoin: "round",
954
+ strokeWidth: "2",
955
+ children: [
956
+ /* @__PURE__ */ t.jsx("path", { d: "M4 21v-1c0 -3.31 2.69 -6 6 -6h4c3.31 0 6 2.69 6 6v1", children: /* @__PURE__ */ t.jsx(
957
+ "animate",
958
+ {
959
+ fill: "freeze",
960
+ attributeName: "stroke-dashoffset",
961
+ dur: "0.4s",
962
+ values: "28;0"
963
+ }
964
+ ) }),
965
+ /* @__PURE__ */ t.jsx("path", { d: "M12 11c-2.21 0 -4 -1.79 -4 -4c0 -2.21 1.79 -4 4 -4c2.21 0 4 1.79 4 4c0 2.21 -1.79 4 -4 4Z", children: /* @__PURE__ */ t.jsx(
966
+ "animate",
967
+ {
968
+ fill: "freeze",
969
+ attributeName: "stroke-dashoffset",
970
+ begin: "0.4s",
971
+ dur: "0.4s",
972
+ values: "28;0"
973
+ }
974
+ ) })
975
+ ]
976
+ }
977
+ )
978
+ }
979
+ ), Ve = () => /* @__PURE__ */ t.jsx(
980
+ "svg",
981
+ {
982
+ xmlns: "http://www.w3.org/2000/svg",
983
+ width: "24",
984
+ height: "24",
985
+ viewBox: "0 0 24 24",
986
+ children: /* @__PURE__ */ t.jsx(
987
+ "path",
988
+ {
989
+ fill: "none",
990
+ stroke: "currentColor",
991
+ strokeLinecap: "round",
992
+ strokeLinejoin: "round",
993
+ strokeWidth: "2",
994
+ 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.11zm7.318-19.539l-10.94 10.939"
995
+ }
996
+ )
997
+ }
998
+ ), Be = (n) => /* @__PURE__ */ t.jsx(
999
+ "svg",
1000
+ {
1001
+ xmlns: "http://www.w3.org/2000/svg",
1002
+ width: "24",
1003
+ height: "24",
1004
+ viewBox: "0 0 24 24",
1005
+ ...n,
1006
+ children: /* @__PURE__ */ t.jsxs(
1007
+ "g",
1008
+ {
1009
+ fill: "none",
1010
+ stroke: "currentColor",
1011
+ strokeLinecap: "round",
1012
+ strokeLinejoin: "round",
1013
+ strokeWidth: "2",
1014
+ children: [
1015
+ /* @__PURE__ */ t.jsxs(
1016
+ "path",
1017
+ {
1018
+ strokeDasharray: "16",
1019
+ strokeDashoffset: "16",
1020
+ d: "M12 3c4.97 0 9 4.03 9 9",
1021
+ children: [
1022
+ /* @__PURE__ */ t.jsx(
1023
+ "animate",
1024
+ {
1025
+ fill: "freeze",
1026
+ attributeName: "stroke-dashoffset",
1027
+ dur: "0.3s",
1028
+ values: "16;0"
1029
+ }
1030
+ ),
1031
+ /* @__PURE__ */ t.jsx(
1032
+ "animateTransform",
1033
+ {
1034
+ attributeName: "transform",
1035
+ dur: "1.5s",
1036
+ repeatCount: "indefinite",
1037
+ type: "rotate",
1038
+ values: "0 12 12;360 12 12"
1039
+ }
1040
+ )
1041
+ ]
1042
+ }
1043
+ ),
1044
+ /* @__PURE__ */ t.jsx(
1045
+ "path",
1046
+ {
1047
+ strokeDasharray: "64",
1048
+ strokeDashoffset: "64",
1049
+ strokeOpacity: "0.3",
1050
+ d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z",
1051
+ children: /* @__PURE__ */ t.jsx(
1052
+ "animate",
1053
+ {
1054
+ fill: "freeze",
1055
+ attributeName: "stroke-dashoffset",
1056
+ dur: "1.2s",
1057
+ values: "64;0"
1058
+ }
1059
+ )
1060
+ }
1061
+ )
1062
+ ]
1063
+ }
1064
+ )
1065
+ }
1066
+ ), $t = (n) => /* @__PURE__ */ t.jsxs(
1067
+ "svg",
1068
+ {
1069
+ xmlns: "http://www.w3.org/2000/svg",
1070
+ width: "24",
1071
+ height: "24",
1072
+ viewBox: "0 0 24 24",
1073
+ ...n,
1074
+ children: [
1075
+ /* @__PURE__ */ t.jsxs("mask", { id: "lineMdChatRoundDotsFilled0", children: [
1076
+ /* @__PURE__ */ t.jsxs(
1077
+ "path",
1078
+ {
1079
+ fill: "#fff",
1080
+ fillOpacity: "0",
1081
+ d: "M5 15.5c1 1 2.5 2 4 2.5c-0.71 -0.24 -1.43 -0.59 -2.09 -1c-0.72 -0.45 -1.39 -0.98 -1.91 -1.5Z",
1082
+ children: [
1083
+ /* @__PURE__ */ t.jsx(
1084
+ "animate",
1085
+ {
1086
+ fill: "freeze",
1087
+ attributeName: "d",
1088
+ begin: "0.6s",
1089
+ dur: "0.2s",
1090
+ values: "M5 15.5c1 1 2.5 2 4 2.5c-0.71 -0.24 -1.43 -0.59 -2.09 -1c-0.72 -0.45 -1.39 -0.98 -1.91 -1.5Z;M5 15.5c1 1 2.5 2 4 2.5c-2 2 -5 3 -7 3c2 -2 3 -3.5 3 -5.5Z"
1091
+ }
1092
+ ),
1093
+ /* @__PURE__ */ t.jsx("set", { fill: "freeze", attributeName: "fill-opacity", begin: "0.6s", to: "1" })
1094
+ ]
1095
+ }
1096
+ ),
1097
+ /* @__PURE__ */ t.jsxs(
1098
+ "g",
1099
+ {
1100
+ fill: "none",
1101
+ stroke: "#fff",
1102
+ strokeLinecap: "round",
1103
+ strokeLinejoin: "round",
1104
+ strokeWidth: "2",
1105
+ children: [
1106
+ /* @__PURE__ */ t.jsxs(
1107
+ "path",
1108
+ {
1109
+ fill: "transparent",
1110
+ fillOpacity: "0",
1111
+ strokeDasharray: "56",
1112
+ strokeDashoffset: "56",
1113
+ d: "M7 16.82c-2.41 -1.25 -4 -3.39 -4 -5.82c0 -3.87 4.03 -7 9 -7c4.97 0 9 3.13 9 7c0 3.87 -4.03 7 -9 7c-1.85 0 -3.57 -0.43 -5 -1.18Z",
1114
+ children: [
1115
+ /* @__PURE__ */ t.jsx(
1116
+ "animate",
1117
+ {
1118
+ fill: "freeze",
1119
+ attributeName: "fill-opacity",
1120
+ begin: "0.9s",
1121
+ dur: "0.5s",
1122
+ values: "0;1"
1123
+ }
1124
+ ),
1125
+ /* @__PURE__ */ t.jsx(
1126
+ "animate",
1127
+ {
1128
+ fill: "freeze",
1129
+ attributeName: "stroke-dashoffset",
1130
+ dur: "0.6s",
1131
+ values: "56;0"
1132
+ }
1133
+ )
1134
+ ]
1135
+ }
1136
+ ),
1137
+ /* @__PURE__ */ t.jsx(
1138
+ "path",
1139
+ {
1140
+ stroke: "currentColor",
1141
+ strokeDasharray: "2",
1142
+ strokeDashoffset: "2",
1143
+ d: "M8 11h0.01",
1144
+ children: /* @__PURE__ */ t.jsx(
1145
+ "animate",
1146
+ {
1147
+ fill: "freeze",
1148
+ attributeName: "stroke-dashoffset",
1149
+ begin: "1.4s",
1150
+ dur: "0.2s",
1151
+ values: "2;0"
1152
+ }
1153
+ )
1154
+ }
1155
+ ),
1156
+ /* @__PURE__ */ t.jsx(
1157
+ "path",
1158
+ {
1159
+ stroke: "currentColor",
1160
+ strokeDasharray: "2",
1161
+ strokeDashoffset: "2",
1162
+ d: "M12 11h0.01",
1163
+ children: /* @__PURE__ */ t.jsx(
1164
+ "animate",
1165
+ {
1166
+ fill: "freeze",
1167
+ attributeName: "stroke-dashoffset",
1168
+ begin: "1.7s",
1169
+ dur: "0.2s",
1170
+ values: "2;0"
1171
+ }
1172
+ )
1173
+ }
1174
+ ),
1175
+ /* @__PURE__ */ t.jsx(
1176
+ "path",
1177
+ {
1178
+ stroke: "currentColor",
1179
+ strokeDasharray: "2",
1180
+ strokeDashoffset: "2",
1181
+ d: "M16 11h0.01",
1182
+ children: /* @__PURE__ */ t.jsx(
1183
+ "animate",
1184
+ {
1185
+ fill: "freeze",
1186
+ attributeName: "stroke-dashoffset",
1187
+ begin: "2s",
1188
+ dur: "0.2s",
1189
+ values: "2;0"
1190
+ }
1191
+ )
1192
+ }
1193
+ )
1194
+ ]
1195
+ }
1196
+ )
1197
+ ] }),
1198
+ /* @__PURE__ */ t.jsx(
1199
+ "rect",
1200
+ {
1201
+ width: "24",
1202
+ height: "24",
1203
+ fill: "currentColor",
1204
+ mask: "url(#lineMdChatRoundDotsFilled0)"
1205
+ }
1206
+ )
1207
+ ]
1208
+ }
1209
+ ), z = S.forwardRef(
1210
+ ({
1211
+ className: n,
1212
+ variant: s = "outline",
1213
+ size: l = "md",
1214
+ shape: i = "rounded",
1215
+ ...v
1216
+ }, d) => /* @__PURE__ */ t.jsx(
1217
+ "button",
1218
+ {
1219
+ className: Rt(
1220
+ "lulichat-btn",
1221
+ `lulichat-btn-${s}`,
1222
+ `lulichat-btn-${l}`,
1223
+ `lulichat-btn-${i}`,
1224
+ n
1225
+ ),
1226
+ ref: d,
1227
+ ...v
1228
+ }
1229
+ )
1230
+ );
1231
+ z.displayName = "Button";
1232
+ const Lt = ({
1233
+ companyName: n,
1234
+ onSubmit: s,
1235
+ onSkip: l,
1236
+ allowAnonymous: i,
1237
+ isLoading: v
1238
+ }) => {
1239
+ const [d, y] = S.useState(!1), [b, u] = P({
1240
+ name: "",
1241
+ email: "",
1242
+ phone: "",
1243
+ company: ""
1244
+ }), [h, p] = P({}), [E, R] = S.useState({
1245
+ email: "",
1246
+ name: ""
1247
+ }), T = () => {
1248
+ const j = {};
1249
+ return b.name.trim() || (j.name = "Name is required"), b.email.trim() ? /\S+@\S+\.\S+/.test(b.email) || (j.email = "Email is invalid") : j.email = "Email is required", p(j), Object.keys(j).length === 0;
1250
+ }, A = (j) => {
1251
+ j.preventDefault(), T() && s(b);
1252
+ }, M = (j, O) => {
1253
+ u((o) => ({ ...o, [j]: O })), h[j] && p((o) => ({ ...o, [j]: void 0 }));
1254
+ };
1255
+ return /* @__PURE__ */ t.jsxs(
1256
+ Y,
1257
+ {
1258
+ autoComplete: "off",
1259
+ onSubmit: A,
1260
+ onValuesChange: R,
1261
+ className: "lulichat-contact-form",
1262
+ children: [
1263
+ /* @__PURE__ */ t.jsxs("div", { className: "lulichat-form-header", children: [
1264
+ /* @__PURE__ */ t.jsxs(
1265
+ "div",
1266
+ {
1267
+ style: {
1268
+ marginBottom: "20px",
1269
+ display: "flex",
1270
+ alignItems: "end",
1271
+ columnGap: 8
1272
+ },
1273
+ children: [
1274
+ /* @__PURE__ */ t.jsx(
1275
+ At,
1276
+ {
1277
+ style: { display: "block" },
1278
+ color: "#DEDEDE6A",
1279
+ height: 40,
1280
+ width: 50
1281
+ }
1282
+ ),
1283
+ /* @__PURE__ */ t.jsx("h3", { style: { fontWeight: 500 }, children: "Hello," })
1284
+ ]
1285
+ }
1286
+ ),
1287
+ /* @__PURE__ */ t.jsxs("h3", { style: { marginBottom: 8 }, className: "lulichat-title", children: [
1288
+ "Welcome to ",
1289
+ n,
1290
+ " Live Chat"
1291
+ ] }),
1292
+ /* @__PURE__ */ t.jsxs(
1293
+ "p",
1294
+ {
1295
+ role: "button",
1296
+ onClickCapture: () => y(!d),
1297
+ style: {
1298
+ textDecoration: "underline",
1299
+ lineHeight: "1rem",
1300
+ cursor: "pointer"
1301
+ },
1302
+ children: [
1303
+ "Please provide your details for a better support experience",
1304
+ " ",
1305
+ /* @__PURE__ */ t.jsx(
1306
+ Pt,
1307
+ {
1308
+ style: {
1309
+ display: "inline-block",
1310
+ marginBottom: -2
1311
+ },
1312
+ height: 20,
1313
+ width: 20
1314
+ }
1315
+ )
1316
+ ]
1317
+ }
1318
+ )
1319
+ ] }),
1320
+ /* @__PURE__ */ t.jsxs("div", { className: `lulichat-form-group${d ? " open" : ""}`, children: [
1321
+ /* @__PURE__ */ t.jsx(Y.Item, { error: h.name, label: "Name (Optional)", name: "name", children: /* @__PURE__ */ t.jsx(
1322
+ ee,
1323
+ {
1324
+ id: "name",
1325
+ placeholder: "Enter your name",
1326
+ type: "text",
1327
+ value: b.name,
1328
+ onChange: (j) => M("name", j.target.value),
1329
+ className: "transparent" + (h.name ? " error" : "")
1330
+ }
1331
+ ) }),
1332
+ /* @__PURE__ */ t.jsx(Y.Item, { name: "email", error: h.email, label: "Email", children: /* @__PURE__ */ t.jsx(
1333
+ ee,
1334
+ {
1335
+ id: "email",
1336
+ type: "email",
1337
+ placeholder: "Enter your valid email",
1338
+ value: b.email,
1339
+ onChange: (j) => M("email", j.target.value),
1340
+ className: "transparent" + (h.name ? " error" : "")
1341
+ }
1342
+ ) }),
1343
+ /* @__PURE__ */ t.jsx(
1344
+ z,
1345
+ {
1346
+ type: "submit",
1347
+ disabled: v || !E.email,
1348
+ style: { width: "100%", marginTop: 10 },
1349
+ className: "lulichat-contact-form-btn",
1350
+ children: v ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1351
+ /* @__PURE__ */ t.jsx(Be, {}),
1352
+ "Submitting..."
1353
+ ] }) : "Submit"
1354
+ }
1355
+ )
1356
+ ] })
1357
+ ]
1358
+ }
1359
+ );
1360
+ };
1361
+ class Wt {
1362
+ constructor(s, l, i = "wss://ws.lulichat.com") {
1363
+ F(this, "socket", null);
1364
+ F(this, "token");
1365
+ F(this, "sessionId");
1366
+ F(this, "onMessageCallback");
1367
+ F(this, "onStatusCallback");
1368
+ F(this, "reconnectAttempts", 0);
1369
+ F(this, "maxReconnectAttempts", 5);
1370
+ this.token = s, this.sessionId = l, this.connect(i);
1371
+ }
1372
+ connect(s) {
1373
+ var l;
1374
+ try {
1375
+ this.socket = new WebSocket(
1376
+ `${s}/chat?token=${this.token}&session=${this.sessionId}`
1377
+ ), this.socket.onopen = () => {
1378
+ var i;
1379
+ console.log("Socket connected"), this.reconnectAttempts = 0, (i = this.onStatusCallback) == null || i.call(this, "connected");
1380
+ }, this.socket.onmessage = (i) => {
1381
+ var v;
1382
+ try {
1383
+ const d = JSON.parse(i.data);
1384
+ (v = this.onMessageCallback) == null || v.call(this, d);
1385
+ } catch (d) {
1386
+ console.error("Failed to parse message:", d);
1387
+ }
1388
+ }, this.socket.onclose = () => {
1389
+ var i;
1390
+ console.log("Socket disconnected"), (i = this.onStatusCallback) == null || i.call(this, "disconnected"), this.handleReconnect(s);
1391
+ }, this.socket.onerror = (i) => {
1392
+ var v;
1393
+ console.error("Socket error:", i), (v = this.onStatusCallback) == null || v.call(this, "error");
1394
+ };
1395
+ } catch (i) {
1396
+ console.error("Failed to connect socket:", i), (l = this.onStatusCallback) == null || l.call(this, "error");
1397
+ }
1398
+ }
1399
+ handleReconnect(s) {
1400
+ this.reconnectAttempts < this.maxReconnectAttempts && (this.reconnectAttempts++, setTimeout(() => {
1401
+ console.log(`Reconnecting... attempt ${this.reconnectAttempts}`), this.connect(s);
1402
+ }, 2e3 * this.reconnectAttempts));
1403
+ }
1404
+ sendMessage(s) {
1405
+ var l;
1406
+ if (((l = this.socket) == null ? void 0 : l.readyState) === WebSocket.OPEN) {
1407
+ const i = {
1408
+ type: "message",
1409
+ content: s,
1410
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1411
+ };
1412
+ this.socket.send(JSON.stringify(i));
1413
+ }
1414
+ }
1415
+ onMessage(s) {
1416
+ this.onMessageCallback = s;
1417
+ }
1418
+ onStatus(s) {
1419
+ this.onStatusCallback = s;
1420
+ }
1421
+ disconnect() {
1422
+ this.socket && (this.socket.close(), this.socket = null);
1423
+ }
1424
+ }
1425
+ const zt = ({
1426
+ session: n,
1427
+ companyInfo: s,
1428
+ onClose: l
1429
+ }) => {
1430
+ const [i, v] = P([]), [d, y] = P(""), [b, u] = P(!1), [h, p] = P("disconnected"), E = U(null), R = U(null);
1431
+ ce(() => (R.current = new Wt(n.token, n.id), R.current.onMessage((w) => {
1432
+ v(($) => [...$, w]), u(!1);
1433
+ }), R.current.onStatus((w) => {
1434
+ p(w);
1435
+ }), v([{
1436
+ id: "welcome",
1437
+ content: "",
1438
+ timestamp: /* @__PURE__ */ new Date(),
1439
+ sender: "system"
1440
+ }]), () => {
1441
+ var w;
1442
+ (w = R.current) == null || w.disconnect();
1443
+ }), [n, s]), ce(() => {
1444
+ T();
1445
+ }, [i]);
1446
+ const T = () => {
1447
+ var o;
1448
+ (o = E.current) == null || o.scrollIntoView({ behavior: "smooth" });
1449
+ }, A = () => {
1450
+ var w;
1451
+ if (!d.trim() || h !== "connected") return;
1452
+ const o = {
1453
+ id: Date.now().toString(),
1454
+ content: d,
1455
+ timestamp: /* @__PURE__ */ new Date(),
1456
+ sender: "user"
1457
+ };
1458
+ v(($) => [...$, o]), (w = R.current) == null || w.sendMessage(d), y(""), u(!0);
1459
+ }, M = (o) => {
1460
+ o.key === "Enter" && !o.shiftKey && (o.preventDefault(), A());
1461
+ }, j = (o) => new Intl.DateTimeFormat("en-US", {
1462
+ hour: "2-digit",
1463
+ minute: "2-digit"
1464
+ }).format(o), O = (o) => {
1465
+ switch (o) {
1466
+ case "agent":
1467
+ return /* @__PURE__ */ t.jsx(Mt, { className: "w-4 h-4" });
1468
+ case "user":
1469
+ return /* @__PURE__ */ t.jsx(It, { className: "w-4 h-4" });
1470
+ default:
1471
+ return null;
1472
+ }
1473
+ };
1474
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full", children: [
1475
+ /* @__PURE__ */ t.jsxs("div", { className: "bg-primary text-primary-foreground p-4 rounded-t-lg", children: [
1476
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between", children: [
1477
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
1478
+ /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-green-400" }),
1479
+ /* @__PURE__ */ t.jsx("span", { className: "font-medium", children: s.name })
1480
+ ] }),
1481
+ /* @__PURE__ */ t.jsx(
1482
+ z,
1483
+ {
1484
+ variant: "ghost",
1485
+ size: "sm",
1486
+ onClick: l,
1487
+ className: "text-primary-foreground hover:bg-primary-foreground/20",
1488
+ children: "×"
1489
+ }
1490
+ )
1491
+ ] }),
1492
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs opacity-80 mt-1", children: h === "connected" ? "Online" : "Connecting..." })
1493
+ ] }),
1494
+ /* @__PURE__ */ t.jsxs("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 bg-background", children: [
1495
+ i.map((o) => /* @__PURE__ */ t.jsx(
1496
+ "div",
1497
+ {
1498
+ className: `flex ${o.sender === "user" ? "justify-end" : "justify-start"}`,
1499
+ children: /* @__PURE__ */ t.jsxs(
1500
+ "div",
1501
+ {
1502
+ className: `max-w-xs lg:max-w-md px-4 py-2 rounded-lg ${o.sender === "user" ? "bg-primary text-primary-foreground" : o.sender === "system" ? "bg-muted text-muted-foreground text-center" : "bg-muted text-foreground"}`,
1503
+ children: [
1504
+ o.sender !== "system" && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-1 mb-1", children: [
1505
+ O(o.sender),
1506
+ /* @__PURE__ */ t.jsx("span", { className: "text-xs opacity-70", children: o.senderName || (o.sender === "user" ? "You" : "Support") })
1507
+ ] }),
1508
+ /* @__PURE__ */ t.jsx("p", { className: "text-sm", children: o.content }),
1509
+ /* @__PURE__ */ t.jsx("p", { className: "text-xs opacity-60 mt-1", children: j(o.timestamp) })
1510
+ ]
1511
+ }
1512
+ )
1513
+ },
1514
+ o.id
1515
+ )),
1516
+ b && /* @__PURE__ */ t.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ t.jsx("div", { className: "bg-muted text-foreground px-4 py-2 rounded-lg", children: /* @__PURE__ */ t.jsxs("div", { className: "flex space-x-1", children: [
1517
+ /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce" }),
1518
+ /* @__PURE__ */ t.jsx(
1519
+ "div",
1520
+ {
1521
+ className: "w-2 h-2 bg-current rounded-full animate-bounce",
1522
+ style: { animationDelay: "0.1s" }
1523
+ }
1524
+ ),
1525
+ /* @__PURE__ */ t.jsx(
1526
+ "div",
1527
+ {
1528
+ className: "w-2 h-2 bg-current rounded-full animate-bounce",
1529
+ style: { animationDelay: "0.2s" }
1530
+ }
1531
+ )
1532
+ ] }) }) }),
1533
+ /* @__PURE__ */ t.jsx("div", { ref: E })
1534
+ ] }),
1535
+ /* @__PURE__ */ t.jsxs("div", { className: "p-4 border-t bg-background", children: [
1536
+ /* @__PURE__ */ t.jsxs("div", { className: "flex space-x-2", children: [
1537
+ /* @__PURE__ */ t.jsx(
1538
+ "input",
1539
+ {
1540
+ value: d,
1541
+ onChange: (o) => y(o.target.value),
1542
+ onKeyPress: M,
1543
+ placeholder: "Type your message...",
1544
+ disabled: h !== "connected",
1545
+ className: "flex-1"
1546
+ }
1547
+ ),
1548
+ /* @__PURE__ */ t.jsx(
1549
+ z,
1550
+ {
1551
+ onClick: A,
1552
+ disabled: !d.trim() || h !== "connected",
1553
+ size: "icon",
1554
+ children: /* @__PURE__ */ t.jsx(Ve, { className: "w-4 h-4" })
1555
+ }
1556
+ )
1557
+ ] }),
1558
+ h !== "connected" && /* @__PURE__ */ t.jsx("p", { className: "text-xs text-muted-foreground mt-2", children: h === "error" ? "Connection error. Retrying..." : "Connecting..." })
1559
+ ] })
1560
+ ] });
1561
+ }, Vt = ({ config: n }) => {
1562
+ const [s, l] = P("contact-form"), [i, v] = P(
1563
+ null
1564
+ ), [d, y] = P(null), [b, u] = P(!1), [h, p] = P(null), [E, R] = S.useState(!1), T = new Tt(n);
1565
+ ce(() => {
1566
+ A();
1567
+ }, [n]);
1568
+ const A = async () => {
1569
+ try {
1570
+ const o = await T.getCompanyInfo();
1571
+ v(o.data);
1572
+ } catch (o) {
1573
+ p("Failed to load chat configuration"), console.error("Failed to load company info:", o);
1574
+ }
1575
+ }, M = async (o) => {
1576
+ u(!0);
1577
+ try {
1578
+ const w = await T.submitContactInfo(o), $ = {
1579
+ id: w.sessionId,
1580
+ token: w.token,
1581
+ isActive: !0
1582
+ };
1583
+ y($), l("chat");
1584
+ } catch (w) {
1585
+ p("Failed to start chat. Please try again."), console.error("Failed to submit contact info:", w);
1586
+ } finally {
1587
+ u(!1);
1588
+ }
1589
+ }, j = async () => {
1590
+ u(!0);
1591
+ try {
1592
+ const o = await T.startAnonymousChat(), w = {
1593
+ id: o.sessionId,
1594
+ token: o.token,
1595
+ isActive: !0
1596
+ };
1597
+ y(w), l("chat");
1598
+ } catch (o) {
1599
+ p("Failed to start chat. Please try again."), console.error("Failed to start anonymous chat:", o);
1600
+ } finally {
1601
+ u(!1);
1602
+ }
1603
+ }, O = () => {
1604
+ l("closed"), y(null), p(null);
1605
+ };
1606
+ return console.log({ companyInfo: i }), /* @__PURE__ */ t.jsxs("div", { className: `lulichat lulichat-${n.position}`, children: [
1607
+ E && /* @__PURE__ */ t.jsxs("div", { className: "lulichat-main", children: [
1608
+ h && /* @__PURE__ */ t.jsxs("div", { className: "p-4 bg-destructive/10 border-b", children: [
1609
+ /* @__PURE__ */ t.jsx("p", { className: "text-sm text-destructive", children: h }),
1610
+ /* @__PURE__ */ t.jsx("button", { onClick: () => p(null), className: "mt-2", children: "Retry" })
1611
+ ] }),
1612
+ /* @__PURE__ */ t.jsx(
1613
+ Lt,
1614
+ {
1615
+ companyName: i == null ? void 0 : i.name,
1616
+ onSubmit: M,
1617
+ onSkip: n.allowAnonymous ? j : void 0,
1618
+ allowAnonymous: n.allowAnonymous || !1,
1619
+ isLoading: b
1620
+ }
1621
+ ),
1622
+ /* @__PURE__ */ t.jsxs("div", { style: { padding: 16 }, children: [
1623
+ /* @__PURE__ */ t.jsx(
1624
+ "div",
1625
+ {
1626
+ style: {
1627
+ display: "flex",
1628
+ gap: 10,
1629
+ flexWrap: "wrap"
1630
+ },
1631
+ children: i == null ? void 0 : i.queues.map((o) => {
1632
+ var w;
1633
+ return /* @__PURE__ */ t.jsx("div", { className: "lulichat-tag", children: (w = o.name) == null ? void 0 : w.toLocaleLowerCase() }, o.id);
1634
+ })
1635
+ }
1636
+ ),
1637
+ /* @__PURE__ */ t.jsx(
1638
+ "div",
1639
+ {
1640
+ style: {
1641
+ height: 2,
1642
+ backgroundColor: "hsl(var(--border))",
1643
+ marginBlock: 16
1644
+ }
1645
+ }
1646
+ ),
1647
+ /* @__PURE__ */ t.jsxs(
1648
+ "div",
1649
+ {
1650
+ style: {
1651
+ display: "flex",
1652
+ alignItems: "center",
1653
+ columnGap: 10
1654
+ },
1655
+ className: "form-control",
1656
+ children: [
1657
+ /* @__PURE__ */ t.jsx(
1658
+ ee,
1659
+ {
1660
+ name: "message",
1661
+ autoComplete: "off",
1662
+ style: { border: "none", paddingInline: 0 },
1663
+ placeholder: "What can we help you with ?."
1664
+ }
1665
+ ),
1666
+ /* @__PURE__ */ t.jsxs("div", { className: "lulichat-btn-group", children: [
1667
+ /* @__PURE__ */ t.jsx(z, { style: { color: "#00000080" }, size: "icon", children: /* @__PURE__ */ t.jsx(Ft, { height: 24 }) }),
1668
+ /* @__PURE__ */ t.jsx(z, { style: { color: "#00000080" }, size: "icon", children: /* @__PURE__ */ t.jsx(Ve, {}) })
1669
+ ] })
1670
+ ]
1671
+ }
1672
+ )
1673
+ ] }),
1674
+ s === "chat" && d && i && /* @__PURE__ */ t.jsx(
1675
+ zt,
1676
+ {
1677
+ session: d,
1678
+ companyInfo: i,
1679
+ onClose: O
1680
+ }
1681
+ )
1682
+ ] }),
1683
+ /* @__PURE__ */ t.jsx(
1684
+ z,
1685
+ {
1686
+ onClick: () => R(!E),
1687
+ className: "",
1688
+ shape: "circle",
1689
+ size: "icon",
1690
+ style: {
1691
+ backgroundColor: n.primaryColor,
1692
+ height: "4rem",
1693
+ width: "4rem",
1694
+ padding: 0,
1695
+ color: "#fff",
1696
+ alignSelf: "end"
1697
+ },
1698
+ disabled: !i && !h,
1699
+ children: !i && !h ? /* @__PURE__ */ t.jsx(Be, {}) : /* @__PURE__ */ t.jsx($t, { height: 40, width: 40 })
1700
+ }
1701
+ )
1702
+ ] });
1703
+ }, qt = ({
1704
+ apiKey: n,
1705
+ baseUrl: s,
1706
+ position: l = "bottom-right",
1707
+ primaryColor: i = "#007bff",
1708
+ companyName: v = "Support",
1709
+ welcomeMessage: d = "Hello! How can we help you today?",
1710
+ requireContactInfo: y = !0,
1711
+ allowAnonymous: b = !0
1712
+ }) => {
1713
+ const u = {
1714
+ apiKey: n,
1715
+ baseUrl: s,
1716
+ position: l,
1717
+ primaryColor: i,
1718
+ companyName: v,
1719
+ welcomeMessage: d,
1720
+ requireContactInfo: y,
1721
+ allowAnonymous: b
1722
+ };
1723
+ return n ? /* @__PURE__ */ t.jsx(Vt, { config: u }) : (console.error("LuliChat: API key is required"), null);
1724
+ };
1725
+ export {
1726
+ qt as default
1727
+ };