code7-leia 0.1.48 → 0.1.52

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.
@@ -10,11 +10,345 @@ var reactRouterDom = require('react-router-dom');
10
10
  var PropTypes = _interopDefault(require('prop-types'));
11
11
  var cc = _interopDefault(require('classcat'));
12
12
  var styled = _interopDefault(require('styled-components'));
13
+ var reactRedux = require('react-redux');
13
14
  var fa = require('react-icons/fa');
14
15
  var unorm = _interopDefault(require('unorm'));
15
16
  var md = require('react-icons/md');
17
+ var reactDropzone = require('react-dropzone');
18
+ var axios = _interopDefault(require('axios'));
16
19
  var pi = require('react-icons/pi');
17
20
 
21
+ function _regeneratorRuntime() {
22
+ _regeneratorRuntime = function () {
23
+ return e;
24
+ };
25
+ var t,
26
+ e = {},
27
+ r = Object.prototype,
28
+ n = r.hasOwnProperty,
29
+ o = Object.defineProperty || function (t, e, r) {
30
+ t[e] = r.value;
31
+ },
32
+ i = "function" == typeof Symbol ? Symbol : {},
33
+ a = i.iterator || "@@iterator",
34
+ c = i.asyncIterator || "@@asyncIterator",
35
+ u = i.toStringTag || "@@toStringTag";
36
+ function define(t, e, r) {
37
+ return Object.defineProperty(t, e, {
38
+ value: r,
39
+ enumerable: !0,
40
+ configurable: !0,
41
+ writable: !0
42
+ }), t[e];
43
+ }
44
+ try {
45
+ define({}, "");
46
+ } catch (t) {
47
+ define = function (t, e, r) {
48
+ return t[e] = r;
49
+ };
50
+ }
51
+ function wrap(t, e, r, n) {
52
+ var i = e && e.prototype instanceof Generator ? e : Generator,
53
+ a = Object.create(i.prototype),
54
+ c = new Context(n || []);
55
+ return o(a, "_invoke", {
56
+ value: makeInvokeMethod(t, r, c)
57
+ }), a;
58
+ }
59
+ function tryCatch(t, e, r) {
60
+ try {
61
+ return {
62
+ type: "normal",
63
+ arg: t.call(e, r)
64
+ };
65
+ } catch (t) {
66
+ return {
67
+ type: "throw",
68
+ arg: t
69
+ };
70
+ }
71
+ }
72
+ e.wrap = wrap;
73
+ var h = "suspendedStart",
74
+ l = "suspendedYield",
75
+ f = "executing",
76
+ s = "completed",
77
+ y = {};
78
+ function Generator() {}
79
+ function GeneratorFunction() {}
80
+ function GeneratorFunctionPrototype() {}
81
+ var p = {};
82
+ define(p, a, function () {
83
+ return this;
84
+ });
85
+ var d = Object.getPrototypeOf,
86
+ v = d && d(d(values([])));
87
+ v && v !== r && n.call(v, a) && (p = v);
88
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
89
+ function defineIteratorMethods(t) {
90
+ ["next", "throw", "return"].forEach(function (e) {
91
+ define(t, e, function (t) {
92
+ return this._invoke(e, t);
93
+ });
94
+ });
95
+ }
96
+ function AsyncIterator(t, e) {
97
+ function invoke(r, o, i, a) {
98
+ var c = tryCatch(t[r], t, o);
99
+ if ("throw" !== c.type) {
100
+ var u = c.arg,
101
+ h = u.value;
102
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
103
+ invoke("next", t, i, a);
104
+ }, function (t) {
105
+ invoke("throw", t, i, a);
106
+ }) : e.resolve(h).then(function (t) {
107
+ u.value = t, i(u);
108
+ }, function (t) {
109
+ return invoke("throw", t, i, a);
110
+ });
111
+ }
112
+ a(c.arg);
113
+ }
114
+ var r;
115
+ o(this, "_invoke", {
116
+ value: function (t, n) {
117
+ function callInvokeWithMethodAndArg() {
118
+ return new e(function (e, r) {
119
+ invoke(t, n, e, r);
120
+ });
121
+ }
122
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
123
+ }
124
+ });
125
+ }
126
+ function makeInvokeMethod(e, r, n) {
127
+ var o = h;
128
+ return function (i, a) {
129
+ if (o === f) throw new Error("Generator is already running");
130
+ if (o === s) {
131
+ if ("throw" === i) throw a;
132
+ return {
133
+ value: t,
134
+ done: !0
135
+ };
136
+ }
137
+ for (n.method = i, n.arg = a;;) {
138
+ var c = n.delegate;
139
+ if (c) {
140
+ var u = maybeInvokeDelegate(c, n);
141
+ if (u) {
142
+ if (u === y) continue;
143
+ return u;
144
+ }
145
+ }
146
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
147
+ if (o === h) throw o = s, n.arg;
148
+ n.dispatchException(n.arg);
149
+ } else "return" === n.method && n.abrupt("return", n.arg);
150
+ o = f;
151
+ var p = tryCatch(e, r, n);
152
+ if ("normal" === p.type) {
153
+ if (o = n.done ? s : l, p.arg === y) continue;
154
+ return {
155
+ value: p.arg,
156
+ done: n.done
157
+ };
158
+ }
159
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
160
+ }
161
+ };
162
+ }
163
+ function maybeInvokeDelegate(e, r) {
164
+ var n = r.method,
165
+ o = e.iterator[n];
166
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
167
+ var i = tryCatch(o, e.iterator, r.arg);
168
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
169
+ var a = i.arg;
170
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
171
+ }
172
+ function pushTryEntry(t) {
173
+ var e = {
174
+ tryLoc: t[0]
175
+ };
176
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
177
+ }
178
+ function resetTryEntry(t) {
179
+ var e = t.completion || {};
180
+ e.type = "normal", delete e.arg, t.completion = e;
181
+ }
182
+ function Context(t) {
183
+ this.tryEntries = [{
184
+ tryLoc: "root"
185
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
186
+ }
187
+ function values(e) {
188
+ if (e || "" === e) {
189
+ var r = e[a];
190
+ if (r) return r.call(e);
191
+ if ("function" == typeof e.next) return e;
192
+ if (!isNaN(e.length)) {
193
+ var o = -1,
194
+ i = function next() {
195
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
196
+ return next.value = t, next.done = !0, next;
197
+ };
198
+ return i.next = i;
199
+ }
200
+ }
201
+ throw new TypeError(typeof e + " is not iterable");
202
+ }
203
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
204
+ value: GeneratorFunctionPrototype,
205
+ configurable: !0
206
+ }), o(GeneratorFunctionPrototype, "constructor", {
207
+ value: GeneratorFunction,
208
+ configurable: !0
209
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
210
+ var e = "function" == typeof t && t.constructor;
211
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
212
+ }, e.mark = function (t) {
213
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
214
+ }, e.awrap = function (t) {
215
+ return {
216
+ __await: t
217
+ };
218
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
219
+ return this;
220
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
221
+ void 0 === i && (i = Promise);
222
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
223
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
224
+ return t.done ? t.value : a.next();
225
+ });
226
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
227
+ return this;
228
+ }), define(g, "toString", function () {
229
+ return "[object Generator]";
230
+ }), e.keys = function (t) {
231
+ var e = Object(t),
232
+ r = [];
233
+ for (var n in e) r.push(n);
234
+ return r.reverse(), function next() {
235
+ for (; r.length;) {
236
+ var t = r.pop();
237
+ if (t in e) return next.value = t, next.done = !1, next;
238
+ }
239
+ return next.done = !0, next;
240
+ };
241
+ }, e.values = values, Context.prototype = {
242
+ constructor: Context,
243
+ reset: function (e) {
244
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
245
+ },
246
+ stop: function () {
247
+ this.done = !0;
248
+ var t = this.tryEntries[0].completion;
249
+ if ("throw" === t.type) throw t.arg;
250
+ return this.rval;
251
+ },
252
+ dispatchException: function (e) {
253
+ if (this.done) throw e;
254
+ var r = this;
255
+ function handle(n, o) {
256
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
257
+ }
258
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
259
+ var i = this.tryEntries[o],
260
+ a = i.completion;
261
+ if ("root" === i.tryLoc) return handle("end");
262
+ if (i.tryLoc <= this.prev) {
263
+ var c = n.call(i, "catchLoc"),
264
+ u = n.call(i, "finallyLoc");
265
+ if (c && u) {
266
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
267
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
268
+ } else if (c) {
269
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
270
+ } else {
271
+ if (!u) throw new Error("try statement without catch or finally");
272
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
273
+ }
274
+ }
275
+ }
276
+ },
277
+ abrupt: function (t, e) {
278
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
279
+ var o = this.tryEntries[r];
280
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
281
+ var i = o;
282
+ break;
283
+ }
284
+ }
285
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
286
+ var a = i ? i.completion : {};
287
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
288
+ },
289
+ complete: function (t, e) {
290
+ if ("throw" === t.type) throw t.arg;
291
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
292
+ },
293
+ finish: function (t) {
294
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
295
+ var r = this.tryEntries[e];
296
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
297
+ }
298
+ },
299
+ catch: function (t) {
300
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
301
+ var r = this.tryEntries[e];
302
+ if (r.tryLoc === t) {
303
+ var n = r.completion;
304
+ if ("throw" === n.type) {
305
+ var o = n.arg;
306
+ resetTryEntry(r);
307
+ }
308
+ return o;
309
+ }
310
+ }
311
+ throw new Error("illegal catch attempt");
312
+ },
313
+ delegateYield: function (e, r, n) {
314
+ return this.delegate = {
315
+ iterator: values(e),
316
+ resultName: r,
317
+ nextLoc: n
318
+ }, "next" === this.method && (this.arg = t), y;
319
+ }
320
+ }, e;
321
+ }
322
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
323
+ try {
324
+ var info = gen[key](arg);
325
+ var value = info.value;
326
+ } catch (error) {
327
+ reject(error);
328
+ return;
329
+ }
330
+ if (info.done) {
331
+ resolve(value);
332
+ } else {
333
+ Promise.resolve(value).then(_next, _throw);
334
+ }
335
+ }
336
+ function _asyncToGenerator(fn) {
337
+ return function () {
338
+ var self = this,
339
+ args = arguments;
340
+ return new Promise(function (resolve, reject) {
341
+ var gen = fn.apply(self, args);
342
+ function _next(value) {
343
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
344
+ }
345
+ function _throw(err) {
346
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
347
+ }
348
+ _next(undefined);
349
+ });
350
+ };
351
+ }
18
352
  function _extends() {
19
353
  _extends = Object.assign ? Object.assign.bind() : function (target) {
20
354
  for (var i = 1; i < arguments.length; i++) {
@@ -224,7 +558,7 @@ var getLanguage = function getLanguage(language) {
224
558
  };
225
559
 
226
560
  var _templateObject$1, _templateObject2$1;
227
- var Container = /*#__PURE__*/styled.div(_templateObject$1 || (_templateObject$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .tag {\n padding: 4px 8px 4px 8px;\n background: #C7F9ED;\n border-radius: 4px;\n }\n\n .tags {\n display: flex;\n justify-content: left;\n gap: 4px;\n }\n\n .divDelete {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n }\n\n .buttonDelete {\n color: #5b0a1f;\n background: #fae0d2;\n padding: 12px 20px;\n border-radius: 4px;\n }\n\n .buttonDelete:hover {\n background: #f5bba7;\n }\n\n .button {\n padding: 8px 16px 8px 16px\n border-radius: 4px\n gap: 10px\n }\n\n .cancel {\n background: #F3F5F9;\n color: #5A5D68;\n }\n\n .send {\n background: #102693;\n color: white;\n }\n"])));
561
+ var Container = /*#__PURE__*/styled.div(_templateObject$1 || (_templateObject$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .tag {\n padding: 4px 8px 4px 8px;\n background: #C7F9ED;\n border-radius: 4px;\n }\n\n .tags {\n display: flex;\n justify-content: left;\n gap: 4px;\n }\n\n .divDelete {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n }\n\n .buttonDelete {\n color: #5b0a1f;\n background: #fae0d2;\n padding: 12px 20px;\n border-radius: 4px;\n }\n\n .buttonDelete:hover {\n background: #f5bba7;\n }\n\n .button {\n padding: 8px 16px 8px 16px;\n border-radius: 4px;\n gap: 10px;\n }\n\n .cancel {\n background: #F3F5F9;\n color: #5A5D68;\n }\n\n .send {\n background: #102693;\n color: white;\n }\n\n .presset {\n padding-top: 10px;\n display: flex;\n flex-direction: column;\n }\n"])));
228
562
  var Header = /*#__PURE__*/styled.div(_templateObject2$1 || (_templateObject2$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n\n .infos {\n display: flex;\n flex-direction: column;\n padding: 14px 0;\n\n h2 {\n font-size: 20px\n }\n\n p {\n font-size: 14px\n }\n }\n\n .actions {\n display: flex;\n justify-content: space-between;\n padding-bottom: 14px;\n\n button {\n background: #102693;\n padding: 10px 20px;\n color: white;\n border-radius: 4px;\n }\n }\n\n"])));
229
563
 
230
564
  var _templateObject$2, _templateObject2$2, _templateObject3;
@@ -555,6 +889,162 @@ var Select = function Select(_ref) {
555
889
  })));
556
890
  };
557
891
 
892
+ var _templateObject$7;
893
+ var getColor = function getColor(props) {
894
+ if (props.isDragAccept) {
895
+ return '#6690ff';
896
+ }
897
+ if (props.isDragReject) {
898
+ return '#e18976';
899
+ }
900
+ if (props.isDragActive) {
901
+ return '#6690ff';
902
+ }
903
+ return '#979aa5';
904
+ };
905
+ var Container$3 = /*#__PURE__*/styled.div(_templateObject$7 || (_templateObject$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-color: #f3f5f9;\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n padding: 20px;\n border-width: 2px;\n border-radius: 4px;\n border-color: var(", ");\n border-style: dashed;\n color: #5a5d68;\n outline: none;\n transition: border 0.24s ease-in-out;\n\n & > span {\n margin: 8px 10px 0 0;\n display: flex;\n }\n\n button {\n padding: 8px 16px 8px 16px;\n border-radius: 4px;\n border: 2px #102693 solid;\n margin-top: 10px;\n }\n"])), function (props) {
906
+ return getColor(props);
907
+ });
908
+
909
+ var AreaUpload = function AreaUpload(_ref) {
910
+ var _ref$formatFile = _ref.formatFile,
911
+ formatFile = _ref$formatFile === void 0 ? 'application/pdf' : _ref$formatFile,
912
+ _ref$multipleFile = _ref.multipleFile,
913
+ multipleFile = _ref$multipleFile === void 0 ? false : _ref$multipleFile,
914
+ _ref$initialFiles = _ref.initialFiles,
915
+ initialFiles = _ref$initialFiles === void 0 ? [] : _ref$initialFiles,
916
+ _ref$setFile = _ref.setFile,
917
+ setFile = _ref$setFile === void 0 ? function () {} : _ref$setFile,
918
+ _ref$onChange = _ref.onChange,
919
+ onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
920
+ var _useState = React.useState([]),
921
+ myFiles = _useState[0],
922
+ setMyFiles = _useState[1];
923
+ var t = getLanguage('pt-br');
924
+ React.useEffect(function () {
925
+ setMyFiles([].concat(initialFiles, myFiles));
926
+ }, []);
927
+ var onDrop = React.useCallback(function (acceptedFiles, fileRejections) {
928
+ if (fileRejections && fileRejections.length > 0) {
929
+ console.error('Arquivos rejeitados:', fileRejections);
930
+ }
931
+ onChange(acceptedFiles);
932
+ var files = [].concat(myFiles, acceptedFiles);
933
+ var filesWithId = files.map(function (item, index) {
934
+ return {
935
+ id: index + 1,
936
+ lastModified: item.lastModified,
937
+ name: item.name,
938
+ size: item.size,
939
+ type: item.type
940
+ };
941
+ });
942
+ setMyFiles(filesWithId);
943
+ acceptedFiles.forEach(function (file) {
944
+ var reader = new FileReader();
945
+ reader.onload = function () {
946
+ var binaryStr = reader.result;
947
+ setFile({
948
+ content: binaryStr,
949
+ properties: file
950
+ });
951
+ };
952
+ reader.readAsArrayBuffer(file);
953
+ });
954
+ }, [myFiles]);
955
+ var _useDropzone = reactDropzone.useDropzone({
956
+ accept: formatFile,
957
+ noClick: true,
958
+ noKeyboard: true,
959
+ multiple: multipleFile,
960
+ onDrop: onDrop
961
+ }),
962
+ getRootProps = _useDropzone.getRootProps,
963
+ getInputProps = _useDropzone.getInputProps,
964
+ open = _useDropzone.open,
965
+ isDragActive = _useDropzone.isDragActive,
966
+ isDragAccept = _useDropzone.isDragAccept,
967
+ isDragReject = _useDropzone.isDragReject;
968
+ return React__default.createElement(React__default.Fragment, null, multipleFile || (myFiles == null ? void 0 : myFiles.length) === 0 ? React__default.createElement(Container$3, Object.assign({}, getRootProps({
969
+ isDragActive: isDragActive,
970
+ isDragAccept: isDragAccept,
971
+ isDragReject: isDragReject
972
+ })), React__default.createElement("input", Object.assign({}, getInputProps())), React__default.createElement("span", null, React__default.createElement("p", null, t.fileArea.modal.descriptionUpload)), React__default.createElement("button", {
973
+ type: "button",
974
+ onClick: open
975
+ }, t.fileArea.modal.chooseFile)) : '');
976
+ };
977
+ AreaUpload.propTypes = {
978
+ formatFile: PropTypes.string,
979
+ multipleFile: PropTypes.bool,
980
+ initialFiles: /*#__PURE__*/PropTypes.arrayOf(PropTypes.object),
981
+ removeItem: PropTypes.func,
982
+ setFile: PropTypes.func,
983
+ onChange: PropTypes.func,
984
+ hasListFiles: PropTypes.bool
985
+ };
986
+ AreaUpload.defaultProps = {
987
+ formatFile: 'application/json',
988
+ multipleFile: false,
989
+ initialFiles: [],
990
+ removeItem: function removeItem() {},
991
+ setFile: function setFile() {},
992
+ onChange: function onChange() {},
993
+ hasListFiles: true
994
+ };
995
+
996
+ var _excluded$5 = ["children"];
997
+ var SharedPropsContext = /*#__PURE__*/React.createContext(undefined);
998
+ var useSharedProps = function useSharedProps() {
999
+ var context = React.useContext(SharedPropsContext);
1000
+ if (!context) {
1001
+ throw new Error('useSharedProps deve ser usado dentro de um SharedPropsProvider');
1002
+ }
1003
+ return context.props;
1004
+ };
1005
+ var SharedPropsProvider = function SharedPropsProvider(_ref) {
1006
+ var children = _ref.children,
1007
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
1008
+ return React__default.createElement(SharedPropsContext.Provider, {
1009
+ value: {
1010
+ props: props
1011
+ }
1012
+ }, children);
1013
+ };
1014
+
1015
+ var url = process.env.REACT_APP_API_URL || 'http://localhost:5000/';
1016
+ axios.defaults.baseURL = url + "/";
1017
+ var api = /*#__PURE__*/axios.create();
1018
+
1019
+ var getFiles = /*#__PURE__*/function () {
1020
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
1021
+ var files;
1022
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1023
+ while (1) switch (_context.prev = _context.next) {
1024
+ case 0:
1025
+ _context.next = 2;
1026
+ return api.get("/files/" + id);
1027
+ case 2:
1028
+ files = _context.sent;
1029
+ return _context.abrupt("return", files);
1030
+ case 4:
1031
+ case "end":
1032
+ return _context.stop();
1033
+ }
1034
+ }, _callee);
1035
+ }));
1036
+ return function getFiles(_x) {
1037
+ return _ref.apply(this, arguments);
1038
+ };
1039
+ }();
1040
+
1041
+ function getFilesAction(id) {
1042
+ return {
1043
+ type: 'GET_FILES',
1044
+ payload: getFiles(id)
1045
+ };
1046
+ }
1047
+
558
1048
  var FileArea = function FileArea() {
559
1049
  var _useState = React.useState([]),
560
1050
  files = _useState[0],
@@ -562,42 +1052,28 @@ var FileArea = function FileArea() {
562
1052
  var _useState2 = React.useState([]),
563
1053
  initialFiles = _useState2[0],
564
1054
  setInitialFiles = _useState2[1];
565
- var _useLocation = reactRouterDom.useLocation(),
566
- pathname = _useLocation.pathname;
567
- var _useState3 = React.useState(false),
568
- modal = _useState3[0],
569
- setModal = _useState3[1];
570
- var id = pathname.split('/')[4];
571
- var t = getLanguage('pt-br');
1055
+ var _useState3 = React.useState(),
1056
+ uploadFile = _useState3[0],
1057
+ setUploadFile = _useState3[1];
1058
+ var _useState4 = React.useState(false),
1059
+ modal = _useState4[0],
1060
+ setModal = _useState4[1];
1061
+ var _useSharedProps = useSharedProps(),
1062
+ id = _useSharedProps.id,
1063
+ language = _useSharedProps.language;
1064
+ var t = getLanguage(language);
1065
+ var dispatch = reactRedux.useDispatch();
1066
+ var initFiles = reactRedux.useSelector(function (state) {
1067
+ return state.initFiles;
1068
+ });
572
1069
  var tags = ["pae", "boteria", "vr", "code7", "vidalink"];
573
1070
  React.useEffect(function () {
574
- setFiles([{
575
- "name": "Documentação conceitual Code7_v3",
576
- "tags": "boteria, code7"
577
- }, {
578
- "name": "PAE_Programa_Apoio_ao_Empregado",
579
- "tags": "pae, vr"
580
- }, {
581
- "name": "Vidalink",
582
- "tags": "vidalink, vr"
583
- }, {
584
- "name": "[GUIA PRÁTICO] Como criar o chatbot perfeito",
585
- "tags": "ebook, code7"
586
- }]);
587
- setInitialFiles([{
588
- "name": "Documentação conceitual Code7_v3",
589
- "tags": "boteria, code7"
590
- }, {
591
- "name": "PAE_Programa_Apoio_ao_Empregado",
592
- "tags": "pae, vr"
593
- }, {
594
- "name": "Vidalink",
595
- "tags": "vidalink, vr"
596
- }, {
597
- "name": "[GUIA PRÁTICO] Como criar o chatbot perfeito",
598
- "tags": "ebook, code7"
599
- }]);
1071
+ dispatch(getFilesAction(id));
600
1072
  }, []);
1073
+ React.useEffect(function () {
1074
+ setFiles(initFiles);
1075
+ setInitialFiles(initFiles);
1076
+ }, [initFiles]);
601
1077
  React.useEffect(function () {
602
1078
  console.log('files, id, t: ', files, id, t);
603
1079
  }, [files]);
@@ -620,6 +1096,7 @@ var FileArea = function FileArea() {
620
1096
  };
621
1097
  var handleSelect = function handleSelect(value) {
622
1098
  console.log(value);
1099
+ console.log(uploadFile);
623
1100
  };
624
1101
  var renderFiles = function renderFiles() {
625
1102
  return React__default.createElement(Container, null, React__default.createElement(Header, null, React__default.createElement("div", {
@@ -670,10 +1147,8 @@ var FileArea = function FileArea() {
670
1147
  title: t.fileArea.modal.uploadFile
671
1148
  }, React__default.createElement(ModalContent, null, React__default.createElement("div", {
672
1149
  className: 'choose-file'
673
- }, React__default.createElement("input", {
674
- type: "file",
675
- id: "file",
676
- name: "file"
1150
+ }, React__default.createElement(AreaUpload, {
1151
+ setFile: setUploadFile
677
1152
  })), React__default.createElement("div", {
678
1153
  className: 'presset'
679
1154
  }, React__default.createElement("p", null, "Presset"), React__default.createElement(Select, {
@@ -692,14 +1167,14 @@ var FileArea = function FileArea() {
692
1167
  return React__default.createElement(Container, null, renderFiles());
693
1168
  };
694
1169
 
695
- var _templateObject$7, _templateObject2$4, _templateObject3$2, _templateObject4$1;
696
- var Container$3 = /*#__PURE__*/styled.div(_templateObject$7 || (_templateObject$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n\n"])));
1170
+ var _templateObject$8, _templateObject2$4, _templateObject3$2, _templateObject4$1;
1171
+ var Container$4 = /*#__PURE__*/styled.div(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n\n"])));
697
1172
  var Header$1 = /*#__PURE__*/styled.div(_templateObject2$4 || (_templateObject2$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n .infos {\n display: flex;\n flex-direction: column;\n padding: 14px 0;\n\n h2 {\n font-size: 20px\n }\n\n p {\n font-size: 14px\n }\n }\n"])));
698
1173
  var Inputs = /*#__PURE__*/styled.div(_templateObject3$2 || (_templateObject3$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 10px;\n\n button {\n background: #102693;\n padding: 10px 20px;\n color: white;\n border-radius: 4px;\n width: 190px;\n height: 40px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n width: 23px;\n height: 23px;\n }\n }\n"])));
699
1174
  var Result = /*#__PURE__*/styled.div(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: left;\n background: #F3F5F9;\n padding: 15px;\n border-radius: 5px;\n margin-top: 15px;\n\n .text{\n margin-left: 5px;\n font-size: 14px;\n }\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 5px;\n\n svg {\n width: 35px;\n height: 35px;\n }\n }\n\n"])));
700
1175
 
701
- var _templateObject$8, _templateObject2$5, _templateObject3$3, _templateObject4$2;
702
- var Container$4 = /*#__PURE__*/styled.div(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n margin-right: 5px;\n"])));
1176
+ var _templateObject$9, _templateObject2$5, _templateObject3$3, _templateObject4$2;
1177
+ var Container$5 = /*#__PURE__*/styled.div(_templateObject$9 || (_templateObject$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n margin-right: 5px;\n"])));
703
1178
  var StyledInput = /*#__PURE__*/styled.input(_templateObject2$5 || (_templateObject2$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding-left: 10px;\n padding-right: 40px;\n border-radius: 5px;\n border: 1px solid #ccc;\n height: 40px;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n"])));
704
1179
  var RecordAudioButton = /*#__PURE__*/styled.div(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 10px;\n right: 10px;\n cursor: pointer;\n"])));
705
1180
  var StyledMicrophoneIcon = /*#__PURE__*/styled(fa.FaMicrophone)(_templateObject4$2 || (_templateObject4$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n pointer-events: none;\n"])));
@@ -708,7 +1183,7 @@ var InputTest = function InputTest(_ref) {
708
1183
  var placeholder = _ref.placeholder,
709
1184
  _onChange = _ref.onChange,
710
1185
  onRecordAudio = _ref.onRecordAudio;
711
- return React__default.createElement(Container$4, null, React__default.createElement(StyledInput, {
1186
+ return React__default.createElement(Container$5, null, React__default.createElement(StyledInput, {
712
1187
  type: "text",
713
1188
  onChange: function onChange(e) {
714
1189
  return _onChange(e.target.value);
@@ -773,7 +1248,7 @@ var TestArea = function TestArea() {
773
1248
  "message": "Você precisa seguir algumas etapas importantes para ter um chatbot perfeito. Primeiro, defina claramente o objetivo do seu chatbot. Em seguida, crie uma mensagem de saudação cativante para atrair a atenção dos usuários. Não se esqueça de pedir feedbacks para melhorar constantemente o desempenho do seu chatbot. Além disso, construa um fluxo de conversa simples e utilize respostas curtas para manter a interação rápida e eficiente. Também é importante incorporar inteligência artificial para tornar o seu chatbot especialista em determinado assunto. Teste o seu bot antes de lançá-lo e personalize-o de acordo com as necessidades dos usuários. Por fim, direcione os usuários para um atendimento humano quando necessário. Seguindo essas dicas, você estará no caminho certo para ter um chatbot perfeito!"
774
1249
  });
775
1250
  };
776
- return React__default.createElement(Container$3, null, React__default.createElement(Header$1, null, React__default.createElement("div", {
1251
+ return React__default.createElement(Container$4, null, React__default.createElement(Header$1, null, React__default.createElement("div", {
777
1252
  className: 'infos'
778
1253
  }, React__default.createElement("h2", null, t.test), React__default.createElement("p", null, t.testArea.description))), React__default.createElement(Inputs, null, React__default.createElement(InputTest, {
779
1254
  placeholder: t.testArea.typeSentence,
@@ -810,7 +1285,7 @@ var Leia = function Leia(props) {
810
1285
  var activeTab = React.useMemo(function () {
811
1286
  return pathname.split('/')[5] || 'files';
812
1287
  }, [pathname]);
813
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(Tabs, {
1288
+ return React__default.createElement(SharedPropsProvider, Object.assign({}, props), React__default.createElement(React__default.Fragment, null, React__default.createElement(Tabs, {
814
1289
  value: activeTab,
815
1290
  onChange: function onChange(value) {
816
1291
  return history.push(match.url + "/" + value);
@@ -831,7 +1306,7 @@ var Leia = function Leia(props) {
831
1306
  }), React__default.createElement(reactRouterDom.Route, {
832
1307
  path: match.path + "/test",
833
1308
  component: TestArea
834
- }))));
1309
+ })))));
835
1310
  };
836
1311
 
837
1312
  function Code7(props) {