contentoh-components-library 21.5.86 → 21.5.88

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.
@@ -117,13 +117,18 @@ var TagAndInput = function TagAndInput(_ref) {
117
117
  isAiGenerated = _useState10[0],
118
118
  setIsAiGenerated = _useState10[1];
119
119
 
120
+ var _useState11 = (0, _react.useState)(""),
121
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
122
+ errorMessage = _useState12[0],
123
+ setErrorMessage = _useState12[1];
124
+
120
125
  function handlerAiGeneration(_x) {
121
126
  return _handlerAiGeneration.apply(this, arguments);
122
127
  }
123
128
 
124
129
  function _handlerAiGeneration() {
125
130
  _handlerAiGeneration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
126
- var type, currentSuggestions, aiSuggestions;
131
+ var type, currentSuggestions, aiSuggestions, errorMsg;
127
132
  return _regenerator.default.wrap(function _callee$(_context) {
128
133
  while (1) {
129
134
  switch (_context.prev = _context.next) {
@@ -158,8 +163,9 @@ var TagAndInput = function TagAndInput(_ref) {
158
163
  return _context.abrupt("return", setIsAiActive(true));
159
164
 
160
165
  case 9:
166
+ setErrorMessage("");
161
167
  setIsAiGenerationLoading(true);
162
- _context.next = 12;
168
+ _context.next = 13;
163
169
  return generateProductSuggestions({
164
170
  inputName: label,
165
171
  currentValue: value,
@@ -173,26 +179,38 @@ var TagAndInput = function TagAndInput(_ref) {
173
179
  attributeId: isBenefitInput ? inputId : null
174
180
  });
175
181
 
176
- case 12:
182
+ case 13:
177
183
  aiSuggestions = _context.sent;
178
184
 
179
185
  if (!(!aiSuggestions && aiSuggestions.length === 0)) {
180
- _context.next = 17;
186
+ _context.next = 19;
187
+ break;
188
+ }
189
+
190
+ errorMsg = "Error: No se recibieron sugerencias de IA";
191
+ console.log(errorMsg);
192
+ setIsAiGenerationLoading(false);
193
+ return _context.abrupt("return");
194
+
195
+ case 19:
196
+ if (!(aiSuggestions !== null && aiSuggestions !== void 0 && aiSuggestions.error)) {
197
+ _context.next = 24;
181
198
  break;
182
199
  }
183
200
 
184
- console.log("Error: No se recibieron sugerencias de IA");
201
+ console.log('Error: ', aiSuggestions.error);
202
+ setErrorMessage(aiSuggestions.error);
185
203
  setIsAiGenerationLoading(false);
186
204
  return _context.abrupt("return");
187
205
 
188
- case 17:
206
+ case 24:
189
207
  setSuggestions(function (prev) {
190
208
  return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, inputId, aiSuggestions));
191
209
  });
192
210
  setIsAiActive(true);
193
211
  setIsAiGenerationLoading(false);
194
212
 
195
- case 20:
213
+ case 27:
196
214
  case "end":
197
215
  return _context.stop();
198
216
  }
@@ -208,7 +226,7 @@ var TagAndInput = function TagAndInput(_ref) {
208
226
 
209
227
  function _handlerRegenerateSuggestions() {
210
228
  _handlerRegenerateSuggestions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
211
- var _ref3$type, type, currentSuggestions, aiSuggestions;
229
+ var _ref3$type, type, currentSuggestions, aiSuggestions, errorMsg;
212
230
 
213
231
  return _regenerator.default.wrap(function _callee2$(_context2) {
214
232
  while (1) {
@@ -224,9 +242,10 @@ var TagAndInput = function TagAndInput(_ref) {
224
242
  return _context2.abrupt("return");
225
243
 
226
244
  case 3:
245
+ setErrorMessage("");
227
246
  setIsAiRegenerationLoading(true);
228
247
  currentSuggestions = suggestions === null || suggestions === void 0 ? void 0 : suggestions[inputId];
229
- _context2.next = 7;
248
+ _context2.next = 8;
230
249
  return regenerateProductSuggestions({
231
250
  inputName: label,
232
251
  currentValue: value,
@@ -240,25 +259,42 @@ var TagAndInput = function TagAndInput(_ref) {
240
259
  attributeId: isBenefitInput ? inputId : null
241
260
  });
242
261
 
243
- case 7:
262
+ case 8:
244
263
  aiSuggestions = _context2.sent;
245
264
 
246
265
  if (!(!aiSuggestions && aiSuggestions.length === 0)) {
247
- _context2.next = 12;
266
+ _context2.next = 15;
267
+ break;
268
+ }
269
+
270
+ errorMsg = "Error: No se recibieron sugerencias de IA";
271
+ console.log(errorMsg);
272
+ setErrorMessage(errorMsg);
273
+ setIsAiRegenerationLoading(false);
274
+ return _context2.abrupt("return");
275
+
276
+ case 15:
277
+ console.log({
278
+ aiSuggestionsRenew: aiSuggestions
279
+ });
280
+
281
+ if (!(aiSuggestions !== null && aiSuggestions !== void 0 && aiSuggestions.error)) {
282
+ _context2.next = 21;
248
283
  break;
249
284
  }
250
285
 
251
- console.log("Error: No se recibieron sugerencias de IA");
286
+ console.log('Error: ', aiSuggestions.error);
287
+ setErrorMessage(aiSuggestions.error);
252
288
  setIsAiRegenerationLoading(false);
253
289
  return _context2.abrupt("return");
254
290
 
255
- case 12:
291
+ case 21:
256
292
  setSuggestions(function (prev) {
257
293
  return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, prev), {}, (0, _defineProperty2.default)({}, inputId, [].concat((0, _toConsumableArray2.default)(currentSuggestions), (0, _toConsumableArray2.default)(aiSuggestions))));
258
294
  });
259
295
  setIsAiRegenerationLoading(false);
260
296
 
261
- case 14:
297
+ case 23:
262
298
  case "end":
263
299
  return _context2.stop();
264
300
  }
@@ -403,6 +439,11 @@ var TagAndInput = function TagAndInput(_ref) {
403
439
  children: "Atributo generado con IA"
404
440
  })]
405
441
  }) : null]
442
+ }), errorMessage && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
443
+ className: "error-message-container",
444
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
445
+ children: errorMessage
446
+ })
406
447
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GeneralInput, {
407
448
  inputId: inputId,
408
449
  inputType: inputType,
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n position: relative;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n font-family: ", ";\n\n .titles{\n display: flex;\n gap: .5rem;\n align-items: center;\n }\n\n .icon_information{\n width: 1.35rem;\n height: 1.35rem;\n filter: brightness(.35);\n margin-top: 10px;\n }\n\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n .ai-generated{\n\n display: flex;\n align-items: items-center;\n gap: .5rem;\n font-size: 11px;\n background-color: rgba(224, 57, 167, 0.025);\n border: 1px solid rgba(224, 57, 167, 0.1);\n padding: .25rem .5rem;\n border-radius: 5px;\n margin-left: 0.5rem;\n margin-top: 7px;\n cursor: default;\n\n > img {\n width: 0.75rem;\n height: 0.75rem;\n }\n\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n\n\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n"])), _variables.FontFamily.Raleway, _variables.GlobalColors.white, function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n position: relative;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n font-family: ", ";\n\n .titles{\n display: flex;\n gap: .5rem;\n align-items: center;\n }\n\n .icon_information{\n width: 1.35rem;\n height: 1.35rem;\n filter: brightness(.35);\n margin-top: 10px;\n }\n\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n .ai-generated{\n\n display: flex;\n align-items: items-center;\n gap: .5rem;\n font-size: 11px;\n background-color: rgba(224, 57, 167, 0.025);\n border: 1px solid rgba(224, 57, 167, 0.1);\n padding: .25rem .5rem;\n border-radius: 5px;\n margin-left: 0.5rem;\n margin-top: 7px;\n cursor: default;\n\n > img {\n width: 0.75rem;\n height: 0.75rem;\n }\n\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n\n\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n\n .error-message-container {\n\n font-family: \"Raleway\";\n font-size: 12px;\n font-weight: 500;\n color: #E1251B;\n margin-bottom: 8px;\n margin-top: 0;\n\n }\n"])), _variables.FontFamily.Raleway, _variables.GlobalColors.white, function (_ref) {
19
19
  var color = _ref.color;
20
20
  return color ? color : _variables.GlobalColors.s5;
21
21
  }, function (_ref2) {
@@ -33,71 +33,120 @@ RetailerProductEditionDefault.args = {
33
33
  },
34
34
  token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI4ZDAxMDIxNC01YmZhLTQzYzMtOTZmYi1jNTU2ZGMwNTc3NGIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjhkMDEwMjE0LTViZmEtNDNjMy05NmZiLWM1NTZkYzA1Nzc0YiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI1MDgwMTVmMy1mZGVkLTQ2ODUtYTIxNy1mYzgyMTg0ZWRmNGMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTc2ODI1MzE3NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTc2ODI1Njc3NywiaWF0IjoxNzY4MjUzMTc3LCJlbWFpbCI6ImthcmFmZTMyMThAbW9tMmtpZC5jb20ifQ.QiZiscuTvrur0g328Zmh2bI-kZyg7YO_T5jT63096JNuSxGnX9wpK87cVTV1dED4ruD-2NMsgLShUIMcklAg17FL6i5_vCuB1dSIDY0LaybvSpriFJaVVdMUIMGFi_1Q7bI9qqyXYkevcf-HO33vVPdU-_-4-u8YRd-QganUk35vPYPh9vFJWbC0Qtvv25ZR4L2xuRIXx4e7StlTvZXysnYL8A84jkK1zn6d77V-9GqQQW8exO6sBW7R6cGt55vnF80NIfG_9lAqCK0PcZH4o50aqrAVhtfV5edlEmXBHeGK5R3Sz5iTeKb51QF3TWVFZCYGvQJ7FShulUWHcm3X2Q",
35
35
  productSelected: {
36
- "articleId": 145186,
36
+ "articleId": 145199,
37
37
  "services": {
38
38
  "datasheets": 1,
39
39
  "descriptions": 1,
40
- "images": 1
40
+ "images": 0
41
41
  },
42
- "orderId": 10449,
42
+ "orderId": 10457,
43
43
  "city": "CDMX, México",
44
44
  "status": "AS",
45
- "datasheet_status": "AC",
45
+ "datasheet_status": "AS",
46
46
  "prio": "none",
47
47
  "version": 3,
48
48
  "description_status": "AS",
49
- "images_status": "AC",
49
+ "images_status": "NS",
50
50
  "statusByRetailer": [{
51
- "status": "AC",
51
+ "status": "AS",
52
+ "service": "datasheet",
53
+ "retailer_id": 9,
54
+ "task_user_group_id": 2
55
+ }, {
56
+ "status": "AS",
57
+ "service": "description",
58
+ "retailer_id": 9,
59
+ "task_user_group_id": 2
60
+ }, {
61
+ "status": "AS",
62
+ "service": "datasheet",
63
+ "retailer_id": 19,
64
+ "task_user_group_id": 2
65
+ }, {
66
+ "status": "AS",
67
+ "service": "description",
68
+ "retailer_id": 19,
69
+ "task_user_group_id": 2
70
+ }, {
71
+ "status": "AS",
52
72
  "service": "datasheet",
53
- "retailer_id": 70,
54
- "task_user_group_id": 4
73
+ "retailer_id": 24,
74
+ "task_user_group_id": 2
55
75
  }, {
56
76
  "status": "AS",
57
77
  "service": "description",
58
- "retailer_id": 70,
78
+ "retailer_id": 24,
59
79
  "task_user_group_id": 2
60
80
  }, {
61
- "status": "AC",
62
- "service": "images",
63
- "retailer_id": 70,
64
- "task_user_group_id": 4
81
+ "status": "AS",
82
+ "service": "datasheet",
83
+ "retailer_id": 1011,
84
+ "task_user_group_id": 2
85
+ }, {
86
+ "status": "AS",
87
+ "service": "description",
88
+ "retailer_id": 1011,
89
+ "task_user_group_id": 2
65
90
  }],
66
91
  "article": {
67
- "id_article": 145186,
68
- "id_category": "4007",
92
+ "id_article": 145199,
93
+ "id_category": "10001",
69
94
  "brand": null,
70
- "name": "Mayonesa",
71
- "upc": "098928",
72
- "sku": "899",
73
- "timestamp": "2026-04-23T16:02:14.000Z",
95
+ "name": "Serna Status Bug 4",
96
+ "upc": "14615181351",
97
+ "sku": "156845131",
98
+ "timestamp": "2026-05-05T15:08:54.000Z",
74
99
  "active": 1,
75
100
  "company_id": 291,
76
101
  "company_name": "LATAM LOGISTICS",
77
102
  "country": "México",
78
- "id_order": 10449,
103
+ "id_order": 10457,
79
104
  "id_datasheet_especialist": 426,
80
105
  "id_datasheet_facilitator": null,
81
106
  "id_description_especialist": 426,
82
107
  "id_description_facilitator": null,
83
- "id_images_especialist": 427,
108
+ "id_images_especialist": null,
84
109
  "id_images_facilitator": null,
85
110
  "id_auditor": 425,
86
111
  "id_recepcionist": null,
87
- "category": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
112
+ "category": "Departamento Hanseatik|Categoría Hanseatik|Subcategoría Hanseatik",
88
113
  "categoryRetailer": [{
89
- "id_category": 4007,
90
- "id_retailer": 70,
91
- "category_name": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
92
- "retailer_name": "Bodega Aurrera"
114
+ "id_category": 3432,
115
+ "id_retailer": 24,
116
+ "category_name": "Bebés Alsuper|Bebés|Bebés",
117
+ "retailer_name": "Alsuper"
118
+ }, {
119
+ "id_category": 3579,
120
+ "id_retailer": 1011,
121
+ "category_name": "Categoría Genérica Farmatodo|Categoría Genérica|Categoría Genérica",
122
+ "retailer_name": "Farmatodo"
123
+ }, {
124
+ "id_category": 6795,
125
+ "id_retailer": 19,
126
+ "category_name": "Categoría Generica Costco|Categoría Generica|Categoría Generica",
127
+ "retailer_name": "Costco"
128
+ }, {
129
+ "id_category": 10001,
130
+ "id_retailer": 9,
131
+ "category_name": "Departamento Hanseatik|Categoría Hanseatik|Subcategoría Hanseatik",
132
+ "retailer_name": "Amazon"
93
133
  }]
94
134
  },
95
135
  "retailers": [{
96
- "id": 70,
97
- "name": "Bodega Aurrera"
136
+ "id": 9,
137
+ "name": "Amazon"
138
+ }, {
139
+ "id": 19,
140
+ "name": "Costco"
141
+ }, {
142
+ "id": 24,
143
+ "name": "Alsuper"
144
+ }, {
145
+ "id": 1011,
146
+ "name": "Farmatodo"
98
147
  }],
99
148
  "country": "México",
100
- "upc": "098928"
149
+ "upc": "14615181351"
101
150
  },
102
151
  // location: {
103
152
  // product: { articleId: 126855, versionId: 3 },
@@ -107,41 +156,42 @@ RetailerProductEditionDefault.args = {
107
156
  // },
108
157
  // },
109
158
  // EDICION IMAGENES
110
- user: {
111
- "id_user": 427,
112
- "name": "Especialista Edición",
113
- "last_name": null,
114
- "email": "kikije1467@mtlcz.com",
115
- "position": "Tester",
116
- "telephone": null,
117
- "country": null,
118
- "id_company": 254,
119
- "id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
120
- "birth_Date": null,
121
- "about_me": null,
122
- "zip_code": null,
123
- "address": null,
124
- "job": null,
125
- "id_stripe": null,
126
- "id_role": 8,
127
- "active": 1,
128
- "is_retailer": 0,
129
- "email_notify": null,
130
- "is_user_tech": null,
131
- "is_onboarding": 0,
132
- "membership": {
133
- "id": 750,
134
- "start_date": "2022-01-07T21:32:54.000Z",
135
- "end_date": "2023-01-07T21:32:54.000Z",
136
- "planID": 6,
137
- "plan": "prod_KvGd6YSTJyR3AP",
138
- "name": "Plan Small",
139
- "user_limit": "10",
140
- "products_limit": "1000",
141
- "type": "Enterprise"
142
- },
143
- "src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
144
- } //TEXTOS
159
+ // user: {
160
+ // "id_user": 427,
161
+ // "name": "Especialista Edición",
162
+ // "last_name": null,
163
+ // "email": "kikije1467@mtlcz.com",
164
+ // "position": "Tester",
165
+ // "telephone": null,
166
+ // "country": null,
167
+ // "id_company": 254,
168
+ // "id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
169
+ // "birth_Date": null,
170
+ // "about_me": null,
171
+ // "zip_code": null,
172
+ // "address": null,
173
+ // "job": null,
174
+ // "id_stripe": null,
175
+ // "id_role": 8,
176
+ // "active": 1,
177
+ // "is_retailer": 0,
178
+ // "email_notify": null,
179
+ // "is_user_tech": null,
180
+ // "is_onboarding": 0,
181
+ // "membership": {
182
+ // "id": 750,
183
+ // "start_date": "2022-01-07T21:32:54.000Z",
184
+ // "end_date": "2023-01-07T21:32:54.000Z",
185
+ // "planID": 6,
186
+ // "plan": "prod_KvGd6YSTJyR3AP",
187
+ // "name": "Plan Small",
188
+ // "user_limit": "10",
189
+ // "products_limit": "1000",
190
+ // "type": "Enterprise"
191
+ // },
192
+ // "src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
193
+ // },
194
+ //TEXTOS
145
195
  // user: {
146
196
  // "id_user": 442,
147
197
  // "name": "Especialista",
@@ -178,40 +228,39 @@ RetailerProductEditionDefault.args = {
178
228
  // },
179
229
  // "src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
180
230
  // },
181
- // user: {
182
- // id_user: 426,
183
- // name: "Especialista Textos",
184
- // last_name: null,
185
- // email: "karafe3218@mom2kid.com",
186
- // position: "Tester",
187
- // telephone: null,
188
- // country: null,
189
- // id_company: 254,
190
- // id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
191
- // birth_Date: null,
192
- // about_me: null,
193
- // zip_code: null,
194
- // address: null,
195
- // job: null,
196
- // id_stripe: null,
197
- // id_role: 7,
198
- // active: 1,
199
- // is_retailer: 0,
200
- // email_notify: null,
201
- // is_user_tech: null,
202
- // is_onboarding: 0,
203
- // membership: {
204
- // id: 750,
205
- // start_date: "2022-01-07T21:32:54.000Z",
206
- // end_date: "2023-01-07T21:32:54.000Z",
207
- // planID: 6,
208
- // plan: "prod_KvGd6YSTJyR3AP",
209
- // name: "Plan Small",
210
- // user_limit: "10",
211
- // products_limit: "1000",
212
- // type: "Enterprise",
213
- // },
214
- // src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478",
215
- // },
216
-
231
+ user: {
232
+ id_user: 426,
233
+ name: "Especialista Textos",
234
+ last_name: null,
235
+ email: "karafe3218@mom2kid.com",
236
+ position: "Tester",
237
+ telephone: null,
238
+ country: null,
239
+ id_company: 254,
240
+ id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
241
+ birth_Date: null,
242
+ about_me: null,
243
+ zip_code: null,
244
+ address: null,
245
+ job: null,
246
+ id_stripe: null,
247
+ id_role: 7,
248
+ active: 1,
249
+ is_retailer: 0,
250
+ email_notify: null,
251
+ is_user_tech: null,
252
+ is_onboarding: 0,
253
+ membership: {
254
+ id: 750,
255
+ start_date: "2022-01-07T21:32:54.000Z",
256
+ end_date: "2023-01-07T21:32:54.000Z",
257
+ planID: 6,
258
+ plan: "prod_KvGd6YSTJyR3AP",
259
+ name: "Plan Small",
260
+ user_limit: "10",
261
+ products_limit: "1000",
262
+ type: "Enterprise"
263
+ },
264
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478"
265
+ }
217
266
  };
@@ -45,26 +45,28 @@ var productReducer = function productReducer(state, action) {
45
45
 
46
46
  case PRODUCT_ACTIONS.SET_RETAILER_STATUS:
47
47
  {
48
+ var _action$payload$find, _action$payload$find2, _action$payload$find3;
49
+
48
50
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
49
51
  product: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.product), {}, {
50
52
  status: getMinorStatus(action.payload.map(function (status) {
51
53
  return status === null || status === void 0 ? void 0 : status.status;
52
54
  })),
53
- description_status: action.payload.find(function (status) {
55
+ description_status: ((_action$payload$find = action.payload.find(function (status) {
54
56
  var _state$active_retaile;
55
57
 
56
58
  return (status === null || status === void 0 ? void 0 : status.service) === "description" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile = state.active_retailer) === null || _state$active_retaile === void 0 ? void 0 : _state$active_retaile.id_retailer);
57
- }).status || "NS",
58
- datasheet_status: action.payload.find(function (status) {
59
+ })) === null || _action$payload$find === void 0 ? void 0 : _action$payload$find.status) || "NS",
60
+ datasheet_status: ((_action$payload$find2 = action.payload.find(function (status) {
59
61
  var _state$active_retaile2;
60
62
 
61
63
  return (status === null || status === void 0 ? void 0 : status.service) === "datasheet" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer);
62
- }).status || "NS",
63
- images_status: action.payload.find(function (status) {
64
+ })) === null || _action$payload$find2 === void 0 ? void 0 : _action$payload$find2.status) || "NS",
65
+ images_status: ((_action$payload$find3 = action.payload.find(function (status) {
64
66
  var _state$active_retaile3;
65
67
 
66
68
  return (status === null || status === void 0 ? void 0 : status.service) === "images" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer);
67
- }).status || "NS",
69
+ })) === null || _action$payload$find3 === void 0 ? void 0 : _action$payload$find3.status) || "NS",
68
70
  statusByRetailer: action.payload
69
71
  })
70
72
  });
@@ -105,6 +107,8 @@ var productReducer = function productReducer(state, action) {
105
107
  exports.productReducer = productReducer;
106
108
 
107
109
  function getMinorStatus() {
110
+ var _STATUS_DICTIONARY$NS;
111
+
108
112
  var servicesStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
109
113
  if (!servicesStatus || servicesStatus.length === 0) return _statusDictionary.STATUS_DICTIONARY.NS.name;
110
114
  console.log({
@@ -117,5 +121,5 @@ function getMinorStatus() {
117
121
  if (!minorObj || typeof minorObj.weight === "undefined") return current;
118
122
  return currentObj.weight < minorObj.weight ? currentObj : minorObj;
119
123
  }, servicesStatus[0] || _statusDictionary.STATUS_DICTIONARY.NS);
120
- return (winner === null || winner === void 0 ? void 0 : winner.status) || _statusDictionary.STATUS_DICTIONARY.NS.status;
124
+ return (winner === null || winner === void 0 ? void 0 : winner.status) || ((_STATUS_DICTIONARY$NS = _statusDictionary.STATUS_DICTIONARY.NS) === null || _STATUS_DICTIONARY$NS === void 0 ? void 0 : _STATUS_DICTIONARY$NS.status);
121
125
  }