hanbiro-react16-sdk 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChatAIDraft/EmptyState.d.ts +6 -0
- package/dist/components/ChatAIDraft/EmptyState.js +220 -0
- package/dist/components/ChatAIDraft/List.js +55 -18
- package/dist/components/ChatAIDraft/SettingPopper.d.ts +5 -4
- package/dist/components/ChatAIDraft/SettingPopper.js +235 -79
- package/dist/components/ChatAIDraft/constants.d.ts +4 -0
- package/dist/components/ChatAIDraft/constants.js +18 -0
- package/dist/components/ChatAIDraft/index.d.ts +5 -8
- package/dist/components/ChatAIDraft/index.js +80 -48
- package/dist/components/index.d.ts +1 -1
- package/dist/hanbiro-react16-sdk.style.css +39 -2
- package/dist/hanbiro-react16-sdk.umd.js +2258 -1698
- package/dist/index.js +2 -2
- package/dist/node_modules/prop-types/index.js +1 -2
- package/dist/node_modules/react-feather/dist/icons/align-justify.js +86 -0
- package/dist/node_modules/react-feather/dist/icons/{send.js → arrow-up.js} +10 -10
- package/dist/node_modules/react-feather/dist/icons/award.js +72 -0
- package/dist/node_modules/react-feather/dist/icons/check.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/chevron-down.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/compass.js +72 -0
- package/dist/node_modules/react-feather/dist/icons/file-text.js +82 -0
- package/dist/node_modules/react-feather/dist/icons/frown.js +82 -0
- package/dist/node_modules/react-feather/dist/icons/heart.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/message-circle.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/message-square.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/scissors.js +89 -0
- package/dist/node_modules/react-feather/dist/icons/smile.js +82 -0
- package/dist/node_modules/react-feather/dist/icons/thumbs-up.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/zap.js +68 -0
- package/package.json +1 -1
- package/dist/components/TinyMceEditor/index.js +0 -181
- package/dist/components/TinyMceEditor/scrollStyle.js +0 -40
- package/dist/components/TinyMceEditor/useEditor.js +0 -120
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/ScriptLoader2.js +0 -148
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/TinyMCE.js +0 -7
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/Utils.js +0 -103
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/Editor.js +0 -353
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/EditorPropTypes.js +0 -102
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.23
|
|
3
|
+
* Build Date: 2026-05-21
|
|
4
4
|
*/
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
6
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
@@ -35,7 +35,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
35
35
|
})(this, function (exports2, React, ReactDOM) {
|
|
36
36
|
"use strict";
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _this9 = this;
|
|
39
39
|
var __defProp = Object.defineProperty;
|
|
40
40
|
var __defProps = Object.defineProperties;
|
|
41
41
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -230,8 +230,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
230
230
|
}
|
|
231
231
|
var propTypesExports = propTypes.exports;
|
|
232
232
|
var PropTypes = /* @__PURE__ */getDefaultExportFromCjs(propTypesExports);
|
|
233
|
-
function _extends$
|
|
234
|
-
_extends$
|
|
233
|
+
function _extends$g() {
|
|
234
|
+
_extends$g = Object.assign || function (target) {
|
|
235
235
|
for (var i = 1; i < arguments.length; i++) {
|
|
236
236
|
var source = arguments[i];
|
|
237
237
|
for (var key in source) {
|
|
@@ -242,11 +242,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
242
242
|
}
|
|
243
243
|
return target;
|
|
244
244
|
};
|
|
245
|
-
return _extends$
|
|
245
|
+
return _extends$g.apply(this, arguments);
|
|
246
246
|
}
|
|
247
|
-
function _objectWithoutProperties$
|
|
247
|
+
function _objectWithoutProperties$g(source, excluded) {
|
|
248
248
|
if (source == null) return {};
|
|
249
|
-
var target = _objectWithoutPropertiesLoose$
|
|
249
|
+
var target = _objectWithoutPropertiesLoose$g(source, excluded);
|
|
250
250
|
var key, i;
|
|
251
251
|
if (Object.getOwnPropertySymbols) {
|
|
252
252
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -259,7 +259,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
259
259
|
}
|
|
260
260
|
return target;
|
|
261
261
|
}
|
|
262
|
-
function _objectWithoutPropertiesLoose$
|
|
262
|
+
function _objectWithoutPropertiesLoose$g(source, excluded) {
|
|
263
263
|
if (source == null) return {};
|
|
264
264
|
var target = {};
|
|
265
265
|
var sourceKeys = Object.keys(source);
|
|
@@ -271,13 +271,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
271
271
|
}
|
|
272
272
|
return target;
|
|
273
273
|
}
|
|
274
|
-
var
|
|
274
|
+
var AlignJustify = React.forwardRef(function (_ref, ref) {
|
|
275
275
|
var _ref$color = _ref.color,
|
|
276
276
|
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
277
277
|
_ref$size = _ref.size,
|
|
278
278
|
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
279
|
-
rest = _objectWithoutProperties$
|
|
280
|
-
return /* @__PURE__ */React.createElement("svg", _extends$
|
|
279
|
+
rest = _objectWithoutProperties$g(_ref, ["color", "size"]);
|
|
280
|
+
return /* @__PURE__ */React.createElement("svg", _extends$g({
|
|
281
281
|
ref: ref,
|
|
282
282
|
xmlns: "http://www.w3.org/2000/svg",
|
|
283
283
|
width: size,
|
|
@@ -288,24 +288,35 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
288
288
|
strokeWidth: "2",
|
|
289
289
|
strokeLinecap: "round",
|
|
290
290
|
strokeLinejoin: "round"
|
|
291
|
-
}, rest), /* @__PURE__ */React.createElement("
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
291
|
+
}, rest), /* @__PURE__ */React.createElement("line", {
|
|
292
|
+
x1: "21",
|
|
293
|
+
y1: "10",
|
|
294
|
+
x2: "3",
|
|
295
|
+
y2: "10"
|
|
296
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
297
|
+
x1: "21",
|
|
298
|
+
y1: "6",
|
|
299
|
+
x2: "3",
|
|
300
|
+
y2: "6"
|
|
301
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
302
|
+
x1: "21",
|
|
303
|
+
y1: "14",
|
|
304
|
+
x2: "3",
|
|
305
|
+
y2: "14"
|
|
306
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
307
|
+
x1: "21",
|
|
308
|
+
y1: "18",
|
|
309
|
+
x2: "3",
|
|
310
|
+
y2: "18"
|
|
300
311
|
}));
|
|
301
312
|
});
|
|
302
|
-
|
|
313
|
+
AlignJustify.propTypes = {
|
|
303
314
|
color: PropTypes.string,
|
|
304
315
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
305
316
|
};
|
|
306
|
-
|
|
307
|
-
function _extends$
|
|
308
|
-
_extends$
|
|
317
|
+
AlignJustify.displayName = "AlignJustify";
|
|
318
|
+
function _extends$f() {
|
|
319
|
+
_extends$f = Object.assign || function (target) {
|
|
309
320
|
for (var i = 1; i < arguments.length; i++) {
|
|
310
321
|
var source = arguments[i];
|
|
311
322
|
for (var key in source) {
|
|
@@ -316,11 +327,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
316
327
|
}
|
|
317
328
|
return target;
|
|
318
329
|
};
|
|
319
|
-
return _extends$
|
|
330
|
+
return _extends$f.apply(this, arguments);
|
|
320
331
|
}
|
|
321
|
-
function _objectWithoutProperties$
|
|
332
|
+
function _objectWithoutProperties$f(source, excluded) {
|
|
322
333
|
if (source == null) return {};
|
|
323
|
-
var target = _objectWithoutPropertiesLoose$
|
|
334
|
+
var target = _objectWithoutPropertiesLoose$f(source, excluded);
|
|
324
335
|
var key, i;
|
|
325
336
|
if (Object.getOwnPropertySymbols) {
|
|
326
337
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -333,7 +344,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
333
344
|
}
|
|
334
345
|
return target;
|
|
335
346
|
}
|
|
336
|
-
function _objectWithoutPropertiesLoose$
|
|
347
|
+
function _objectWithoutPropertiesLoose$f(source, excluded) {
|
|
337
348
|
if (source == null) return {};
|
|
338
349
|
var target = {};
|
|
339
350
|
var sourceKeys = Object.keys(source);
|
|
@@ -345,13 +356,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
345
356
|
}
|
|
346
357
|
return target;
|
|
347
358
|
}
|
|
348
|
-
var
|
|
359
|
+
var ArrowUp = React.forwardRef(function (_ref, ref) {
|
|
349
360
|
var _ref$color = _ref.color,
|
|
350
361
|
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
351
362
|
_ref$size = _ref.size,
|
|
352
363
|
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
353
|
-
rest = _objectWithoutProperties$
|
|
354
|
-
return /* @__PURE__ */React.createElement("svg", _extends$
|
|
364
|
+
rest = _objectWithoutProperties$f(_ref, ["color", "size"]);
|
|
365
|
+
return /* @__PURE__ */React.createElement("svg", _extends$f({
|
|
355
366
|
ref: ref,
|
|
356
367
|
xmlns: "http://www.w3.org/2000/svg",
|
|
357
368
|
width: size,
|
|
@@ -363,21 +374,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
363
374
|
strokeLinecap: "round",
|
|
364
375
|
strokeLinejoin: "round"
|
|
365
376
|
}, rest), /* @__PURE__ */React.createElement("line", {
|
|
366
|
-
x1: "
|
|
367
|
-
y1: "
|
|
368
|
-
x2: "
|
|
369
|
-
y2: "
|
|
370
|
-
}), /* @__PURE__ */React.createElement("
|
|
371
|
-
points: "
|
|
377
|
+
x1: "12",
|
|
378
|
+
y1: "19",
|
|
379
|
+
x2: "12",
|
|
380
|
+
y2: "5"
|
|
381
|
+
}), /* @__PURE__ */React.createElement("polyline", {
|
|
382
|
+
points: "5 12 12 5 19 12"
|
|
372
383
|
}));
|
|
373
384
|
});
|
|
374
|
-
|
|
385
|
+
ArrowUp.propTypes = {
|
|
375
386
|
color: PropTypes.string,
|
|
376
387
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
377
388
|
};
|
|
378
|
-
|
|
379
|
-
function _extends() {
|
|
380
|
-
_extends = Object.assign || function (target) {
|
|
389
|
+
ArrowUp.displayName = "ArrowUp";
|
|
390
|
+
function _extends$e() {
|
|
391
|
+
_extends$e = Object.assign || function (target) {
|
|
381
392
|
for (var i = 1; i < arguments.length; i++) {
|
|
382
393
|
var source = arguments[i];
|
|
383
394
|
for (var key in source) {
|
|
@@ -388,11 +399,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
388
399
|
}
|
|
389
400
|
return target;
|
|
390
401
|
};
|
|
391
|
-
return _extends.apply(this, arguments);
|
|
402
|
+
return _extends$e.apply(this, arguments);
|
|
392
403
|
}
|
|
393
|
-
function _objectWithoutProperties(source, excluded) {
|
|
404
|
+
function _objectWithoutProperties$e(source, excluded) {
|
|
394
405
|
if (source == null) return {};
|
|
395
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
406
|
+
var target = _objectWithoutPropertiesLoose$e(source, excluded);
|
|
396
407
|
var key, i;
|
|
397
408
|
if (Object.getOwnPropertySymbols) {
|
|
398
409
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -405,7 +416,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
405
416
|
}
|
|
406
417
|
return target;
|
|
407
418
|
}
|
|
408
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
419
|
+
function _objectWithoutPropertiesLoose$e(source, excluded) {
|
|
409
420
|
if (source == null) return {};
|
|
410
421
|
var target = {};
|
|
411
422
|
var sourceKeys = Object.keys(source);
|
|
@@ -417,13 +428,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
417
428
|
}
|
|
418
429
|
return target;
|
|
419
430
|
}
|
|
420
|
-
var
|
|
431
|
+
var Award = React.forwardRef(function (_ref, ref) {
|
|
421
432
|
var _ref$color = _ref.color,
|
|
422
433
|
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
423
434
|
_ref$size = _ref.size,
|
|
424
435
|
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
425
|
-
rest = _objectWithoutProperties(_ref, ["color", "size"]);
|
|
426
|
-
return /* @__PURE__ */React.createElement("svg", _extends({
|
|
436
|
+
rest = _objectWithoutProperties$e(_ref, ["color", "size"]);
|
|
437
|
+
return /* @__PURE__ */React.createElement("svg", _extends$e({
|
|
427
438
|
ref: ref,
|
|
428
439
|
xmlns: "http://www.w3.org/2000/svg",
|
|
429
440
|
width: size,
|
|
@@ -436,137 +447,1091 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
436
447
|
strokeLinejoin: "round"
|
|
437
448
|
}, rest), /* @__PURE__ */React.createElement("circle", {
|
|
438
449
|
cx: "12",
|
|
439
|
-
cy: "
|
|
440
|
-
r: "
|
|
441
|
-
}), /* @__PURE__ */React.createElement("
|
|
442
|
-
|
|
450
|
+
cy: "8",
|
|
451
|
+
r: "7"
|
|
452
|
+
}), /* @__PURE__ */React.createElement("polyline", {
|
|
453
|
+
points: "8.21 13.89 7 23 12 20 17 23 15.79 13.88"
|
|
443
454
|
}));
|
|
444
455
|
});
|
|
445
|
-
|
|
456
|
+
Award.propTypes = {
|
|
446
457
|
color: PropTypes.string,
|
|
447
458
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
448
459
|
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
460
|
+
Award.displayName = "Award";
|
|
461
|
+
function _extends$d() {
|
|
462
|
+
_extends$d = Object.assign || function (target) {
|
|
463
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
464
|
+
var source = arguments[i];
|
|
465
|
+
for (var key in source) {
|
|
466
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
467
|
+
target[key] = source[key];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return target;
|
|
472
|
+
};
|
|
473
|
+
return _extends$d.apply(this, arguments);
|
|
474
|
+
}
|
|
475
|
+
function _objectWithoutProperties$d(source, excluded) {
|
|
476
|
+
if (source == null) return {};
|
|
477
|
+
var target = _objectWithoutPropertiesLoose$d(source, excluded);
|
|
478
|
+
var key, i;
|
|
479
|
+
if (Object.getOwnPropertySymbols) {
|
|
480
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
481
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
482
|
+
key = sourceSymbolKeys[i];
|
|
483
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
484
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
485
|
+
target[key] = source[key];
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return target;
|
|
489
|
+
}
|
|
490
|
+
function _objectWithoutPropertiesLoose$d(source, excluded) {
|
|
491
|
+
if (source == null) return {};
|
|
492
|
+
var target = {};
|
|
493
|
+
var sourceKeys = Object.keys(source);
|
|
494
|
+
var key, i;
|
|
495
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
496
|
+
key = sourceKeys[i];
|
|
497
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
498
|
+
target[key] = source[key];
|
|
499
|
+
}
|
|
500
|
+
return target;
|
|
501
|
+
}
|
|
502
|
+
var Check = React.forwardRef(function (_ref, ref) {
|
|
503
|
+
var _ref$color = _ref.color,
|
|
504
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
505
|
+
_ref$size = _ref.size,
|
|
506
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
507
|
+
rest = _objectWithoutProperties$d(_ref, ["color", "size"]);
|
|
508
|
+
return /* @__PURE__ */React.createElement("svg", _extends$d({
|
|
509
|
+
ref: ref,
|
|
459
510
|
xmlns: "http://www.w3.org/2000/svg",
|
|
460
511
|
width: size,
|
|
461
512
|
height: size,
|
|
462
513
|
viewBox: "0 0 24 24",
|
|
463
|
-
style: {
|
|
464
|
-
flexShrink: 0
|
|
465
|
-
}
|
|
466
|
-
}, isGradient && /* @__PURE__ */React__namespace.createElement("defs", null, /* @__PURE__ */React__namespace.createElement("linearGradient", {
|
|
467
|
-
id: gradientId,
|
|
468
|
-
x1: "0%",
|
|
469
|
-
y1: "0%",
|
|
470
|
-
x2: "0%",
|
|
471
|
-
y2: "100%"
|
|
472
|
-
}, /* @__PURE__ */React__namespace.createElement("stop", {
|
|
473
|
-
offset: "0%",
|
|
474
|
-
stopColor: "#9D50BB"
|
|
475
|
-
}, /* @__PURE__ */React__namespace.createElement("animate", {
|
|
476
|
-
attributeName: "offset",
|
|
477
|
-
values: "0%;0.4;0%",
|
|
478
|
-
dur: "1s",
|
|
479
|
-
repeatCount: "indefinite"
|
|
480
|
-
})), /* @__PURE__ */React__namespace.createElement("stop", {
|
|
481
|
-
offset: "30%",
|
|
482
|
-
stopColor: "#6E48AA"
|
|
483
|
-
}, /* @__PURE__ */React__namespace.createElement("animate", {
|
|
484
|
-
attributeName: "offset",
|
|
485
|
-
values: "0.4;0.7;0.4",
|
|
486
|
-
dur: "1s",
|
|
487
|
-
repeatCount: "indefinite"
|
|
488
|
-
})), /* @__PURE__ */React__namespace.createElement("stop", {
|
|
489
|
-
offset: "50%",
|
|
490
|
-
stopColor: "#4776E6"
|
|
491
|
-
}, /* @__PURE__ */React__namespace.createElement("animate", {
|
|
492
|
-
attributeName: "offset",
|
|
493
|
-
values: "0.5;0.7;0.5",
|
|
494
|
-
dur: "1s",
|
|
495
|
-
repeatCount: "indefinite"
|
|
496
|
-
})), /* @__PURE__ */React__namespace.createElement("animateTransform", {
|
|
497
|
-
attributeName: "gradientTransform",
|
|
498
|
-
type: "translate",
|
|
499
|
-
from: "0,0",
|
|
500
|
-
to: "100,0",
|
|
501
|
-
dur: "1s",
|
|
502
|
-
repeatCount: "indefinite"
|
|
503
|
-
}))), /* @__PURE__ */React__namespace.createElement("path", {
|
|
504
514
|
fill: "none",
|
|
505
|
-
stroke:
|
|
515
|
+
stroke: color,
|
|
516
|
+
strokeWidth: "2",
|
|
506
517
|
strokeLinecap: "round",
|
|
507
|
-
strokeLinejoin: "round"
|
|
508
|
-
|
|
509
|
-
|
|
518
|
+
strokeLinejoin: "round"
|
|
519
|
+
}, rest), /* @__PURE__ */React.createElement("polyline", {
|
|
520
|
+
points: "20 6 9 17 4 12"
|
|
510
521
|
}));
|
|
522
|
+
});
|
|
523
|
+
Check.propTypes = {
|
|
524
|
+
color: PropTypes.string,
|
|
525
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
511
526
|
};
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
var checkDevelopment = function checkDevelopment() {
|
|
523
|
-
var locationInfo = window.location;
|
|
524
|
-
var hostname = locationInfo.hostname;
|
|
525
|
-
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
526
|
-
return true;
|
|
527
|
-
} else {
|
|
528
|
-
return false;
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
var isDevelopment = checkDevelopment();
|
|
532
|
-
var getBaseUrl = function getBaseUrl() {
|
|
533
|
-
var _a2;
|
|
534
|
-
var locationInfo = window.location;
|
|
535
|
-
var host = locationInfo.host;
|
|
536
|
-
if (isDevelopment) {
|
|
537
|
-
var baseUrlArr = (_a2 = SDKConfig.baseUrl) == null ? void 0 : _a2.split("/");
|
|
538
|
-
if (baseUrlArr) {
|
|
539
|
-
return "https://" + (baseUrlArr == null ? void 0 : baseUrlArr[2]);
|
|
540
|
-
} else {
|
|
541
|
-
return "https://vndev.hanbiro.com";
|
|
527
|
+
Check.displayName = "Check";
|
|
528
|
+
function _extends$c() {
|
|
529
|
+
_extends$c = Object.assign || function (target) {
|
|
530
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
531
|
+
var source = arguments[i];
|
|
532
|
+
for (var key in source) {
|
|
533
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
534
|
+
target[key] = source[key];
|
|
535
|
+
}
|
|
536
|
+
}
|
|
542
537
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
538
|
+
return target;
|
|
539
|
+
};
|
|
540
|
+
return _extends$c.apply(this, arguments);
|
|
541
|
+
}
|
|
542
|
+
function _objectWithoutProperties$c(source, excluded) {
|
|
543
|
+
if (source == null) return {};
|
|
544
|
+
var target = _objectWithoutPropertiesLoose$c(source, excluded);
|
|
545
|
+
var key, i;
|
|
546
|
+
if (Object.getOwnPropertySymbols) {
|
|
547
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
548
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
549
|
+
key = sourceSymbolKeys[i];
|
|
550
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
551
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
552
|
+
target[key] = source[key];
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return target;
|
|
556
|
+
}
|
|
557
|
+
function _objectWithoutPropertiesLoose$c(source, excluded) {
|
|
558
|
+
if (source == null) return {};
|
|
559
|
+
var target = {};
|
|
560
|
+
var sourceKeys = Object.keys(source);
|
|
561
|
+
var key, i;
|
|
562
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
563
|
+
key = sourceKeys[i];
|
|
564
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
565
|
+
target[key] = source[key];
|
|
547
566
|
}
|
|
567
|
+
return target;
|
|
568
|
+
}
|
|
569
|
+
var ChevronDown = React.forwardRef(function (_ref, ref) {
|
|
570
|
+
var _ref$color = _ref.color,
|
|
571
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
572
|
+
_ref$size = _ref.size,
|
|
573
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
574
|
+
rest = _objectWithoutProperties$c(_ref, ["color", "size"]);
|
|
575
|
+
return /* @__PURE__ */React.createElement("svg", _extends$c({
|
|
576
|
+
ref: ref,
|
|
577
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
578
|
+
width: size,
|
|
579
|
+
height: size,
|
|
580
|
+
viewBox: "0 0 24 24",
|
|
581
|
+
fill: "none",
|
|
582
|
+
stroke: color,
|
|
583
|
+
strokeWidth: "2",
|
|
584
|
+
strokeLinecap: "round",
|
|
585
|
+
strokeLinejoin: "round"
|
|
586
|
+
}, rest), /* @__PURE__ */React.createElement("polyline", {
|
|
587
|
+
points: "6 9 12 15 18 9"
|
|
588
|
+
}));
|
|
589
|
+
});
|
|
590
|
+
ChevronDown.propTypes = {
|
|
591
|
+
color: PropTypes.string,
|
|
592
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
548
593
|
};
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
594
|
+
ChevronDown.displayName = "ChevronDown";
|
|
595
|
+
function _extends$b() {
|
|
596
|
+
_extends$b = Object.assign || function (target) {
|
|
597
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
598
|
+
var source = arguments[i];
|
|
599
|
+
for (var key in source) {
|
|
600
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
601
|
+
target[key] = source[key];
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return target;
|
|
606
|
+
};
|
|
607
|
+
return _extends$b.apply(this, arguments);
|
|
608
|
+
}
|
|
609
|
+
function _objectWithoutProperties$b(source, excluded) {
|
|
610
|
+
if (source == null) return {};
|
|
611
|
+
var target = _objectWithoutPropertiesLoose$b(source, excluded);
|
|
612
|
+
var key, i;
|
|
613
|
+
if (Object.getOwnPropertySymbols) {
|
|
614
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
615
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
616
|
+
key = sourceSymbolKeys[i];
|
|
617
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
618
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
619
|
+
target[key] = source[key];
|
|
556
620
|
}
|
|
557
|
-
var _locationInfo = locationInfo,
|
|
558
|
-
hostname = _locationInfo.hostname,
|
|
559
|
-
protocol = _locationInfo.protocol;
|
|
560
|
-
return [protocol, "//", hostname, "/ngw"].join("");
|
|
561
621
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
622
|
+
return target;
|
|
623
|
+
}
|
|
624
|
+
function _objectWithoutPropertiesLoose$b(source, excluded) {
|
|
625
|
+
if (source == null) return {};
|
|
626
|
+
var target = {};
|
|
627
|
+
var sourceKeys = Object.keys(source);
|
|
628
|
+
var key, i;
|
|
629
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
630
|
+
key = sourceKeys[i];
|
|
631
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
632
|
+
target[key] = source[key];
|
|
633
|
+
}
|
|
634
|
+
return target;
|
|
635
|
+
}
|
|
636
|
+
var Compass = React.forwardRef(function (_ref, ref) {
|
|
637
|
+
var _ref$color = _ref.color,
|
|
638
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
639
|
+
_ref$size = _ref.size,
|
|
640
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
641
|
+
rest = _objectWithoutProperties$b(_ref, ["color", "size"]);
|
|
642
|
+
return /* @__PURE__ */React.createElement("svg", _extends$b({
|
|
643
|
+
ref: ref,
|
|
644
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
645
|
+
width: size,
|
|
646
|
+
height: size,
|
|
647
|
+
viewBox: "0 0 24 24",
|
|
648
|
+
fill: "none",
|
|
649
|
+
stroke: color,
|
|
650
|
+
strokeWidth: "2",
|
|
651
|
+
strokeLinecap: "round",
|
|
652
|
+
strokeLinejoin: "round"
|
|
653
|
+
}, rest), /* @__PURE__ */React.createElement("circle", {
|
|
654
|
+
cx: "12",
|
|
655
|
+
cy: "12",
|
|
656
|
+
r: "10"
|
|
657
|
+
}), /* @__PURE__ */React.createElement("polygon", {
|
|
658
|
+
points: "16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"
|
|
659
|
+
}));
|
|
660
|
+
});
|
|
661
|
+
Compass.propTypes = {
|
|
662
|
+
color: PropTypes.string,
|
|
663
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
664
|
+
};
|
|
665
|
+
Compass.displayName = "Compass";
|
|
666
|
+
function _extends$a() {
|
|
667
|
+
_extends$a = Object.assign || function (target) {
|
|
668
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
669
|
+
var source = arguments[i];
|
|
670
|
+
for (var key in source) {
|
|
671
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
672
|
+
target[key] = source[key];
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return target;
|
|
677
|
+
};
|
|
678
|
+
return _extends$a.apply(this, arguments);
|
|
679
|
+
}
|
|
680
|
+
function _objectWithoutProperties$a(source, excluded) {
|
|
681
|
+
if (source == null) return {};
|
|
682
|
+
var target = _objectWithoutPropertiesLoose$a(source, excluded);
|
|
683
|
+
var key, i;
|
|
684
|
+
if (Object.getOwnPropertySymbols) {
|
|
685
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
686
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
687
|
+
key = sourceSymbolKeys[i];
|
|
688
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
689
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
690
|
+
target[key] = source[key];
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
return target;
|
|
694
|
+
}
|
|
695
|
+
function _objectWithoutPropertiesLoose$a(source, excluded) {
|
|
696
|
+
if (source == null) return {};
|
|
697
|
+
var target = {};
|
|
698
|
+
var sourceKeys = Object.keys(source);
|
|
699
|
+
var key, i;
|
|
700
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
701
|
+
key = sourceKeys[i];
|
|
702
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
703
|
+
target[key] = source[key];
|
|
704
|
+
}
|
|
705
|
+
return target;
|
|
706
|
+
}
|
|
707
|
+
var Copy = React.forwardRef(function (_ref, ref) {
|
|
708
|
+
var _ref$color = _ref.color,
|
|
709
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
710
|
+
_ref$size = _ref.size,
|
|
711
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
712
|
+
rest = _objectWithoutProperties$a(_ref, ["color", "size"]);
|
|
713
|
+
return /* @__PURE__ */React.createElement("svg", _extends$a({
|
|
714
|
+
ref: ref,
|
|
715
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
716
|
+
width: size,
|
|
717
|
+
height: size,
|
|
718
|
+
viewBox: "0 0 24 24",
|
|
719
|
+
fill: "none",
|
|
720
|
+
stroke: color,
|
|
721
|
+
strokeWidth: "2",
|
|
722
|
+
strokeLinecap: "round",
|
|
723
|
+
strokeLinejoin: "round"
|
|
724
|
+
}, rest), /* @__PURE__ */React.createElement("rect", {
|
|
725
|
+
x: "9",
|
|
726
|
+
y: "9",
|
|
727
|
+
width: "13",
|
|
728
|
+
height: "13",
|
|
729
|
+
rx: "2",
|
|
730
|
+
ry: "2"
|
|
731
|
+
}), /* @__PURE__ */React.createElement("path", {
|
|
732
|
+
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
|
|
733
|
+
}));
|
|
734
|
+
});
|
|
735
|
+
Copy.propTypes = {
|
|
736
|
+
color: PropTypes.string,
|
|
737
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
738
|
+
};
|
|
739
|
+
Copy.displayName = "Copy";
|
|
740
|
+
function _extends$9() {
|
|
741
|
+
_extends$9 = Object.assign || function (target) {
|
|
742
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
743
|
+
var source = arguments[i];
|
|
744
|
+
for (var key in source) {
|
|
745
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
746
|
+
target[key] = source[key];
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
return target;
|
|
751
|
+
};
|
|
752
|
+
return _extends$9.apply(this, arguments);
|
|
753
|
+
}
|
|
754
|
+
function _objectWithoutProperties$9(source, excluded) {
|
|
755
|
+
if (source == null) return {};
|
|
756
|
+
var target = _objectWithoutPropertiesLoose$9(source, excluded);
|
|
757
|
+
var key, i;
|
|
758
|
+
if (Object.getOwnPropertySymbols) {
|
|
759
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
760
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
761
|
+
key = sourceSymbolKeys[i];
|
|
762
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
763
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
764
|
+
target[key] = source[key];
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return target;
|
|
768
|
+
}
|
|
769
|
+
function _objectWithoutPropertiesLoose$9(source, excluded) {
|
|
770
|
+
if (source == null) return {};
|
|
771
|
+
var target = {};
|
|
772
|
+
var sourceKeys = Object.keys(source);
|
|
773
|
+
var key, i;
|
|
774
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
775
|
+
key = sourceKeys[i];
|
|
776
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
777
|
+
target[key] = source[key];
|
|
778
|
+
}
|
|
779
|
+
return target;
|
|
780
|
+
}
|
|
781
|
+
var FileText = React.forwardRef(function (_ref, ref) {
|
|
782
|
+
var _ref$color = _ref.color,
|
|
783
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
784
|
+
_ref$size = _ref.size,
|
|
785
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
786
|
+
rest = _objectWithoutProperties$9(_ref, ["color", "size"]);
|
|
787
|
+
return /* @__PURE__ */React.createElement("svg", _extends$9({
|
|
788
|
+
ref: ref,
|
|
789
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
790
|
+
width: size,
|
|
791
|
+
height: size,
|
|
792
|
+
viewBox: "0 0 24 24",
|
|
793
|
+
fill: "none",
|
|
794
|
+
stroke: color,
|
|
795
|
+
strokeWidth: "2",
|
|
796
|
+
strokeLinecap: "round",
|
|
797
|
+
strokeLinejoin: "round"
|
|
798
|
+
}, rest), /* @__PURE__ */React.createElement("path", {
|
|
799
|
+
d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"
|
|
800
|
+
}), /* @__PURE__ */React.createElement("polyline", {
|
|
801
|
+
points: "14 2 14 8 20 8"
|
|
802
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
803
|
+
x1: "16",
|
|
804
|
+
y1: "13",
|
|
805
|
+
x2: "8",
|
|
806
|
+
y2: "13"
|
|
807
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
808
|
+
x1: "16",
|
|
809
|
+
y1: "17",
|
|
810
|
+
x2: "8",
|
|
811
|
+
y2: "17"
|
|
812
|
+
}), /* @__PURE__ */React.createElement("polyline", {
|
|
813
|
+
points: "10 9 9 9 8 9"
|
|
814
|
+
}));
|
|
815
|
+
});
|
|
816
|
+
FileText.propTypes = {
|
|
817
|
+
color: PropTypes.string,
|
|
818
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
819
|
+
};
|
|
820
|
+
FileText.displayName = "FileText";
|
|
821
|
+
function _extends$8() {
|
|
822
|
+
_extends$8 = Object.assign || function (target) {
|
|
823
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
824
|
+
var source = arguments[i];
|
|
825
|
+
for (var key in source) {
|
|
826
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
827
|
+
target[key] = source[key];
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
return target;
|
|
832
|
+
};
|
|
833
|
+
return _extends$8.apply(this, arguments);
|
|
834
|
+
}
|
|
835
|
+
function _objectWithoutProperties$8(source, excluded) {
|
|
836
|
+
if (source == null) return {};
|
|
837
|
+
var target = _objectWithoutPropertiesLoose$8(source, excluded);
|
|
838
|
+
var key, i;
|
|
839
|
+
if (Object.getOwnPropertySymbols) {
|
|
840
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
841
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
842
|
+
key = sourceSymbolKeys[i];
|
|
843
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
844
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
845
|
+
target[key] = source[key];
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return target;
|
|
849
|
+
}
|
|
850
|
+
function _objectWithoutPropertiesLoose$8(source, excluded) {
|
|
851
|
+
if (source == null) return {};
|
|
852
|
+
var target = {};
|
|
853
|
+
var sourceKeys = Object.keys(source);
|
|
854
|
+
var key, i;
|
|
855
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
856
|
+
key = sourceKeys[i];
|
|
857
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
858
|
+
target[key] = source[key];
|
|
859
|
+
}
|
|
860
|
+
return target;
|
|
861
|
+
}
|
|
862
|
+
var Frown = React.forwardRef(function (_ref, ref) {
|
|
863
|
+
var _ref$color = _ref.color,
|
|
864
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
865
|
+
_ref$size = _ref.size,
|
|
866
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
867
|
+
rest = _objectWithoutProperties$8(_ref, ["color", "size"]);
|
|
868
|
+
return /* @__PURE__ */React.createElement("svg", _extends$8({
|
|
869
|
+
ref: ref,
|
|
870
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
871
|
+
width: size,
|
|
872
|
+
height: size,
|
|
873
|
+
viewBox: "0 0 24 24",
|
|
874
|
+
fill: "none",
|
|
875
|
+
stroke: color,
|
|
876
|
+
strokeWidth: "2",
|
|
877
|
+
strokeLinecap: "round",
|
|
878
|
+
strokeLinejoin: "round"
|
|
879
|
+
}, rest), /* @__PURE__ */React.createElement("circle", {
|
|
880
|
+
cx: "12",
|
|
881
|
+
cy: "12",
|
|
882
|
+
r: "10"
|
|
883
|
+
}), /* @__PURE__ */React.createElement("path", {
|
|
884
|
+
d: "M16 16s-1.5-2-4-2-4 2-4 2"
|
|
885
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
886
|
+
x1: "9",
|
|
887
|
+
y1: "9",
|
|
888
|
+
x2: "9.01",
|
|
889
|
+
y2: "9"
|
|
890
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
891
|
+
x1: "15",
|
|
892
|
+
y1: "9",
|
|
893
|
+
x2: "15.01",
|
|
894
|
+
y2: "9"
|
|
895
|
+
}));
|
|
896
|
+
});
|
|
897
|
+
Frown.propTypes = {
|
|
898
|
+
color: PropTypes.string,
|
|
899
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
900
|
+
};
|
|
901
|
+
Frown.displayName = "Frown";
|
|
902
|
+
function _extends$7() {
|
|
903
|
+
_extends$7 = Object.assign || function (target) {
|
|
904
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
905
|
+
var source = arguments[i];
|
|
906
|
+
for (var key in source) {
|
|
907
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
908
|
+
target[key] = source[key];
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return target;
|
|
913
|
+
};
|
|
914
|
+
return _extends$7.apply(this, arguments);
|
|
915
|
+
}
|
|
916
|
+
function _objectWithoutProperties$7(source, excluded) {
|
|
917
|
+
if (source == null) return {};
|
|
918
|
+
var target = _objectWithoutPropertiesLoose$7(source, excluded);
|
|
919
|
+
var key, i;
|
|
920
|
+
if (Object.getOwnPropertySymbols) {
|
|
921
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
922
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
923
|
+
key = sourceSymbolKeys[i];
|
|
924
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
925
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
926
|
+
target[key] = source[key];
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
return target;
|
|
930
|
+
}
|
|
931
|
+
function _objectWithoutPropertiesLoose$7(source, excluded) {
|
|
932
|
+
if (source == null) return {};
|
|
933
|
+
var target = {};
|
|
934
|
+
var sourceKeys = Object.keys(source);
|
|
935
|
+
var key, i;
|
|
936
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
937
|
+
key = sourceKeys[i];
|
|
938
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
939
|
+
target[key] = source[key];
|
|
940
|
+
}
|
|
941
|
+
return target;
|
|
942
|
+
}
|
|
943
|
+
var Heart = React.forwardRef(function (_ref, ref) {
|
|
944
|
+
var _ref$color = _ref.color,
|
|
945
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
946
|
+
_ref$size = _ref.size,
|
|
947
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
948
|
+
rest = _objectWithoutProperties$7(_ref, ["color", "size"]);
|
|
949
|
+
return /* @__PURE__ */React.createElement("svg", _extends$7({
|
|
950
|
+
ref: ref,
|
|
951
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
952
|
+
width: size,
|
|
953
|
+
height: size,
|
|
954
|
+
viewBox: "0 0 24 24",
|
|
955
|
+
fill: "none",
|
|
956
|
+
stroke: color,
|
|
957
|
+
strokeWidth: "2",
|
|
958
|
+
strokeLinecap: "round",
|
|
959
|
+
strokeLinejoin: "round"
|
|
960
|
+
}, rest), /* @__PURE__ */React.createElement("path", {
|
|
961
|
+
d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"
|
|
962
|
+
}));
|
|
963
|
+
});
|
|
964
|
+
Heart.propTypes = {
|
|
965
|
+
color: PropTypes.string,
|
|
966
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
967
|
+
};
|
|
968
|
+
Heart.displayName = "Heart";
|
|
969
|
+
function _extends$6() {
|
|
970
|
+
_extends$6 = Object.assign || function (target) {
|
|
971
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
972
|
+
var source = arguments[i];
|
|
973
|
+
for (var key in source) {
|
|
974
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
975
|
+
target[key] = source[key];
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return target;
|
|
980
|
+
};
|
|
981
|
+
return _extends$6.apply(this, arguments);
|
|
982
|
+
}
|
|
983
|
+
function _objectWithoutProperties$6(source, excluded) {
|
|
984
|
+
if (source == null) return {};
|
|
985
|
+
var target = _objectWithoutPropertiesLoose$6(source, excluded);
|
|
986
|
+
var key, i;
|
|
987
|
+
if (Object.getOwnPropertySymbols) {
|
|
988
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
989
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
990
|
+
key = sourceSymbolKeys[i];
|
|
991
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
992
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
993
|
+
target[key] = source[key];
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
return target;
|
|
997
|
+
}
|
|
998
|
+
function _objectWithoutPropertiesLoose$6(source, excluded) {
|
|
999
|
+
if (source == null) return {};
|
|
1000
|
+
var target = {};
|
|
1001
|
+
var sourceKeys = Object.keys(source);
|
|
1002
|
+
var key, i;
|
|
1003
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1004
|
+
key = sourceKeys[i];
|
|
1005
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1006
|
+
target[key] = source[key];
|
|
1007
|
+
}
|
|
1008
|
+
return target;
|
|
1009
|
+
}
|
|
1010
|
+
var MessageCircle = React.forwardRef(function (_ref, ref) {
|
|
1011
|
+
var _ref$color = _ref.color,
|
|
1012
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1013
|
+
_ref$size = _ref.size,
|
|
1014
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1015
|
+
rest = _objectWithoutProperties$6(_ref, ["color", "size"]);
|
|
1016
|
+
return /* @__PURE__ */React.createElement("svg", _extends$6({
|
|
1017
|
+
ref: ref,
|
|
1018
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1019
|
+
width: size,
|
|
1020
|
+
height: size,
|
|
1021
|
+
viewBox: "0 0 24 24",
|
|
1022
|
+
fill: "none",
|
|
1023
|
+
stroke: color,
|
|
1024
|
+
strokeWidth: "2",
|
|
1025
|
+
strokeLinecap: "round",
|
|
1026
|
+
strokeLinejoin: "round"
|
|
1027
|
+
}, rest), /* @__PURE__ */React.createElement("path", {
|
|
1028
|
+
d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"
|
|
1029
|
+
}));
|
|
1030
|
+
});
|
|
1031
|
+
MessageCircle.propTypes = {
|
|
1032
|
+
color: PropTypes.string,
|
|
1033
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1034
|
+
};
|
|
1035
|
+
MessageCircle.displayName = "MessageCircle";
|
|
1036
|
+
function _extends$5() {
|
|
1037
|
+
_extends$5 = Object.assign || function (target) {
|
|
1038
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1039
|
+
var source = arguments[i];
|
|
1040
|
+
for (var key in source) {
|
|
1041
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1042
|
+
target[key] = source[key];
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
return target;
|
|
1047
|
+
};
|
|
1048
|
+
return _extends$5.apply(this, arguments);
|
|
1049
|
+
}
|
|
1050
|
+
function _objectWithoutProperties$5(source, excluded) {
|
|
1051
|
+
if (source == null) return {};
|
|
1052
|
+
var target = _objectWithoutPropertiesLoose$5(source, excluded);
|
|
1053
|
+
var key, i;
|
|
1054
|
+
if (Object.getOwnPropertySymbols) {
|
|
1055
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1056
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1057
|
+
key = sourceSymbolKeys[i];
|
|
1058
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1059
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1060
|
+
target[key] = source[key];
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return target;
|
|
1064
|
+
}
|
|
1065
|
+
function _objectWithoutPropertiesLoose$5(source, excluded) {
|
|
1066
|
+
if (source == null) return {};
|
|
1067
|
+
var target = {};
|
|
1068
|
+
var sourceKeys = Object.keys(source);
|
|
1069
|
+
var key, i;
|
|
1070
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1071
|
+
key = sourceKeys[i];
|
|
1072
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1073
|
+
target[key] = source[key];
|
|
1074
|
+
}
|
|
1075
|
+
return target;
|
|
1076
|
+
}
|
|
1077
|
+
var MessageSquare = React.forwardRef(function (_ref, ref) {
|
|
1078
|
+
var _ref$color = _ref.color,
|
|
1079
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1080
|
+
_ref$size = _ref.size,
|
|
1081
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1082
|
+
rest = _objectWithoutProperties$5(_ref, ["color", "size"]);
|
|
1083
|
+
return /* @__PURE__ */React.createElement("svg", _extends$5({
|
|
1084
|
+
ref: ref,
|
|
1085
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1086
|
+
width: size,
|
|
1087
|
+
height: size,
|
|
1088
|
+
viewBox: "0 0 24 24",
|
|
1089
|
+
fill: "none",
|
|
1090
|
+
stroke: color,
|
|
1091
|
+
strokeWidth: "2",
|
|
1092
|
+
strokeLinecap: "round",
|
|
1093
|
+
strokeLinejoin: "round"
|
|
1094
|
+
}, rest), /* @__PURE__ */React.createElement("path", {
|
|
1095
|
+
d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"
|
|
1096
|
+
}));
|
|
1097
|
+
});
|
|
1098
|
+
MessageSquare.propTypes = {
|
|
1099
|
+
color: PropTypes.string,
|
|
1100
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1101
|
+
};
|
|
1102
|
+
MessageSquare.displayName = "MessageSquare";
|
|
1103
|
+
function _extends$4() {
|
|
1104
|
+
_extends$4 = Object.assign || function (target) {
|
|
1105
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1106
|
+
var source = arguments[i];
|
|
1107
|
+
for (var key in source) {
|
|
1108
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1109
|
+
target[key] = source[key];
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
return target;
|
|
1114
|
+
};
|
|
1115
|
+
return _extends$4.apply(this, arguments);
|
|
1116
|
+
}
|
|
1117
|
+
function _objectWithoutProperties$4(source, excluded) {
|
|
1118
|
+
if (source == null) return {};
|
|
1119
|
+
var target = _objectWithoutPropertiesLoose$4(source, excluded);
|
|
1120
|
+
var key, i;
|
|
1121
|
+
if (Object.getOwnPropertySymbols) {
|
|
1122
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1123
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1124
|
+
key = sourceSymbolKeys[i];
|
|
1125
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1126
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1127
|
+
target[key] = source[key];
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
return target;
|
|
1131
|
+
}
|
|
1132
|
+
function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
1133
|
+
if (source == null) return {};
|
|
1134
|
+
var target = {};
|
|
1135
|
+
var sourceKeys = Object.keys(source);
|
|
1136
|
+
var key, i;
|
|
1137
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1138
|
+
key = sourceKeys[i];
|
|
1139
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1140
|
+
target[key] = source[key];
|
|
1141
|
+
}
|
|
1142
|
+
return target;
|
|
1143
|
+
}
|
|
1144
|
+
var Scissors = React.forwardRef(function (_ref, ref) {
|
|
1145
|
+
var _ref$color = _ref.color,
|
|
1146
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1147
|
+
_ref$size = _ref.size,
|
|
1148
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1149
|
+
rest = _objectWithoutProperties$4(_ref, ["color", "size"]);
|
|
1150
|
+
return /* @__PURE__ */React.createElement("svg", _extends$4({
|
|
1151
|
+
ref: ref,
|
|
1152
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1153
|
+
width: size,
|
|
1154
|
+
height: size,
|
|
1155
|
+
viewBox: "0 0 24 24",
|
|
1156
|
+
fill: "none",
|
|
1157
|
+
stroke: color,
|
|
1158
|
+
strokeWidth: "2",
|
|
1159
|
+
strokeLinecap: "round",
|
|
1160
|
+
strokeLinejoin: "round"
|
|
1161
|
+
}, rest), /* @__PURE__ */React.createElement("circle", {
|
|
1162
|
+
cx: "6",
|
|
1163
|
+
cy: "6",
|
|
1164
|
+
r: "3"
|
|
1165
|
+
}), /* @__PURE__ */React.createElement("circle", {
|
|
1166
|
+
cx: "6",
|
|
1167
|
+
cy: "18",
|
|
1168
|
+
r: "3"
|
|
1169
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
1170
|
+
x1: "20",
|
|
1171
|
+
y1: "4",
|
|
1172
|
+
x2: "8.12",
|
|
1173
|
+
y2: "15.88"
|
|
1174
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
1175
|
+
x1: "14.47",
|
|
1176
|
+
y1: "14.48",
|
|
1177
|
+
x2: "20",
|
|
1178
|
+
y2: "20"
|
|
1179
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
1180
|
+
x1: "8.12",
|
|
1181
|
+
y1: "8.12",
|
|
1182
|
+
x2: "12",
|
|
1183
|
+
y2: "12"
|
|
1184
|
+
}));
|
|
1185
|
+
});
|
|
1186
|
+
Scissors.propTypes = {
|
|
1187
|
+
color: PropTypes.string,
|
|
1188
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1189
|
+
};
|
|
1190
|
+
Scissors.displayName = "Scissors";
|
|
1191
|
+
function _extends$3() {
|
|
1192
|
+
_extends$3 = Object.assign || function (target) {
|
|
1193
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1194
|
+
var source = arguments[i];
|
|
1195
|
+
for (var key in source) {
|
|
1196
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1197
|
+
target[key] = source[key];
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
return target;
|
|
1202
|
+
};
|
|
1203
|
+
return _extends$3.apply(this, arguments);
|
|
1204
|
+
}
|
|
1205
|
+
function _objectWithoutProperties$3(source, excluded) {
|
|
1206
|
+
if (source == null) return {};
|
|
1207
|
+
var target = _objectWithoutPropertiesLoose$3(source, excluded);
|
|
1208
|
+
var key, i;
|
|
1209
|
+
if (Object.getOwnPropertySymbols) {
|
|
1210
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1211
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1212
|
+
key = sourceSymbolKeys[i];
|
|
1213
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1214
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1215
|
+
target[key] = source[key];
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
return target;
|
|
1219
|
+
}
|
|
1220
|
+
function _objectWithoutPropertiesLoose$3(source, excluded) {
|
|
1221
|
+
if (source == null) return {};
|
|
1222
|
+
var target = {};
|
|
1223
|
+
var sourceKeys = Object.keys(source);
|
|
1224
|
+
var key, i;
|
|
1225
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1226
|
+
key = sourceKeys[i];
|
|
1227
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1228
|
+
target[key] = source[key];
|
|
1229
|
+
}
|
|
1230
|
+
return target;
|
|
1231
|
+
}
|
|
1232
|
+
var Settings = React.forwardRef(function (_ref, ref) {
|
|
1233
|
+
var _ref$color = _ref.color,
|
|
1234
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1235
|
+
_ref$size = _ref.size,
|
|
1236
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1237
|
+
rest = _objectWithoutProperties$3(_ref, ["color", "size"]);
|
|
1238
|
+
return /* @__PURE__ */React.createElement("svg", _extends$3({
|
|
1239
|
+
ref: ref,
|
|
1240
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1241
|
+
width: size,
|
|
1242
|
+
height: size,
|
|
1243
|
+
viewBox: "0 0 24 24",
|
|
1244
|
+
fill: "none",
|
|
1245
|
+
stroke: color,
|
|
1246
|
+
strokeWidth: "2",
|
|
1247
|
+
strokeLinecap: "round",
|
|
1248
|
+
strokeLinejoin: "round"
|
|
1249
|
+
}, rest), /* @__PURE__ */React.createElement("circle", {
|
|
1250
|
+
cx: "12",
|
|
1251
|
+
cy: "12",
|
|
1252
|
+
r: "3"
|
|
1253
|
+
}), /* @__PURE__ */React.createElement("path", {
|
|
1254
|
+
d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
1255
|
+
}));
|
|
1256
|
+
});
|
|
1257
|
+
Settings.propTypes = {
|
|
1258
|
+
color: PropTypes.string,
|
|
1259
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1260
|
+
};
|
|
1261
|
+
Settings.displayName = "Settings";
|
|
1262
|
+
function _extends$2() {
|
|
1263
|
+
_extends$2 = Object.assign || function (target) {
|
|
1264
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1265
|
+
var source = arguments[i];
|
|
1266
|
+
for (var key in source) {
|
|
1267
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1268
|
+
target[key] = source[key];
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
return target;
|
|
1273
|
+
};
|
|
1274
|
+
return _extends$2.apply(this, arguments);
|
|
1275
|
+
}
|
|
1276
|
+
function _objectWithoutProperties$2(source, excluded) {
|
|
1277
|
+
if (source == null) return {};
|
|
1278
|
+
var target = _objectWithoutPropertiesLoose$2(source, excluded);
|
|
1279
|
+
var key, i;
|
|
1280
|
+
if (Object.getOwnPropertySymbols) {
|
|
1281
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1282
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1283
|
+
key = sourceSymbolKeys[i];
|
|
1284
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1285
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1286
|
+
target[key] = source[key];
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
return target;
|
|
1290
|
+
}
|
|
1291
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
1292
|
+
if (source == null) return {};
|
|
1293
|
+
var target = {};
|
|
1294
|
+
var sourceKeys = Object.keys(source);
|
|
1295
|
+
var key, i;
|
|
1296
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1297
|
+
key = sourceKeys[i];
|
|
1298
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1299
|
+
target[key] = source[key];
|
|
1300
|
+
}
|
|
1301
|
+
return target;
|
|
1302
|
+
}
|
|
1303
|
+
var Smile = React.forwardRef(function (_ref, ref) {
|
|
1304
|
+
var _ref$color = _ref.color,
|
|
1305
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1306
|
+
_ref$size = _ref.size,
|
|
1307
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1308
|
+
rest = _objectWithoutProperties$2(_ref, ["color", "size"]);
|
|
1309
|
+
return /* @__PURE__ */React.createElement("svg", _extends$2({
|
|
1310
|
+
ref: ref,
|
|
1311
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1312
|
+
width: size,
|
|
1313
|
+
height: size,
|
|
1314
|
+
viewBox: "0 0 24 24",
|
|
1315
|
+
fill: "none",
|
|
1316
|
+
stroke: color,
|
|
1317
|
+
strokeWidth: "2",
|
|
1318
|
+
strokeLinecap: "round",
|
|
1319
|
+
strokeLinejoin: "round"
|
|
1320
|
+
}, rest), /* @__PURE__ */React.createElement("circle", {
|
|
1321
|
+
cx: "12",
|
|
1322
|
+
cy: "12",
|
|
1323
|
+
r: "10"
|
|
1324
|
+
}), /* @__PURE__ */React.createElement("path", {
|
|
1325
|
+
d: "M8 14s1.5 2 4 2 4-2 4-2"
|
|
1326
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
1327
|
+
x1: "9",
|
|
1328
|
+
y1: "9",
|
|
1329
|
+
x2: "9.01",
|
|
1330
|
+
y2: "9"
|
|
1331
|
+
}), /* @__PURE__ */React.createElement("line", {
|
|
1332
|
+
x1: "15",
|
|
1333
|
+
y1: "9",
|
|
1334
|
+
x2: "15.01",
|
|
1335
|
+
y2: "9"
|
|
1336
|
+
}));
|
|
1337
|
+
});
|
|
1338
|
+
Smile.propTypes = {
|
|
1339
|
+
color: PropTypes.string,
|
|
1340
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1341
|
+
};
|
|
1342
|
+
Smile.displayName = "Smile";
|
|
1343
|
+
function _extends$1() {
|
|
1344
|
+
_extends$1 = Object.assign || function (target) {
|
|
1345
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1346
|
+
var source = arguments[i];
|
|
1347
|
+
for (var key in source) {
|
|
1348
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1349
|
+
target[key] = source[key];
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
return target;
|
|
1354
|
+
};
|
|
1355
|
+
return _extends$1.apply(this, arguments);
|
|
1356
|
+
}
|
|
1357
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
1358
|
+
if (source == null) return {};
|
|
1359
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
1360
|
+
var key, i;
|
|
1361
|
+
if (Object.getOwnPropertySymbols) {
|
|
1362
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1363
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1364
|
+
key = sourceSymbolKeys[i];
|
|
1365
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1366
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1367
|
+
target[key] = source[key];
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
return target;
|
|
1371
|
+
}
|
|
1372
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
1373
|
+
if (source == null) return {};
|
|
1374
|
+
var target = {};
|
|
1375
|
+
var sourceKeys = Object.keys(source);
|
|
1376
|
+
var key, i;
|
|
1377
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1378
|
+
key = sourceKeys[i];
|
|
1379
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1380
|
+
target[key] = source[key];
|
|
1381
|
+
}
|
|
1382
|
+
return target;
|
|
1383
|
+
}
|
|
1384
|
+
var ThumbsUp = React.forwardRef(function (_ref, ref) {
|
|
1385
|
+
var _ref$color = _ref.color,
|
|
1386
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1387
|
+
_ref$size = _ref.size,
|
|
1388
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1389
|
+
rest = _objectWithoutProperties$1(_ref, ["color", "size"]);
|
|
1390
|
+
return /* @__PURE__ */React.createElement("svg", _extends$1({
|
|
1391
|
+
ref: ref,
|
|
1392
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1393
|
+
width: size,
|
|
1394
|
+
height: size,
|
|
1395
|
+
viewBox: "0 0 24 24",
|
|
1396
|
+
fill: "none",
|
|
1397
|
+
stroke: color,
|
|
1398
|
+
strokeWidth: "2",
|
|
1399
|
+
strokeLinecap: "round",
|
|
1400
|
+
strokeLinejoin: "round"
|
|
1401
|
+
}, rest), /* @__PURE__ */React.createElement("path", {
|
|
1402
|
+
d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
|
|
1403
|
+
}));
|
|
1404
|
+
});
|
|
1405
|
+
ThumbsUp.propTypes = {
|
|
1406
|
+
color: PropTypes.string,
|
|
1407
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1408
|
+
};
|
|
1409
|
+
ThumbsUp.displayName = "ThumbsUp";
|
|
1410
|
+
function _extends() {
|
|
1411
|
+
_extends = Object.assign || function (target) {
|
|
1412
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1413
|
+
var source = arguments[i];
|
|
1414
|
+
for (var key in source) {
|
|
1415
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1416
|
+
target[key] = source[key];
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
return target;
|
|
1421
|
+
};
|
|
1422
|
+
return _extends.apply(this, arguments);
|
|
1423
|
+
}
|
|
1424
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1425
|
+
if (source == null) return {};
|
|
1426
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1427
|
+
var key, i;
|
|
1428
|
+
if (Object.getOwnPropertySymbols) {
|
|
1429
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1430
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1431
|
+
key = sourceSymbolKeys[i];
|
|
1432
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1433
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1434
|
+
target[key] = source[key];
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
return target;
|
|
1438
|
+
}
|
|
1439
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1440
|
+
if (source == null) return {};
|
|
1441
|
+
var target = {};
|
|
1442
|
+
var sourceKeys = Object.keys(source);
|
|
1443
|
+
var key, i;
|
|
1444
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1445
|
+
key = sourceKeys[i];
|
|
1446
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1447
|
+
target[key] = source[key];
|
|
1448
|
+
}
|
|
1449
|
+
return target;
|
|
1450
|
+
}
|
|
1451
|
+
var Zap = React.forwardRef(function (_ref, ref) {
|
|
1452
|
+
var _ref$color = _ref.color,
|
|
1453
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
1454
|
+
_ref$size = _ref.size,
|
|
1455
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1456
|
+
rest = _objectWithoutProperties(_ref, ["color", "size"]);
|
|
1457
|
+
return /* @__PURE__ */React.createElement("svg", _extends({
|
|
1458
|
+
ref: ref,
|
|
1459
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1460
|
+
width: size,
|
|
1461
|
+
height: size,
|
|
1462
|
+
viewBox: "0 0 24 24",
|
|
1463
|
+
fill: "none",
|
|
1464
|
+
stroke: color,
|
|
1465
|
+
strokeWidth: "2",
|
|
1466
|
+
strokeLinecap: "round",
|
|
1467
|
+
strokeLinejoin: "round"
|
|
1468
|
+
}, rest), /* @__PURE__ */React.createElement("polygon", {
|
|
1469
|
+
points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2"
|
|
1470
|
+
}));
|
|
1471
|
+
});
|
|
1472
|
+
Zap.propTypes = {
|
|
1473
|
+
color: PropTypes.string,
|
|
1474
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
1475
|
+
};
|
|
1476
|
+
Zap.displayName = "Zap";
|
|
1477
|
+
var SDKConfig = {
|
|
1478
|
+
baseUrl: "V3",
|
|
1479
|
+
signer: null
|
|
1480
|
+
};
|
|
1481
|
+
var initHanbiroReactSDK = function initHanbiroReactSDK(_ref2) {
|
|
1482
|
+
var baseUrl = _ref2.baseUrl,
|
|
1483
|
+
signer = _ref2.signer;
|
|
1484
|
+
SDKConfig.baseUrl = baseUrl;
|
|
1485
|
+
SDKConfig.signer = signer;
|
|
1486
|
+
};
|
|
1487
|
+
var checkDevelopment = function checkDevelopment() {
|
|
1488
|
+
var locationInfo = window.location;
|
|
1489
|
+
var hostname = locationInfo.hostname;
|
|
1490
|
+
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
1491
|
+
return true;
|
|
1492
|
+
} else {
|
|
1493
|
+
return false;
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
var isDevelopment = checkDevelopment();
|
|
1497
|
+
var getBaseUrl = function getBaseUrl() {
|
|
1498
|
+
var _a2;
|
|
1499
|
+
var locationInfo = window.location;
|
|
1500
|
+
var host = locationInfo.host;
|
|
1501
|
+
if (isDevelopment) {
|
|
1502
|
+
var baseUrlArr = (_a2 = SDKConfig.baseUrl) == null ? void 0 : _a2.split("/");
|
|
1503
|
+
if (baseUrlArr) {
|
|
1504
|
+
return "https://" + (baseUrlArr == null ? void 0 : baseUrlArr[2]);
|
|
1505
|
+
} else {
|
|
1506
|
+
return "https://vndev.hanbiro.com";
|
|
1507
|
+
}
|
|
1508
|
+
} else {
|
|
1509
|
+
var data = localStorage.getItem("host") || host;
|
|
1510
|
+
var dataArr = data == null ? void 0 : data.split("/");
|
|
1511
|
+
return "https://" + (dataArr == null ? void 0 : dataArr[0]);
|
|
1512
|
+
}
|
|
1513
|
+
};
|
|
1514
|
+
var getGroupwareUrl = function getGroupwareUrl() {
|
|
1515
|
+
var locationInfo = window.location;
|
|
1516
|
+
if (isDevelopment) {
|
|
1517
|
+
return getBaseUrl() || "https://vndev.hanbiro.com/ngw";
|
|
1518
|
+
} else {
|
|
1519
|
+
if (window.location !== window.parent.location) {
|
|
1520
|
+
locationInfo = window.parent.location;
|
|
1521
|
+
}
|
|
1522
|
+
var _locationInfo = locationInfo,
|
|
1523
|
+
hostname = _locationInfo.hostname,
|
|
1524
|
+
protocol = _locationInfo.protocol;
|
|
1525
|
+
return [protocol, "//", hostname, "/ngw"].join("");
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
function callAI(_0, _1) {
|
|
1529
|
+
return __async(this, arguments, function (params, _ref3) {
|
|
1530
|
+
var setContent = _ref3.setContent,
|
|
1531
|
+
setIsLoading = _ref3.setIsLoading,
|
|
1532
|
+
setConversationId = _ref3.setConversationId;
|
|
1533
|
+
return /*#__PURE__*/_regenerator().m(function _callee() {
|
|
1534
|
+
var currentContent, baseUrl, config, sigHeaders, signer, response, reader, fullContentDecode, readIndex, _yield$reader$read, done, value, originStr, jsonFormat, contentDecode, contentRegex, conversationIdRegex, matchArray, conversationIdmatch, _regMatchItem, nVal, decoded, _t;
|
|
570
1535
|
return _regenerator().w(function (_context) {
|
|
571
1536
|
while (1) switch (_context.p = _context.n) {
|
|
572
1537
|
case 0:
|
|
@@ -999,15 +1964,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
999
1964
|
return -1;
|
|
1000
1965
|
}
|
|
1001
1966
|
var level = 0;
|
|
1002
|
-
for (var
|
|
1003
|
-
if (str[
|
|
1004
|
-
|
|
1005
|
-
} else if (str[
|
|
1967
|
+
for (var _i = 0; _i < str.length; _i++) {
|
|
1968
|
+
if (str[_i] === "\\") {
|
|
1969
|
+
_i++;
|
|
1970
|
+
} else if (str[_i] === b[0]) {
|
|
1006
1971
|
level++;
|
|
1007
|
-
} else if (str[
|
|
1972
|
+
} else if (str[_i] === b[1]) {
|
|
1008
1973
|
level--;
|
|
1009
1974
|
if (level < 0) {
|
|
1010
|
-
return
|
|
1975
|
+
return _i;
|
|
1011
1976
|
}
|
|
1012
1977
|
}
|
|
1013
1978
|
}
|
|
@@ -1147,18 +2112,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1147
2112
|
while (lines.length > 0) {
|
|
1148
2113
|
var inBlockquote = false;
|
|
1149
2114
|
var currentLines = [];
|
|
1150
|
-
var
|
|
1151
|
-
for (
|
|
1152
|
-
if (this.rules.other.blockquoteStart.test(lines[
|
|
1153
|
-
currentLines.push(lines[
|
|
2115
|
+
var _i2 = void 0;
|
|
2116
|
+
for (_i2 = 0; _i2 < lines.length; _i2++) {
|
|
2117
|
+
if (this.rules.other.blockquoteStart.test(lines[_i2])) {
|
|
2118
|
+
currentLines.push(lines[_i2]);
|
|
1154
2119
|
inBlockquote = true;
|
|
1155
2120
|
} else if (!inBlockquote) {
|
|
1156
|
-
currentLines.push(lines[
|
|
2121
|
+
currentLines.push(lines[_i2]);
|
|
1157
2122
|
} else {
|
|
1158
2123
|
break;
|
|
1159
2124
|
}
|
|
1160
2125
|
}
|
|
1161
|
-
lines = lines.slice(
|
|
2126
|
+
lines = lines.slice(_i2);
|
|
1162
2127
|
var currentRaw = currentLines.join("\n");
|
|
1163
2128
|
var currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1164
2129
|
raw = raw ? "".concat(raw, "\n").concat(currentRaw) : currentRaw;
|
|
@@ -1203,7 +2168,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1203
2168
|
}, {
|
|
1204
2169
|
key: "list",
|
|
1205
2170
|
value: function list(src) {
|
|
1206
|
-
var
|
|
2171
|
+
var _this = this;
|
|
1207
2172
|
var cap = this.rules.block.list.exec(src);
|
|
1208
2173
|
if (cap) {
|
|
1209
2174
|
var bull = cap[1].trim();
|
|
@@ -1350,22 +2315,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1350
2315
|
return;
|
|
1351
2316
|
}
|
|
1352
2317
|
list2.raw = list2.raw.trimEnd();
|
|
1353
|
-
for (var
|
|
2318
|
+
for (var _i3 = 0; _i3 < list2.items.length; _i3++) {
|
|
1354
2319
|
this.lexer.state.top = false;
|
|
1355
|
-
list2.items[
|
|
2320
|
+
list2.items[_i3].tokens = this.lexer.blockTokens(list2.items[_i3].text, []);
|
|
1356
2321
|
if (!list2.loose) {
|
|
1357
|
-
var spacers = list2.items[
|
|
2322
|
+
var spacers = list2.items[_i3].tokens.filter(function (t) {
|
|
1358
2323
|
return t.type === "space";
|
|
1359
2324
|
});
|
|
1360
2325
|
var hasMultipleLineBreaks = spacers.length > 0 && spacers.some(function (t) {
|
|
1361
|
-
return
|
|
2326
|
+
return _this.rules.other.anyLine.test(t.raw);
|
|
1362
2327
|
});
|
|
1363
2328
|
list2.loose = hasMultipleLineBreaks;
|
|
1364
2329
|
}
|
|
1365
2330
|
}
|
|
1366
2331
|
if (list2.loose) {
|
|
1367
|
-
for (var
|
|
1368
|
-
list2.items[
|
|
2332
|
+
for (var _i4 = 0; _i4 < list2.items.length; _i4++) {
|
|
2333
|
+
list2.items[_i4].loose = true;
|
|
1369
2334
|
}
|
|
1370
2335
|
}
|
|
1371
2336
|
return list2;
|
|
@@ -1406,7 +2371,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1406
2371
|
}, {
|
|
1407
2372
|
key: "table",
|
|
1408
2373
|
value: function table(src) {
|
|
1409
|
-
var
|
|
2374
|
+
var _this2 = this;
|
|
1410
2375
|
var _a2;
|
|
1411
2376
|
var cap = this.rules.block.table.exec(src);
|
|
1412
2377
|
if (!cap) {
|
|
@@ -1448,12 +2413,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1448
2413
|
} finally {
|
|
1449
2414
|
_iterator3.f();
|
|
1450
2415
|
}
|
|
1451
|
-
for (var
|
|
2416
|
+
for (var _i5 = 0; _i5 < headers.length; _i5++) {
|
|
1452
2417
|
item.header.push({
|
|
1453
|
-
text: headers[
|
|
1454
|
-
tokens: this.lexer.inline(headers[
|
|
2418
|
+
text: headers[_i5],
|
|
2419
|
+
tokens: this.lexer.inline(headers[_i5]),
|
|
1455
2420
|
header: true,
|
|
1456
|
-
align: item.align[
|
|
2421
|
+
align: item.align[_i5]
|
|
1457
2422
|
});
|
|
1458
2423
|
}
|
|
1459
2424
|
var _iterator4 = _createForOfIteratorHelper(rows),
|
|
@@ -1464,7 +2429,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1464
2429
|
item.rows.push(splitCells(row, item.header.length).map(function (cell, i) {
|
|
1465
2430
|
return {
|
|
1466
2431
|
text: cell,
|
|
1467
|
-
tokens:
|
|
2432
|
+
tokens: _this2.lexer.inline(cell),
|
|
1468
2433
|
header: false,
|
|
1469
2434
|
align: item.align[i]
|
|
1470
2435
|
};
|
|
@@ -1850,8 +2815,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1850
2815
|
function lex(src) {
|
|
1851
2816
|
src = src.replace(other.carriageReturn, "\n");
|
|
1852
2817
|
this.blockTokens(src, this.tokens);
|
|
1853
|
-
for (var
|
|
1854
|
-
var next = this.inlineQueue[
|
|
2818
|
+
for (var _i6 = 0; _i6 < this.inlineQueue.length; _i6++) {
|
|
2819
|
+
var next = this.inlineQueue[_i6];
|
|
1855
2820
|
this.inlineTokens(next.src, next.tokens);
|
|
1856
2821
|
}
|
|
1857
2822
|
this.inlineQueue = [];
|
|
@@ -1860,7 +2825,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1860
2825
|
}, {
|
|
1861
2826
|
key: "blockTokens",
|
|
1862
2827
|
value: function blockTokens(src) {
|
|
1863
|
-
var
|
|
2828
|
+
var _this3 = this;
|
|
1864
2829
|
var tokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
1865
2830
|
var lastParagraphClipped = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1866
2831
|
var _a2, _b, _c;
|
|
@@ -1869,9 +2834,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1869
2834
|
}
|
|
1870
2835
|
var _loop2 = function _loop2() {
|
|
1871
2836
|
var token;
|
|
1872
|
-
if ((_b = (_a2 =
|
|
2837
|
+
if ((_b = (_a2 = _this3.options.extensions) == null ? void 0 : _a2.block) == null ? void 0 : _b.some(function (extTokenizer) {
|
|
1873
2838
|
if (token = extTokenizer.call({
|
|
1874
|
-
lexer:
|
|
2839
|
+
lexer: _this3
|
|
1875
2840
|
}, src, tokens)) {
|
|
1876
2841
|
src = src.substring(token.raw.length);
|
|
1877
2842
|
tokens.push(token);
|
|
@@ -1881,7 +2846,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1881
2846
|
})) {
|
|
1882
2847
|
return 0; // continue
|
|
1883
2848
|
}
|
|
1884
|
-
if (token =
|
|
2849
|
+
if (token = _this3.tokenizer.space(src)) {
|
|
1885
2850
|
src = src.substring(token.raw.length);
|
|
1886
2851
|
var lastToken = tokens.at(-1);
|
|
1887
2852
|
if (token.raw.length === 1 && lastToken !== void 0) {
|
|
@@ -1891,81 +2856,81 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1891
2856
|
}
|
|
1892
2857
|
return 0; // continue
|
|
1893
2858
|
}
|
|
1894
|
-
if (token =
|
|
2859
|
+
if (token = _this3.tokenizer.code(src)) {
|
|
1895
2860
|
src = src.substring(token.raw.length);
|
|
1896
2861
|
var _lastToken = tokens.at(-1);
|
|
1897
2862
|
if ((_lastToken == null ? void 0 : _lastToken.type) === "paragraph" || (_lastToken == null ? void 0 : _lastToken.type) === "text") {
|
|
1898
2863
|
_lastToken.raw += "\n" + token.raw;
|
|
1899
2864
|
_lastToken.text += "\n" + token.text;
|
|
1900
|
-
|
|
2865
|
+
_this3.inlineQueue.at(-1).src = _lastToken.text;
|
|
1901
2866
|
} else {
|
|
1902
2867
|
tokens.push(token);
|
|
1903
2868
|
}
|
|
1904
2869
|
return 0; // continue
|
|
1905
2870
|
}
|
|
1906
|
-
if (token =
|
|
2871
|
+
if (token = _this3.tokenizer.fences(src)) {
|
|
1907
2872
|
src = src.substring(token.raw.length);
|
|
1908
2873
|
tokens.push(token);
|
|
1909
2874
|
return 0; // continue
|
|
1910
2875
|
}
|
|
1911
|
-
if (token =
|
|
2876
|
+
if (token = _this3.tokenizer.heading(src)) {
|
|
1912
2877
|
src = src.substring(token.raw.length);
|
|
1913
2878
|
tokens.push(token);
|
|
1914
2879
|
return 0; // continue
|
|
1915
2880
|
}
|
|
1916
|
-
if (token =
|
|
2881
|
+
if (token = _this3.tokenizer.hr(src)) {
|
|
1917
2882
|
src = src.substring(token.raw.length);
|
|
1918
2883
|
tokens.push(token);
|
|
1919
2884
|
return 0; // continue
|
|
1920
2885
|
}
|
|
1921
|
-
if (token =
|
|
2886
|
+
if (token = _this3.tokenizer.blockquote(src)) {
|
|
1922
2887
|
src = src.substring(token.raw.length);
|
|
1923
2888
|
tokens.push(token);
|
|
1924
2889
|
return 0; // continue
|
|
1925
2890
|
}
|
|
1926
|
-
if (token =
|
|
2891
|
+
if (token = _this3.tokenizer.list(src)) {
|
|
1927
2892
|
src = src.substring(token.raw.length);
|
|
1928
2893
|
tokens.push(token);
|
|
1929
2894
|
return 0; // continue
|
|
1930
2895
|
}
|
|
1931
|
-
if (token =
|
|
2896
|
+
if (token = _this3.tokenizer.html(src)) {
|
|
1932
2897
|
src = src.substring(token.raw.length);
|
|
1933
2898
|
tokens.push(token);
|
|
1934
2899
|
return 0; // continue
|
|
1935
2900
|
}
|
|
1936
|
-
if (token =
|
|
2901
|
+
if (token = _this3.tokenizer.def(src)) {
|
|
1937
2902
|
src = src.substring(token.raw.length);
|
|
1938
2903
|
var _lastToken2 = tokens.at(-1);
|
|
1939
2904
|
if ((_lastToken2 == null ? void 0 : _lastToken2.type) === "paragraph" || (_lastToken2 == null ? void 0 : _lastToken2.type) === "text") {
|
|
1940
2905
|
_lastToken2.raw += "\n" + token.raw;
|
|
1941
2906
|
_lastToken2.text += "\n" + token.raw;
|
|
1942
|
-
|
|
1943
|
-
} else if (!
|
|
1944
|
-
|
|
2907
|
+
_this3.inlineQueue.at(-1).src = _lastToken2.text;
|
|
2908
|
+
} else if (!_this3.tokens.links[token.tag]) {
|
|
2909
|
+
_this3.tokens.links[token.tag] = {
|
|
1945
2910
|
href: token.href,
|
|
1946
2911
|
title: token.title
|
|
1947
2912
|
};
|
|
1948
2913
|
}
|
|
1949
2914
|
return 0; // continue
|
|
1950
2915
|
}
|
|
1951
|
-
if (token =
|
|
2916
|
+
if (token = _this3.tokenizer.table(src)) {
|
|
1952
2917
|
src = src.substring(token.raw.length);
|
|
1953
2918
|
tokens.push(token);
|
|
1954
2919
|
return 0; // continue
|
|
1955
2920
|
}
|
|
1956
|
-
if (token =
|
|
2921
|
+
if (token = _this3.tokenizer.lheading(src)) {
|
|
1957
2922
|
src = src.substring(token.raw.length);
|
|
1958
2923
|
tokens.push(token);
|
|
1959
2924
|
return 0; // continue
|
|
1960
2925
|
}
|
|
1961
2926
|
var cutSrc = src;
|
|
1962
|
-
if ((_c =
|
|
2927
|
+
if ((_c = _this3.options.extensions) == null ? void 0 : _c.startBlock) {
|
|
1963
2928
|
var startIndex = Infinity;
|
|
1964
2929
|
var tempSrc = src.slice(1);
|
|
1965
2930
|
var tempStart;
|
|
1966
|
-
|
|
2931
|
+
_this3.options.extensions.startBlock.forEach(function (getStartIndex) {
|
|
1967
2932
|
tempStart = getStartIndex.call({
|
|
1968
|
-
lexer:
|
|
2933
|
+
lexer: _this3
|
|
1969
2934
|
}, tempSrc);
|
|
1970
2935
|
if (typeof tempStart === "number" && tempStart >= 0) {
|
|
1971
2936
|
startIndex = Math.min(startIndex, tempStart);
|
|
@@ -1975,13 +2940,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1975
2940
|
cutSrc = src.substring(0, startIndex + 1);
|
|
1976
2941
|
}
|
|
1977
2942
|
}
|
|
1978
|
-
if (
|
|
2943
|
+
if (_this3.state.top && (token = _this3.tokenizer.paragraph(cutSrc))) {
|
|
1979
2944
|
var _lastToken3 = tokens.at(-1);
|
|
1980
2945
|
if (lastParagraphClipped && (_lastToken3 == null ? void 0 : _lastToken3.type) === "paragraph") {
|
|
1981
2946
|
_lastToken3.raw += "\n" + token.raw;
|
|
1982
2947
|
_lastToken3.text += "\n" + token.text;
|
|
1983
|
-
|
|
1984
|
-
|
|
2948
|
+
_this3.inlineQueue.pop();
|
|
2949
|
+
_this3.inlineQueue.at(-1).src = _lastToken3.text;
|
|
1985
2950
|
} else {
|
|
1986
2951
|
tokens.push(token);
|
|
1987
2952
|
}
|
|
@@ -1989,14 +2954,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1989
2954
|
src = src.substring(token.raw.length);
|
|
1990
2955
|
return 0; // continue
|
|
1991
2956
|
}
|
|
1992
|
-
if (token =
|
|
2957
|
+
if (token = _this3.tokenizer.text(src)) {
|
|
1993
2958
|
src = src.substring(token.raw.length);
|
|
1994
2959
|
var _lastToken4 = tokens.at(-1);
|
|
1995
2960
|
if ((_lastToken4 == null ? void 0 : _lastToken4.type) === "text") {
|
|
1996
2961
|
_lastToken4.raw += "\n" + token.raw;
|
|
1997
2962
|
_lastToken4.text += "\n" + token.text;
|
|
1998
|
-
|
|
1999
|
-
|
|
2963
|
+
_this3.inlineQueue.pop();
|
|
2964
|
+
_this3.inlineQueue.at(-1).src = _lastToken4.text;
|
|
2000
2965
|
} else {
|
|
2001
2966
|
tokens.push(token);
|
|
2002
2967
|
}
|
|
@@ -2004,7 +2969,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2004
2969
|
}
|
|
2005
2970
|
if (src) {
|
|
2006
2971
|
var errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
|
|
2007
|
-
if (
|
|
2972
|
+
if (_this3.options.silent) {
|
|
2008
2973
|
console.error(errMsg);
|
|
2009
2974
|
return 1; // break
|
|
2010
2975
|
} else {
|
|
@@ -2037,7 +3002,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2037
3002
|
}, {
|
|
2038
3003
|
key: "inlineTokens",
|
|
2039
3004
|
value: function inlineTokens(src) {
|
|
2040
|
-
var
|
|
3005
|
+
var _this4 = this;
|
|
2041
3006
|
var tokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
2042
3007
|
var _a2, _b, _c;
|
|
2043
3008
|
var maskedSrc = src;
|
|
@@ -2066,9 +3031,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2066
3031
|
}
|
|
2067
3032
|
keepPrevChar = false;
|
|
2068
3033
|
var token;
|
|
2069
|
-
if ((_b = (_a2 =
|
|
3034
|
+
if ((_b = (_a2 = _this4.options.extensions) == null ? void 0 : _a2.inline) == null ? void 0 : _b.some(function (extTokenizer) {
|
|
2070
3035
|
if (token = extTokenizer.call({
|
|
2071
|
-
lexer:
|
|
3036
|
+
lexer: _this4
|
|
2072
3037
|
}, src, tokens)) {
|
|
2073
3038
|
src = src.substring(token.raw.length);
|
|
2074
3039
|
tokens.push(token);
|
|
@@ -2078,22 +3043,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2078
3043
|
})) {
|
|
2079
3044
|
return 0; // continue
|
|
2080
3045
|
}
|
|
2081
|
-
if (token =
|
|
3046
|
+
if (token = _this4.tokenizer.escape(src)) {
|
|
2082
3047
|
src = src.substring(token.raw.length);
|
|
2083
3048
|
tokens.push(token);
|
|
2084
3049
|
return 0; // continue
|
|
2085
3050
|
}
|
|
2086
|
-
if (token =
|
|
3051
|
+
if (token = _this4.tokenizer.tag(src)) {
|
|
2087
3052
|
src = src.substring(token.raw.length);
|
|
2088
3053
|
tokens.push(token);
|
|
2089
3054
|
return 0; // continue
|
|
2090
3055
|
}
|
|
2091
|
-
if (token =
|
|
3056
|
+
if (token = _this4.tokenizer.link(src)) {
|
|
2092
3057
|
src = src.substring(token.raw.length);
|
|
2093
3058
|
tokens.push(token);
|
|
2094
3059
|
return 0; // continue
|
|
2095
3060
|
}
|
|
2096
|
-
if (token =
|
|
3061
|
+
if (token = _this4.tokenizer.reflink(src, _this4.tokens.links)) {
|
|
2097
3062
|
src = src.substring(token.raw.length);
|
|
2098
3063
|
var lastToken = tokens.at(-1);
|
|
2099
3064
|
if (token.type === "text" && (lastToken == null ? void 0 : lastToken.type) === "text") {
|
|
@@ -2104,44 +3069,44 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2104
3069
|
}
|
|
2105
3070
|
return 0; // continue
|
|
2106
3071
|
}
|
|
2107
|
-
if (token =
|
|
3072
|
+
if (token = _this4.tokenizer.emStrong(src, maskedSrc, prevChar)) {
|
|
2108
3073
|
src = src.substring(token.raw.length);
|
|
2109
3074
|
tokens.push(token);
|
|
2110
3075
|
return 0; // continue
|
|
2111
3076
|
}
|
|
2112
|
-
if (token =
|
|
3077
|
+
if (token = _this4.tokenizer.codespan(src)) {
|
|
2113
3078
|
src = src.substring(token.raw.length);
|
|
2114
3079
|
tokens.push(token);
|
|
2115
3080
|
return 0; // continue
|
|
2116
3081
|
}
|
|
2117
|
-
if (token =
|
|
3082
|
+
if (token = _this4.tokenizer.br(src)) {
|
|
2118
3083
|
src = src.substring(token.raw.length);
|
|
2119
3084
|
tokens.push(token);
|
|
2120
3085
|
return 0; // continue
|
|
2121
3086
|
}
|
|
2122
|
-
if (token =
|
|
3087
|
+
if (token = _this4.tokenizer.del(src)) {
|
|
2123
3088
|
src = src.substring(token.raw.length);
|
|
2124
3089
|
tokens.push(token);
|
|
2125
3090
|
return 0; // continue
|
|
2126
3091
|
}
|
|
2127
|
-
if (token =
|
|
3092
|
+
if (token = _this4.tokenizer.autolink(src)) {
|
|
2128
3093
|
src = src.substring(token.raw.length);
|
|
2129
3094
|
tokens.push(token);
|
|
2130
3095
|
return 0; // continue
|
|
2131
3096
|
}
|
|
2132
|
-
if (!
|
|
3097
|
+
if (!_this4.state.inLink && (token = _this4.tokenizer.url(src))) {
|
|
2133
3098
|
src = src.substring(token.raw.length);
|
|
2134
3099
|
tokens.push(token);
|
|
2135
3100
|
return 0; // continue
|
|
2136
3101
|
}
|
|
2137
3102
|
var cutSrc = src;
|
|
2138
|
-
if ((_c =
|
|
3103
|
+
if ((_c = _this4.options.extensions) == null ? void 0 : _c.startInline) {
|
|
2139
3104
|
var startIndex = Infinity;
|
|
2140
3105
|
var tempSrc = src.slice(1);
|
|
2141
3106
|
var tempStart;
|
|
2142
|
-
|
|
3107
|
+
_this4.options.extensions.startInline.forEach(function (getStartIndex) {
|
|
2143
3108
|
tempStart = getStartIndex.call({
|
|
2144
|
-
lexer:
|
|
3109
|
+
lexer: _this4
|
|
2145
3110
|
}, tempSrc);
|
|
2146
3111
|
if (typeof tempStart === "number" && tempStart >= 0) {
|
|
2147
3112
|
startIndex = Math.min(startIndex, tempStart);
|
|
@@ -2151,7 +3116,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2151
3116
|
cutSrc = src.substring(0, startIndex + 1);
|
|
2152
3117
|
}
|
|
2153
3118
|
}
|
|
2154
|
-
if (token =
|
|
3119
|
+
if (token = _this4.tokenizer.inlineText(cutSrc)) {
|
|
2155
3120
|
src = src.substring(token.raw.length);
|
|
2156
3121
|
if (token.raw.slice(-1) !== "_") {
|
|
2157
3122
|
prevChar = token.raw.slice(-1);
|
|
@@ -2168,7 +3133,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2168
3133
|
}
|
|
2169
3134
|
if (src) {
|
|
2170
3135
|
var errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
|
|
2171
|
-
if (
|
|
3136
|
+
if (_this4.options.silent) {
|
|
2172
3137
|
console.error(errMsg);
|
|
2173
3138
|
return 1; // break
|
|
2174
3139
|
} else {
|
|
@@ -2227,10 +3192,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2227
3192
|
}
|
|
2228
3193
|
}, {
|
|
2229
3194
|
key: "code",
|
|
2230
|
-
value: function code(
|
|
2231
|
-
var text =
|
|
2232
|
-
lang =
|
|
2233
|
-
escaped =
|
|
3195
|
+
value: function code(_ref4) {
|
|
3196
|
+
var text = _ref4.text,
|
|
3197
|
+
lang = _ref4.lang,
|
|
3198
|
+
escaped = _ref4.escaped;
|
|
2234
3199
|
var _a2;
|
|
2235
3200
|
var langString = (_a2 = (lang || "").match(other.notSpaceStart)) == null ? void 0 : _a2[0];
|
|
2236
3201
|
var code = text.replace(other.endingNewline, "") + "\n";
|
|
@@ -2241,22 +3206,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2241
3206
|
}
|
|
2242
3207
|
}, {
|
|
2243
3208
|
key: "blockquote",
|
|
2244
|
-
value: function blockquote(
|
|
2245
|
-
var tokens =
|
|
3209
|
+
value: function blockquote(_ref5) {
|
|
3210
|
+
var tokens = _ref5.tokens;
|
|
2246
3211
|
var body = this.parser.parse(tokens);
|
|
2247
3212
|
return "<blockquote>\n".concat(body, "</blockquote>\n");
|
|
2248
3213
|
}
|
|
2249
3214
|
}, {
|
|
2250
3215
|
key: "html",
|
|
2251
|
-
value: function html(
|
|
2252
|
-
var text =
|
|
3216
|
+
value: function html(_ref6) {
|
|
3217
|
+
var text = _ref6.text;
|
|
2253
3218
|
return text;
|
|
2254
3219
|
}
|
|
2255
3220
|
}, {
|
|
2256
3221
|
key: "heading",
|
|
2257
|
-
value: function heading(
|
|
2258
|
-
var tokens =
|
|
2259
|
-
depth =
|
|
3222
|
+
value: function heading(_ref7) {
|
|
3223
|
+
var tokens = _ref7.tokens,
|
|
3224
|
+
depth = _ref7.depth;
|
|
2260
3225
|
return "<h".concat(depth, ">").concat(this.parser.parseInline(tokens), "</h").concat(depth, ">\n");
|
|
2261
3226
|
}
|
|
2262
3227
|
}, {
|
|
@@ -2311,14 +3276,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2311
3276
|
}
|
|
2312
3277
|
}, {
|
|
2313
3278
|
key: "checkbox",
|
|
2314
|
-
value: function checkbox(
|
|
2315
|
-
var checked =
|
|
3279
|
+
value: function checkbox(_ref8) {
|
|
3280
|
+
var checked = _ref8.checked;
|
|
2316
3281
|
return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
|
|
2317
3282
|
}
|
|
2318
3283
|
}, {
|
|
2319
3284
|
key: "paragraph",
|
|
2320
|
-
value: function paragraph(
|
|
2321
|
-
var tokens =
|
|
3285
|
+
value: function paragraph(_ref9) {
|
|
3286
|
+
var tokens = _ref9.tokens;
|
|
2322
3287
|
return "<p>".concat(this.parser.parseInline(tokens), "</p>\n");
|
|
2323
3288
|
}
|
|
2324
3289
|
}, {
|
|
@@ -2348,8 +3313,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2348
3313
|
}
|
|
2349
3314
|
}, {
|
|
2350
3315
|
key: "tablerow",
|
|
2351
|
-
value: function tablerow(
|
|
2352
|
-
var text =
|
|
3316
|
+
value: function tablerow(_ref0) {
|
|
3317
|
+
var text = _ref0.text;
|
|
2353
3318
|
return "<tr>\n".concat(text, "</tr>\n");
|
|
2354
3319
|
}
|
|
2355
3320
|
}, {
|
|
@@ -2365,20 +3330,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2365
3330
|
*/
|
|
2366
3331
|
}, {
|
|
2367
3332
|
key: "strong",
|
|
2368
|
-
value: function strong(
|
|
2369
|
-
var tokens =
|
|
3333
|
+
value: function strong(_ref1) {
|
|
3334
|
+
var tokens = _ref1.tokens;
|
|
2370
3335
|
return "<strong>".concat(this.parser.parseInline(tokens), "</strong>");
|
|
2371
3336
|
}
|
|
2372
3337
|
}, {
|
|
2373
3338
|
key: "em",
|
|
2374
|
-
value: function em(
|
|
2375
|
-
var tokens =
|
|
3339
|
+
value: function em(_ref10) {
|
|
3340
|
+
var tokens = _ref10.tokens;
|
|
2376
3341
|
return "<em>".concat(this.parser.parseInline(tokens), "</em>");
|
|
2377
3342
|
}
|
|
2378
3343
|
}, {
|
|
2379
3344
|
key: "codespan",
|
|
2380
|
-
value: function codespan(
|
|
2381
|
-
var text =
|
|
3345
|
+
value: function codespan(_ref11) {
|
|
3346
|
+
var text = _ref11.text;
|
|
2382
3347
|
return "<code>".concat(escape2(text, true), "</code>");
|
|
2383
3348
|
}
|
|
2384
3349
|
}, {
|
|
@@ -2388,16 +3353,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2388
3353
|
}
|
|
2389
3354
|
}, {
|
|
2390
3355
|
key: "del",
|
|
2391
|
-
value: function del(
|
|
2392
|
-
var tokens =
|
|
3356
|
+
value: function del(_ref12) {
|
|
3357
|
+
var tokens = _ref12.tokens;
|
|
2393
3358
|
return "<del>".concat(this.parser.parseInline(tokens), "</del>");
|
|
2394
3359
|
}
|
|
2395
3360
|
}, {
|
|
2396
3361
|
key: "link",
|
|
2397
|
-
value: function link(
|
|
2398
|
-
var href =
|
|
2399
|
-
title =
|
|
2400
|
-
tokens =
|
|
3362
|
+
value: function link(_ref13) {
|
|
3363
|
+
var href = _ref13.href,
|
|
3364
|
+
title = _ref13.title,
|
|
3365
|
+
tokens = _ref13.tokens;
|
|
2401
3366
|
var text = this.parser.parseInline(tokens);
|
|
2402
3367
|
var cleanHref = cleanUrl(href);
|
|
2403
3368
|
if (cleanHref === null) {
|
|
@@ -2413,11 +3378,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2413
3378
|
}
|
|
2414
3379
|
}, {
|
|
2415
3380
|
key: "image",
|
|
2416
|
-
value: function image(
|
|
2417
|
-
var href =
|
|
2418
|
-
title =
|
|
2419
|
-
text =
|
|
2420
|
-
tokens =
|
|
3381
|
+
value: function image(_ref14) {
|
|
3382
|
+
var href = _ref14.href,
|
|
3383
|
+
title = _ref14.title,
|
|
3384
|
+
text = _ref14.text,
|
|
3385
|
+
tokens = _ref14.tokens;
|
|
2421
3386
|
if (tokens) {
|
|
2422
3387
|
text = this.parser.parseInline(tokens, this.parser.textRenderer);
|
|
2423
3388
|
}
|
|
@@ -2448,50 +3413,50 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2448
3413
|
key: "strong",
|
|
2449
3414
|
value:
|
|
2450
3415
|
// no need for block level renderers
|
|
2451
|
-
function strong(
|
|
2452
|
-
var text =
|
|
3416
|
+
function strong(_ref15) {
|
|
3417
|
+
var text = _ref15.text;
|
|
2453
3418
|
return text;
|
|
2454
3419
|
}
|
|
2455
3420
|
}, {
|
|
2456
3421
|
key: "em",
|
|
2457
|
-
value: function em(
|
|
2458
|
-
var text =
|
|
3422
|
+
value: function em(_ref16) {
|
|
3423
|
+
var text = _ref16.text;
|
|
2459
3424
|
return text;
|
|
2460
3425
|
}
|
|
2461
3426
|
}, {
|
|
2462
3427
|
key: "codespan",
|
|
2463
|
-
value: function codespan(
|
|
2464
|
-
var text =
|
|
3428
|
+
value: function codespan(_ref17) {
|
|
3429
|
+
var text = _ref17.text;
|
|
2465
3430
|
return text;
|
|
2466
3431
|
}
|
|
2467
3432
|
}, {
|
|
2468
3433
|
key: "del",
|
|
2469
|
-
value: function del(
|
|
2470
|
-
var text =
|
|
3434
|
+
value: function del(_ref18) {
|
|
3435
|
+
var text = _ref18.text;
|
|
2471
3436
|
return text;
|
|
2472
3437
|
}
|
|
2473
3438
|
}, {
|
|
2474
3439
|
key: "html",
|
|
2475
|
-
value: function html(
|
|
2476
|
-
var text =
|
|
3440
|
+
value: function html(_ref19) {
|
|
3441
|
+
var text = _ref19.text;
|
|
2477
3442
|
return text;
|
|
2478
3443
|
}
|
|
2479
3444
|
}, {
|
|
2480
3445
|
key: "text",
|
|
2481
|
-
value: function text(
|
|
2482
|
-
var _text =
|
|
3446
|
+
value: function text(_ref20) {
|
|
3447
|
+
var _text = _ref20.text;
|
|
2483
3448
|
return _text;
|
|
2484
3449
|
}
|
|
2485
3450
|
}, {
|
|
2486
3451
|
key: "link",
|
|
2487
|
-
value: function link(
|
|
2488
|
-
var text =
|
|
3452
|
+
value: function link(_ref21) {
|
|
3453
|
+
var text = _ref21.text;
|
|
2489
3454
|
return "" + text;
|
|
2490
3455
|
}
|
|
2491
3456
|
}, {
|
|
2492
3457
|
key: "image",
|
|
2493
|
-
value: function image(
|
|
2494
|
-
var text =
|
|
3458
|
+
value: function image(_ref22) {
|
|
3459
|
+
var text = _ref22.text;
|
|
2495
3460
|
return "" + text;
|
|
2496
3461
|
}
|
|
2497
3462
|
}, {
|
|
@@ -2527,8 +3492,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2527
3492
|
var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2528
3493
|
var _a2, _b;
|
|
2529
3494
|
var out = "";
|
|
2530
|
-
for (var
|
|
2531
|
-
var anyToken = tokens[
|
|
3495
|
+
for (var _i7 = 0; _i7 < tokens.length; _i7++) {
|
|
3496
|
+
var anyToken = tokens[_i7];
|
|
2532
3497
|
if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b[anyToken.type]) {
|
|
2533
3498
|
var genericToken = anyToken;
|
|
2534
3499
|
var ret = this.options.extensions.renderers[genericToken.type].call({
|
|
@@ -2590,8 +3555,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2590
3555
|
{
|
|
2591
3556
|
var textToken = token;
|
|
2592
3557
|
var body = this.renderer.text(textToken);
|
|
2593
|
-
while (
|
|
2594
|
-
textToken = tokens[++
|
|
3558
|
+
while (_i7 + 1 < tokens.length && tokens[_i7 + 1].type === "text") {
|
|
3559
|
+
textToken = tokens[++_i7];
|
|
2595
3560
|
body += "\n" + this.renderer.text(textToken);
|
|
2596
3561
|
}
|
|
2597
3562
|
if (top) {
|
|
@@ -2634,8 +3599,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2634
3599
|
var renderer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.renderer;
|
|
2635
3600
|
var _a2, _b;
|
|
2636
3601
|
var out = "";
|
|
2637
|
-
for (var
|
|
2638
|
-
var anyToken = tokens[
|
|
3602
|
+
for (var _i8 = 0; _i8 < tokens.length; _i8++) {
|
|
3603
|
+
var anyToken = tokens[_i8];
|
|
2639
3604
|
if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b[anyToken.type]) {
|
|
2640
3605
|
var ret = this.options.extensions.renderers[anyToken.type].call({
|
|
2641
3606
|
parser: this
|
|
@@ -2798,7 +3763,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2798
3763
|
return _createClass(Marked, [{
|
|
2799
3764
|
key: "walkTokens",
|
|
2800
3765
|
value: function walkTokens(tokens, callback) {
|
|
2801
|
-
var
|
|
3766
|
+
var _this5 = this;
|
|
2802
3767
|
var _a2, _b;
|
|
2803
3768
|
var values = [];
|
|
2804
3769
|
var _iterator5 = _createForOfIteratorHelper(tokens),
|
|
@@ -2806,7 +3771,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2806
3771
|
try {
|
|
2807
3772
|
var _loop4 = function _loop4() {
|
|
2808
3773
|
var token = _step5.value;
|
|
2809
|
-
values = values.concat(callback.call(
|
|
3774
|
+
values = values.concat(callback.call(_this5, token));
|
|
2810
3775
|
switch (token.type) {
|
|
2811
3776
|
case "table":
|
|
2812
3777
|
{
|
|
@@ -2816,7 +3781,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2816
3781
|
try {
|
|
2817
3782
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
2818
3783
|
var cell = _step6.value;
|
|
2819
|
-
values = values.concat(
|
|
3784
|
+
values = values.concat(_this5.walkTokens(cell.tokens, callback));
|
|
2820
3785
|
}
|
|
2821
3786
|
} catch (err) {
|
|
2822
3787
|
_iterator6.e(err);
|
|
@@ -2833,7 +3798,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2833
3798
|
try {
|
|
2834
3799
|
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
2835
3800
|
var _cell = _step8.value;
|
|
2836
|
-
values = values.concat(
|
|
3801
|
+
values = values.concat(_this5.walkTokens(_cell.tokens, callback));
|
|
2837
3802
|
}
|
|
2838
3803
|
} catch (err) {
|
|
2839
3804
|
_iterator8.e(err);
|
|
@@ -2851,19 +3816,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2851
3816
|
case "list":
|
|
2852
3817
|
{
|
|
2853
3818
|
var listToken = token;
|
|
2854
|
-
values = values.concat(
|
|
3819
|
+
values = values.concat(_this5.walkTokens(listToken.items, callback));
|
|
2855
3820
|
break;
|
|
2856
3821
|
}
|
|
2857
3822
|
default:
|
|
2858
3823
|
{
|
|
2859
3824
|
var genericToken = token;
|
|
2860
|
-
if ((_b = (_a2 =
|
|
2861
|
-
|
|
3825
|
+
if ((_b = (_a2 = _this5.defaults.extensions) == null ? void 0 : _a2.childTokens) == null ? void 0 : _b[genericToken.type]) {
|
|
3826
|
+
_this5.defaults.extensions.childTokens[genericToken.type].forEach(function (childTokens) {
|
|
2862
3827
|
var tokens2 = genericToken[childTokens].flat(Infinity);
|
|
2863
|
-
values = values.concat(
|
|
3828
|
+
values = values.concat(_this5.walkTokens(tokens2, callback));
|
|
2864
3829
|
});
|
|
2865
3830
|
} else if (genericToken.tokens) {
|
|
2866
|
-
values = values.concat(
|
|
3831
|
+
values = values.concat(_this5.walkTokens(genericToken.tokens, callback));
|
|
2867
3832
|
}
|
|
2868
3833
|
}
|
|
2869
3834
|
}
|
|
@@ -2881,7 +3846,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2881
3846
|
}, {
|
|
2882
3847
|
key: "use",
|
|
2883
3848
|
value: function use() {
|
|
2884
|
-
var
|
|
3849
|
+
var _this6 = this;
|
|
2885
3850
|
var extensions = this.defaults.extensions || {
|
|
2886
3851
|
renderers: {},
|
|
2887
3852
|
childTokens: {}
|
|
@@ -2891,7 +3856,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2891
3856
|
}
|
|
2892
3857
|
args.forEach(function (pack) {
|
|
2893
3858
|
var opts = __spreadValues({}, pack);
|
|
2894
|
-
opts.async =
|
|
3859
|
+
opts.async = _this6.defaults.async || opts.async || false;
|
|
2895
3860
|
if (pack.extensions) {
|
|
2896
3861
|
pack.extensions.forEach(function (ext) {
|
|
2897
3862
|
if (!ext.name) {
|
|
@@ -2947,7 +3912,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2947
3912
|
opts.extensions = extensions;
|
|
2948
3913
|
}
|
|
2949
3914
|
if (pack.renderer) {
|
|
2950
|
-
var renderer =
|
|
3915
|
+
var renderer = _this6.defaults.renderer || new _Renderer(_this6.defaults);
|
|
2951
3916
|
var _loop5 = function _loop5() {
|
|
2952
3917
|
if (!(prop in renderer)) {
|
|
2953
3918
|
throw new Error("renderer '".concat(prop, "' does not exist"));
|
|
@@ -2975,7 +3940,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2975
3940
|
opts.renderer = renderer;
|
|
2976
3941
|
}
|
|
2977
3942
|
if (pack.tokenizer) {
|
|
2978
|
-
var tokenizer =
|
|
3943
|
+
var tokenizer = _this6.defaults.tokenizer || new _Tokenizer(_this6.defaults);
|
|
2979
3944
|
var _loop6 = function _loop6() {
|
|
2980
3945
|
if (!(_prop in tokenizer)) {
|
|
2981
3946
|
throw new Error("tokenizer '".concat(_prop, "' does not exist"));
|
|
@@ -3003,7 +3968,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3003
3968
|
opts.tokenizer = tokenizer;
|
|
3004
3969
|
}
|
|
3005
3970
|
if (pack.hooks) {
|
|
3006
|
-
var hooks =
|
|
3971
|
+
var hooks = _this6.defaults.hooks || new _Hooks();
|
|
3007
3972
|
var _loop7 = function _loop7() {
|
|
3008
3973
|
if (!(_prop2 in hooks)) {
|
|
3009
3974
|
throw new Error("hook '".concat(_prop2, "' does not exist"));
|
|
@@ -3016,7 +3981,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3016
3981
|
var prevHook = hooks[hooksProp];
|
|
3017
3982
|
if (_Hooks.passThroughHooks.has(_prop2)) {
|
|
3018
3983
|
hooks[hooksProp] = function (arg) {
|
|
3019
|
-
if (
|
|
3984
|
+
if (_this6.defaults.async) {
|
|
3020
3985
|
return Promise.resolve(hooksFunc.call(hooks, arg)).then(function (ret2) {
|
|
3021
3986
|
return prevHook.call(hooks, ret2);
|
|
3022
3987
|
});
|
|
@@ -3043,7 +4008,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3043
4008
|
opts.hooks = hooks;
|
|
3044
4009
|
}
|
|
3045
4010
|
if (pack.walkTokens) {
|
|
3046
|
-
var walkTokens2 =
|
|
4011
|
+
var walkTokens2 = _this6.defaults.walkTokens;
|
|
3047
4012
|
var packWalktokens = pack.walkTokens;
|
|
3048
4013
|
opts.walkTokens = function (token) {
|
|
3049
4014
|
var values = [];
|
|
@@ -3054,7 +4019,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3054
4019
|
return values;
|
|
3055
4020
|
};
|
|
3056
4021
|
}
|
|
3057
|
-
|
|
4022
|
+
_this6.defaults = __spreadValues(__spreadValues({}, _this6.defaults), opts);
|
|
3058
4023
|
});
|
|
3059
4024
|
return this;
|
|
3060
4025
|
}
|
|
@@ -3077,12 +4042,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3077
4042
|
}, {
|
|
3078
4043
|
key: "parseMarkdown",
|
|
3079
4044
|
value: function parseMarkdown(blockType) {
|
|
3080
|
-
var
|
|
4045
|
+
var _this7 = this;
|
|
3081
4046
|
var parse2 = function parse2(src, options2) {
|
|
3082
4047
|
var origOpt = __spreadValues({}, options2);
|
|
3083
|
-
var opt = __spreadValues(__spreadValues({},
|
|
3084
|
-
var throwError =
|
|
3085
|
-
if (
|
|
4048
|
+
var opt = __spreadValues(__spreadValues({}, _this7.defaults), origOpt);
|
|
4049
|
+
var throwError = _this7.onError(!!opt.silent, !!opt.async);
|
|
4050
|
+
if (_this7.defaults.async === true && origOpt.async === false) {
|
|
3086
4051
|
return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
3087
4052
|
}
|
|
3088
4053
|
if (typeof src === "undefined" || src === null) {
|
|
@@ -3103,7 +4068,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3103
4068
|
}).then(function (tokens) {
|
|
3104
4069
|
return opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens;
|
|
3105
4070
|
}).then(function (tokens) {
|
|
3106
|
-
return opt.walkTokens ? Promise.all(
|
|
4071
|
+
return opt.walkTokens ? Promise.all(_this7.walkTokens(tokens, opt.walkTokens)).then(function () {
|
|
3107
4072
|
return tokens;
|
|
3108
4073
|
}) : tokens;
|
|
3109
4074
|
}).then(function (tokens) {
|
|
@@ -3121,7 +4086,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3121
4086
|
tokens = opt.hooks.processAllTokens(tokens);
|
|
3122
4087
|
}
|
|
3123
4088
|
if (opt.walkTokens) {
|
|
3124
|
-
|
|
4089
|
+
_this7.walkTokens(tokens, opt.walkTokens);
|
|
3125
4090
|
}
|
|
3126
4091
|
var html2 = parser2(tokens, opt);
|
|
3127
4092
|
if (opt.hooks) {
|
|
@@ -3192,9 +4157,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3192
4157
|
marked.parseInline;
|
|
3193
4158
|
_Parser.parse;
|
|
3194
4159
|
_Lexer.lex;
|
|
3195
|
-
var TypingText = function TypingText(
|
|
3196
|
-
var data =
|
|
3197
|
-
style =
|
|
4160
|
+
var TypingText = function TypingText(_ref23) {
|
|
4161
|
+
var data = _ref23.data,
|
|
4162
|
+
style = _ref23.style;
|
|
3198
4163
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
3199
4164
|
style: __spreadValues({
|
|
3200
4165
|
maxWidth: "80%"
|
|
@@ -3212,90 +4177,56 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3212
4177
|
}
|
|
3213
4178
|
}, data ? data.question : ""));
|
|
3214
4179
|
};
|
|
3215
|
-
var LoadingCircular = function LoadingCircular(_ref25) {
|
|
3216
|
-
var _ref25$size = _ref25.size,
|
|
3217
|
-
size = _ref25$size === void 0 ? 40 : _ref25$size,
|
|
3218
|
-
_ref25$color = _ref25.color,
|
|
3219
|
-
color = _ref25$color === void 0 ? "var(--primary-main)" : _ref25$color,
|
|
3220
|
-
_ref25$thickness = _ref25.thickness,
|
|
3221
|
-
thickness = _ref25$thickness === void 0 ? 3.6 : _ref25$thickness;
|
|
3222
|
-
var radius = 20;
|
|
3223
|
-
var circumference = 2 * Math.PI * radius;
|
|
3224
|
-
return /* @__PURE__ */React.createElement("div", {
|
|
3225
|
-
className: "circular-container",
|
|
3226
|
-
style: {
|
|
3227
|
-
width: size,
|
|
3228
|
-
height: size
|
|
3229
|
-
},
|
|
3230
|
-
role: "progressbar"
|
|
3231
|
-
}, /* @__PURE__ */React.createElement("svg", {
|
|
3232
|
-
className: "circular-svg",
|
|
3233
|
-
viewBox: "22 22 44 44"
|
|
3234
|
-
}, /* @__PURE__ */React.createElement("circle", {
|
|
3235
|
-
className: "circular-circle",
|
|
3236
|
-
cx: "44",
|
|
3237
|
-
cy: "44",
|
|
3238
|
-
r: radius,
|
|
3239
|
-
fill: "none",
|
|
3240
|
-
stroke: color,
|
|
3241
|
-
strokeWidth: thickness,
|
|
3242
|
-
strokeDasharray: circumference,
|
|
3243
|
-
style: {
|
|
3244
|
-
strokeDashoffset: circumference * 0.7
|
|
3245
|
-
// Độ dài của thanh loading
|
|
3246
|
-
}
|
|
3247
|
-
})));
|
|
3248
|
-
};
|
|
3249
4180
|
var ARROW_SIZE = 6;
|
|
3250
4181
|
var GAP = 4;
|
|
3251
4182
|
var Tooltip = /*#__PURE__*/function (_React__namespace$Com) {
|
|
3252
4183
|
function Tooltip(props) {
|
|
3253
|
-
var
|
|
4184
|
+
var _this8;
|
|
3254
4185
|
_classCallCheck(this, Tooltip);
|
|
3255
|
-
|
|
3256
|
-
__publicField(
|
|
3257
|
-
__publicField(
|
|
3258
|
-
__publicField(
|
|
3259
|
-
__publicField(
|
|
3260
|
-
__publicField(
|
|
3261
|
-
if (
|
|
3262
|
-
clearTimeout(
|
|
3263
|
-
|
|
4186
|
+
_this8 = _callSuper(this, Tooltip, [props]);
|
|
4187
|
+
__publicField(_this8, "triggerRef");
|
|
4188
|
+
__publicField(_this8, "tooltipRef");
|
|
4189
|
+
__publicField(_this8, "enterTimer", null);
|
|
4190
|
+
__publicField(_this8, "leaveTimer", null);
|
|
4191
|
+
__publicField(_this8, "handleMouseEnter", function () {
|
|
4192
|
+
if (_this8.leaveTimer) {
|
|
4193
|
+
clearTimeout(_this8.leaveTimer);
|
|
4194
|
+
_this8.leaveTimer = null;
|
|
3264
4195
|
}
|
|
3265
|
-
var enterDelay =
|
|
3266
|
-
|
|
3267
|
-
|
|
4196
|
+
var enterDelay = _this8.props.enterDelay;
|
|
4197
|
+
_this8.enterTimer = setTimeout(function () {
|
|
4198
|
+
_this8.setState({
|
|
3268
4199
|
visible: true
|
|
3269
4200
|
}, function () {
|
|
3270
|
-
var coords =
|
|
3271
|
-
|
|
4201
|
+
var coords = _this8.computeCoords();
|
|
4202
|
+
_this8.setState({
|
|
3272
4203
|
coords: coords
|
|
3273
4204
|
});
|
|
3274
4205
|
});
|
|
3275
4206
|
}, enterDelay);
|
|
3276
4207
|
});
|
|
3277
|
-
__publicField(
|
|
3278
|
-
if (
|
|
3279
|
-
clearTimeout(
|
|
3280
|
-
|
|
4208
|
+
__publicField(_this8, "handleMouseLeave", function () {
|
|
4209
|
+
if (_this8.enterTimer) {
|
|
4210
|
+
clearTimeout(_this8.enterTimer);
|
|
4211
|
+
_this8.enterTimer = null;
|
|
3281
4212
|
}
|
|
3282
|
-
var leaveDelay =
|
|
3283
|
-
|
|
3284
|
-
|
|
4213
|
+
var leaveDelay = _this8.props.leaveDelay;
|
|
4214
|
+
_this8.leaveTimer = setTimeout(function () {
|
|
4215
|
+
_this8.setState({
|
|
3285
4216
|
visible: false
|
|
3286
4217
|
});
|
|
3287
4218
|
}, leaveDelay);
|
|
3288
4219
|
});
|
|
3289
|
-
|
|
4220
|
+
_this8.state = {
|
|
3290
4221
|
visible: false,
|
|
3291
4222
|
coords: {
|
|
3292
4223
|
top: 0,
|
|
3293
4224
|
left: 0
|
|
3294
4225
|
}
|
|
3295
4226
|
};
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
return
|
|
4227
|
+
_this8.triggerRef = React__namespace.createRef();
|
|
4228
|
+
_this8.tooltipRef = React__namespace.createRef();
|
|
4229
|
+
return _this8;
|
|
3299
4230
|
}
|
|
3300
4231
|
_inherits(Tooltip, _React__namespace$Com);
|
|
3301
4232
|
return _createClass(Tooltip, [{
|
|
@@ -3426,12 +4357,50 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3426
4357
|
leaveDelay: 0,
|
|
3427
4358
|
zIndex: 1500
|
|
3428
4359
|
});
|
|
3429
|
-
var
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
4360
|
+
var AIAvatar = function AIAvatar() {
|
|
4361
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4362
|
+
style: {
|
|
4363
|
+
width: 28,
|
|
4364
|
+
height: 28,
|
|
4365
|
+
borderRadius: "50%",
|
|
4366
|
+
background: "var(--primary-main)",
|
|
4367
|
+
color: "var(--primary-contrasttext)",
|
|
4368
|
+
display: "flex",
|
|
4369
|
+
alignItems: "center",
|
|
4370
|
+
justifyContent: "center",
|
|
4371
|
+
fontSize: 11,
|
|
4372
|
+
fontWeight: 700,
|
|
4373
|
+
letterSpacing: 0.5,
|
|
4374
|
+
flexShrink: 0
|
|
4375
|
+
}
|
|
4376
|
+
}, "AI");
|
|
4377
|
+
};
|
|
4378
|
+
var LoadingDots = function LoadingDots(_ref24) {
|
|
4379
|
+
var _ref24$label = _ref24.label,
|
|
4380
|
+
label = _ref24$label === void 0 ? "Thinking" : _ref24$label;
|
|
4381
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4382
|
+
style: {
|
|
4383
|
+
display: "inline-flex",
|
|
4384
|
+
alignItems: "center",
|
|
4385
|
+
gap: 6,
|
|
4386
|
+
background: "var(--background-softGrey)",
|
|
4387
|
+
borderRadius: 8,
|
|
4388
|
+
borderTopLeftRadius: 0,
|
|
4389
|
+
padding: "8px 12px",
|
|
4390
|
+
fontSize: 13,
|
|
4391
|
+
color: "var(--text-secondary)"
|
|
4392
|
+
}
|
|
4393
|
+
}, /* @__PURE__ */React__namespace.createElement("span", null, label), /* @__PURE__ */React__namespace.createElement("span", {
|
|
4394
|
+
className: "chat-ai-dots",
|
|
4395
|
+
"aria-hidden": "true"
|
|
4396
|
+
}, /* @__PURE__ */React__namespace.createElement("span", null), /* @__PURE__ */React__namespace.createElement("span", null), /* @__PURE__ */React__namespace.createElement("span", null)));
|
|
4397
|
+
};
|
|
4398
|
+
var List = function List(_ref25) {
|
|
4399
|
+
var items = _ref25.items,
|
|
4400
|
+
onApply = _ref25.onApply,
|
|
4401
|
+
getEditorContent = _ref25.getEditorContent;
|
|
3433
4402
|
var handleApply = function handleApply(body) {
|
|
3434
|
-
return __async(
|
|
4403
|
+
return __async(_this9, null, /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
3435
4404
|
var titleRegex, matches, content, html2, signatureRegex, editorValue, signatureMatch;
|
|
3436
4405
|
return _regenerator().w(function (_context2) {
|
|
3437
4406
|
while (1) switch (_context2.n) {
|
|
@@ -3453,1082 +4422,337 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3453
4422
|
onApply({
|
|
3454
4423
|
html: html2
|
|
3455
4424
|
});
|
|
3456
|
-
case 2:
|
|
3457
|
-
return _context2.a(2);
|
|
3458
|
-
}
|
|
3459
|
-
}, _callee2);
|
|
3460
|
-
}));
|
|
3461
|
-
};
|
|
3462
|
-
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
3463
|
-
style: {
|
|
3464
|
-
flex: 1,
|
|
3465
|
-
minHeight: 0,
|
|
3466
|
-
position: "relative",
|
|
3467
|
-
overflowY: "auto",
|
|
3468
|
-
paddingRight: 16,
|
|
3469
|
-
marginRight: -16,
|
|
3470
|
-
marginBottom: 8,
|
|
3471
|
-
display: "flex",
|
|
3472
|
-
flexDirection: "column"
|
|
3473
|
-
}
|
|
3474
|
-
}, items && items.map(function (_item) {
|
|
3475
|
-
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
3476
|
-
key: _item.id,
|
|
3477
|
-
style: {
|
|
3478
|
-
display: "flex",
|
|
3479
|
-
flexDirection: "column",
|
|
3480
|
-
marginBottom: 16
|
|
3481
|
-
}
|
|
3482
|
-
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
3483
|
-
style: {
|
|
3484
|
-
width: "100%",
|
|
3485
|
-
display: "flex",
|
|
3486
|
-
alignItems: "flex-end",
|
|
3487
|
-
flexDirection: "column",
|
|
3488
|
-
position: "relative",
|
|
3489
|
-
marginTop: 8
|
|
3490
|
-
}
|
|
3491
|
-
}, /* @__PURE__ */React__namespace.createElement(TypingText, {
|
|
3492
|
-
data: {
|
|
3493
|
-
question: _item.question
|
|
3494
|
-
},
|
|
3495
|
-
style: {
|
|
3496
|
-
borderRadius: 8,
|
|
3497
|
-
borderTopRightRadius: 0,
|
|
3498
|
-
padding: "8px 12px",
|
|
3499
|
-
background: "var(--background-softGrey)"
|
|
3500
|
-
}
|
|
3501
|
-
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
3502
|
-
style: {
|
|
3503
|
-
width: "100%",
|
|
3504
|
-
display: "flex",
|
|
3505
|
-
alignItems: "flex-start",
|
|
3506
|
-
flexDirection: "column",
|
|
3507
|
-
position: "relative",
|
|
3508
|
-
marginTop: 8
|
|
3509
|
-
}
|
|
3510
|
-
}, (_item == null ? void 0 : _item.isLoading) ? /* @__PURE__ */React__namespace.createElement(LoadingCircular, {
|
|
3511
|
-
size: 32
|
|
3512
|
-
}) : /* @__PURE__ */React__namespace.createElement("div", {
|
|
3513
|
-
style: {
|
|
3514
|
-
display: "flex",
|
|
3515
|
-
flexDirection: "row",
|
|
3516
|
-
alignItems: "flex-end",
|
|
3517
|
-
width: "100%"
|
|
3518
|
-
}
|
|
3519
|
-
}, /* @__PURE__ */React__namespace.createElement(TypingText, {
|
|
3520
|
-
data: {
|
|
3521
|
-
subject: _item.subject,
|
|
3522
|
-
body: _item.body
|
|
3523
|
-
},
|
|
3524
|
-
style: {
|
|
3525
|
-
background: "var(--background-softGrey)",
|
|
3526
|
-
borderRadius: 8,
|
|
3527
|
-
borderTopLeftRadius: 0,
|
|
3528
|
-
padding: "8px 12px",
|
|
3529
|
-
flexShrink: 0
|
|
3530
|
-
}
|
|
3531
|
-
}), /* @__PURE__ */React__namespace.createElement(Tooltip, {
|
|
3532
|
-
title: "Apply content"
|
|
3533
|
-
}, /* @__PURE__ */React__namespace.createElement("button", {
|
|
3534
|
-
type: "button",
|
|
3535
|
-
onClick: function onClick() {
|
|
3536
|
-
return handleApply(_item.body);
|
|
3537
|
-
},
|
|
3538
|
-
color: "primary",
|
|
3539
|
-
className: "icon-button small",
|
|
3540
|
-
style: {
|
|
3541
|
-
marginLeft: 4
|
|
3542
|
-
}
|
|
3543
|
-
}, /* @__PURE__ */React__namespace.createElement(Copy, {
|
|
3544
|
-
size: 16
|
|
3545
|
-
}))))));
|
|
3546
|
-
}));
|
|
3547
|
-
};
|
|
3548
|
-
var circularSize = {
|
|
3549
|
-
small: 28,
|
|
3550
|
-
medium: 40
|
|
3551
|
-
};
|
|
3552
|
-
var LoadingContainer = function LoadingContainer(_ref27) {
|
|
3553
|
-
var style = _ref27.style,
|
|
3554
|
-
_ref27$fullHeight = _ref27.fullHeight,
|
|
3555
|
-
fullHeight = _ref27$fullHeight === void 0 ? false : _ref27$fullHeight,
|
|
3556
|
-
_ref27$size = _ref27.size,
|
|
3557
|
-
size = _ref27$size === void 0 ? "medium" : _ref27$size,
|
|
3558
|
-
label = _ref27.label;
|
|
3559
|
-
return /* @__PURE__ */React.createElement("div", {
|
|
3560
|
-
style: __spreadValues({
|
|
3561
|
-
display: "flex",
|
|
3562
|
-
alignItems: "center",
|
|
3563
|
-
justifyContent: "center",
|
|
3564
|
-
width: "100%",
|
|
3565
|
-
height: fullHeight ? "100%" : 350
|
|
3566
|
-
}, style)
|
|
3567
|
-
}, /* @__PURE__ */React.createElement(LoadingCircular, {
|
|
3568
|
-
size: circularSize[size]
|
|
3569
|
-
}), label && /* @__PURE__ */React.createElement("p", {
|
|
3570
|
-
color: "text.secondary",
|
|
3571
|
-
style: {
|
|
3572
|
-
marginTop: 16,
|
|
3573
|
-
fontSize: size === "small" ? 12 : 13
|
|
3574
|
-
}
|
|
3575
|
-
}, label));
|
|
3576
|
-
};
|
|
3577
|
-
var scrollStyle = "\n::-webkit-scrollbar,\n*::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n\n*::-webkit-scrollbar-track {\n background: transparent;\n backdrop-filter: blur(6px);\n}\n\n::-webkit-scrollbar-thumb,\n*::-webkit-scrollbar-thumb {\n background: #e0e0e0;\n}\n\n::-webkit-scrollbar-thumb:focus,\n*::-webkit-scrollbar-thumb:focus {\n background: #bdbdbd;\n}\n\n::-webkit-scrollbar-thumb:active,\n*::-webkit-scrollbar-thumb:active {\n background: #bdbdbd;\n}\n\n::-webkit-scrollbar-thumb:hover,\n*::-webkit-scrollbar-thumb:hover {\n background: #bdbdbd;\n}\n\n::-webkit-scrollbar-corner,\n*::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n";
|
|
3578
|
-
var _assign$ = function __assign$2() {
|
|
3579
|
-
_assign$ = Object.assign || function (t) {
|
|
3580
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3581
|
-
s = arguments[i];
|
|
3582
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3583
|
-
}
|
|
3584
|
-
return t;
|
|
3585
|
-
};
|
|
3586
|
-
return _assign$.apply(this, arguments);
|
|
3587
|
-
};
|
|
3588
|
-
var eventPropTypes = {
|
|
3589
|
-
onActivate: propTypesExports.func,
|
|
3590
|
-
onAddUndo: propTypesExports.func,
|
|
3591
|
-
onBeforeAddUndo: propTypesExports.func,
|
|
3592
|
-
onBeforeExecCommand: propTypesExports.func,
|
|
3593
|
-
onBeforeGetContent: propTypesExports.func,
|
|
3594
|
-
onBeforeRenderUI: propTypesExports.func,
|
|
3595
|
-
onBeforeSetContent: propTypesExports.func,
|
|
3596
|
-
onBeforePaste: propTypesExports.func,
|
|
3597
|
-
onBlur: propTypesExports.func,
|
|
3598
|
-
onChange: propTypesExports.func,
|
|
3599
|
-
onClearUndos: propTypesExports.func,
|
|
3600
|
-
onClick: propTypesExports.func,
|
|
3601
|
-
onContextMenu: propTypesExports.func,
|
|
3602
|
-
onCommentChange: propTypesExports.func,
|
|
3603
|
-
onCopy: propTypesExports.func,
|
|
3604
|
-
onCut: propTypesExports.func,
|
|
3605
|
-
onDblclick: propTypesExports.func,
|
|
3606
|
-
onDeactivate: propTypesExports.func,
|
|
3607
|
-
onDirty: propTypesExports.func,
|
|
3608
|
-
onDrag: propTypesExports.func,
|
|
3609
|
-
onDragDrop: propTypesExports.func,
|
|
3610
|
-
onDragEnd: propTypesExports.func,
|
|
3611
|
-
onDragGesture: propTypesExports.func,
|
|
3612
|
-
onDragOver: propTypesExports.func,
|
|
3613
|
-
onDrop: propTypesExports.func,
|
|
3614
|
-
onExecCommand: propTypesExports.func,
|
|
3615
|
-
onFocus: propTypesExports.func,
|
|
3616
|
-
onFocusIn: propTypesExports.func,
|
|
3617
|
-
onFocusOut: propTypesExports.func,
|
|
3618
|
-
onGetContent: propTypesExports.func,
|
|
3619
|
-
onHide: propTypesExports.func,
|
|
3620
|
-
onInit: propTypesExports.func,
|
|
3621
|
-
onKeyDown: propTypesExports.func,
|
|
3622
|
-
onKeyPress: propTypesExports.func,
|
|
3623
|
-
onKeyUp: propTypesExports.func,
|
|
3624
|
-
onLoadContent: propTypesExports.func,
|
|
3625
|
-
onMouseDown: propTypesExports.func,
|
|
3626
|
-
onMouseEnter: propTypesExports.func,
|
|
3627
|
-
onMouseLeave: propTypesExports.func,
|
|
3628
|
-
onMouseMove: propTypesExports.func,
|
|
3629
|
-
onMouseOut: propTypesExports.func,
|
|
3630
|
-
onMouseOver: propTypesExports.func,
|
|
3631
|
-
onMouseUp: propTypesExports.func,
|
|
3632
|
-
onNodeChange: propTypesExports.func,
|
|
3633
|
-
onObjectResizeStart: propTypesExports.func,
|
|
3634
|
-
onObjectResized: propTypesExports.func,
|
|
3635
|
-
onObjectSelected: propTypesExports.func,
|
|
3636
|
-
onPaste: propTypesExports.func,
|
|
3637
|
-
onPostProcess: propTypesExports.func,
|
|
3638
|
-
onPostRender: propTypesExports.func,
|
|
3639
|
-
onPreProcess: propTypesExports.func,
|
|
3640
|
-
onProgressState: propTypesExports.func,
|
|
3641
|
-
onRedo: propTypesExports.func,
|
|
3642
|
-
onRemove: propTypesExports.func,
|
|
3643
|
-
onReset: propTypesExports.func,
|
|
3644
|
-
onSaveContent: propTypesExports.func,
|
|
3645
|
-
onSelectionChange: propTypesExports.func,
|
|
3646
|
-
onSetAttrib: propTypesExports.func,
|
|
3647
|
-
onSetContent: propTypesExports.func,
|
|
3648
|
-
onShow: propTypesExports.func,
|
|
3649
|
-
onSubmit: propTypesExports.func,
|
|
3650
|
-
onUndo: propTypesExports.func,
|
|
3651
|
-
onVisualAid: propTypesExports.func,
|
|
3652
|
-
onSkinLoadError: propTypesExports.func,
|
|
3653
|
-
onThemeLoadError: propTypesExports.func,
|
|
3654
|
-
onModelLoadError: propTypesExports.func,
|
|
3655
|
-
onPluginLoadError: propTypesExports.func,
|
|
3656
|
-
onIconsLoadError: propTypesExports.func,
|
|
3657
|
-
onLanguageLoadError: propTypesExports.func,
|
|
3658
|
-
onScriptsLoad: propTypesExports.func,
|
|
3659
|
-
onScriptsLoadError: propTypesExports.func
|
|
3660
|
-
};
|
|
3661
|
-
var EditorPropTypes = _assign$({
|
|
3662
|
-
apiKey: propTypesExports.string,
|
|
3663
|
-
id: propTypesExports.string,
|
|
3664
|
-
inline: propTypesExports.bool,
|
|
3665
|
-
init: propTypesExports.object,
|
|
3666
|
-
initialValue: propTypesExports.string,
|
|
3667
|
-
onEditorChange: propTypesExports.func,
|
|
3668
|
-
value: propTypesExports.string,
|
|
3669
|
-
tagName: propTypesExports.string,
|
|
3670
|
-
cloudChannel: propTypesExports.string,
|
|
3671
|
-
plugins: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.array]),
|
|
3672
|
-
toolbar: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.array]),
|
|
3673
|
-
disabled: propTypesExports.bool,
|
|
3674
|
-
textareaName: propTypesExports.string,
|
|
3675
|
-
tinymceScriptSrc: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string), propTypesExports.arrayOf(propTypesExports.shape({
|
|
3676
|
-
src: propTypesExports.string,
|
|
3677
|
-
async: propTypesExports.bool,
|
|
3678
|
-
defer: propTypesExports.bool
|
|
3679
|
-
}))]),
|
|
3680
|
-
rollback: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.oneOf([false])]),
|
|
3681
|
-
scriptLoading: propTypesExports.shape({
|
|
3682
|
-
async: propTypesExports.bool,
|
|
3683
|
-
defer: propTypesExports.bool,
|
|
3684
|
-
delay: propTypesExports.number
|
|
3685
|
-
})
|
|
3686
|
-
}, eventPropTypes);
|
|
3687
|
-
var isFunction = function isFunction(x) {
|
|
3688
|
-
return typeof x === "function";
|
|
3689
|
-
};
|
|
3690
|
-
var isEventProp = function isEventProp(name) {
|
|
3691
|
-
return name in eventPropTypes;
|
|
3692
|
-
};
|
|
3693
|
-
var eventAttrToEventName = function eventAttrToEventName(attrName) {
|
|
3694
|
-
return attrName.substr(2);
|
|
3695
|
-
};
|
|
3696
|
-
var configHandlers2 = function configHandlers2(handlerLookup, on, off, adapter, prevProps, props, boundHandlers) {
|
|
3697
|
-
var prevEventKeys = Object.keys(prevProps).filter(isEventProp);
|
|
3698
|
-
var currEventKeys = Object.keys(props).filter(isEventProp);
|
|
3699
|
-
var removedKeys = prevEventKeys.filter(function (key) {
|
|
3700
|
-
return props[key] === void 0;
|
|
3701
|
-
});
|
|
3702
|
-
var addedKeys = currEventKeys.filter(function (key) {
|
|
3703
|
-
return prevProps[key] === void 0;
|
|
3704
|
-
});
|
|
3705
|
-
removedKeys.forEach(function (key) {
|
|
3706
|
-
var eventName = eventAttrToEventName(key);
|
|
3707
|
-
var wrappedHandler = boundHandlers[eventName];
|
|
3708
|
-
off(eventName, wrappedHandler);
|
|
3709
|
-
delete boundHandlers[eventName];
|
|
3710
|
-
});
|
|
3711
|
-
addedKeys.forEach(function (key) {
|
|
3712
|
-
var wrappedHandler = adapter(handlerLookup, key);
|
|
3713
|
-
var eventName = eventAttrToEventName(key);
|
|
3714
|
-
boundHandlers[eventName] = wrappedHandler;
|
|
3715
|
-
on(eventName, wrappedHandler);
|
|
3716
|
-
});
|
|
3717
|
-
};
|
|
3718
|
-
var configHandlers = function configHandlers(editor, prevProps, props, boundHandlers, lookup) {
|
|
3719
|
-
return configHandlers2(lookup, editor.on.bind(editor), editor.off.bind(editor),
|
|
3720
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
3721
|
-
function (handlerLookup, key) {
|
|
3722
|
-
return function (e) {
|
|
3723
|
-
var _a2;
|
|
3724
|
-
return (_a2 = handlerLookup(key)) === null || _a2 === void 0 ? void 0 : _a2(e, editor);
|
|
3725
|
-
};
|
|
3726
|
-
}, prevProps, props, boundHandlers);
|
|
3727
|
-
};
|
|
3728
|
-
var unique = 0;
|
|
3729
|
-
var uuid = function uuid(prefix) {
|
|
3730
|
-
var time = Date.now();
|
|
3731
|
-
var random = Math.floor(Math.random() * 1e9);
|
|
3732
|
-
unique++;
|
|
3733
|
-
return prefix + "_" + random + unique + String(time);
|
|
3734
|
-
};
|
|
3735
|
-
var isTextareaOrInput = function isTextareaOrInput(element) {
|
|
3736
|
-
return element !== null && (element.tagName.toLowerCase() === "textarea" || element.tagName.toLowerCase() === "input");
|
|
3737
|
-
};
|
|
3738
|
-
var normalizePluginArray = function normalizePluginArray(plugins) {
|
|
3739
|
-
if (typeof plugins === "undefined" || plugins === "") {
|
|
3740
|
-
return [];
|
|
3741
|
-
}
|
|
3742
|
-
return Array.isArray(plugins) ? plugins : plugins.split(" ");
|
|
3743
|
-
};
|
|
3744
|
-
var mergePlugins = function mergePlugins(initPlugins, inputPlugins) {
|
|
3745
|
-
return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
|
|
3746
|
-
};
|
|
3747
|
-
var isBeforeInputEventAvailable = function isBeforeInputEventAvailable() {
|
|
3748
|
-
return window.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
|
|
3749
|
-
};
|
|
3750
|
-
var isInDoc = function isInDoc(elem) {
|
|
3751
|
-
if (!("isConnected" in Node.prototype)) {
|
|
3752
|
-
var current = elem;
|
|
3753
|
-
var parent_1 = elem.parentNode;
|
|
3754
|
-
while (parent_1 != null) {
|
|
3755
|
-
current = parent_1;
|
|
3756
|
-
parent_1 = current.parentNode;
|
|
3757
|
-
}
|
|
3758
|
-
return current === elem.ownerDocument;
|
|
3759
|
-
}
|
|
3760
|
-
return elem.isConnected;
|
|
3761
|
-
};
|
|
3762
|
-
var setMode = function setMode(editor, mode) {
|
|
3763
|
-
if (editor !== void 0) {
|
|
3764
|
-
if (editor.mode != null && _typeof(editor.mode) === "object" && typeof editor.mode.set === "function") {
|
|
3765
|
-
editor.mode.set(mode);
|
|
3766
|
-
} else {
|
|
3767
|
-
editor.setMode(mode);
|
|
3768
|
-
}
|
|
3769
|
-
}
|
|
3770
|
-
};
|
|
3771
|
-
var _assign$2 = function __assign$1() {
|
|
3772
|
-
_assign$2 = Object.assign || function (t) {
|
|
3773
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3774
|
-
s = arguments[i];
|
|
3775
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3776
|
-
}
|
|
3777
|
-
return t;
|
|
3778
|
-
};
|
|
3779
|
-
return _assign$2.apply(this, arguments);
|
|
3780
|
-
};
|
|
3781
|
-
var injectScriptTag = function injectScriptTag(doc, item, handler) {
|
|
3782
|
-
var _a2, _b;
|
|
3783
|
-
var scriptTag = doc.createElement("script");
|
|
3784
|
-
scriptTag.referrerPolicy = "origin";
|
|
3785
|
-
scriptTag.type = "application/javascript";
|
|
3786
|
-
scriptTag.id = item.id;
|
|
3787
|
-
scriptTag.src = item.src;
|
|
3788
|
-
scriptTag.async = (_a2 = item.async) !== null && _a2 !== void 0 ? _a2 : false;
|
|
3789
|
-
scriptTag.defer = (_b = item.defer) !== null && _b !== void 0 ? _b : false;
|
|
3790
|
-
var _loadHandler = function loadHandler() {
|
|
3791
|
-
scriptTag.removeEventListener("load", _loadHandler);
|
|
3792
|
-
scriptTag.removeEventListener("error", _errorHandler);
|
|
3793
|
-
handler(item.src);
|
|
3794
|
-
};
|
|
3795
|
-
var _errorHandler = function errorHandler(err) {
|
|
3796
|
-
scriptTag.removeEventListener("load", _loadHandler);
|
|
3797
|
-
scriptTag.removeEventListener("error", _errorHandler);
|
|
3798
|
-
handler(item.src, err);
|
|
3799
|
-
};
|
|
3800
|
-
scriptTag.addEventListener("load", _loadHandler);
|
|
3801
|
-
scriptTag.addEventListener("error", _errorHandler);
|
|
3802
|
-
if (doc.head) {
|
|
3803
|
-
doc.head.appendChild(scriptTag);
|
|
3804
|
-
}
|
|
3805
|
-
};
|
|
3806
|
-
var createDocumentScriptLoader = function createDocumentScriptLoader(doc) {
|
|
3807
|
-
var lookup = {};
|
|
3808
|
-
var scriptLoadOrErrorHandler = function scriptLoadOrErrorHandler(src, err) {
|
|
3809
|
-
var item = lookup[src];
|
|
3810
|
-
item.done = true;
|
|
3811
|
-
item.error = err;
|
|
3812
|
-
for (var _i = 0, _a2 = item.handlers; _i < _a2.length; _i++) {
|
|
3813
|
-
var h = _a2[_i];
|
|
3814
|
-
h(src, err);
|
|
3815
|
-
}
|
|
3816
|
-
item.handlers = [];
|
|
3817
|
-
};
|
|
3818
|
-
var loadScripts = function loadScripts(items, success, failure) {
|
|
3819
|
-
var failureOrLog = function failureOrLog(err) {
|
|
3820
|
-
return failure !== void 0 ? failure(err) : console.error(err);
|
|
3821
|
-
};
|
|
3822
|
-
if (items.length === 0) {
|
|
3823
|
-
failureOrLog(new Error("At least one script must be provided"));
|
|
3824
|
-
return;
|
|
3825
|
-
}
|
|
3826
|
-
var successCount = 0;
|
|
3827
|
-
var failed = false;
|
|
3828
|
-
var loaded = function loaded(_src, err) {
|
|
3829
|
-
if (failed) {
|
|
3830
|
-
return;
|
|
3831
|
-
}
|
|
3832
|
-
if (err) {
|
|
3833
|
-
failed = true;
|
|
3834
|
-
failureOrLog(err);
|
|
3835
|
-
} else if (++successCount === items.length) {
|
|
3836
|
-
success();
|
|
3837
|
-
}
|
|
3838
|
-
};
|
|
3839
|
-
for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
|
|
3840
|
-
var item = items_1[_i];
|
|
3841
|
-
var existing = lookup[item.src];
|
|
3842
|
-
if (existing) {
|
|
3843
|
-
if (existing.done) {
|
|
3844
|
-
loaded(item.src, existing.error);
|
|
3845
|
-
} else {
|
|
3846
|
-
existing.handlers.push(loaded);
|
|
3847
|
-
}
|
|
3848
|
-
} else {
|
|
3849
|
-
var id = uuid("tiny-");
|
|
3850
|
-
lookup[item.src] = {
|
|
3851
|
-
id: id,
|
|
3852
|
-
src: item.src,
|
|
3853
|
-
done: false,
|
|
3854
|
-
error: null,
|
|
3855
|
-
handlers: [loaded]
|
|
3856
|
-
};
|
|
3857
|
-
injectScriptTag(doc, _assign$2({
|
|
3858
|
-
id: id
|
|
3859
|
-
}, item), scriptLoadOrErrorHandler);
|
|
3860
|
-
}
|
|
3861
|
-
}
|
|
3862
|
-
};
|
|
3863
|
-
var deleteScripts = function deleteScripts() {
|
|
3864
|
-
var _a2;
|
|
3865
|
-
for (var _i = 0, _b = Object.values(lookup); _i < _b.length; _i++) {
|
|
3866
|
-
var item = _b[_i];
|
|
3867
|
-
var scriptTag = doc.getElementById(item.id);
|
|
3868
|
-
if (scriptTag != null && scriptTag.tagName === "SCRIPT") {
|
|
3869
|
-
(_a2 = scriptTag.parentNode) === null || _a2 === void 0 ? void 0 : _a2.removeChild(scriptTag);
|
|
3870
|
-
}
|
|
3871
|
-
}
|
|
3872
|
-
lookup = {};
|
|
3873
|
-
};
|
|
3874
|
-
var getDocument = function getDocument() {
|
|
3875
|
-
return doc;
|
|
3876
|
-
};
|
|
3877
|
-
return {
|
|
3878
|
-
loadScripts: loadScripts,
|
|
3879
|
-
deleteScripts: deleteScripts,
|
|
3880
|
-
getDocument: getDocument
|
|
3881
|
-
};
|
|
3882
|
-
};
|
|
3883
|
-
var createScriptLoader = function createScriptLoader() {
|
|
3884
|
-
var cache = [];
|
|
3885
|
-
var getDocumentScriptLoader = function getDocumentScriptLoader(doc) {
|
|
3886
|
-
var loader = cache.find(function (l) {
|
|
3887
|
-
return l.getDocument() === doc;
|
|
3888
|
-
});
|
|
3889
|
-
if (loader === void 0) {
|
|
3890
|
-
loader = createDocumentScriptLoader(doc);
|
|
3891
|
-
cache.push(loader);
|
|
3892
|
-
}
|
|
3893
|
-
return loader;
|
|
3894
|
-
};
|
|
3895
|
-
var loadList = function loadList(doc, items, delay, success, failure) {
|
|
3896
|
-
var doLoad = function doLoad() {
|
|
3897
|
-
return getDocumentScriptLoader(doc).loadScripts(items, success, failure);
|
|
3898
|
-
};
|
|
3899
|
-
if (delay > 0) {
|
|
3900
|
-
setTimeout(doLoad, delay);
|
|
3901
|
-
} else {
|
|
3902
|
-
doLoad();
|
|
3903
|
-
}
|
|
3904
|
-
};
|
|
3905
|
-
var reinitialize = function reinitialize() {
|
|
3906
|
-
for (var loader = cache.pop(); loader != null; loader = cache.pop()) {
|
|
3907
|
-
loader.deleteScripts();
|
|
3908
|
-
}
|
|
3909
|
-
};
|
|
3910
|
-
return {
|
|
3911
|
-
loadList: loadList,
|
|
3912
|
-
reinitialize: reinitialize
|
|
3913
|
-
};
|
|
3914
|
-
};
|
|
3915
|
-
var ScriptLoader = createScriptLoader();
|
|
3916
|
-
var getTinymce = function getTinymce(view) {
|
|
3917
|
-
var global = view;
|
|
3918
|
-
return global && global.tinymce ? global.tinymce : null;
|
|
3919
|
-
};
|
|
3920
|
-
var __extends = /* @__PURE__ */function () {
|
|
3921
|
-
var _extendStatics = function extendStatics(d, b) {
|
|
3922
|
-
_extendStatics = Object.setPrototypeOf || {
|
|
3923
|
-
__proto__: []
|
|
3924
|
-
} instanceof Array && function (d2, b2) {
|
|
3925
|
-
d2.__proto__ = b2;
|
|
3926
|
-
} || function (d2, b2) {
|
|
3927
|
-
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
|
3928
|
-
};
|
|
3929
|
-
return _extendStatics(d, b);
|
|
3930
|
-
};
|
|
3931
|
-
return function (d, b) {
|
|
3932
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3933
|
-
_extendStatics(d, b);
|
|
3934
|
-
function __() {
|
|
3935
|
-
this.constructor = d;
|
|
3936
|
-
}
|
|
3937
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3938
|
-
};
|
|
3939
|
-
}();
|
|
3940
|
-
var _assign = function __assign() {
|
|
3941
|
-
_assign = Object.assign || function (t) {
|
|
3942
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3943
|
-
s = arguments[i];
|
|
3944
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3945
|
-
}
|
|
3946
|
-
return t;
|
|
3947
|
-
};
|
|
3948
|
-
return _assign.apply(this, arguments);
|
|
3949
|
-
};
|
|
3950
|
-
var Editor = /** @class */
|
|
3951
|
-
function (_super) {
|
|
3952
|
-
__extends(Editor2, _super);
|
|
3953
|
-
function Editor2(props) {
|
|
3954
|
-
var _a2, _b, _c;
|
|
3955
|
-
var _this = _super.call(this, props) || this;
|
|
3956
|
-
_this.rollbackTimer = void 0;
|
|
3957
|
-
_this.valueCursor = void 0;
|
|
3958
|
-
_this.rollbackChange = function () {
|
|
3959
|
-
var editor = _this.editor;
|
|
3960
|
-
var value = _this.props.value;
|
|
3961
|
-
if (editor && value && value !== _this.currentContent) {
|
|
3962
|
-
editor.undoManager.ignore(function () {
|
|
3963
|
-
editor.setContent(value);
|
|
3964
|
-
if (_this.valueCursor && (!_this.inline || editor.hasFocus())) {
|
|
3965
|
-
try {
|
|
3966
|
-
editor.selection.moveToBookmark(_this.valueCursor);
|
|
3967
|
-
} catch (e) {}
|
|
3968
|
-
}
|
|
3969
|
-
});
|
|
3970
|
-
}
|
|
3971
|
-
_this.rollbackTimer = void 0;
|
|
3972
|
-
};
|
|
3973
|
-
_this.handleBeforeInput = function (_evt) {
|
|
3974
|
-
if (_this.props.value !== void 0 && _this.props.value === _this.currentContent && _this.editor) {
|
|
3975
|
-
if (!_this.inline || _this.editor.hasFocus()) {
|
|
3976
|
-
try {
|
|
3977
|
-
_this.valueCursor = _this.editor.selection.getBookmark(3);
|
|
3978
|
-
} catch (e) {}
|
|
3979
|
-
}
|
|
3980
|
-
}
|
|
3981
|
-
};
|
|
3982
|
-
_this.handleBeforeInputSpecial = function (evt) {
|
|
3983
|
-
if (evt.key === "Enter" || evt.key === "Backspace" || evt.key === "Delete") {
|
|
3984
|
-
_this.handleBeforeInput(evt);
|
|
3985
|
-
}
|
|
3986
|
-
};
|
|
3987
|
-
_this.handleEditorChange = function (_evt) {
|
|
3988
|
-
var editor = _this.editor;
|
|
3989
|
-
if (editor && editor.initialized) {
|
|
3990
|
-
var newContent = editor.getContent();
|
|
3991
|
-
if (_this.props.value !== void 0 && _this.props.value !== newContent && _this.props.rollback !== false) {
|
|
3992
|
-
if (!_this.rollbackTimer) {
|
|
3993
|
-
_this.rollbackTimer = window.setTimeout(_this.rollbackChange, typeof _this.props.rollback === "number" ? _this.props.rollback : 200);
|
|
3994
|
-
}
|
|
3995
|
-
}
|
|
3996
|
-
if (newContent !== _this.currentContent) {
|
|
3997
|
-
_this.currentContent = newContent;
|
|
3998
|
-
if (isFunction(_this.props.onEditorChange)) {
|
|
3999
|
-
_this.props.onEditorChange(newContent, editor);
|
|
4000
|
-
}
|
|
4001
|
-
}
|
|
4002
|
-
}
|
|
4003
|
-
};
|
|
4004
|
-
_this.handleEditorChangeSpecial = function (evt) {
|
|
4005
|
-
if (evt.key === "Backspace" || evt.key === "Delete") {
|
|
4006
|
-
_this.handleEditorChange(evt);
|
|
4007
|
-
}
|
|
4008
|
-
};
|
|
4009
|
-
_this.initialise = function (attempts) {
|
|
4010
|
-
var _a3, _b2, _c2;
|
|
4011
|
-
if (attempts === void 0) {
|
|
4012
|
-
attempts = 0;
|
|
4425
|
+
case 2:
|
|
4426
|
+
return _context2.a(2);
|
|
4427
|
+
}
|
|
4428
|
+
}, _callee2);
|
|
4429
|
+
}));
|
|
4430
|
+
};
|
|
4431
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4432
|
+
style: {
|
|
4433
|
+
flex: 1,
|
|
4434
|
+
minHeight: 0,
|
|
4435
|
+
position: "relative",
|
|
4436
|
+
overflowY: "auto",
|
|
4437
|
+
paddingRight: 16,
|
|
4438
|
+
marginRight: -16,
|
|
4439
|
+
marginBottom: 8,
|
|
4440
|
+
display: "flex",
|
|
4441
|
+
flexDirection: "column"
|
|
4442
|
+
}
|
|
4443
|
+
}, items && items.map(function (_item) {
|
|
4444
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4445
|
+
key: _item.id,
|
|
4446
|
+
style: {
|
|
4447
|
+
display: "flex",
|
|
4448
|
+
flexDirection: "column",
|
|
4449
|
+
marginBottom: 16
|
|
4013
4450
|
}
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4451
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4452
|
+
style: {
|
|
4453
|
+
width: "100%",
|
|
4454
|
+
display: "flex",
|
|
4455
|
+
alignItems: "flex-end",
|
|
4456
|
+
flexDirection: "column",
|
|
4457
|
+
position: "relative",
|
|
4458
|
+
marginTop: 8
|
|
4017
4459
|
}
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
throw new Error("tinymce can only be initialised when in a document");
|
|
4029
|
-
}
|
|
4030
|
-
return;
|
|
4460
|
+
}, /* @__PURE__ */React__namespace.createElement(TypingText, {
|
|
4461
|
+
data: {
|
|
4462
|
+
question: _item.question
|
|
4463
|
+
},
|
|
4464
|
+
style: {
|
|
4465
|
+
borderRadius: 8,
|
|
4466
|
+
borderTopRightRadius: 0,
|
|
4467
|
+
padding: "8px 12px",
|
|
4468
|
+
background: "var(--primary-main)",
|
|
4469
|
+
color: "var(--primary-contrasttext)"
|
|
4031
4470
|
}
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4471
|
+
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4472
|
+
style: {
|
|
4473
|
+
width: "100%",
|
|
4474
|
+
display: "flex",
|
|
4475
|
+
alignItems: "flex-start",
|
|
4476
|
+
flexDirection: "row",
|
|
4477
|
+
position: "relative",
|
|
4478
|
+
marginTop: 8,
|
|
4479
|
+
gap: 8
|
|
4035
4480
|
}
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
toolbar: (_b2 = _this.props.toolbar) !== null && _b2 !== void 0 ? _b2 : (_c2 = _this.props.init) === null || _c2 === void 0 ? void 0 : _c2.toolbar,
|
|
4043
|
-
setup: function setup(editor) {
|
|
4044
|
-
_this.editor = editor;
|
|
4045
|
-
_this.bindHandlers({});
|
|
4046
|
-
if (_this.inline && !isTextareaOrInput(target)) {
|
|
4047
|
-
editor.once("PostRender", function (_evt) {
|
|
4048
|
-
editor.setContent(_this.getInitialValue(), {
|
|
4049
|
-
no_events: true
|
|
4050
|
-
});
|
|
4051
|
-
});
|
|
4052
|
-
}
|
|
4053
|
-
if (_this.props.init && isFunction(_this.props.init.setup)) {
|
|
4054
|
-
_this.props.init.setup(editor);
|
|
4055
|
-
}
|
|
4056
|
-
},
|
|
4057
|
-
init_instance_callback: function init_instance_callback(editor) {
|
|
4058
|
-
var _a4, _b3;
|
|
4059
|
-
var initialValue = _this.getInitialValue();
|
|
4060
|
-
_this.currentContent = (_a4 = _this.currentContent) !== null && _a4 !== void 0 ? _a4 : editor.getContent();
|
|
4061
|
-
if (_this.currentContent !== initialValue) {
|
|
4062
|
-
_this.currentContent = initialValue;
|
|
4063
|
-
editor.setContent(initialValue);
|
|
4064
|
-
editor.undoManager.clear();
|
|
4065
|
-
editor.undoManager.add();
|
|
4066
|
-
editor.setDirty(false);
|
|
4067
|
-
}
|
|
4068
|
-
var disabled = (_b3 = _this.props.disabled) !== null && _b3 !== void 0 ? _b3 : false;
|
|
4069
|
-
setMode(_this.editor, disabled ? "readonly" : "design");
|
|
4070
|
-
if (_this.props.init && isFunction(_this.props.init.init_instance_callback)) {
|
|
4071
|
-
_this.props.init.init_instance_callback(editor);
|
|
4072
|
-
}
|
|
4073
|
-
}
|
|
4074
|
-
});
|
|
4075
|
-
if (!_this.inline) {
|
|
4076
|
-
target.style.visibility = "";
|
|
4481
|
+
}, /* @__PURE__ */React__namespace.createElement(AIAvatar, null), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4482
|
+
style: {
|
|
4483
|
+
flex: 1,
|
|
4484
|
+
minWidth: 0,
|
|
4485
|
+
display: "flex",
|
|
4486
|
+
flexDirection: "column"
|
|
4077
4487
|
}
|
|
4078
|
-
|
|
4079
|
-
|
|
4488
|
+
}, (_item == null ? void 0 : _item.isLoading) ? /* @__PURE__ */React__namespace.createElement(LoadingDots, null) : /* @__PURE__ */React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */React__namespace.createElement(TypingText, {
|
|
4489
|
+
data: {
|
|
4490
|
+
subject: _item.subject,
|
|
4491
|
+
body: _item.body
|
|
4492
|
+
},
|
|
4493
|
+
style: {
|
|
4494
|
+
background: "var(--background-softGrey)",
|
|
4495
|
+
borderRadius: 8,
|
|
4496
|
+
borderTopLeftRadius: 0,
|
|
4497
|
+
padding: "8px 12px"
|
|
4080
4498
|
}
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
_this.elementRef = React__namespace.createRef();
|
|
4085
|
-
_this.inline = (_c = (_a2 = _this.props.inline) !== null && _a2 !== void 0 ? _a2 : (_b = _this.props.init) === null || _b === void 0 ? void 0 : _b.inline) !== null && _c !== void 0 ? _c : false;
|
|
4086
|
-
_this.boundHandlers = {};
|
|
4087
|
-
return _this;
|
|
4088
|
-
}
|
|
4089
|
-
Object.defineProperty(Editor2.prototype, "view", {
|
|
4090
|
-
get: function get() {
|
|
4091
|
-
var _a2, _b;
|
|
4092
|
-
return (_b = (_a2 = this.elementRef.current) === null || _a2 === void 0 ? void 0 : _a2.ownerDocument.defaultView) !== null && _b !== void 0 ? _b : window;
|
|
4093
|
-
},
|
|
4094
|
-
enumerable: false,
|
|
4095
|
-
configurable: true
|
|
4096
|
-
});
|
|
4097
|
-
Editor2.prototype.componentDidUpdate = function (prevProps) {
|
|
4098
|
-
var _this = this;
|
|
4099
|
-
var _a2, _b;
|
|
4100
|
-
if (this.rollbackTimer) {
|
|
4101
|
-
clearTimeout(this.rollbackTimer);
|
|
4102
|
-
this.rollbackTimer = void 0;
|
|
4103
|
-
}
|
|
4104
|
-
if (this.editor) {
|
|
4105
|
-
this.bindHandlers(prevProps);
|
|
4106
|
-
if (this.editor.initialized) {
|
|
4107
|
-
this.currentContent = (_a2 = this.currentContent) !== null && _a2 !== void 0 ? _a2 : this.editor.getContent();
|
|
4108
|
-
if (typeof this.props.initialValue === "string" && this.props.initialValue !== prevProps.initialValue) {
|
|
4109
|
-
this.editor.setContent(this.props.initialValue);
|
|
4110
|
-
this.editor.undoManager.clear();
|
|
4111
|
-
this.editor.undoManager.add();
|
|
4112
|
-
this.editor.setDirty(false);
|
|
4113
|
-
} else if (typeof this.props.value === "string" && this.props.value !== this.currentContent) {
|
|
4114
|
-
var localEditor_1 = this.editor;
|
|
4115
|
-
localEditor_1.undoManager.transact(function () {
|
|
4116
|
-
var cursor;
|
|
4117
|
-
if (!_this.inline || localEditor_1.hasFocus()) {
|
|
4118
|
-
try {
|
|
4119
|
-
cursor = localEditor_1.selection.getBookmark(3);
|
|
4120
|
-
} catch (e) {}
|
|
4121
|
-
}
|
|
4122
|
-
var valueCursor = _this.valueCursor;
|
|
4123
|
-
localEditor_1.setContent(_this.props.value);
|
|
4124
|
-
if (!_this.inline || localEditor_1.hasFocus()) {
|
|
4125
|
-
for (var _i = 0, _a3 = [cursor, valueCursor]; _i < _a3.length; _i++) {
|
|
4126
|
-
var bookmark = _a3[_i];
|
|
4127
|
-
if (bookmark) {
|
|
4128
|
-
try {
|
|
4129
|
-
localEditor_1.selection.moveToBookmark(bookmark);
|
|
4130
|
-
_this.valueCursor = bookmark;
|
|
4131
|
-
break;
|
|
4132
|
-
} catch (e) {}
|
|
4133
|
-
}
|
|
4134
|
-
}
|
|
4135
|
-
}
|
|
4136
|
-
});
|
|
4137
|
-
}
|
|
4138
|
-
if (this.props.disabled !== prevProps.disabled) {
|
|
4139
|
-
var disabled = (_b = this.props.disabled) !== null && _b !== void 0 ? _b : false;
|
|
4140
|
-
setMode(this.editor, disabled ? "readonly" : "design");
|
|
4141
|
-
}
|
|
4499
|
+
}), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4500
|
+
style: {
|
|
4501
|
+
marginTop: 4
|
|
4142
4502
|
}
|
|
4503
|
+
}, /* @__PURE__ */React__namespace.createElement(Tooltip, {
|
|
4504
|
+
title: "Apply content"
|
|
4505
|
+
}, /* @__PURE__ */React__namespace.createElement("button", {
|
|
4506
|
+
type: "button",
|
|
4507
|
+
onClick: function onClick() {
|
|
4508
|
+
return handleApply(_item.body);
|
|
4509
|
+
},
|
|
4510
|
+
color: "primary",
|
|
4511
|
+
className: "icon-button small"
|
|
4512
|
+
}, /* @__PURE__ */React__namespace.createElement(Copy, {
|
|
4513
|
+
size: 16
|
|
4514
|
+
}))))))));
|
|
4515
|
+
}));
|
|
4516
|
+
};
|
|
4517
|
+
var CustomAiIcon = function CustomAiIcon(_ref26) {
|
|
4518
|
+
var _ref26$isGradient = _ref26.isGradient,
|
|
4519
|
+
isGradient = _ref26$isGradient === void 0 ? false : _ref26$isGradient,
|
|
4520
|
+
_ref26$stroke = _ref26.stroke,
|
|
4521
|
+
stroke = _ref26$stroke === void 0 ? 1.5 : _ref26$stroke,
|
|
4522
|
+
_ref26$size = _ref26.size,
|
|
4523
|
+
size = _ref26$size === void 0 ? 40 : _ref26$size;
|
|
4524
|
+
var gradientId = "ai-gradient-" + Math.random().toString(36).substr(2, 9);
|
|
4525
|
+
return /* @__PURE__ */React__namespace.createElement("svg", {
|
|
4526
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4527
|
+
width: size,
|
|
4528
|
+
height: size,
|
|
4529
|
+
viewBox: "0 0 24 24",
|
|
4530
|
+
style: {
|
|
4531
|
+
flexShrink: 0
|
|
4143
4532
|
}
|
|
4144
|
-
}
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4533
|
+
}, isGradient && /* @__PURE__ */React__namespace.createElement("defs", null, /* @__PURE__ */React__namespace.createElement("linearGradient", {
|
|
4534
|
+
id: gradientId,
|
|
4535
|
+
x1: "0%",
|
|
4536
|
+
y1: "0%",
|
|
4537
|
+
x2: "0%",
|
|
4538
|
+
y2: "100%"
|
|
4539
|
+
}, /* @__PURE__ */React__namespace.createElement("stop", {
|
|
4540
|
+
offset: "0%",
|
|
4541
|
+
stopColor: "#9D50BB"
|
|
4542
|
+
}, /* @__PURE__ */React__namespace.createElement("animate", {
|
|
4543
|
+
attributeName: "offset",
|
|
4544
|
+
values: "0%;0.4;0%",
|
|
4545
|
+
dur: "1s",
|
|
4546
|
+
repeatCount: "indefinite"
|
|
4547
|
+
})), /* @__PURE__ */React__namespace.createElement("stop", {
|
|
4548
|
+
offset: "30%",
|
|
4549
|
+
stopColor: "#6E48AA"
|
|
4550
|
+
}, /* @__PURE__ */React__namespace.createElement("animate", {
|
|
4551
|
+
attributeName: "offset",
|
|
4552
|
+
values: "0.4;0.7;0.4",
|
|
4553
|
+
dur: "1s",
|
|
4554
|
+
repeatCount: "indefinite"
|
|
4555
|
+
})), /* @__PURE__ */React__namespace.createElement("stop", {
|
|
4556
|
+
offset: "50%",
|
|
4557
|
+
stopColor: "#4776E6"
|
|
4558
|
+
}, /* @__PURE__ */React__namespace.createElement("animate", {
|
|
4559
|
+
attributeName: "offset",
|
|
4560
|
+
values: "0.5;0.7;0.5",
|
|
4561
|
+
dur: "1s",
|
|
4562
|
+
repeatCount: "indefinite"
|
|
4563
|
+
})), /* @__PURE__ */React__namespace.createElement("animateTransform", {
|
|
4564
|
+
attributeName: "gradientTransform",
|
|
4565
|
+
type: "translate",
|
|
4566
|
+
from: "0,0",
|
|
4567
|
+
to: "100,0",
|
|
4568
|
+
dur: "1s",
|
|
4569
|
+
repeatCount: "indefinite"
|
|
4570
|
+
}))), /* @__PURE__ */React__namespace.createElement("path", {
|
|
4571
|
+
fill: "none",
|
|
4572
|
+
stroke: isGradient ? "url(#".concat(gradientId, ")") : "currentColor",
|
|
4573
|
+
strokeLinecap: "round",
|
|
4574
|
+
strokeLinejoin: "round",
|
|
4575
|
+
strokeWidth: stroke,
|
|
4576
|
+
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 0zM20 3v4m2-2h-4M4 17v2m1-1H3"
|
|
4577
|
+
}));
|
|
4578
|
+
};
|
|
4579
|
+
var FEATURES = [{
|
|
4580
|
+
icon: /* @__PURE__ */React__namespace.createElement(MessageCircle, {
|
|
4581
|
+
size: 16
|
|
4582
|
+
}),
|
|
4583
|
+
title: "Request via message",
|
|
4584
|
+
desc: 'e.g., "Draft an email to Director Hong proposing a Q3 collaboration meeting (May 20, 3 PM)"'
|
|
4585
|
+
}, {
|
|
4586
|
+
icon: /* @__PURE__ */React__namespace.createElement(CustomAiIcon, {
|
|
4587
|
+
size: 16,
|
|
4588
|
+
stroke: 2
|
|
4589
|
+
}),
|
|
4590
|
+
title: "AI generates a draft",
|
|
4591
|
+
desc: "Refine the draft freely with follow-ups like 'more polite' or 'add a deadline'."
|
|
4592
|
+
}, {
|
|
4593
|
+
icon: /* @__PURE__ */React__namespace.createElement(Check, {
|
|
4594
|
+
size: 16
|
|
4595
|
+
}),
|
|
4596
|
+
title: "Apply to body",
|
|
4597
|
+
desc: "Insert the response you like into the email body and send."
|
|
4598
|
+
}];
|
|
4599
|
+
var SUGGESTIONS = ["Propose a Q3 meeting to Director Hong (May 20, 3 PM)", "Notify client of payment schedule (Due May 30)", "Welcome message to new employee (Joining May 22)"];
|
|
4600
|
+
var EmptyState = function EmptyState(_ref27) {
|
|
4601
|
+
var onSelectPrompt = _ref27.onSelectPrompt;
|
|
4602
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4603
|
+
style: {
|
|
4604
|
+
flex: 1,
|
|
4605
|
+
minHeight: 0,
|
|
4606
|
+
overflowY: "auto",
|
|
4607
|
+
display: "flex",
|
|
4608
|
+
flexDirection: "column",
|
|
4609
|
+
paddingRight: 8,
|
|
4610
|
+
marginRight: -8
|
|
4163
4611
|
}
|
|
4164
|
-
}
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
if (editor) {
|
|
4169
|
-
editor.off(this.changeEvents(), this.handleEditorChange);
|
|
4170
|
-
editor.off(this.beforeInputEvent(), this.handleBeforeInput);
|
|
4171
|
-
editor.off("keypress", this.handleEditorChangeSpecial);
|
|
4172
|
-
editor.off("keydown", this.handleBeforeInputSpecial);
|
|
4173
|
-
editor.off("NewBlock", this.handleEditorChange);
|
|
4174
|
-
Object.keys(this.boundHandlers).forEach(function (eventName) {
|
|
4175
|
-
editor.off(eventName, _this.boundHandlers[eventName]);
|
|
4176
|
-
});
|
|
4177
|
-
this.boundHandlers = {};
|
|
4178
|
-
editor.remove();
|
|
4179
|
-
this.editor = void 0;
|
|
4612
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4613
|
+
style: {
|
|
4614
|
+
textAlign: "center",
|
|
4615
|
+
marginTop: 8
|
|
4180
4616
|
}
|
|
4181
|
-
}
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
var isIE = (_c = (_b = (_a2 = getTinymce(this.view)) === null || _a2 === void 0 ? void 0 : _a2.Env) === null || _b === void 0 ? void 0 : _b.browser) === null || _c === void 0 ? void 0 : _c.isIE();
|
|
4188
|
-
return isIE ? "change keyup compositionend setcontent CommentChange" : "change input compositionend setcontent CommentChange";
|
|
4189
|
-
};
|
|
4190
|
-
Editor2.prototype.beforeInputEvent = function () {
|
|
4191
|
-
return isBeforeInputEventAvailable() ? "beforeinput SelectionChange" : "SelectionChange";
|
|
4192
|
-
};
|
|
4193
|
-
Editor2.prototype.renderInline = function () {
|
|
4194
|
-
var _a2 = this.props.tagName,
|
|
4195
|
-
tagName = _a2 === void 0 ? "div" : _a2;
|
|
4196
|
-
return React__namespace.createElement(tagName, {
|
|
4197
|
-
ref: this.elementRef,
|
|
4198
|
-
id: this.id
|
|
4199
|
-
});
|
|
4200
|
-
};
|
|
4201
|
-
Editor2.prototype.renderIframe = function () {
|
|
4202
|
-
return React__namespace.createElement("textarea", {
|
|
4203
|
-
ref: this.elementRef,
|
|
4204
|
-
style: {
|
|
4205
|
-
visibility: "hidden"
|
|
4206
|
-
},
|
|
4207
|
-
name: this.props.textareaName,
|
|
4208
|
-
id: this.id
|
|
4209
|
-
});
|
|
4210
|
-
};
|
|
4211
|
-
Editor2.prototype.getScriptSources = function () {
|
|
4212
|
-
var _a2, _b;
|
|
4213
|
-
var async = (_a2 = this.props.scriptLoading) === null || _a2 === void 0 ? void 0 : _a2.async;
|
|
4214
|
-
var defer = (_b = this.props.scriptLoading) === null || _b === void 0 ? void 0 : _b.defer;
|
|
4215
|
-
if (this.props.tinymceScriptSrc !== void 0) {
|
|
4216
|
-
if (typeof this.props.tinymceScriptSrc === "string") {
|
|
4217
|
-
return [{
|
|
4218
|
-
src: this.props.tinymceScriptSrc,
|
|
4219
|
-
async: async,
|
|
4220
|
-
defer: defer
|
|
4221
|
-
}];
|
|
4222
|
-
}
|
|
4223
|
-
return this.props.tinymceScriptSrc.map(function (item) {
|
|
4224
|
-
if (typeof item === "string") {
|
|
4225
|
-
return {
|
|
4226
|
-
src: item,
|
|
4227
|
-
async: async,
|
|
4228
|
-
defer: defer
|
|
4229
|
-
};
|
|
4230
|
-
} else {
|
|
4231
|
-
return item;
|
|
4232
|
-
}
|
|
4233
|
-
});
|
|
4617
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4618
|
+
style: {
|
|
4619
|
+
fontSize: 14,
|
|
4620
|
+
fontWeight: 600,
|
|
4621
|
+
color: "var(--text-primary)",
|
|
4622
|
+
lineHeight: 1.5
|
|
4234
4623
|
}
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
async: async,
|
|
4241
|
-
defer: defer
|
|
4242
|
-
}];
|
|
4243
|
-
};
|
|
4244
|
-
Editor2.prototype.getInitialValue = function () {
|
|
4245
|
-
if (typeof this.props.initialValue === "string") {
|
|
4246
|
-
return this.props.initialValue;
|
|
4247
|
-
} else if (typeof this.props.value === "string") {
|
|
4248
|
-
return this.props.value;
|
|
4249
|
-
} else {
|
|
4250
|
-
return "";
|
|
4624
|
+
}, "Let's draft a new email together from scratch."), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4625
|
+
style: {
|
|
4626
|
+
fontSize: 13,
|
|
4627
|
+
color: "var(--text-secondary)",
|
|
4628
|
+
marginTop: 4
|
|
4251
4629
|
}
|
|
4252
|
-
}
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
var
|
|
4264
|
-
if (!wasControlled && nowControlled) {
|
|
4265
|
-
this.editor.on(this.changeEvents(), this.handleEditorChange);
|
|
4266
|
-
this.editor.on(this.beforeInputEvent(), this.handleBeforeInput);
|
|
4267
|
-
this.editor.on("keydown", this.handleBeforeInputSpecial);
|
|
4268
|
-
this.editor.on("keyup", this.handleEditorChangeSpecial);
|
|
4269
|
-
this.editor.on("NewBlock", this.handleEditorChange);
|
|
4270
|
-
} else if (wasControlled && !nowControlled) {
|
|
4271
|
-
this.editor.off(this.changeEvents(), this.handleEditorChange);
|
|
4272
|
-
this.editor.off(this.beforeInputEvent(), this.handleBeforeInput);
|
|
4273
|
-
this.editor.off("keydown", this.handleBeforeInputSpecial);
|
|
4274
|
-
this.editor.off("keyup", this.handleEditorChangeSpecial);
|
|
4275
|
-
this.editor.off("NewBlock", this.handleEditorChange);
|
|
4276
|
-
}
|
|
4630
|
+
}, "Tell me what kind of email you'd like to write.")), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4631
|
+
style: {
|
|
4632
|
+
alignSelf: "center",
|
|
4633
|
+
width: 120,
|
|
4634
|
+
height: 120,
|
|
4635
|
+
borderRadius: "50%",
|
|
4636
|
+
background: "var(--primary-lighter)",
|
|
4637
|
+
display: "flex",
|
|
4638
|
+
alignItems: "center",
|
|
4639
|
+
justifyContent: "center",
|
|
4640
|
+
margin: "20px 0",
|
|
4641
|
+
color: "var(--primary-main)"
|
|
4277
4642
|
}
|
|
4278
|
-
}
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
}(React__namespace.Component);
|
|
4285
|
-
var useEditor = function useEditor(options) {
|
|
4286
|
-
var isSimple = options.isSimple,
|
|
4287
|
-
noImage = options.noImage;
|
|
4288
|
-
var fontSize = 13;
|
|
4289
|
-
var fontType = void 0;
|
|
4290
|
-
var fontWeight = 0;
|
|
4291
|
-
var lang = "en";
|
|
4292
|
-
var imageUploadBasePath = getBaseUrl();
|
|
4293
|
-
var supportImageTypes = "jpeg,JPEG,jpg,JPG,jpe,JPE,jfi,jif,jfif,png,PNG,gif,GIF,bmp,BMP,webp,WEBP";
|
|
4294
|
-
var fontfamily = function () {
|
|
4295
|
-
var baseFonts = "Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats;";
|
|
4296
|
-
var localeFonts = {
|
|
4297
|
-
ko: '맑은고딕=Malgun Gothic;돋움="돋움",Dotum;돋움체="돋움체",DotumChe;굴림="굴림",Gulim;굴림체="굴림체",GulimChe;바탕="바탕",Batang;바탕체="바탕체",BatangChe;궁서="궁서",Gungseo;',
|
|
4298
|
-
en: "MS PGothic=MS PGothic,Sans-serif;Meiryo UI=Meiryo UI,Sans-serif;HiraKakuProN-W3=HiraKakuProN-W3;MS PMincho=MS PMincho,Sans-serif;MS Gothic=MS Gothic,Sans-serif;MS Mincho=MS Mincho,Sans-serif;",
|
|
4299
|
-
ch: "Microsoft YaHei=Microsoft YaHei,Sans-serif;"
|
|
4300
|
-
};
|
|
4301
|
-
return localeFonts[lang] + baseFonts;
|
|
4302
|
-
}();
|
|
4303
|
-
var imageUploadUrl = function () {
|
|
4304
|
-
var locationInfo = window.location;
|
|
4305
|
-
var hostname = locationInfo.hostname;
|
|
4306
|
-
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
4307
|
-
return "".concat(imageUploadBasePath, "/ngw/app/lib/tinymce/plugins/jbimages/ci/index.php?upload/dropupload");
|
|
4308
|
-
} else {
|
|
4309
|
-
return "".concat(imageUploadBasePath, "/ngw/app/lib/tinymce/plugins/jbimages/ci/index.php?upload/dropupload");
|
|
4310
|
-
}
|
|
4311
|
-
}();
|
|
4312
|
-
var defaultPlugins;
|
|
4313
|
-
var defaultToolbar = [];
|
|
4314
|
-
if (isSimple) {
|
|
4315
|
-
defaultPlugins = "hanbiroclip";
|
|
4316
|
-
defaultToolbar = ["fontfamily fontsize", "bold italic underline", "forecolor backcolor", "bullist numlist", "emoticons"];
|
|
4317
|
-
} else {
|
|
4318
|
-
defaultPlugins = "checklist lists link image table code codesample insertdatetime emoticons fullscreen wordcount hanbiroclip";
|
|
4319
|
-
defaultToolbar = ["fontfamily fontsize styles", "align lineheight checklist", "bold italic underline", "forecolor backcolor", "bullist numlist", "link image table", "code codesample", "insertdatetime emoticons", "fullscreen", "removeformat"];
|
|
4320
|
-
}
|
|
4321
|
-
var setupFunction = function setupFunction(ed) {
|
|
4322
|
-
ed.on("init", function () {
|
|
4323
|
-
setTimeout(function () {
|
|
4324
|
-
var editorBody = ed == null ? void 0 : ed.getBody();
|
|
4325
|
-
var style = [];
|
|
4326
|
-
{
|
|
4327
|
-
ed.execCommand("FontSize", false, fontSize);
|
|
4328
|
-
style.push("font-size: ".concat(fontSize, "pt;"));
|
|
4329
|
-
}
|
|
4330
|
-
if ((style == null ? void 0 : style.length) > 0) {
|
|
4331
|
-
editorBody == null ? void 0 : editorBody.setAttribute("style", style.join(" "));
|
|
4332
|
-
}
|
|
4333
|
-
if (Number(fontWeight)) {
|
|
4334
|
-
ed.execCommand("Bold");
|
|
4335
|
-
}
|
|
4336
|
-
}, 0);
|
|
4337
|
-
});
|
|
4338
|
-
if (noImage) {
|
|
4339
|
-
ed.on("BeforeSetContent", function (e) {
|
|
4340
|
-
if (/<img[\s\S]*?>/i.test(e == null ? void 0 : e.content)) {
|
|
4341
|
-
ed.windowManager.alert("Image is not allowed!");
|
|
4342
|
-
}
|
|
4343
|
-
});
|
|
4643
|
+
}, /* @__PURE__ */React__namespace.createElement(CustomAiIcon, {
|
|
4644
|
+
size: 56,
|
|
4645
|
+
stroke: 1.5
|
|
4646
|
+
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4647
|
+
style: {
|
|
4648
|
+
textAlign: "center"
|
|
4344
4649
|
}
|
|
4345
|
-
}
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
reader.readAsDataURL(file);
|
|
4369
|
-
}
|
|
4370
|
-
};
|
|
4371
|
-
input.click();
|
|
4372
|
-
};
|
|
4373
|
-
return {
|
|
4374
|
-
defaultPlugins: defaultPlugins,
|
|
4375
|
-
defaultToolbar: defaultToolbar == null ? void 0 : defaultToolbar.join(" | "),
|
|
4376
|
-
imageUploadBasePath: imageUploadBasePath,
|
|
4377
|
-
imageUploadUrl: imageUploadUrl,
|
|
4378
|
-
supportImageTypes: supportImageTypes,
|
|
4379
|
-
fontfamily: fontfamily,
|
|
4380
|
-
setupFunction: setupFunction,
|
|
4381
|
-
filePickerHandle: filePickerHandle,
|
|
4382
|
-
defaultFontType: fontType,
|
|
4383
|
-
defaultFontSize: fontSize,
|
|
4384
|
-
isFontWeightBold: Number(fontWeight) === 1
|
|
4385
|
-
};
|
|
4386
|
-
};
|
|
4387
|
-
var TinyMceEditor = /*#__PURE__*/function (_React$Component) {
|
|
4388
|
-
function TinyMceEditor(props) {
|
|
4389
|
-
var _this1;
|
|
4390
|
-
_classCallCheck(this, TinyMceEditor);
|
|
4391
|
-
_this1 = _callSuper(this, TinyMceEditor, [props]);
|
|
4392
|
-
__publicField(_this1, "editorRef", null);
|
|
4393
|
-
// Các hàm public được expose ra (tương tự như useImperativeHandle trước đó)
|
|
4394
|
-
__publicField(_this1, "getContent", function () {
|
|
4395
|
-
var _a2;
|
|
4396
|
-
var editorContent = ((_a2 = _this1.editorRef) == null ? void 0 : _a2.getContent()) || "";
|
|
4397
|
-
return {
|
|
4398
|
-
content: editorContent
|
|
4399
|
-
};
|
|
4400
|
-
});
|
|
4401
|
-
__publicField(_this1, "getRawContent", function () {
|
|
4402
|
-
var _a2;
|
|
4403
|
-
var editorContent = ((_a2 = _this1.editorRef) == null ? void 0 : _a2.getContent()) || "";
|
|
4404
|
-
return editorContent;
|
|
4405
|
-
});
|
|
4406
|
-
__publicField(_this1, "handleEditorChange", function (content) {
|
|
4407
|
-
if (_this1.props.onChange) {
|
|
4408
|
-
_this1.props.onChange(content);
|
|
4650
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4651
|
+
style: {
|
|
4652
|
+
fontSize: 13,
|
|
4653
|
+
color: "var(--text-secondary)",
|
|
4654
|
+
lineHeight: 1.6
|
|
4655
|
+
}
|
|
4656
|
+
}, "Give me the recipient, purpose, and key points", /* @__PURE__ */React__namespace.createElement("br", null), "and AI will generate a polished draft.")), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4657
|
+
style: {
|
|
4658
|
+
borderTop: "1px solid var(--border-light)",
|
|
4659
|
+
marginTop: 20,
|
|
4660
|
+
paddingTop: 16,
|
|
4661
|
+
display: "flex",
|
|
4662
|
+
flexDirection: "column",
|
|
4663
|
+
gap: 14
|
|
4664
|
+
}
|
|
4665
|
+
}, FEATURES.map(function (f, i) {
|
|
4666
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4667
|
+
key: i,
|
|
4668
|
+
style: {
|
|
4669
|
+
display: "flex",
|
|
4670
|
+
flexDirection: "row",
|
|
4671
|
+
alignItems: "flex-start",
|
|
4672
|
+
gap: 10
|
|
4409
4673
|
}
|
|
4410
|
-
}
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
defaultToolbar = _useEditor.defaultToolbar,
|
|
4447
|
-
imageUploadBasePath = _useEditor.imageUploadBasePath,
|
|
4448
|
-
imageUploadUrl = _useEditor.imageUploadUrl,
|
|
4449
|
-
supportImageTypes = _useEditor.supportImageTypes,
|
|
4450
|
-
fontfamily = _useEditor.fontfamily,
|
|
4451
|
-
setupFunction = _useEditor.setupFunction,
|
|
4452
|
-
filePickerHandle = _useEditor.filePickerHandle,
|
|
4453
|
-
defaultFontSize = _useEditor.defaultFontSize;
|
|
4454
|
-
return /* @__PURE__ */React.createElement("div", {
|
|
4455
|
-
style: __spreadValues({
|
|
4456
|
-
position: "relative",
|
|
4457
|
-
borderRadius: 1,
|
|
4458
|
-
height: height
|
|
4459
|
-
}, style)
|
|
4460
|
-
}, /* @__PURE__ */React.createElement("style", null, "\n .tox.tox-tinymce {\n border-radius: 4px;\n }\n "), !showEditor && /* @__PURE__ */React.createElement(LoadingContainer, {
|
|
4461
|
-
style: {
|
|
4462
|
-
position: "absolute",
|
|
4463
|
-
top: 0,
|
|
4464
|
-
left: 0,
|
|
4465
|
-
right: 0,
|
|
4466
|
-
zIndex: 12,
|
|
4467
|
-
background: "#ffffff",
|
|
4468
|
-
border: "1px solid var(--border-main)",
|
|
4469
|
-
borderRadius: 4,
|
|
4470
|
-
height: (options == null ? void 0 : options.height) || height
|
|
4471
|
-
}
|
|
4472
|
-
}), /* @__PURE__ */React.createElement(Editor, {
|
|
4473
|
-
disabled: disabled,
|
|
4474
|
-
onEditorChange: this.handleEditorChange,
|
|
4475
|
-
value: value,
|
|
4476
|
-
onInit: function onInit(evt, editor) {
|
|
4477
|
-
_this10.setState({
|
|
4478
|
-
showEditor: true
|
|
4479
|
-
});
|
|
4480
|
-
_this10.editorRef = editor;
|
|
4481
|
-
},
|
|
4482
|
-
onClick: onClick,
|
|
4483
|
-
plugins: defaultPlugins,
|
|
4484
|
-
init: __spreadProps(__spreadValues({
|
|
4485
|
-
text_patterns: false,
|
|
4486
|
-
placeholder: placeholder,
|
|
4487
|
-
indent: false,
|
|
4488
|
-
skin: skin,
|
|
4489
|
-
visual: false,
|
|
4490
|
-
promotion: false,
|
|
4491
|
-
language: lang || "en",
|
|
4492
|
-
// language_url: language
|
|
4493
|
-
// ? `${process.env.PUBLIC_URL || ""}/js/tinymce/langs/${language}.js`
|
|
4494
|
-
// : undefined,
|
|
4495
|
-
branding: false,
|
|
4496
|
-
elementpath: false,
|
|
4497
|
-
height: height,
|
|
4498
|
-
menubar: !isSimple,
|
|
4499
|
-
verify_html: true,
|
|
4500
|
-
toolbar: defaultToolbar,
|
|
4501
|
-
toolbar_mode: "sliding",
|
|
4502
|
-
images_upload_base_path: imageUploadBasePath,
|
|
4503
|
-
images_upload_url: imageUploadUrl,
|
|
4504
|
-
images_upload_credentials: true,
|
|
4505
|
-
automatic_uploads: true,
|
|
4506
|
-
images_file_types: supportImageTypes,
|
|
4507
|
-
font_family_formats: fontfamily,
|
|
4508
|
-
paste_data_images: true,
|
|
4509
|
-
a11y_advanced_options: true,
|
|
4510
|
-
image_advtab: true,
|
|
4511
|
-
file_picker_types: "file image media",
|
|
4512
|
-
file_picker_callback: filePickerHandle,
|
|
4513
|
-
forced_root_block_attrs: {
|
|
4514
|
-
style: "margin: 0;"
|
|
4515
|
-
},
|
|
4516
|
-
font_size_formats: "6pt 8pt 9pt 10pt 11pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 36pt 48pt 72pt"
|
|
4517
|
-
}, noImage && {
|
|
4518
|
-
invalid_elements: "img"
|
|
4519
|
-
}), {
|
|
4520
|
-
content_style: "\n ".concat(scrollStyle, "\n [data-mce-placeholder]::before {\n color: rgba(0, 23, 55, 0.42) !important;\n }\n body { \n font-family: ", "Helvetica,Arial,sans-serif", "; \n font-size: ").concat(defaultFontSize, "pt;\n line-height: unset;\n background: var(--background-softGrey);\n color: var(--text-primary);\n }"),
|
|
4521
|
-
setup: setupFunction,
|
|
4522
|
-
relative_urls: false,
|
|
4523
|
-
remove_script_host: false,
|
|
4524
|
-
document_base_url: "/"
|
|
4525
|
-
})
|
|
4526
|
-
}));
|
|
4674
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4675
|
+
style: {
|
|
4676
|
+
width: 28,
|
|
4677
|
+
height: 28,
|
|
4678
|
+
borderRadius: "50%",
|
|
4679
|
+
background: "var(--background-softGrey)",
|
|
4680
|
+
color: "var(--primary-main)",
|
|
4681
|
+
display: "flex",
|
|
4682
|
+
alignItems: "center",
|
|
4683
|
+
justifyContent: "center",
|
|
4684
|
+
flexShrink: 0
|
|
4685
|
+
}
|
|
4686
|
+
}, f.icon), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4687
|
+
style: {
|
|
4688
|
+
flex: 1,
|
|
4689
|
+
minWidth: 0
|
|
4690
|
+
}
|
|
4691
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4692
|
+
style: {
|
|
4693
|
+
fontSize: 13,
|
|
4694
|
+
fontWeight: 600,
|
|
4695
|
+
color: "var(--text-primary)"
|
|
4696
|
+
}
|
|
4697
|
+
}, f.title), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4698
|
+
style: {
|
|
4699
|
+
fontSize: 12,
|
|
4700
|
+
color: "var(--text-secondary)",
|
|
4701
|
+
marginTop: 2,
|
|
4702
|
+
lineHeight: 1.5
|
|
4703
|
+
}
|
|
4704
|
+
}, f.desc)));
|
|
4705
|
+
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4706
|
+
style: {
|
|
4707
|
+
borderTop: "1px solid var(--border-light)",
|
|
4708
|
+
marginTop: 20,
|
|
4709
|
+
paddingTop: 16
|
|
4527
4710
|
}
|
|
4528
|
-
}
|
|
4529
|
-
|
|
4711
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4712
|
+
style: {
|
|
4713
|
+
fontSize: 12,
|
|
4714
|
+
color: "var(--text-secondary)",
|
|
4715
|
+
marginBottom: 8
|
|
4716
|
+
}
|
|
4717
|
+
}, "💡 Try these prompts to get a draft right away"), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4718
|
+
style: {
|
|
4719
|
+
display: "flex",
|
|
4720
|
+
flexDirection: "column",
|
|
4721
|
+
gap: 8
|
|
4722
|
+
}
|
|
4723
|
+
}, SUGGESTIONS.map(function (s, i) {
|
|
4724
|
+
return /* @__PURE__ */React__namespace.createElement("button", {
|
|
4725
|
+
key: i,
|
|
4726
|
+
type: "button",
|
|
4727
|
+
onClick: function onClick() {
|
|
4728
|
+
return onSelectPrompt(s);
|
|
4729
|
+
},
|
|
4730
|
+
style: {
|
|
4731
|
+
display: "flex",
|
|
4732
|
+
alignItems: "center",
|
|
4733
|
+
gap: 8,
|
|
4734
|
+
width: "100%",
|
|
4735
|
+
padding: "10px 12px",
|
|
4736
|
+
borderRadius: 8,
|
|
4737
|
+
border: "none",
|
|
4738
|
+
background: "var(--primary-lighter)",
|
|
4739
|
+
color: "var(--text-primary)",
|
|
4740
|
+
fontSize: 13,
|
|
4741
|
+
textAlign: "left",
|
|
4742
|
+
cursor: "pointer",
|
|
4743
|
+
fontFamily: "inherit"
|
|
4744
|
+
}
|
|
4745
|
+
}, /* @__PURE__ */React__namespace.createElement(MessageSquare, {
|
|
4746
|
+
size: 14,
|
|
4747
|
+
style: {
|
|
4748
|
+
color: "var(--primary-main)",
|
|
4749
|
+
flexShrink: 0
|
|
4750
|
+
}
|
|
4751
|
+
}), /* @__PURE__ */React__namespace.createElement("span", null, s));
|
|
4752
|
+
}))));
|
|
4753
|
+
};
|
|
4530
4754
|
var apiGet = function apiGet(url, opts) {
|
|
4531
|
-
return __async(
|
|
4755
|
+
return __async(_this9, null, /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
4532
4756
|
var response, data;
|
|
4533
4757
|
return _regenerator().w(function (_context3) {
|
|
4534
4758
|
while (1) switch (_context3.n) {
|
|
@@ -4565,205 +4789,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4565
4789
|
}, _callee3);
|
|
4566
4790
|
}));
|
|
4567
4791
|
};
|
|
4568
|
-
var SettingPopper = /*#__PURE__*/function (_React__namespace$Com2) {
|
|
4569
|
-
function SettingPopper(props) {
|
|
4570
|
-
var _this11;
|
|
4571
|
-
_classCallCheck(this, SettingPopper);
|
|
4572
|
-
_this11 = _callSuper(this, SettingPopper, [props]);
|
|
4573
|
-
__publicField(_this11, "containerRef");
|
|
4574
|
-
__publicField(_this11, "popperRef");
|
|
4575
|
-
__publicField(_this11, "getLanguageOptions", function () {
|
|
4576
|
-
return __async(_this11, null, /*#__PURE__*/_regenerator().m(function _callee4() {
|
|
4577
|
-
var _a2, _yield$apiGet, data, langs;
|
|
4578
|
-
return _regenerator().w(function (_context4) {
|
|
4579
|
-
while (1) switch (_context4.n) {
|
|
4580
|
-
case 0:
|
|
4581
|
-
_context4.n = 1;
|
|
4582
|
-
return apiGet("/email/ai/langlist");
|
|
4583
|
-
case 1:
|
|
4584
|
-
_yield$apiGet = _context4.v;
|
|
4585
|
-
data = _yield$apiGet.data;
|
|
4586
|
-
if (data == null ? void 0 : data.list) {
|
|
4587
|
-
langs = (_a2 = Object.keys(data == null ? void 0 : data.list)) == null ? void 0 : _a2.map(function (_key, i) {
|
|
4588
|
-
var _a3;
|
|
4589
|
-
var _item = (_a3 = data == null ? void 0 : data.list) == null ? void 0 : _a3[_key];
|
|
4590
|
-
return {
|
|
4591
|
-
value: _key,
|
|
4592
|
-
label: _item == null ? void 0 : _item.name
|
|
4593
|
-
};
|
|
4594
|
-
});
|
|
4595
|
-
this.setState({
|
|
4596
|
-
languageOptions: langs
|
|
4597
|
-
});
|
|
4598
|
-
}
|
|
4599
|
-
case 2:
|
|
4600
|
-
return _context4.a(2);
|
|
4601
|
-
}
|
|
4602
|
-
}, _callee4, this);
|
|
4603
|
-
}));
|
|
4604
|
-
});
|
|
4605
|
-
__publicField(_this11, "handleClickOutside", function (event) {
|
|
4606
|
-
var target = event.target;
|
|
4607
|
-
if (_this11.containerRef.current && !_this11.containerRef.current.contains(target) && (!_this11.popperRef.current || !_this11.popperRef.current.contains(target))) {
|
|
4608
|
-
_this11.setState({
|
|
4609
|
-
open: false
|
|
4610
|
-
});
|
|
4611
|
-
}
|
|
4612
|
-
});
|
|
4613
|
-
__publicField(_this11, "togglePopper", function () {
|
|
4614
|
-
_this11.setState(function (prevState) {
|
|
4615
|
-
return {
|
|
4616
|
-
open: !prevState.open
|
|
4617
|
-
};
|
|
4618
|
-
});
|
|
4619
|
-
});
|
|
4620
|
-
__publicField(_this11, "handleLangChange", function (e) {
|
|
4621
|
-
var selected = _this11.state.languageOptions.find(function (opt) {
|
|
4622
|
-
return opt.value === e.target.value;
|
|
4623
|
-
});
|
|
4624
|
-
_this11.props.setLang(selected || null);
|
|
4625
|
-
});
|
|
4626
|
-
_this11.state = {
|
|
4627
|
-
open: false,
|
|
4628
|
-
languageOptions: []
|
|
4629
|
-
};
|
|
4630
|
-
_this11.containerRef = React__namespace.createRef();
|
|
4631
|
-
_this11.popperRef = React__namespace.createRef();
|
|
4632
|
-
return _this11;
|
|
4633
|
-
}
|
|
4634
|
-
_inherits(SettingPopper, _React__namespace$Com2);
|
|
4635
|
-
return _createClass(SettingPopper, [{
|
|
4636
|
-
key: "componentDidMount",
|
|
4637
|
-
value: function componentDidMount() {
|
|
4638
|
-
document.addEventListener("mousedown", this.handleClickOutside);
|
|
4639
|
-
this.getLanguageOptions();
|
|
4640
|
-
}
|
|
4641
|
-
}, {
|
|
4642
|
-
key: "componentWillUnmount",
|
|
4643
|
-
value: function componentWillUnmount() {
|
|
4644
|
-
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
4645
|
-
}
|
|
4646
|
-
}, {
|
|
4647
|
-
key: "render",
|
|
4648
|
-
value: function render() {
|
|
4649
|
-
var _this$props4 = this.props,
|
|
4650
|
-
lang = _this$props4.lang,
|
|
4651
|
-
originalEmail = _this$props4.originalEmail,
|
|
4652
|
-
setOriginalEmail = _this$props4.setOriginalEmail,
|
|
4653
|
-
getEditorContent = _this$props4.getEditorContent,
|
|
4654
|
-
parentRef = _this$props4.parentRef;
|
|
4655
|
-
var _this$state2 = this.state,
|
|
4656
|
-
open = _this$state2.open,
|
|
4657
|
-
languageOptions = _this$state2.languageOptions;
|
|
4658
|
-
var popperTop = 0;
|
|
4659
|
-
var popperLeft = 0;
|
|
4660
|
-
var popperWidth = 320;
|
|
4661
|
-
if (open && this.containerRef.current) {
|
|
4662
|
-
var rect = this.containerRef.current.getBoundingClientRect();
|
|
4663
|
-
popperTop = rect.top + (window.scrollY || document.documentElement.scrollTop) - 8;
|
|
4664
|
-
popperLeft = rect.left + (window.scrollX || document.documentElement.scrollLeft);
|
|
4665
|
-
if (parentRef && parentRef.current) {
|
|
4666
|
-
var parentRect = parentRef.current.getBoundingClientRect();
|
|
4667
|
-
popperWidth = parentRect.width - 16;
|
|
4668
|
-
popperLeft = parentRect.left + 8;
|
|
4669
|
-
}
|
|
4670
|
-
}
|
|
4671
|
-
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4672
|
-
ref: this.containerRef,
|
|
4673
|
-
style: {
|
|
4674
|
-
position: "relative",
|
|
4675
|
-
display: "inline-block"
|
|
4676
|
-
}
|
|
4677
|
-
}, /* @__PURE__ */React__namespace.createElement("button", {
|
|
4678
|
-
type: "button",
|
|
4679
|
-
onClick: this.togglePopper,
|
|
4680
|
-
className: "icon-button small"
|
|
4681
|
-
}, /* @__PURE__ */React__namespace.createElement(Settings, {
|
|
4682
|
-
size: 16
|
|
4683
|
-
})), open && this.containerRef.current && ReactDOM__namespace.createPortal(/* @__PURE__ */React__namespace.createElement("div", {
|
|
4684
|
-
ref: this.popperRef,
|
|
4685
|
-
style: {
|
|
4686
|
-
position: "absolute",
|
|
4687
|
-
top: popperTop,
|
|
4688
|
-
left: popperLeft,
|
|
4689
|
-
transform: "translateY(-100%)",
|
|
4690
|
-
zIndex: 1051,
|
|
4691
|
-
background: "#fff",
|
|
4692
|
-
border: "1px solid #ddd",
|
|
4693
|
-
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
4694
|
-
borderRadius: 8,
|
|
4695
|
-
padding: 16,
|
|
4696
|
-
width: popperWidth,
|
|
4697
|
-
boxSizing: "border-box"
|
|
4698
|
-
}
|
|
4699
|
-
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4700
|
-
style: {
|
|
4701
|
-
display: "flex",
|
|
4702
|
-
flexDirection: "column",
|
|
4703
|
-
gap: 12
|
|
4704
|
-
}
|
|
4705
|
-
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4706
|
-
style: {
|
|
4707
|
-
display: "flex",
|
|
4708
|
-
flexDirection: "column",
|
|
4709
|
-
gap: 4
|
|
4710
|
-
}
|
|
4711
|
-
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
4712
|
-
style: {
|
|
4713
|
-
fontSize: 12,
|
|
4714
|
-
fontWeight: 500
|
|
4715
|
-
// color: "var(--text-secondary)",
|
|
4716
|
-
}
|
|
4717
|
-
}, "Language"), /* @__PURE__ */React__namespace.createElement("select", {
|
|
4718
|
-
name: "language",
|
|
4719
|
-
value: lang ? lang.value : "",
|
|
4720
|
-
onChange: this.handleLangChange
|
|
4721
|
-
}, /* @__PURE__ */React__namespace.createElement("option", {
|
|
4722
|
-
value: "",
|
|
4723
|
-
disabled: true
|
|
4724
|
-
}, "Select Language"), languageOptions.map(function (opt) {
|
|
4725
|
-
return /* @__PURE__ */React__namespace.createElement("option", {
|
|
4726
|
-
key: opt.value,
|
|
4727
|
-
value: opt.value
|
|
4728
|
-
}, opt.label);
|
|
4729
|
-
}))), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4730
|
-
style: {
|
|
4731
|
-
display: "flex",
|
|
4732
|
-
flexDirection: "column",
|
|
4733
|
-
gap: 4
|
|
4734
|
-
}
|
|
4735
|
-
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4736
|
-
style: {
|
|
4737
|
-
display: "flex",
|
|
4738
|
-
alignItems: "center",
|
|
4739
|
-
justifyContent: "space-between"
|
|
4740
|
-
}
|
|
4741
|
-
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
4742
|
-
style: {
|
|
4743
|
-
fontSize: 12,
|
|
4744
|
-
fontWeight: 500
|
|
4745
|
-
// color: "var(--text-secondary)",
|
|
4746
|
-
}
|
|
4747
|
-
}, "AI Context"), getEditorContent && /* @__PURE__ */React__namespace.createElement(Tooltip, {
|
|
4748
|
-
title: "Copy from origin email"
|
|
4749
|
-
}, /* @__PURE__ */React__namespace.createElement("button", {
|
|
4750
|
-
type: "button",
|
|
4751
|
-
onClick: function onClick() {
|
|
4752
|
-
var currentContent = getEditorContent();
|
|
4753
|
-
setOriginalEmail(currentContent);
|
|
4754
|
-
},
|
|
4755
|
-
className: "icon-button small"
|
|
4756
|
-
}, /* @__PURE__ */React__namespace.createElement(Copy, null)))), /* @__PURE__ */React__namespace.createElement(TinyMceEditor, {
|
|
4757
|
-
value: originalEmail,
|
|
4758
|
-
onChange: function onChange(val) {
|
|
4759
|
-
return setOriginalEmail(val);
|
|
4760
|
-
},
|
|
4761
|
-
height: 350,
|
|
4762
|
-
isSimple: true
|
|
4763
|
-
})))), document.body));
|
|
4764
|
-
}
|
|
4765
|
-
}]);
|
|
4766
|
-
}(React__namespace.Component);
|
|
4767
4792
|
var AI_LANG_FLAGS = [{
|
|
4768
4793
|
label: "English",
|
|
4769
4794
|
value: "en",
|
|
@@ -6382,29 +6407,465 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6382
6407
|
us: USFlag,
|
|
6383
6408
|
vn: VNFlag
|
|
6384
6409
|
};
|
|
6385
|
-
var CountryFlag = function CountryFlag(props) {
|
|
6386
|
-
var _a2 = props,
|
|
6387
|
-
flagCode = _a2.flagCode,
|
|
6388
|
-
style = _a2.style,
|
|
6389
|
-
rest = __objRest(_a2, ["flagCode", "style"]);
|
|
6390
|
-
if (!flagCode) return null;
|
|
6391
|
-
var FlagComponent = FlagMap[flagCode];
|
|
6392
|
-
if (!FlagComponent) return null;
|
|
6393
|
-
return /* @__PURE__ */React__namespace.createElement(FlagComponent, __spreadValues({
|
|
6394
|
-
style: style
|
|
6395
|
-
}, rest));
|
|
6410
|
+
var CountryFlag = function CountryFlag(props) {
|
|
6411
|
+
var _a2 = props,
|
|
6412
|
+
flagCode = _a2.flagCode,
|
|
6413
|
+
style = _a2.style,
|
|
6414
|
+
rest = __objRest(_a2, ["flagCode", "style"]);
|
|
6415
|
+
if (!flagCode) return null;
|
|
6416
|
+
var FlagComponent = FlagMap[flagCode];
|
|
6417
|
+
if (!FlagComponent) return null;
|
|
6418
|
+
return /* @__PURE__ */React__namespace.createElement(FlagComponent, __spreadValues({
|
|
6419
|
+
style: style
|
|
6420
|
+
}, rest));
|
|
6421
|
+
};
|
|
6422
|
+
var TONE_OPTIONS = [{
|
|
6423
|
+
label: "Formal",
|
|
6424
|
+
value: "formal"
|
|
6425
|
+
}, {
|
|
6426
|
+
label: "Polite",
|
|
6427
|
+
value: "polite"
|
|
6428
|
+
}, {
|
|
6429
|
+
label: "Neutral",
|
|
6430
|
+
value: "neutral"
|
|
6431
|
+
}, {
|
|
6432
|
+
label: "Friendly",
|
|
6433
|
+
value: "friendly"
|
|
6434
|
+
}, {
|
|
6435
|
+
label: "Firm",
|
|
6436
|
+
value: "firm"
|
|
6437
|
+
}, {
|
|
6438
|
+
label: "Apology",
|
|
6439
|
+
value: "apologetic"
|
|
6440
|
+
}];
|
|
6441
|
+
var LENGTH_OPTIONS = [{
|
|
6442
|
+
label: "Short",
|
|
6443
|
+
value: "short"
|
|
6444
|
+
}, {
|
|
6445
|
+
label: "Medium",
|
|
6446
|
+
value: "medium"
|
|
6447
|
+
}, {
|
|
6448
|
+
label: "Long",
|
|
6449
|
+
value: "long"
|
|
6450
|
+
}, {
|
|
6451
|
+
label: "1-liner",
|
|
6452
|
+
value: "one_liner"
|
|
6453
|
+
}];
|
|
6454
|
+
var getFlagCode = function getFlagCode(value) {
|
|
6455
|
+
var _a2;
|
|
6456
|
+
return (_a2 = AI_LANG_FLAGS.find(function (l) {
|
|
6457
|
+
return l.value === value;
|
|
6458
|
+
})) == null ? void 0 : _a2.flagCode;
|
|
6459
|
+
};
|
|
6460
|
+
var LanguageSelect = /*#__PURE__*/function (_React__namespace$Com2) {
|
|
6461
|
+
function LanguageSelect(props) {
|
|
6462
|
+
var _this0;
|
|
6463
|
+
_classCallCheck(this, LanguageSelect);
|
|
6464
|
+
_this0 = _callSuper(this, LanguageSelect, [props]);
|
|
6465
|
+
__publicField(_this0, "ref");
|
|
6466
|
+
__publicField(_this0, "handleClickOutside", function (e) {
|
|
6467
|
+
if (_this0.ref.current && !_this0.ref.current.contains(e.target)) {
|
|
6468
|
+
_this0.setState({
|
|
6469
|
+
open: false
|
|
6470
|
+
});
|
|
6471
|
+
}
|
|
6472
|
+
});
|
|
6473
|
+
__publicField(_this0, "toggle", function () {
|
|
6474
|
+
_this0.setState(function (s) {
|
|
6475
|
+
return {
|
|
6476
|
+
open: !s.open
|
|
6477
|
+
};
|
|
6478
|
+
});
|
|
6479
|
+
});
|
|
6480
|
+
__publicField(_this0, "pick", function (opt) {
|
|
6481
|
+
_this0.props.onChange(opt);
|
|
6482
|
+
_this0.setState({
|
|
6483
|
+
open: false
|
|
6484
|
+
});
|
|
6485
|
+
});
|
|
6486
|
+
_this0.state = {
|
|
6487
|
+
open: false
|
|
6488
|
+
};
|
|
6489
|
+
_this0.ref = React__namespace.createRef();
|
|
6490
|
+
return _this0;
|
|
6491
|
+
}
|
|
6492
|
+
_inherits(LanguageSelect, _React__namespace$Com2);
|
|
6493
|
+
return _createClass(LanguageSelect, [{
|
|
6494
|
+
key: "componentDidMount",
|
|
6495
|
+
value: function componentDidMount() {
|
|
6496
|
+
document.addEventListener("mousedown", this.handleClickOutside);
|
|
6497
|
+
}
|
|
6498
|
+
}, {
|
|
6499
|
+
key: "componentWillUnmount",
|
|
6500
|
+
value: function componentWillUnmount() {
|
|
6501
|
+
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
6502
|
+
}
|
|
6503
|
+
}, {
|
|
6504
|
+
key: "render",
|
|
6505
|
+
value: function render() {
|
|
6506
|
+
var _this1 = this;
|
|
6507
|
+
var _this$props3 = this.props,
|
|
6508
|
+
value = _this$props3.value,
|
|
6509
|
+
options = _this$props3.options;
|
|
6510
|
+
var open = this.state.open;
|
|
6511
|
+
var selectedFlag = getFlagCode(value == null ? void 0 : value.value);
|
|
6512
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
6513
|
+
ref: this.ref,
|
|
6514
|
+
style: {
|
|
6515
|
+
position: "relative",
|
|
6516
|
+
width: "100%"
|
|
6517
|
+
}
|
|
6518
|
+
}, /* @__PURE__ */React__namespace.createElement("button", {
|
|
6519
|
+
type: "button",
|
|
6520
|
+
onClick: this.toggle,
|
|
6521
|
+
style: {
|
|
6522
|
+
width: "100%",
|
|
6523
|
+
display: "flex",
|
|
6524
|
+
alignItems: "center",
|
|
6525
|
+
gap: 8,
|
|
6526
|
+
padding: "8px 10px",
|
|
6527
|
+
border: "1px solid var(--border-main)",
|
|
6528
|
+
borderRadius: 4,
|
|
6529
|
+
background: "#fff",
|
|
6530
|
+
cursor: "pointer",
|
|
6531
|
+
fontFamily: "inherit",
|
|
6532
|
+
fontSize: 13,
|
|
6533
|
+
color: "var(--text-primary)"
|
|
6534
|
+
}
|
|
6535
|
+
}, selectedFlag && /* @__PURE__ */React__namespace.createElement(CountryFlag, {
|
|
6536
|
+
flagCode: selectedFlag,
|
|
6537
|
+
style: {
|
|
6538
|
+
width: 18,
|
|
6539
|
+
height: 14,
|
|
6540
|
+
flexShrink: 0
|
|
6541
|
+
}
|
|
6542
|
+
}), /* @__PURE__ */React__namespace.createElement("span", {
|
|
6543
|
+
style: {
|
|
6544
|
+
flex: 1,
|
|
6545
|
+
textAlign: "left"
|
|
6546
|
+
}
|
|
6547
|
+
}, (value == null ? void 0 : value.label) || "Select Language"), /* @__PURE__ */React__namespace.createElement(ChevronDown, {
|
|
6548
|
+
size: 14,
|
|
6549
|
+
style: {
|
|
6550
|
+
transform: open ? "rotate(180deg)" : "none",
|
|
6551
|
+
transition: "transform 0.15s"
|
|
6552
|
+
}
|
|
6553
|
+
})), open && /* @__PURE__ */React__namespace.createElement("div", {
|
|
6554
|
+
style: {
|
|
6555
|
+
position: "absolute",
|
|
6556
|
+
top: "calc(100% + 4px)",
|
|
6557
|
+
left: 0,
|
|
6558
|
+
right: 0,
|
|
6559
|
+
maxHeight: 220,
|
|
6560
|
+
overflowY: "auto",
|
|
6561
|
+
border: "1px solid var(--border-main)",
|
|
6562
|
+
borderRadius: 4,
|
|
6563
|
+
background: "#fff",
|
|
6564
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)",
|
|
6565
|
+
zIndex: 2
|
|
6566
|
+
}
|
|
6567
|
+
}, options.map(function (opt) {
|
|
6568
|
+
var fc = getFlagCode(opt.value);
|
|
6569
|
+
var isActive = (value == null ? void 0 : value.value) === opt.value;
|
|
6570
|
+
return /* @__PURE__ */React__namespace.createElement("button", {
|
|
6571
|
+
key: opt.value,
|
|
6572
|
+
type: "button",
|
|
6573
|
+
onClick: function onClick() {
|
|
6574
|
+
return _this1.pick(opt);
|
|
6575
|
+
},
|
|
6576
|
+
className: "chat-ai-lang-option" + (isActive ? " is-active" : ""),
|
|
6577
|
+
style: {
|
|
6578
|
+
width: "100%",
|
|
6579
|
+
display: "flex",
|
|
6580
|
+
alignItems: "center",
|
|
6581
|
+
gap: 8,
|
|
6582
|
+
padding: "8px 10px",
|
|
6583
|
+
border: "none",
|
|
6584
|
+
background: isActive ? "var(--primary-lighter)" : void 0,
|
|
6585
|
+
cursor: "pointer",
|
|
6586
|
+
fontFamily: "inherit",
|
|
6587
|
+
fontSize: 13,
|
|
6588
|
+
textAlign: "left",
|
|
6589
|
+
color: "var(--text-primary)",
|
|
6590
|
+
fontWeight: 400
|
|
6591
|
+
}
|
|
6592
|
+
}, fc && /* @__PURE__ */React__namespace.createElement(CountryFlag, {
|
|
6593
|
+
flagCode: fc,
|
|
6594
|
+
style: {
|
|
6595
|
+
width: 18,
|
|
6596
|
+
height: 14,
|
|
6597
|
+
flexShrink: 0
|
|
6598
|
+
}
|
|
6599
|
+
}), /* @__PURE__ */React__namespace.createElement("span", null, opt.label));
|
|
6600
|
+
})));
|
|
6601
|
+
}
|
|
6602
|
+
}]);
|
|
6603
|
+
}(React__namespace.Component);
|
|
6604
|
+
var ICON_SIZE = 14;
|
|
6605
|
+
var TONE_ICONS = {
|
|
6606
|
+
formal: /* @__PURE__ */React__namespace.createElement(Award, {
|
|
6607
|
+
size: ICON_SIZE
|
|
6608
|
+
}),
|
|
6609
|
+
polite: /* @__PURE__ */React__namespace.createElement(Heart, {
|
|
6610
|
+
size: ICON_SIZE
|
|
6611
|
+
}),
|
|
6612
|
+
neutral: /* @__PURE__ */React__namespace.createElement(Compass, {
|
|
6613
|
+
size: ICON_SIZE
|
|
6614
|
+
}),
|
|
6615
|
+
friendly: /* @__PURE__ */React__namespace.createElement(Smile, {
|
|
6616
|
+
size: ICON_SIZE
|
|
6617
|
+
}),
|
|
6618
|
+
firm: /* @__PURE__ */React__namespace.createElement(ThumbsUp, {
|
|
6619
|
+
size: ICON_SIZE
|
|
6620
|
+
}),
|
|
6621
|
+
apologetic: /* @__PURE__ */React__namespace.createElement(Frown, {
|
|
6622
|
+
size: ICON_SIZE
|
|
6623
|
+
})
|
|
6624
|
+
};
|
|
6625
|
+
var LENGTH_ICONS = {
|
|
6626
|
+
short: /* @__PURE__ */React__namespace.createElement(Scissors, {
|
|
6627
|
+
size: ICON_SIZE
|
|
6628
|
+
}),
|
|
6629
|
+
medium: /* @__PURE__ */React__namespace.createElement(AlignJustify, {
|
|
6630
|
+
size: ICON_SIZE
|
|
6631
|
+
}),
|
|
6632
|
+
long: /* @__PURE__ */React__namespace.createElement(FileText, {
|
|
6633
|
+
size: ICON_SIZE
|
|
6634
|
+
}),
|
|
6635
|
+
one_liner: /* @__PURE__ */React__namespace.createElement(Zap, {
|
|
6636
|
+
size: ICON_SIZE
|
|
6637
|
+
})
|
|
6396
6638
|
};
|
|
6397
|
-
var
|
|
6639
|
+
var SettingPopper = /*#__PURE__*/function (_React__namespace$Com3) {
|
|
6640
|
+
function SettingPopper(props) {
|
|
6641
|
+
var _this10;
|
|
6642
|
+
_classCallCheck(this, SettingPopper);
|
|
6643
|
+
_this10 = _callSuper(this, SettingPopper, [props]);
|
|
6644
|
+
__publicField(_this10, "containerRef");
|
|
6645
|
+
__publicField(_this10, "popperRef");
|
|
6646
|
+
__publicField(_this10, "getLanguageOptions", function () {
|
|
6647
|
+
return __async(_this10, null, /*#__PURE__*/_regenerator().m(function _callee4() {
|
|
6648
|
+
var _a2, _yield$apiGet, data, langs;
|
|
6649
|
+
return _regenerator().w(function (_context4) {
|
|
6650
|
+
while (1) switch (_context4.n) {
|
|
6651
|
+
case 0:
|
|
6652
|
+
_context4.n = 1;
|
|
6653
|
+
return apiGet("/email/ai/langlist");
|
|
6654
|
+
case 1:
|
|
6655
|
+
_yield$apiGet = _context4.v;
|
|
6656
|
+
data = _yield$apiGet.data;
|
|
6657
|
+
if (data == null ? void 0 : data.list) {
|
|
6658
|
+
langs = (_a2 = Object.keys(data == null ? void 0 : data.list)) == null ? void 0 : _a2.map(function (_key, i) {
|
|
6659
|
+
var _a3;
|
|
6660
|
+
var _item = (_a3 = data == null ? void 0 : data.list) == null ? void 0 : _a3[_key];
|
|
6661
|
+
return {
|
|
6662
|
+
value: _key,
|
|
6663
|
+
label: _item == null ? void 0 : _item.name
|
|
6664
|
+
};
|
|
6665
|
+
});
|
|
6666
|
+
this.setState({
|
|
6667
|
+
languageOptions: langs
|
|
6668
|
+
});
|
|
6669
|
+
}
|
|
6670
|
+
case 2:
|
|
6671
|
+
return _context4.a(2);
|
|
6672
|
+
}
|
|
6673
|
+
}, _callee4, this);
|
|
6674
|
+
}));
|
|
6675
|
+
});
|
|
6676
|
+
__publicField(_this10, "handleClickOutside", function (event) {
|
|
6677
|
+
var target = event.target;
|
|
6678
|
+
if (_this10.containerRef.current && !_this10.containerRef.current.contains(target) && (!_this10.popperRef.current || !_this10.popperRef.current.contains(target))) {
|
|
6679
|
+
_this10.setState({
|
|
6680
|
+
open: false
|
|
6681
|
+
});
|
|
6682
|
+
}
|
|
6683
|
+
});
|
|
6684
|
+
__publicField(_this10, "togglePopper", function () {
|
|
6685
|
+
_this10.setState(function (prevState) {
|
|
6686
|
+
return {
|
|
6687
|
+
open: !prevState.open
|
|
6688
|
+
};
|
|
6689
|
+
});
|
|
6690
|
+
});
|
|
6691
|
+
__publicField(_this10, "renderChipGroup", function (options, selected, onSelect, iconMap) {
|
|
6692
|
+
var columns = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 3;
|
|
6693
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
6694
|
+
style: {
|
|
6695
|
+
display: "grid",
|
|
6696
|
+
gridTemplateColumns: "repeat(".concat(columns, ", minmax(0, 1fr))"),
|
|
6697
|
+
gap: 6
|
|
6698
|
+
}
|
|
6699
|
+
}, options.map(function (opt) {
|
|
6700
|
+
var isActive = (selected == null ? void 0 : selected.value) === opt.value;
|
|
6701
|
+
return /* @__PURE__ */React__namespace.createElement("button", {
|
|
6702
|
+
key: opt.value,
|
|
6703
|
+
type: "button",
|
|
6704
|
+
onClick: function onClick() {
|
|
6705
|
+
return onSelect(opt);
|
|
6706
|
+
},
|
|
6707
|
+
style: {
|
|
6708
|
+
display: "flex",
|
|
6709
|
+
alignItems: "center",
|
|
6710
|
+
justifyContent: "center",
|
|
6711
|
+
gap: 6,
|
|
6712
|
+
padding: "8px 10px",
|
|
6713
|
+
borderRadius: 4,
|
|
6714
|
+
border: isActive ? "1px solid var(--primary-main)" : "1px solid var(--border-main)",
|
|
6715
|
+
background: isActive ? "var(--primary-lighter)" : "#fff",
|
|
6716
|
+
color: isActive ? "var(--primary-main)" : "var(--text-primary)",
|
|
6717
|
+
fontWeight: isActive ? 600 : 400,
|
|
6718
|
+
fontSize: 13,
|
|
6719
|
+
cursor: "pointer",
|
|
6720
|
+
fontFamily: "inherit",
|
|
6721
|
+
transition: "background 0.15s, border-color 0.15s",
|
|
6722
|
+
minWidth: 0
|
|
6723
|
+
}
|
|
6724
|
+
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
6725
|
+
style: {
|
|
6726
|
+
display: "inline-flex",
|
|
6727
|
+
alignItems: "center",
|
|
6728
|
+
flexShrink: 0
|
|
6729
|
+
}
|
|
6730
|
+
}, iconMap[opt.value]), /* @__PURE__ */React__namespace.createElement("span", {
|
|
6731
|
+
style: {
|
|
6732
|
+
whiteSpace: "nowrap"
|
|
6733
|
+
}
|
|
6734
|
+
}, opt.label));
|
|
6735
|
+
}));
|
|
6736
|
+
});
|
|
6737
|
+
_this10.state = {
|
|
6738
|
+
open: false,
|
|
6739
|
+
languageOptions: []
|
|
6740
|
+
};
|
|
6741
|
+
_this10.containerRef = React__namespace.createRef();
|
|
6742
|
+
_this10.popperRef = React__namespace.createRef();
|
|
6743
|
+
return _this10;
|
|
6744
|
+
}
|
|
6745
|
+
_inherits(SettingPopper, _React__namespace$Com3);
|
|
6746
|
+
return _createClass(SettingPopper, [{
|
|
6747
|
+
key: "componentDidMount",
|
|
6748
|
+
value: function componentDidMount() {
|
|
6749
|
+
document.addEventListener("mousedown", this.handleClickOutside);
|
|
6750
|
+
this.getLanguageOptions();
|
|
6751
|
+
}
|
|
6752
|
+
}, {
|
|
6753
|
+
key: "componentWillUnmount",
|
|
6754
|
+
value: function componentWillUnmount() {
|
|
6755
|
+
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
6756
|
+
}
|
|
6757
|
+
}, {
|
|
6758
|
+
key: "render",
|
|
6759
|
+
value: function render() {
|
|
6760
|
+
var _this11 = this;
|
|
6761
|
+
var _this$props4 = this.props,
|
|
6762
|
+
lang = _this$props4.lang,
|
|
6763
|
+
tone = _this$props4.tone,
|
|
6764
|
+
length = _this$props4.length,
|
|
6765
|
+
parentRef = _this$props4.parentRef;
|
|
6766
|
+
var _this$state2 = this.state,
|
|
6767
|
+
open = _this$state2.open,
|
|
6768
|
+
languageOptions = _this$state2.languageOptions;
|
|
6769
|
+
var popperTop = 0;
|
|
6770
|
+
var popperLeft = 0;
|
|
6771
|
+
var popperWidth = 320;
|
|
6772
|
+
if (open && this.containerRef.current) {
|
|
6773
|
+
var rect = this.containerRef.current.getBoundingClientRect();
|
|
6774
|
+
popperTop = rect.top + (window.scrollY || document.documentElement.scrollTop) - 8;
|
|
6775
|
+
popperLeft = rect.left + (window.scrollX || document.documentElement.scrollLeft);
|
|
6776
|
+
if (parentRef && parentRef.current) {
|
|
6777
|
+
var parentRect = parentRef.current.getBoundingClientRect();
|
|
6778
|
+
popperWidth = parentRect.width - 16;
|
|
6779
|
+
popperLeft = parentRect.left + 8;
|
|
6780
|
+
}
|
|
6781
|
+
}
|
|
6782
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
6783
|
+
ref: this.containerRef,
|
|
6784
|
+
style: {
|
|
6785
|
+
position: "relative",
|
|
6786
|
+
display: "inline-block"
|
|
6787
|
+
}
|
|
6788
|
+
}, /* @__PURE__ */React__namespace.createElement("button", {
|
|
6789
|
+
type: "button",
|
|
6790
|
+
onClick: this.togglePopper,
|
|
6791
|
+
className: "icon-button small"
|
|
6792
|
+
}, /* @__PURE__ */React__namespace.createElement(Settings, {
|
|
6793
|
+
size: 16
|
|
6794
|
+
})), open && this.containerRef.current && ReactDOM__namespace.createPortal(/* @__PURE__ */React__namespace.createElement("div", {
|
|
6795
|
+
ref: this.popperRef,
|
|
6796
|
+
style: {
|
|
6797
|
+
position: "absolute",
|
|
6798
|
+
top: popperTop,
|
|
6799
|
+
left: popperLeft,
|
|
6800
|
+
transform: "translateY(-100%)",
|
|
6801
|
+
zIndex: 1051,
|
|
6802
|
+
background: "#fff",
|
|
6803
|
+
border: "1px solid #ddd",
|
|
6804
|
+
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
6805
|
+
borderRadius: 8,
|
|
6806
|
+
padding: 16,
|
|
6807
|
+
width: popperWidth,
|
|
6808
|
+
boxSizing: "border-box"
|
|
6809
|
+
}
|
|
6810
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
6811
|
+
style: {
|
|
6812
|
+
display: "flex",
|
|
6813
|
+
flexDirection: "column",
|
|
6814
|
+
gap: 12
|
|
6815
|
+
}
|
|
6816
|
+
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
6817
|
+
style: {
|
|
6818
|
+
display: "flex",
|
|
6819
|
+
flexDirection: "column",
|
|
6820
|
+
gap: 6
|
|
6821
|
+
}
|
|
6822
|
+
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
6823
|
+
style: {
|
|
6824
|
+
fontSize: 12,
|
|
6825
|
+
fontWeight: 600
|
|
6826
|
+
}
|
|
6827
|
+
}, "Language"), /* @__PURE__ */React__namespace.createElement(LanguageSelect, {
|
|
6828
|
+
value: lang,
|
|
6829
|
+
options: languageOptions,
|
|
6830
|
+
onChange: function onChange(opt) {
|
|
6831
|
+
return _this11.props.setLang(opt);
|
|
6832
|
+
}
|
|
6833
|
+
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
6834
|
+
style: {
|
|
6835
|
+
display: "flex",
|
|
6836
|
+
flexDirection: "column",
|
|
6837
|
+
gap: 6
|
|
6838
|
+
}
|
|
6839
|
+
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
6840
|
+
style: {
|
|
6841
|
+
fontSize: 12,
|
|
6842
|
+
fontWeight: 600
|
|
6843
|
+
}
|
|
6844
|
+
}, "Tone"), this.renderChipGroup(TONE_OPTIONS, tone, function (opt) {
|
|
6845
|
+
return _this11.props.setTone(opt);
|
|
6846
|
+
}, TONE_ICONS)), /* @__PURE__ */React__namespace.createElement("div", {
|
|
6847
|
+
style: {
|
|
6848
|
+
display: "flex",
|
|
6849
|
+
flexDirection: "column",
|
|
6850
|
+
gap: 6
|
|
6851
|
+
}
|
|
6852
|
+
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
6853
|
+
style: {
|
|
6854
|
+
fontSize: 12,
|
|
6855
|
+
fontWeight: 600
|
|
6856
|
+
}
|
|
6857
|
+
}, "Length"), this.renderChipGroup(LENGTH_OPTIONS, length, function (opt) {
|
|
6858
|
+
return _this11.props.setLength(opt);
|
|
6859
|
+
}, LENGTH_ICONS, 4)))), document.body));
|
|
6860
|
+
}
|
|
6861
|
+
}]);
|
|
6862
|
+
}(React__namespace.Component);
|
|
6863
|
+
var ChatAIDraft = /*#__PURE__*/function (_React__namespace$Com4) {
|
|
6398
6864
|
function ChatAIDraft(props) {
|
|
6399
6865
|
var _this12;
|
|
6400
6866
|
_classCallCheck(this, ChatAIDraft);
|
|
6401
6867
|
_this12 = _callSuper(this, ChatAIDraft, [props]);
|
|
6402
6868
|
__publicField(_this12, "rootRef");
|
|
6403
|
-
__publicField(_this12, "setAIContext", function (html2) {
|
|
6404
|
-
_this12.setState({
|
|
6405
|
-
originalEmail: html2
|
|
6406
|
-
});
|
|
6407
|
-
});
|
|
6408
6869
|
__publicField(_this12, "handleMessageChange", function (e) {
|
|
6409
6870
|
_this12.setState({
|
|
6410
6871
|
message: e.target.value
|
|
@@ -6413,11 +6874,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6413
6874
|
__publicField(_this12, "handleSubmit", function () {
|
|
6414
6875
|
return __async(_this12, null, /*#__PURE__*/_regenerator().m(function _callee5() {
|
|
6415
6876
|
var _this13 = this;
|
|
6416
|
-
var _this$state3, message, messages, lang,
|
|
6877
|
+
var _this$state3, message, messages, lang, tone, length, conversationId, newId, newMessage, currentItems, params, setContent, setIsLoading, setConversationId;
|
|
6417
6878
|
return _regenerator().w(function (_context5) {
|
|
6418
6879
|
while (1) switch (_context5.n) {
|
|
6419
6880
|
case 0:
|
|
6420
|
-
_this$state3 = this.state, message = _this$state3.message, messages = _this$state3.messages, lang = _this$state3.lang,
|
|
6881
|
+
_this$state3 = this.state, message = _this$state3.message, messages = _this$state3.messages, lang = _this$state3.lang, tone = _this$state3.tone, length = _this$state3.length, conversationId = _this$state3.conversationId;
|
|
6421
6882
|
if (message.trim()) {
|
|
6422
6883
|
_context5.n = 1;
|
|
6423
6884
|
break;
|
|
@@ -6442,9 +6903,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6442
6903
|
params = {
|
|
6443
6904
|
query: message,
|
|
6444
6905
|
default_language: lang ? lang.value : "KR",
|
|
6445
|
-
original_email: originalEmail,
|
|
6446
6906
|
debug_grpc: true
|
|
6447
6907
|
};
|
|
6908
|
+
if (tone) {
|
|
6909
|
+
params.tone = tone.value;
|
|
6910
|
+
}
|
|
6911
|
+
if (length) {
|
|
6912
|
+
params.length = length.value;
|
|
6913
|
+
}
|
|
6448
6914
|
if (conversationId) {
|
|
6449
6915
|
params.conversation_id = conversationId;
|
|
6450
6916
|
}
|
|
@@ -6507,9 +6973,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6507
6973
|
lang: lang
|
|
6508
6974
|
});
|
|
6509
6975
|
});
|
|
6510
|
-
__publicField(_this12, "
|
|
6976
|
+
__publicField(_this12, "setTone", function (tone) {
|
|
6977
|
+
_this12.setState({
|
|
6978
|
+
tone: tone
|
|
6979
|
+
});
|
|
6980
|
+
});
|
|
6981
|
+
__publicField(_this12, "setLength", function (length) {
|
|
6511
6982
|
_this12.setState({
|
|
6512
|
-
|
|
6983
|
+
length: length
|
|
6513
6984
|
});
|
|
6514
6985
|
});
|
|
6515
6986
|
_this12.rootRef = React__namespace.createRef();
|
|
@@ -6521,15 +6992,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6521
6992
|
messages: [],
|
|
6522
6993
|
isSending: false,
|
|
6523
6994
|
lang: lang,
|
|
6524
|
-
|
|
6525
|
-
|
|
6995
|
+
tone: TONE_OPTIONS[2],
|
|
6996
|
+
// Neutral
|
|
6997
|
+
length: LENGTH_OPTIONS[1],
|
|
6998
|
+
// Medium
|
|
6999
|
+
conversationId: ""
|
|
6526
7000
|
};
|
|
6527
7001
|
return _this12;
|
|
6528
7002
|
}
|
|
6529
|
-
_inherits(ChatAIDraft, _React__namespace$
|
|
7003
|
+
_inherits(ChatAIDraft, _React__namespace$Com4);
|
|
6530
7004
|
return _createClass(ChatAIDraft, [{
|
|
6531
7005
|
key: "render",
|
|
6532
7006
|
value: function render() {
|
|
7007
|
+
var _this14 = this;
|
|
6533
7008
|
var _a2;
|
|
6534
7009
|
var _this$props5 = this.props,
|
|
6535
7010
|
onApply = _this$props5.onApply,
|
|
@@ -6539,7 +7014,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6539
7014
|
messages = _this$state4.messages,
|
|
6540
7015
|
isSending = _this$state4.isSending,
|
|
6541
7016
|
lang = _this$state4.lang,
|
|
6542
|
-
|
|
7017
|
+
tone = _this$state4.tone,
|
|
7018
|
+
length = _this$state4.length;
|
|
6543
7019
|
var flagCode = (_a2 = AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
6544
7020
|
return (_item == null ? void 0 : _item.value) === (lang == null ? void 0 : lang.value);
|
|
6545
7021
|
})) == null ? void 0 : _a2.flagCode;
|
|
@@ -6558,32 +7034,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6558
7034
|
items: messages,
|
|
6559
7035
|
onApply: onApply,
|
|
6560
7036
|
getEditorContent: getEditorContent
|
|
6561
|
-
}) : /* @__PURE__ */React__namespace.createElement(
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
flexDirection: "column",
|
|
6567
|
-
alignItems: "center",
|
|
6568
|
-
justifyContent: "center",
|
|
6569
|
-
color: "var(--grey-light)"
|
|
6570
|
-
}
|
|
6571
|
-
}, /* @__PURE__ */React__namespace.createElement(CustomAiIcon, {
|
|
6572
|
-
size: 46
|
|
6573
|
-
}), /* @__PURE__ */React__namespace.createElement("h2", {
|
|
6574
|
-
style: {
|
|
6575
|
-
marginTop: 16,
|
|
6576
|
-
fontWeight: 600,
|
|
6577
|
-
color: "inherit",
|
|
6578
|
-
fontSize: 18
|
|
7037
|
+
}) : /* @__PURE__ */React__namespace.createElement(EmptyState, {
|
|
7038
|
+
onSelectPrompt: function onSelectPrompt(text) {
|
|
7039
|
+
return _this14.setState({
|
|
7040
|
+
message: text
|
|
7041
|
+
});
|
|
6579
7042
|
}
|
|
6580
|
-
}
|
|
7043
|
+
}), /* @__PURE__ */React__namespace.createElement("div", {
|
|
6581
7044
|
style: {
|
|
6582
7045
|
width: "100%",
|
|
6583
|
-
|
|
6584
|
-
borderRadius: 4,
|
|
7046
|
+
borderRadius: 12,
|
|
6585
7047
|
overflow: "hidden",
|
|
6586
|
-
background: "
|
|
7048
|
+
background: "var(--background-softGrey)",
|
|
6587
7049
|
display: "flex",
|
|
6588
7050
|
flexDirection: "column"
|
|
6589
7051
|
}
|
|
@@ -6597,14 +7059,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6597
7059
|
style: {
|
|
6598
7060
|
flex: 1,
|
|
6599
7061
|
minWidth: 0,
|
|
6600
|
-
borderRadius: 4,
|
|
6601
7062
|
padding: 12,
|
|
6602
7063
|
fontSize: 13,
|
|
6603
7064
|
border: "none",
|
|
6604
7065
|
resize: "none",
|
|
6605
7066
|
outline: "none",
|
|
6606
7067
|
minHeight: 60,
|
|
6607
|
-
fontFamily: "inherit"
|
|
7068
|
+
fontFamily: "inherit",
|
|
7069
|
+
background: "transparent"
|
|
6608
7070
|
}
|
|
6609
7071
|
}), /* @__PURE__ */React__namespace.createElement("div", {
|
|
6610
7072
|
style: {
|
|
@@ -6618,9 +7080,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6618
7080
|
}, /* @__PURE__ */React__namespace.createElement(SettingPopper, {
|
|
6619
7081
|
lang: lang,
|
|
6620
7082
|
setLang: this.setLang,
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
7083
|
+
tone: tone,
|
|
7084
|
+
setTone: this.setTone,
|
|
7085
|
+
length: length,
|
|
7086
|
+
setLength: this.setLength,
|
|
6624
7087
|
parentRef: this.rootRef
|
|
6625
7088
|
}), /* @__PURE__ */React__namespace.createElement(CountryFlag, {
|
|
6626
7089
|
flagCode: flagCode,
|
|
@@ -6628,18 +7091,115 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6628
7091
|
marginLeft: 4,
|
|
6629
7092
|
height: 14
|
|
6630
7093
|
}
|
|
6631
|
-
}), /* @__PURE__ */React__namespace.createElement("
|
|
7094
|
+
}), (tone || length) && /* @__PURE__ */React__namespace.createElement("span", {
|
|
7095
|
+
style: {
|
|
7096
|
+
marginLeft: 8,
|
|
7097
|
+
padding: "2px 8px",
|
|
7098
|
+
borderRadius: 999,
|
|
7099
|
+
background: "var(--primary-lighter)",
|
|
7100
|
+
color: "var(--primary-main)",
|
|
7101
|
+
fontSize: 11,
|
|
7102
|
+
fontWeight: 500,
|
|
7103
|
+
whiteSpace: "nowrap",
|
|
7104
|
+
display: "inline-flex",
|
|
7105
|
+
alignItems: "center",
|
|
7106
|
+
gap: 4
|
|
7107
|
+
}
|
|
7108
|
+
}, (tone == null ? void 0 : tone.label) && /* @__PURE__ */React__namespace.createElement("span", null, tone.label), (tone == null ? void 0 : tone.label) && (length == null ? void 0 : length.label) && /* @__PURE__ */React__namespace.createElement("span", {
|
|
7109
|
+
style: {
|
|
7110
|
+
width: 3,
|
|
7111
|
+
height: 3,
|
|
7112
|
+
borderRadius: "50%",
|
|
7113
|
+
background: "currentColor",
|
|
7114
|
+
display: "inline-block"
|
|
7115
|
+
}
|
|
7116
|
+
}), (length == null ? void 0 : length.label) && /* @__PURE__ */React__namespace.createElement("span", null, length.label)), /* @__PURE__ */React__namespace.createElement("button", {
|
|
7117
|
+
type: "button",
|
|
6632
7118
|
disabled: !message.trim() || isSending,
|
|
6633
7119
|
onClick: this.handleSubmit,
|
|
6634
|
-
className: "icon-button",
|
|
6635
|
-
color: "primary",
|
|
6636
7120
|
style: {
|
|
6637
|
-
marginLeft: "auto"
|
|
7121
|
+
marginLeft: "auto",
|
|
7122
|
+
width: 32,
|
|
7123
|
+
height: 32,
|
|
7124
|
+
borderRadius: "50%",
|
|
7125
|
+
border: "none",
|
|
7126
|
+
display: "flex",
|
|
7127
|
+
alignItems: "center",
|
|
7128
|
+
justifyContent: "center",
|
|
7129
|
+
background: !message.trim() || isSending ? "var(--primary-lighter)" : "var(--primary-main)",
|
|
7130
|
+
color: "var(--primary-contrasttext)",
|
|
7131
|
+
cursor: !message.trim() || isSending ? "not-allowed" : "pointer",
|
|
7132
|
+
transition: "background 0.15s ease-in-out"
|
|
6638
7133
|
}
|
|
6639
|
-
}, /* @__PURE__ */React__namespace.createElement(
|
|
7134
|
+
}, /* @__PURE__ */React__namespace.createElement(ArrowUp, {
|
|
7135
|
+
size: 18
|
|
7136
|
+
})))));
|
|
6640
7137
|
}
|
|
6641
7138
|
}]);
|
|
6642
7139
|
}(React__namespace.Component);
|
|
7140
|
+
var LoadingCircular = function LoadingCircular(_ref28) {
|
|
7141
|
+
var _ref28$size = _ref28.size,
|
|
7142
|
+
size = _ref28$size === void 0 ? 40 : _ref28$size,
|
|
7143
|
+
_ref28$color = _ref28.color,
|
|
7144
|
+
color = _ref28$color === void 0 ? "var(--primary-main)" : _ref28$color,
|
|
7145
|
+
_ref28$thickness = _ref28.thickness,
|
|
7146
|
+
thickness = _ref28$thickness === void 0 ? 3.6 : _ref28$thickness;
|
|
7147
|
+
var radius = 20;
|
|
7148
|
+
var circumference = 2 * Math.PI * radius;
|
|
7149
|
+
return /* @__PURE__ */React.createElement("div", {
|
|
7150
|
+
className: "circular-container",
|
|
7151
|
+
style: {
|
|
7152
|
+
width: size,
|
|
7153
|
+
height: size
|
|
7154
|
+
},
|
|
7155
|
+
role: "progressbar"
|
|
7156
|
+
}, /* @__PURE__ */React.createElement("svg", {
|
|
7157
|
+
className: "circular-svg",
|
|
7158
|
+
viewBox: "22 22 44 44"
|
|
7159
|
+
}, /* @__PURE__ */React.createElement("circle", {
|
|
7160
|
+
className: "circular-circle",
|
|
7161
|
+
cx: "44",
|
|
7162
|
+
cy: "44",
|
|
7163
|
+
r: radius,
|
|
7164
|
+
fill: "none",
|
|
7165
|
+
stroke: color,
|
|
7166
|
+
strokeWidth: thickness,
|
|
7167
|
+
strokeDasharray: circumference,
|
|
7168
|
+
style: {
|
|
7169
|
+
strokeDashoffset: circumference * 0.7
|
|
7170
|
+
// Độ dài của thanh loading
|
|
7171
|
+
}
|
|
7172
|
+
})));
|
|
7173
|
+
};
|
|
7174
|
+
var circularSize = {
|
|
7175
|
+
small: 28,
|
|
7176
|
+
medium: 40
|
|
7177
|
+
};
|
|
7178
|
+
var LoadingContainer = function LoadingContainer(_ref29) {
|
|
7179
|
+
var style = _ref29.style,
|
|
7180
|
+
_ref29$fullHeight = _ref29.fullHeight,
|
|
7181
|
+
fullHeight = _ref29$fullHeight === void 0 ? false : _ref29$fullHeight,
|
|
7182
|
+
_ref29$size = _ref29.size,
|
|
7183
|
+
size = _ref29$size === void 0 ? "medium" : _ref29$size,
|
|
7184
|
+
label = _ref29.label;
|
|
7185
|
+
return /* @__PURE__ */React.createElement("div", {
|
|
7186
|
+
style: __spreadValues({
|
|
7187
|
+
display: "flex",
|
|
7188
|
+
alignItems: "center",
|
|
7189
|
+
justifyContent: "center",
|
|
7190
|
+
width: "100%",
|
|
7191
|
+
height: fullHeight ? "100%" : 350
|
|
7192
|
+
}, style)
|
|
7193
|
+
}, /* @__PURE__ */React.createElement(LoadingCircular, {
|
|
7194
|
+
size: circularSize[size]
|
|
7195
|
+
}), label && /* @__PURE__ */React.createElement("p", {
|
|
7196
|
+
color: "text.secondary",
|
|
7197
|
+
style: {
|
|
7198
|
+
marginTop: 16,
|
|
7199
|
+
fontSize: size === "small" ? 12 : 13
|
|
7200
|
+
}
|
|
7201
|
+
}, label));
|
|
7202
|
+
};
|
|
6643
7203
|
exports2.AI_LANG_FLAGS = AI_LANG_FLAGS;
|
|
6644
7204
|
exports2.ChatAIDraft = ChatAIDraft;
|
|
6645
7205
|
exports2.CountryFlag = CountryFlag;
|