@navservice/core 1.29.0 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,660 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ var __webpack_modules__ = ({
10
+ "./src/config_env/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ A: () => (__rspack_default_export)
13
+ });
14
+ class config_env {
15
+ static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
16
+ static init(config) {
17
+ config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
18
+ }
19
+ static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
20
+ return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
21
+ }
22
+ }
23
+ /* export default */ const __rspack_default_export = (config_env);
24
+
25
+
26
+ },
27
+
28
+ });
29
+ // The module cache
30
+ var __webpack_module_cache__ = {};
31
+
32
+ // The require function
33
+ function __webpack_require__(moduleId) {
34
+
35
+ // Check if module is in cache
36
+ var cachedModule = __webpack_module_cache__[moduleId];
37
+ if (cachedModule !== undefined) {
38
+ return cachedModule.exports;
39
+ }
40
+ // Create a new module (and put it into the cache)
41
+ var module = (__webpack_module_cache__[moduleId] = {
42
+ exports: {}
43
+ });
44
+ // Execute the module function
45
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
46
+
47
+ // Return the exports of the module
48
+ return module.exports;
49
+
50
+ }
51
+
52
+ // webpack/runtime/compat_get_default_export
53
+ (() => {
54
+ // getDefaultExport function for compatibility with non-ESM modules
55
+ __webpack_require__.n = (module) => {
56
+ var getter = module && module.__esModule ?
57
+ () => (module['default']) :
58
+ () => (module);
59
+ __webpack_require__.d(getter, { a: getter });
60
+ return getter;
61
+ };
62
+
63
+ })();
64
+ // webpack/runtime/define_property_getters
65
+ (() => {
66
+ __webpack_require__.d = (exports, definition) => {
67
+ for(var key in definition) {
68
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
69
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
70
+ }
71
+ }
72
+ };
73
+ })();
74
+ // webpack/runtime/has_own_property
75
+ (() => {
76
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
77
+ })();
78
+ // webpack/runtime/make_namespace_object
79
+ (() => {
80
+ // define __esModule on exports
81
+ __webpack_require__.r = (exports) => {
82
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
83
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
84
+ }
85
+ Object.defineProperty(exports, '__esModule', { value: true });
86
+ };
87
+ })();
88
+ var __webpack_exports__ = {};
89
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
90
+ (() => {
91
+ // ESM COMPAT FLAG
92
+ __webpack_require__.r(__webpack_exports__);
93
+
94
+ // EXPORTS
95
+ __webpack_require__.d(__webpack_exports__, {
96
+ "default": () => (/* binding */ src_utils)
97
+ });
98
+
99
+ ;// CONCATENATED MODULE: external "axios"
100
+ const external_axios_namespaceObject = require("axios");
101
+ var external_axios_default = /*#__PURE__*/__webpack_require__.n(external_axios_namespaceObject);
102
+ // EXTERNAL MODULE: ./src/config_env/index.ts
103
+ var config_env = __webpack_require__("./src/config_env/index.ts");
104
+ ;// CONCATENATED MODULE: ./src/utils/_api.ts
105
+
106
+
107
+
108
+ const _api_api = class _api {
109
+ static servidor_service_usuario = class servidor_service_usuario {
110
+ static get #axios() {
111
+ return external_axios_default().create({
112
+ baseURL: config_env/* ["default"].PUBLIC_BASE_URL_BACKEND_PRINCIPAL */.A.PUBLIC_BASE_URL_BACKEND_PRINCIPAL
113
+ });
114
+ }
115
+ static async post({ url, data, setToken = true }) {
116
+ return await this.#axios.post(url, data, _api.headers({
117
+ setToken: setToken
118
+ }));
119
+ }
120
+ static async get({ url, params, setToken = true }) {
121
+ const queryParams = new URLSearchParams();
122
+ if (params) {
123
+ Object.entries(params).forEach(([key, value])=>{
124
+ console.log('13');
125
+ if (value !== null && value !== undefined) {
126
+ console.log('14');
127
+ queryParams.append(key, value);
128
+ console.log('15');
129
+ }
130
+ });
131
+ }
132
+ const queryString = queryParams.toString();
133
+ const fullUrl = queryString ? `${url}?${queryString}` : url;
134
+ return await this.#axios.get(fullUrl, _api.headers({
135
+ setToken: setToken
136
+ }));
137
+ }
138
+ static async patch({ url, data, setToken = true }) {
139
+ return await this.#axios.patch(url, data, _api.headers({
140
+ setToken: setToken
141
+ }));
142
+ }
143
+ static async delete({ url }) {
144
+ return await this.#axios.delete(url);
145
+ }
146
+ };
147
+ static headers({ setToken = true }) {
148
+ const get_auth_user = src_utils.session_sorage.get_item_session_storage("auth_user");
149
+ if (setToken === true) {
150
+ return {
151
+ headers: {
152
+ Authorization: `Bearer ${get_auth_user?.data?.usuario?.token}`,
153
+ "Content-type": "application/json"
154
+ }
155
+ };
156
+ } else {
157
+ return {
158
+ headers: {
159
+ "Content-type": "application/json"
160
+ }
161
+ };
162
+ }
163
+ }
164
+ };
165
+ /* export default */ const utils_api = (_api_api);
166
+
167
+ ;// CONCATENATED MODULE: ./src/utils/_data.ts
168
+ const _data = class _data {
169
+ static YYYY_MM_DD_00_00_00(newData) {
170
+ let dataAtual = new Date();
171
+ if (newData) {
172
+ dataAtual = new Date(newData);
173
+ }
174
+ const options = {
175
+ timeZone: "America/Sao_Paulo",
176
+ ano: "numeric",
177
+ mes: "numeric",
178
+ dia: "numeric",
179
+ hora: "numeric"
180
+ };
181
+ const horarioFormatado = dataAtual.toLocaleString("pt-BR", options);
182
+ const [data, hora] = horarioFormatado.split(",");
183
+ const [dia, mes, ano] = data.split("/");
184
+ return `${ano}-${mes}-${dia} ${hora}`;
185
+ }
186
+ static DD_MM_YYYY_00_00_00(newData) {
187
+ let dataAtual = new Date();
188
+ if (newData) {
189
+ dataAtual = new Date(newData);
190
+ }
191
+ const options = {
192
+ timeZone: "America/Sao_Paulo",
193
+ ano: "numeric",
194
+ mes: "numeric",
195
+ dia: "numeric",
196
+ hora: "numeric"
197
+ };
198
+ return dataAtual.toLocaleString("pt-BR", options);
199
+ }
200
+ static DD_MM_YYYY_00_00(newData) {
201
+ let dataAtual = new Date();
202
+ if (newData) {
203
+ dataAtual = new Date(newData);
204
+ }
205
+ const options = {
206
+ timeZone: "America/Sao_Paulo",
207
+ ano: "numeric",
208
+ mes: "numeric",
209
+ dia: "numeric",
210
+ hora: "numeric"
211
+ };
212
+ const dataFormatada = dataAtual.toLocaleString("pt-BR", options).replace(",", "");
213
+ return dataFormatada;
214
+ }
215
+ static DD_MM_YYYY(newData) {
216
+ let dataAtual = new Date();
217
+ if (newData) {
218
+ dataAtual = new Date(newData);
219
+ }
220
+ const options = {
221
+ timeZone: "America/Sao_Paulo",
222
+ ano: "numeric",
223
+ mes: "numeric",
224
+ dia: "numeric",
225
+ hora: "numeric"
226
+ };
227
+ return dataAtual.toLocaleString("pt-BR", options);
228
+ }
229
+ static YYYY_MM_DD(newData) {
230
+ let dataAtual = new Date();
231
+ if (newData) {
232
+ dataAtual = new Date(newData);
233
+ }
234
+ const options = {
235
+ timeZone: "America/Sao_Paulo",
236
+ ano: "numeric",
237
+ mes: "numeric",
238
+ dia: "numeric",
239
+ hora: "numeric"
240
+ };
241
+ const horarioFormatado = dataAtual.toLocaleString("pt-BR", options);
242
+ const [data] = horarioFormatado.split(",");
243
+ const [dia, mes, ano] = data.split("/");
244
+ return `${ano}-${mes}-${dia}`;
245
+ }
246
+ static DIFERENCA_SEGUNDOS(data) {
247
+ var dataInicial = new Date(data);
248
+ var dataAtual = new Date();
249
+ var diferenca = Number(dataAtual) - Number(dataInicial);
250
+ var diferencaEmSegundos = Math.floor(diferenca / 1000);
251
+ return diferencaEmSegundos;
252
+ }
253
+ static DIFERENCA_DIAS(data) {
254
+ var dataInicial = new Date(data);
255
+ var dataAtual = new Date();
256
+ var diferenca = dataAtual.getTime() - dataInicial.getTime(); // Obtém a diferença em milissegundos
257
+ var diferencaEmDias = Math.floor(diferenca / (1000 * 60 * 60 * 24)); // Calcula a diferença em dias
258
+ return diferencaEmDias;
259
+ }
260
+ };
261
+ /* export default */ const utils_data = (_data);
262
+
263
+ ;// CONCATENATED MODULE: ./src/utils/_form.ts
264
+ class _form {
265
+ static regex_cpf_cnpj(value) {
266
+ let tempValue = value.replace(/\D/g, "");
267
+ if (tempValue.length > 14) {
268
+ tempValue = tempValue.slice(0, 14);
269
+ }
270
+ if (tempValue.length <= 11) {
271
+ tempValue = tempValue.replace(/^(\d{0,3})(\d{0,3})(\d{0,3})(\d{0,2})$/, (match, p1, p2, p3, p4)=>{
272
+ let result = p1;
273
+ if (p2) result += "." + p2;
274
+ if (p3) result += "." + p3;
275
+ if (p4) result += "-" + p4;
276
+ return result;
277
+ });
278
+ } else {
279
+ tempValue = tempValue.replace(/^(\d{0,2})(\d{0,3})(\d{0,3})(\d{0,4})(\d{0,2})$/, (match, p1, p2, p3, p4, p5)=>{
280
+ let result = p1;
281
+ if (p2) result += "." + p2;
282
+ if (p3) result += "." + p3;
283
+ if (p4) result += "/" + p4;
284
+ if (p5) result += "-" + p5;
285
+ return result;
286
+ });
287
+ }
288
+ return tempValue;
289
+ }
290
+ static formatar_cpf(value) {
291
+ const cpf = value.replace(/\D/g, "");
292
+ if (cpf.length > 11) {
293
+ return cpf.slice(0, 11);
294
+ }
295
+ return cpf.replace(/^(\d{0,3})(\d{0,3})(\d{0,3})(\d{0,2})$/, (match, p1, p2, p3, p4)=>{
296
+ let result = p1;
297
+ if (p2) result += "." + p2;
298
+ if (p3) result += "." + p3;
299
+ if (p4) result += "-" + p4;
300
+ return result;
301
+ });
302
+ }
303
+ static formatar_cnpj(value) {
304
+ const cnpj = value.replace(/\D/g, "");
305
+ if (cnpj.length > 14) {
306
+ return cnpj.slice(0, 14);
307
+ }
308
+ return cnpj.replace(/^(\d{0,2})(\d{0,3})(\d{0,3})(\d{0,4})(\d{0,2})$/, (match, p1, p2, p3, p4, p5)=>{
309
+ let result = p1;
310
+ if (p2) result += "." + p2;
311
+ if (p3) result += "." + p3;
312
+ if (p4) result += "/" + p4;
313
+ if (p5) result += "-" + p5;
314
+ return result;
315
+ });
316
+ }
317
+ static formatar_cep(value) {
318
+ const cep = value.replace(/\D/g, "");
319
+ if (cep.length > 8) {
320
+ return cep.slice(0, 8);
321
+ }
322
+ return cep.replace(/^(\d{0,5})(\d{0,3})$/, (match, p1, p2)=>{
323
+ if (p2) return `${p1}-${p2}`;
324
+ return p1;
325
+ });
326
+ }
327
+ static formatar_telefone_fixo(value) {
328
+ const telefone = value.replace(/\D/g, "");
329
+ if (telefone.length > 10) {
330
+ return telefone.slice(0, 10);
331
+ }
332
+ return telefone.replace(/^(\d{0,2})(\d{0,4})(\d{0,4})$/, (match, p1, p2, p3)=>{
333
+ let result = "";
334
+ if (p1) result += `(${p1}`;
335
+ if (p2) result += `) ${p2}`;
336
+ if (p3) result += `-${p3}`;
337
+ return result;
338
+ });
339
+ }
340
+ static formatar_celular(value) {
341
+ const celular = value.replace(/\D/g, "");
342
+ if (celular.length > 11) {
343
+ return celular.slice(0, 11);
344
+ }
345
+ return celular.replace(/^(\d{0,2})(\d{0,5})(\d{0,4})$/, (match, p1, p2, p3)=>{
346
+ let result = "";
347
+ if (p1) result += `(${p1}`;
348
+ if (p2) result += `) ${p2}`;
349
+ if (p3) result += `-${p3}`;
350
+ return result;
351
+ });
352
+ }
353
+ static formatar_nome(name) {
354
+ const lowercaseWords = [
355
+ "de",
356
+ "da",
357
+ "do",
358
+ "das",
359
+ "dos",
360
+ "e",
361
+ "a",
362
+ "o"
363
+ ];
364
+ const words = name.toLowerCase().split(" ");
365
+ const formattedWords = words.map((word, index)=>{
366
+ if (index === 0) {
367
+ return word.charAt(0).toUpperCase() + word.slice(1);
368
+ }
369
+ if (lowercaseWords.includes(word)) {
370
+ return word;
371
+ }
372
+ return word.charAt(0).toUpperCase() + word.slice(1);
373
+ });
374
+ return formattedWords.join(" ");
375
+ }
376
+ static formatar_reais_br(value) {
377
+ let num = value.replace(/\D/g, "");
378
+ return new Intl.NumberFormat("pt-BR", {
379
+ style: "currency",
380
+ currency: "BRL",
381
+ minimumFractionDigits: 2
382
+ }).format(Number(num) / 100);
383
+ }
384
+ }
385
+ /* export default */ const utils_form = (_form);
386
+
387
+ ;// CONCATENATED MODULE: ./src/utils/_geral.ts
388
+ const geral = class geral {
389
+ static slice_file_name(filename, maxLength = 30) {
390
+ if (!filename || typeof filename !== "string") return "";
391
+ // Encontra a última ocorrência do ponto para identificar a extensão
392
+ const lastDotIndex = filename.lastIndexOf(".");
393
+ // Se não houver extensão, trunca diretamente
394
+ if (lastDotIndex === -1) {
395
+ return filename.length > maxLength ? filename.substring(0, maxLength - 3) + "..." : filename;
396
+ }
397
+ const name = filename.substring(0, lastDotIndex);
398
+ const extension = filename.substring(lastDotIndex);
399
+ // Se o nome + extensão é menor que o máximo, retorna completo
400
+ if (filename.length <= maxLength) return filename;
401
+ // Calcula quanto espaço temos para o nome
402
+ // Considerando: extensão + '...' + 1 caractere do nome
403
+ const availableLength = maxLength - extension.length - 3;
404
+ if (availableLength <= 0) {
405
+ // Se não há espaço suficiente nem para 1 caractere do nome
406
+ return name.substring(0, 1) + "..." + extension;
407
+ }
408
+ // Trunca o nome e mantém a extensão
409
+ return name.substring(0, availableLength) + "..." + extension;
410
+ }
411
+ static extrair_id(array_enviado) {
412
+ const ids = [];
413
+ for(let i = 0; i < array_enviado.length; i++){
414
+ if (array_enviado[i]?._id) ids.push(array_enviado[i]._id);
415
+ }
416
+ return ids;
417
+ }
418
+ static gerar_id = (length = 32)=>{
419
+ // Caracteres permitidos (apenas alfanuméricos)
420
+ const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
421
+ // Timestamp em formato hexadecimal (sem separadores)
422
+ const timestamp = Date.now().toString(16) + performance.now().toString(16).replace(".", "");
423
+ // Inicializa resultado com timestamp para garantir unicidade temporal
424
+ let result = timestamp;
425
+ // Adiciona caracteres aleatórios até atingir o comprimento desejado
426
+ while(result.length < length){
427
+ const randomIndex = Math.floor(Math.random() * chars.length);
428
+ result += chars[randomIndex];
429
+ }
430
+ // Combina com características do navegador para aumentar a unicidade
431
+ const navigatorData = (window.navigator.userAgent + screen.width + screen.height).split("").map((c)=>c.charCodeAt(0)).reduce((a, b)=>a + b, 0).toString(36);
432
+ // Combina os dados e corta para o tamanho correto
433
+ const finalResult = (result + navigatorData).replace(/[^a-zA-Z0-9]/g, "");
434
+ // Garante o comprimento exato
435
+ return finalResult.substring(0, length);
436
+ };
437
+ };
438
+ /* export default */ const _geral = (geral);
439
+
440
+ ;// CONCATENATED MODULE: ./src/utils/_local_storage.ts
441
+ const _local_storage = class _local_storage {
442
+ static adicionar_item_local_storage(chave, novoItem) {
443
+ try {
444
+ const valorAtual = window.localStorage.getItem(chave);
445
+ const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
446
+ const newDataItem = {
447
+ ...listaAtual,
448
+ ...novoItem
449
+ };
450
+ window.localStorage.setItem(chave, JSON.stringify(newDataItem));
451
+ } catch (error) {
452
+ console.log(error);
453
+ }
454
+ }
455
+ static set_local_storage_sem_incremento(chave, novoItem) {
456
+ try {
457
+ window.localStorage.setItem(chave, JSON.stringify(novoItem));
458
+ } catch (error) {
459
+ console.log(error);
460
+ }
461
+ }
462
+ static get_item_local_storage(chave) {
463
+ try {
464
+ if (typeof window !== "undefined") {
465
+ const valorAtual = window.localStorage.getItem(chave);
466
+ return valorAtual ? JSON.parse(valorAtual) : valorAtual;
467
+ }
468
+ return;
469
+ } catch (error) {
470
+ console.log(error);
471
+ }
472
+ }
473
+ static remover_item_local_storage(chave) {
474
+ try {
475
+ window.localStorage.removeItem(chave);
476
+ } catch (error) {
477
+ console.log(error);
478
+ }
479
+ }
480
+ };
481
+ // Para usar a classe, você pode fazer:
482
+ /* export default */ const utils_local_storage = (_local_storage);
483
+
484
+ ;// CONCATENATED MODULE: ./src/utils/_update_context.ts
485
+ const _update_context = class _update_context {
486
+ static set_new_item_end = ({ oldArray = [], newItem = [], key = "_id" })=>{
487
+ try {
488
+ const hasValidIds = Array.isArray(newItem) ? newItem.every((item)=>item?.[key]) : newItem?.[key];
489
+ const newItemArray = hasValidIds ? Array.isArray(newItem) ? newItem : [
490
+ newItem
491
+ ] : oldArray;
492
+ if (oldArray?.length === 0) return newItemArray;
493
+ // Cria uma cópia rasa do array original
494
+ const updatedArray = [
495
+ ...oldArray
496
+ ];
497
+ // Itera sobre os novos itens
498
+ newItemArray.forEach((novoItem)=>{
499
+ const index = updatedArray.findIndex((oldItem)=>oldItem?.[key] === novoItem?.[key]);
500
+ if (index !== -1) {
501
+ // Atualiza o item existente mantendo as propriedades antigas que não estão no novo item
502
+ novoItem.new = false;
503
+ updatedArray[index] = {
504
+ ...updatedArray[index],
505
+ ...novoItem
506
+ };
507
+ } else {
508
+ // Adiciona novo item no FINAL com a propriedade new = true
509
+ novoItem.new = true;
510
+ updatedArray.push(novoItem); // Usa push em vez de unshift
511
+ }
512
+ });
513
+ return updatedArray;
514
+ } catch (error) {
515
+ console.error("Erro ao atualizar array:", error);
516
+ return oldArray; // Retorna o array original em caso de erro
517
+ }
518
+ };
519
+ static update_array_itens = ({ oldArray = [], newItem = [], key = "_id" })=>{
520
+ try {
521
+ const hasValidIds = Array.isArray(newItem) ? newItem.every((item)=>item?.[key]) : newItem?.[key];
522
+ const newItemArray = hasValidIds ? Array.isArray(newItem) ? newItem : [
523
+ newItem
524
+ ] : oldArray;
525
+ if (oldArray?.length === 0) return newItemArray;
526
+ // Cria uma cópia rasa do array original
527
+ const updatedArray = [
528
+ ...oldArray
529
+ ];
530
+ // Itera sobre os novos itens
531
+ newItemArray.forEach((novoItem)=>{
532
+ const index = updatedArray.findIndex((oldItem)=>oldItem?.[key] === novoItem?.[key]);
533
+ if (index !== -1) {
534
+ // Atualiza o item existente mantendo as propriedades antigas que não estão no novo item
535
+ novoItem.new = false;
536
+ updatedArray[index] = {
537
+ ...updatedArray[index],
538
+ ...novoItem
539
+ };
540
+ } else {
541
+ // Adiciona novo item no início com a propriedade new = true
542
+ novoItem.new = true;
543
+ updatedArray.unshift(novoItem);
544
+ }
545
+ });
546
+ return updatedArray;
547
+ } catch (error) {
548
+ console.error("Erro ao atualizar array:", error);
549
+ return oldArray; // Retorna o array original em caso de erro
550
+ }
551
+ };
552
+ static remove_array_items = ({ oldArray = [], itemsToRemove = [], key = "_id" })=>{
553
+ try {
554
+ // Verifica se os argumentos são válidos
555
+ if (!Array.isArray(oldArray) || oldArray.length === 0) return oldArray;
556
+ if (!itemsToRemove) return oldArray;
557
+ // Converte itemsToRemove para array se for um único item
558
+ const itemsArray = Array.isArray(itemsToRemove) ? itemsToRemove : [
559
+ itemsToRemove
560
+ ];
561
+ // Se não houver itens para remover, retorna o array original
562
+ if (itemsArray.length === 0) return oldArray;
563
+ // Cria um Set com os IDs dos itens a serem removidos para busca mais eficiente
564
+ const removeIds = new Set(itemsArray.filter((item)=>item?.[key]).map((item)=>item[key]));
565
+ // Filtra o array original removendo os itens cujos IDs estão no Set
566
+ const updatedArray = oldArray.filter((item)=>!removeIds.has(item?.[key]));
567
+ return updatedArray;
568
+ } catch (error) {
569
+ console.error("Erro ao remover itens do array:", error);
570
+ return oldArray; // Retorna o array original em caso de erro
571
+ }
572
+ };
573
+ static compare_arrays({ arrayAntigo, arrayNovo }) {
574
+ // Cria Sets para performance
575
+ const idsAntigos = new Set(arrayAntigo.map((item)=>item._id));
576
+ const idsNovos = new Set(arrayNovo.map((item)=>item._id));
577
+ // Mantém apenas os itens do array antigo que ainda existem no novo
578
+ const itensMantidos = arrayAntigo.filter((item)=>idsNovos.has(item._id));
579
+ // Adiciona os itens novos que não existiam no array antigo
580
+ const itensNovos = arrayNovo.filter((item)=>!idsAntigos.has(item._id));
581
+ // Combina os arrays
582
+ return [
583
+ ...itensMantidos,
584
+ ...itensNovos
585
+ ];
586
+ }
587
+ };
588
+ /* export default */ const utils_update_context = (_update_context);
589
+
590
+ ;// CONCATENATED MODULE: ./src/utils/_session_storage.ts
591
+ const _session_storage = class _session_storage {
592
+ static adicionar_item_session_storage({ chave, novoItem }) {
593
+ try {
594
+ const valorAtual = window.sessionStorage.getItem(chave);
595
+ const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
596
+ const newDataItem = {
597
+ ...listaAtual,
598
+ ...novoItem
599
+ };
600
+ window.sessionStorage.setItem(chave, JSON.stringify(newDataItem));
601
+ } catch (error) {
602
+ console.error(error);
603
+ }
604
+ }
605
+ static set_session_storage_sem_incremento({ chave, novoItem }) {
606
+ try {
607
+ window.sessionStorage.setItem(chave, JSON.stringify(novoItem));
608
+ } catch (error) {
609
+ console.error(error);
610
+ }
611
+ }
612
+ static get_item_session_storage(chave) {
613
+ try {
614
+ if (typeof window !== "undefined") {
615
+ const valorAtual = window.sessionStorage.getItem(chave);
616
+ return valorAtual ? JSON.parse(valorAtual) : valorAtual;
617
+ }
618
+ return;
619
+ } catch (error) {
620
+ console.error(error);
621
+ }
622
+ }
623
+ static remover_item_session_storage(chave) {
624
+ try {
625
+ window.sessionStorage.removeItem(chave);
626
+ } catch (error) {
627
+ console.error(error);
628
+ }
629
+ }
630
+ };
631
+ /* export default */ const utils_session_storage = (_session_storage);
632
+
633
+ ;// CONCATENATED MODULE: ./src/utils/index.ts
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+ const utils = class utils {
642
+ static api = utils_api;
643
+ static data = utils_data;
644
+ static form = utils_form;
645
+ static geral = _geral;
646
+ static local_storage = utils_local_storage;
647
+ static update_context = utils_update_context;
648
+ static session_sorage = utils_session_storage;
649
+ };
650
+ /* export default */ const src_utils = (utils);
651
+
652
+ })();
653
+
654
+ exports["default"] = __webpack_exports__["default"];
655
+ for(var __rspack_i in __webpack_exports__) {
656
+ if(["default"].indexOf(__rspack_i) === -1) {
657
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
658
+ }
659
+ }
660
+ Object.defineProperty(exports, '__esModule', { value: true });