vobi_lib 1.12.2 → 1.13.1
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/index.d.ts +81 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -252,6 +252,86 @@ declare const base64ToFile: (base64String: string, mimeType?: string, filename?:
|
|
|
252
252
|
|
|
253
253
|
declare const getUUIDFromEmail: (email: string) => string;
|
|
254
254
|
|
|
255
|
+
type PermissionAction = "view" | "createEdit" | "delete";
|
|
256
|
+
interface PermissionFamily {
|
|
257
|
+
readonly actions: readonly PermissionAction[];
|
|
258
|
+
readonly ids: readonly string[];
|
|
259
|
+
}
|
|
260
|
+
declare const FULL: readonly PermissionAction[];
|
|
261
|
+
declare const NO_DELETE: readonly PermissionAction[];
|
|
262
|
+
declare const VIEW_ONLY: readonly PermissionAction[];
|
|
263
|
+
declare const FAMILIES: Readonly<Record<string, PermissionFamily>>;
|
|
264
|
+
declare const ACTION_EXEMPT_MODELS: ReadonlySet<string>;
|
|
265
|
+
declare const FAMILY_BY_PERMISSION: Record<string, string>;
|
|
266
|
+
declare const ACTIONS_BY_PERMISSION: Record<string, readonly PermissionAction[]>;
|
|
267
|
+
declare const familyOf: (id?: string | null) => string | null;
|
|
268
|
+
declare const actionsOf: (id?: string | null) => readonly PermissionAction[];
|
|
269
|
+
declare const isGated: (id: string | null | undefined, action: PermissionAction) => boolean;
|
|
270
|
+
|
|
271
|
+
type ActionErrorKey = "cannotCreate" | "cannotEdit" | "cannotDelete";
|
|
272
|
+
interface ActionGateUser {
|
|
273
|
+
id?: number | string | null;
|
|
274
|
+
userType?: string | null;
|
|
275
|
+
permissions?: readonly string[] | null;
|
|
276
|
+
families?: Record<string, Partial<Record<PermissionAction, boolean>>> | null;
|
|
277
|
+
isOwner?: boolean | null;
|
|
278
|
+
groupPermission?: number | null;
|
|
279
|
+
isCustomerView?: boolean | null;
|
|
280
|
+
}
|
|
281
|
+
interface ActionGateParams {
|
|
282
|
+
user?: ActionGateUser | null;
|
|
283
|
+
method?: string | null;
|
|
284
|
+
model?: string | null;
|
|
285
|
+
required?: readonly string[] | null;
|
|
286
|
+
isPublic?: boolean | null;
|
|
287
|
+
isAnonymous?: unknown;
|
|
288
|
+
}
|
|
289
|
+
interface ActionGateResult {
|
|
290
|
+
allowed: boolean;
|
|
291
|
+
action: PermissionAction;
|
|
292
|
+
errorKey?: ActionErrorKey;
|
|
293
|
+
}
|
|
294
|
+
interface MethodGate {
|
|
295
|
+
action: PermissionAction;
|
|
296
|
+
errorKey?: ActionErrorKey;
|
|
297
|
+
}
|
|
298
|
+
declare const METHOD_GATE: Readonly<Record<string, MethodGate>>;
|
|
299
|
+
declare const DEFAULT_GATE: MethodGate;
|
|
300
|
+
declare const gateOf: (method?: string | null) => MethodGate;
|
|
301
|
+
declare const getPermissionAction: (method?: string | null) => PermissionAction;
|
|
302
|
+
declare const skipsActionGate: ({ user, isPublic, isAnonymous, }: Pick<ActionGateParams, "user" | "isPublic" | "isAnonymous">) => boolean;
|
|
303
|
+
declare const checkActionAccess: ({ user, method, model, required, isPublic, isAnonymous, }?: ActionGateParams) => ActionGateResult;
|
|
304
|
+
|
|
305
|
+
declare const DENY: readonly string[];
|
|
306
|
+
declare const BILL_TYPE_FAMILY: Readonly<Record<string, readonly string[]>>;
|
|
307
|
+
declare const CHARGE_FAMILY: Readonly<Record<string, readonly string[]>>;
|
|
308
|
+
declare const PRE_PAYMENT_FAMILY: readonly string[];
|
|
309
|
+
declare const VOBIPAY_FAMILY: readonly string[];
|
|
310
|
+
/** Importação cria despesa e receita na mesma operação — exige as duas famílias. */
|
|
311
|
+
declare const IMPORT_FAMILY: readonly string[];
|
|
312
|
+
declare const ALL_FINANCIAL_IDS: readonly string[];
|
|
313
|
+
declare const DISCRIMINANTS: readonly string[];
|
|
314
|
+
interface FinancialRecordShape {
|
|
315
|
+
billType?: string | null;
|
|
316
|
+
isCharge?: unknown;
|
|
317
|
+
ownBusiness?: unknown;
|
|
318
|
+
isVobiPay?: unknown;
|
|
319
|
+
idPrePayment?: unknown;
|
|
320
|
+
[key: string]: unknown;
|
|
321
|
+
}
|
|
322
|
+
/** O payload traz algum campo capaz de classificar o registro? */
|
|
323
|
+
declare const hasDiscriminant: (source?: FinancialRecordShape) => boolean;
|
|
324
|
+
/** `ownBusiness` chega como boolean do banco e como `'myCompany'` do front. */
|
|
325
|
+
declare const isOwnBusiness: (ownBusiness: unknown) => boolean;
|
|
326
|
+
declare const isTrue: (value: unknown) => boolean;
|
|
327
|
+
declare const familyOfRecord: ({ billType, isCharge, ownBusiness, isVobiPay, idPrePayment, }?: FinancialRecordShape) => readonly string[] | null;
|
|
328
|
+
|
|
329
|
+
interface RecordLoadContext {
|
|
330
|
+
user?: ActionGateUser | null;
|
|
331
|
+
isPublic?: boolean | null;
|
|
332
|
+
}
|
|
333
|
+
declare const skipsRecordLoad: ({ user, isPublic, }?: RecordLoadContext) => boolean;
|
|
334
|
+
|
|
255
335
|
interface ConfigType {
|
|
256
336
|
[key: string]: any;
|
|
257
337
|
sources: any[];
|
|
@@ -261,4 +341,4 @@ declare const configure: (options?: Record<string, any>) => void;
|
|
|
261
341
|
declare const getConfig: () => ConfigType;
|
|
262
342
|
declare const get: <T>(key: string, defaultValue?: T) => T;
|
|
263
343
|
|
|
264
|
-
export { type ArrayItem, BAD_GATEWAY, BAD_REQUEST, type Encode, FORBIDDEN, type FormatCurrencyProps, type ICustomErrorParams, INTERNAL_SERVER_ERROR, IsJsonString, METHOD_NOT_ALLOWED, type MimeType, NOT_ALLOWED, NOT_FOUND, SERVICE_UNAVAILABLE, type SignUrls, UNAUTHORIZED, type UploadCompleteData, type UploadInitData, type UploadParams, type UploadPart, _setSharpForTesting, asArray, asBrazilianDate, asDate, asyncForEach, base64ToFile, brazilianDateTime, brazilianDateToDate, capitalize, checkApprovalAuthority, checkCnpj, checkCpf, checkEmail, compressImage, configure, containsEncodedComponents, createThumbnail, currentDay, curry, dateIsValid, decodeToken, decrypt, diffObject, dynamici18nString, elasticTransformOr, encrypt, enumHelper, error, eventBus, extractMonthInfo, extractValueFromWhere, filterAttributes, filterEmpty, findValue, firstMonthDay, flatMapData, flattenChildren, formatCurrency, formatDate, formatDocument, formatNumber, formatNumberAnyFormat, get, getConfig, getDateOpenFinance, getExtension, getMonthNumber, getNameWithoutExtension, getNextDay, getNextWeekday, getPreviewsWeekday, getToday, getToken, getTomorrow, getUUIDFromEmail, getYesterday, imgSrcRegex, isAfter, isDateValid, isNumber, isOfAge, isValidUrl, lastMonthDay, makeRefurbishFileUrl, maxDateToList, minDateToList, monthsBetween, normalizeString, nullIfEmpty, padLeft, parseArrayAsObject, parseRouteToModel, prepareDoc, prepareSession, promiseAny, promiseEach, removeProperty, removeSpecialChar, replaceNumberOrPercentage, slugify, splitList, sum, sumByFunction, upload, validateAccess, validateMobilePhoneNumber, valueReplacer };
|
|
344
|
+
export { ACTIONS_BY_PERMISSION, ACTION_EXEMPT_MODELS, ALL_FINANCIAL_IDS, type ActionErrorKey, type ActionGateParams, type ActionGateResult, type ActionGateUser, type ArrayItem, BAD_GATEWAY, BAD_REQUEST, BILL_TYPE_FAMILY, CHARGE_FAMILY, DEFAULT_GATE, DENY, DISCRIMINANTS, type Encode, FAMILIES, FAMILY_BY_PERMISSION, FORBIDDEN, FULL, type FinancialRecordShape, type FormatCurrencyProps, type ICustomErrorParams, IMPORT_FAMILY, INTERNAL_SERVER_ERROR, IsJsonString, METHOD_GATE, METHOD_NOT_ALLOWED, type MimeType, NOT_ALLOWED, NOT_FOUND, NO_DELETE, PRE_PAYMENT_FAMILY, type PermissionAction, type PermissionFamily, type RecordLoadContext, SERVICE_UNAVAILABLE, type SignUrls, UNAUTHORIZED, type UploadCompleteData, type UploadInitData, type UploadParams, type UploadPart, VIEW_ONLY, VOBIPAY_FAMILY, _setSharpForTesting, actionsOf, asArray, asBrazilianDate, asDate, asyncForEach, base64ToFile, brazilianDateTime, brazilianDateToDate, capitalize, checkActionAccess, checkApprovalAuthority, checkCnpj, checkCpf, checkEmail, compressImage, configure, containsEncodedComponents, createThumbnail, currentDay, curry, dateIsValid, decodeToken, decrypt, diffObject, dynamici18nString, elasticTransformOr, encrypt, enumHelper, error, eventBus, extractMonthInfo, extractValueFromWhere, familyOf, familyOfRecord, filterAttributes, filterEmpty, findValue, firstMonthDay, flatMapData, flattenChildren, formatCurrency, formatDate, formatDocument, formatNumber, formatNumberAnyFormat, gateOf, get, getConfig, getDateOpenFinance, getExtension, getMonthNumber, getNameWithoutExtension, getNextDay, getNextWeekday, getPermissionAction, getPreviewsWeekday, getToday, getToken, getTomorrow, getUUIDFromEmail, getYesterday, hasDiscriminant, imgSrcRegex, isAfter, isDateValid, isGated, isNumber, isOfAge, isOwnBusiness, isTrue, isValidUrl, lastMonthDay, makeRefurbishFileUrl, maxDateToList, minDateToList, monthsBetween, normalizeString, nullIfEmpty, padLeft, parseArrayAsObject, parseRouteToModel, prepareDoc, prepareSession, promiseAny, promiseEach, removeProperty, removeSpecialChar, replaceNumberOrPercentage, skipsActionGate, skipsRecordLoad, slugify, splitList, sum, sumByFunction, upload, validateAccess, validateMobilePhoneNumber, valueReplacer };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var re=Object.create;var R=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var de=(e,t)=>{for(var o in t)R(e,o,{get:t[o],enumerable:!0})},W=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ie(t))!ce.call(e,r)&&r!==o&&R(e,r,{get:()=>t[r],enumerable:!(n=se(t,r))||n.enumerable});return e};var D=(e,t,o)=>(o=e!=null?re(le(e)):{},W(t||!e||!e.__esModule?R(o,"default",{value:e,enumerable:!0}):o,e)),ue=e=>W(R({},"__esModule",{value:!0}),e);var jt={};de(jt,{BAD_GATEWAY:()=>ge,BAD_REQUEST:()=>c,FORBIDDEN:()=>pe,INTERNAL_SERVER_ERROR:()=>F,IsJsonString:()=>he,METHOD_NOT_ALLOWED:()=>fe,NOT_ALLOWED:()=>w,NOT_FOUND:()=>L,SERVICE_UNAVAILABLE:()=>ye,UNAUTHORIZED:()=>P,_setSharpForTesting:()=>Tt,asArray:()=>O,asBrazilianDate:()=>_,asDate:()=>B,asyncForEach:()=>xe,base64ToFile:()=>kt,brazilianDateTime:()=>K,brazilianDateToDate:()=>_e,capitalize:()=>U,checkApprovalAuthority:()=>Nt,checkCnpj:()=>Ce,checkCpf:()=>ve,checkEmail:()=>Ie,compressImage:()=>Mt,configure:()=>be,containsEncodedComponents:()=>Ne,createThumbnail:()=>Ut,currentDay:()=>G,curry:()=>Re,dateIsValid:()=>Ze,decodeToken:()=>st,decrypt:()=>Pe,diffObject:()=>Te,dynamici18nString:()=>Be,elasticTransformOr:()=>Se,encrypt:()=>we,enumHelper:()=>a,error:()=>h,eventBus:()=>Le,extractMonthInfo:()=>It,extractValueFromWhere:()=>Fe,filterAttributes:()=>Ue,filterEmpty:()=>Me,findValue:()=>M,firstMonthDay:()=>j,flatMapData:()=>Ct,flattenChildren:()=>V,formatCurrency:()=>k,formatDate:()=>Q,formatDocument:()=>Rt,formatNumber:()=>Qe,formatNumberAnyFormat:()=>Xe,get:()=>I,getConfig:()=>De,getDateOpenFinance:()=>Pt,getExtension:()=>et,getMonthNumber:()=>ze,getNameWithoutExtension:()=>Oe,getNextDay:()=>ke,getNextWeekday:()=>X,getPreviewsWeekday:()=>ee,getToday:()=>Ge,getToken:()=>rt,getTomorrow:()=>qe,getUUIDFromEmail:()=>_t,getYesterday:()=>Ve,imgSrcRegex:()=>tt,isAfter:()=>$e,isDateValid:()=>at,isNumber:()=>ot,isOfAge:()=>He,isValidUrl:()=>nt,lastMonthDay:()=>$,makeRefurbishFileUrl:()=>it,maxDateToList:()=>We,minDateToList:()=>Ye,monthsBetween:()=>je,normalizeString:()=>At,nullIfEmpty:()=>lt,padLeft:()=>ct,parseArrayAsObject:()=>dt,parseRouteToModel:()=>ut,prepareDoc:()=>mt,prepareSession:()=>pt,promiseAny:()=>ft,promiseEach:()=>Ee,removeProperty:()=>gt,removeSpecialChar:()=>yt,replaceNumberOrPercentage:()=>vt,slugify:()=>ht,splitList:()=>Et,sum:()=>xt,sumByFunction:()=>bt,upload:()=>Ot,validateAccess:()=>Ae,validateMobilePhoneNumber:()=>Dt,valueReplacer:()=>S});module.exports=ue(jt);var Y={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"A\xE7\xE3o n\xE3o autorizada, atualize a p\xE1gina e tente novamente.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado.",invalidValue:"Valor informado inv\xE1lido.",invalidDoc:"O documento informado (CNPJ/CPF) est\xE1 incorreto.",docAlreadyExists:"Documento j\xE1 cadastrado.",tokenPasswordError:"Link de recupera\xE7\xE3o de senha inv\xE1lido.",errPassword:"Senha est\xE1 inv\xE1lida.",noParameters:"Par\xE2metros n\xE3o informado.",uniqueCode:"C\xF3digo j\xE1 cadastrado."};var h={},Z={en:Y,"pt-br":"PT_BR_LOCALE"},i=Z.en||Z.en,c=400,w=405,P=401,pe=403,L=404,fe=405,F=500,ge=502,ye=503;h.NOT_FOUND={userNotFound:{statusCode:L,code:"NF-00001",message:i.userNotFound},pageNotFound:{statusCode:L,code:"NF-00002",message:i.pageNotFound}};h.UNAUTHORIZED={notAuthorized:{statusCode:P,code:"UA-00001",message:i.notAuthorized},tokenExpired:{statusCode:P,code:"UA-00002",message:i.tokenExpired},invalidToken:{statusCode:P,code:"UA-00003",message:i.invalidToken}};h.NOT_ALLOWED={notUpdated:{statusCode:w,code:"NA-00001",message:i.notUpdated},cantDelete:{statusCode:w,code:"NA-00002",message:i.cantDelete}};h.INTERNAL_SERVER_ERROR={general:{statusCode:F,code:"ISE-00001",message:i.general},sentError:{statusCode:F,code:"ISE-00002",message:i.sentError}};h.BAD_REQUEST={noUser:{statusCode:c,code:"LIB-B-00001",message:i.noUser},noEmail:{statusCode:c,code:"LIB-B-00002",message:i.noEmail},noPassword:{statusCode:c,code:"LIB-B-00003",message:i.noPassword},invalidEmail:{statusCode:c,code:"LIB-B-00004",message:i.invalidEmail},uniqueEmail:{statusCode:c,code:"LIB-B-00005",message:i.uniqueEmail},invalidCPF:{statusCode:c,code:"LIB-B-00006",message:i.invalidCPF},invalidCNPJ:{statusCode:c,code:"LIB-B-00007",message:i.invalidCNPJ},uniqueName:{statusCode:c,code:"LIB-B-00008",message:i.uniqueName},noName:{statusCode:c,code:"LIB-B-00009",message:i.noName},noData:{statusCode:c,code:"LIB-B-00010",message:i.noData},invalidCredentials:{statusCode:c,code:"LIB-B-00011",message:i.invalidCredentials},tokenPasswordError:{statusCode:c,code:"LIB-B-00012",message:i.tokenPasswordError},errPassword:{statusCode:c,code:"LIB-B-00013",message:i.errPassword},noPhone:{statusCode:c,code:"LIB-B-00014",message:i.noPhone},noCPF:{statusCode:c,code:"LIB-B-00015",message:i.noCPF},noRG:{statusCode:c,code:"LIB-B-00016",message:i.noRG},noZipcode:{statusCode:c,code:"LIB-B-00017",message:i.noZipcode},noStreet:{statusCode:c,code:"LIB-B-00018",message:i.noStreet},noNumber:{statusCode:c,code:"LIB-B-00019",message:i.noNumber},noState:{statusCode:c,code:"LIB-B-00020",message:i.noState},noCity:{statusCode:c,code:"LIB-B-00021",message:i.noCity},noNeighborhood:{statusCode:c,code:"LIB-B-00022",message:i.noNeighborhood},noCNPJ:{statusCode:c,code:"LIB-B-00023",message:i.noCNPJ},noCompanyName:{statusCode:c,code:"LIB-B-00024",message:i.noCompanyName},noTrademarkName:{statusCode:c,code:"LIB-B-00025",message:i.noTrademarkName},noCompanyZipcode:{statusCode:c,code:"LIB-B-00026",message:i.noCompanyZipcode},noCompanyStreet:{statusCode:c,code:"LIB-B-00027",message:i.noCompanyStreet},noCompanyNumber:{statusCode:c,code:"LIB-B-00028",message:i.noCompanyNumber},noCompanyState:{statusCode:c,code:"LIB-B-00029",message:i.noCompanyState},noCompanyCity:{statusCode:c,code:"LIB-B-00030",message:i.noCompanyCity},noCompanyNeighborhood:{statusCode:c,code:"PRO-00031",message:i.noCompanyNeighborhood},noBirthdate:{statusCode:c,code:"LIB-B-00032",message:i.noBirthdate},noCompany:{statusCode:c,code:"LIB-B-00033",message:i.noCompany},noParameters:{statusCode:c,code:"LIB-B-00034",message:i.noParameters},invalidDoc:{statusCode:c,code:"LIB-B-00035",message:i.invalidDoc},docAlreadyExists:{statusCode:c,code:"LIB-B-00036",message:i.docAlreadyExists},invalidURL:{statusCode:c,code:"LIB-B-00037",message:i.invalidURL},noPermissions:{statusCode:c,code:"LIB-B-00038",message:i.noPermissions},fileLimit50:{statusCode:c,code:"LIB-B-00039",message:i.fileLimit50},fileLimit10:{statusCode:c,code:"LIB-B-00040",message:i.fileLimit10},invalidDates:{statusCode:c,code:"LIB-B-00041",message:i.invalidDates},maxLength:{statusCode:c,code:"LIB-B-00042",message:i.maxLength},uniqueCode:{statusCode:c,code:"LIB-B-00043",message:i.uniqueCode},invalidValue:{statusCode:c,code:"LIB-B-00044",message:i.invalidValue},invalidData:{statusCode:c,code:"LIB-B-00045",message:i.invalidData},invalidUUID:{statusCode:c,code:"LIB-B-00046",message:i.invalidUUID},noDate:{statusCode:c,code:"LIB-B-00047",message:i.noDate},invalidDate:{statusCode:c,code:"LIB-B-00048",message:i.invalidDate},invalidId:{statusCode:c,code:"LIB-B-00049",message:i.invalidId},noModel:{statusCode:c,code:"LIB-B-00050",message:i.noModel},sequelizeValidation:{statusCode:c,code:"LIB-B-00999"}};var he=e=>{try{JSON.parse(e)}catch{return!1}return JSON.parse(e)};var Ee=async(e,t)=>{for(let o of e)await t(o,e.indexOf(o))};var O=e=>e==null?[]:Array.isArray(e)?e:[e];var xe=async(e,t)=>{await Promise.all(e.map((o,n)=>t(o,n,e)))};var a={};a.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund",eml:"eml"};a.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};a.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};a.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};a.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};a.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};a.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};a.userType={guest:{name:"Visitante",value:"guest",type:"visitante"},operator:{name:"Operador",value:"operator",type:"operador"},customer:{name:"Cliente",value:"customer",type:"cliente"},provider:{name:"Profissional",value:"provider",type:"profissional"},system:{name:"Sistema",value:"system",type:"sistema"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"],skipPermission:["operator","customer"],all:["system","provider","customer","operator"]};a.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};a.personTypes={pf:"pf",pj:"pj"};a.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};a.stepAccount={personal:0,address:1,documents:2};a.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};a.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};a.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};a.planType={free:{value:"free",label:"freemium"},paid:{value:"paid",label:"Pago"}};a.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};a.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};a.billType={income:"receita",expense:"despesa",transfer:"transferencia",balance:"saldo inicial"};a.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento do cliente"},balance:{value:"balance",label:"saldo inicial"}};a.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};a.getEnumValue=(e,t,o=["id","name"])=>{let n=null;return!e||!t||Object.keys(e).some(r=>e[r][o[0]]===t?(n=e[r][o[1]],!0):!1),n};a.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};a.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};a.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};a.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};a.asaasPaymentStatus={PENDING:{label:"PENDING",value:a.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:a.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:a.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:a.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:a.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:a.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:a.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:a.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:a.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:a.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:a.installmentStatuses.inAnalysis}};a.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};a.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};a.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};a.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};a.withdrawSteps={list:1,fillData:2,confirmData:3};a.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};a.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};a.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};a.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};a.paymentCreditPermission={allowed:2e4,blocked:0};a.withdrawLimit={pj:{daytime:2e4,nightly:5e3},pf:{daytime:2e4,nightly:5e3}};a.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};a.refurbishReportType={budgeted:[a.optionsRefurbishReport.financialPhysicBudgeted.value,a.optionsRefurbishReport.physicBudgeted.value,a.optionsRefurbishReport.financialBudgeted.value],accomplished:[a.optionsRefurbishReport.physicAccomplished.value,a.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[a.optionsRefurbishReport.financialBudAcp.value,a.optionsRefurbishReport.physicBudAcp.value],common:[a.optionsRefurbishReport.financialPhysicBudgeted.value,a.optionsRefurbishReport.physicBudgeted.value,a.optionsRefurbishReport.physicBudAcp.value,a.optionsRefurbishReport.financialBudgeted.value,a.optionsRefurbishReport.financialBudAcp.value],measurement:[a.optionsRefurbishReport.physicAccomplished.value],financial:[a.optionsRefurbishReport.financialAccomplished.value],customColumns:[a.optionsRefurbishReport.physicBudAcp.value,a.optionsRefurbishReport.financialBudAcp.value],simpleExport:[a.optionsRefurbishReport.physicAccomplished.value,a.optionsRefurbishReport.financialAccomplished.value,a.optionsRefurbishReport.physicBudgeted.value,a.optionsRefurbishReport.financialBudgeted.value]};a.reportTypeActions={consolidatedByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"paidDate",idInstallmentStatus:a.installmentStatuses.allPaid,howDoesItsWorksId:"howFinancialReportByProjectStatusPaid",tableTitle:"Resultado de projetos",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"consolidatedByProject"},foreseenByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"dueDate",howDoesItsWorksId:"howFinancialReportByProjectAllStatus",tableTitle:"Previs\xE3o de resultado dos projetos",tableTitleTooltip:"S\xE3o contabilizadas todas as receitas e despesas, que j\xE1 foram pagas ou ainda em aberto.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"foreseenByProject"},resultsByInstallment:{model:"installments",clickRow:!0,groupBy:"months",rangeField:"paidDate",idInstallmentStatus:a.installmentStatuses.allPaid,howDoesItsWorksId:"howResultsWork",tableTitle:"Transa\xE7\xF5es realizadas",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial",exportEntity:"resultsByInstallment"},"cashFlow-monthly":{model:"cashFlow",idInstallmentStatus:a.installmentStatuses.allPaid,howDoesItsWorksId:"howCashFlowWork",tableTitle:"Fluxo de caixa",tableTitleTooltip:"",withResultChart:!1,filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!0},showLegend:!1,exportCsvModel:"financial/cashFlow",exportEntity:"cashFlow"},dre:{model:"dre",howDoesItsWorksId:"howDREWorks",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!1},showLegend:!1,exportCsvModel:"financial/dre",exportEntity:"dre"},"cashFlow-daily":{model:"cashFlow",howDoesItsWorksId:"howDailyCashFlowWorks",tableTitleTooltip:"",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,monthPicker:!0,columns:!1,paymentBankAccount:!0},showLegend:!1,exportCsvModel:"financial/dailyCashFlow",exportEntity:"dailyCashFlow"}};a.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};a.extraValuesPaymentType={simple:[a.extraValuesPayment.taxes,a.extraValuesPayment.discount,a.extraValuesPayment.shipping],asaas:[a.extraValuesPayment.dueDateDiscount,a.extraValuesPayment.dueDateDiscountType,a.extraValuesPayment.dueDateLimitDays,a.extraValuesPayment.fine,a.extraValuesPayment.fineType,a.extraValuesPayment.interest]};a.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};a.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};a.administrativePermissions={administrative:"administrative",admNote:"admNote",admFile:"admFile",admDetails:"admDetails",admTasks:"admTasks",admFinancial:"admFinancial",admFinancialExpense:"admFinancialExpense",admFinancialIncome:"admFinancialIncome",admFinancialResults:"admFinancialResults",admFinancialResume:"admFinancialResume",admPurchase:"admPurchase",admPurchaseQuote:"admPurchaseQuote",admPurchaseOrder:"admPurchaseOrder",admPurchaseOverview:"admPurchaseOverview",admPurchaseSolicitation:"admPurchaseSolicitation",admInventory:"admInventory",admInventoryItems:"admInventoryItems",admInventoryTransactions:"admInventoryTransactions",admStock:"admStock",admContract:"admContract"};a.colors={primary50:"#EBF0FF",primary100:"#D6E2FF",primary400:"#4F8EFA",primary500:"#2F74DE",teal500:"#00a296",teal600:"#009389",green500:"#46a22e",green600:"#40932A",yellow400:"#e0a819",yellow500:"#BA8A12",orange500:"#de7400",orange600:"#CA6A00",red50:"#fdeceb",red100:"#fac4c0",red500:"#ef4134",red600:"#D93B2F",pink500:"#e547a6",pink600:"#D04197",violet500:"#a145de",violet600:"#933FCA",neutral500:"#6F778B",neutral600:"#565E71"};a.maxInstallmentLength=60;a.contractStatus={draft:30,open:31,inProgress:32,paused:33,finished:34,editable:[30,31,32,33],active:[31,32,33],closed:[34]};a.contractMeasurementStatus={draft:1,confirmed:2,open:3,approved:4,rejected:5,editable:[1,3],paymentEnabled:[2,4]};a.contractMeasurementMoveStatus=(e=!1,t=!1)=>({[a.contractMeasurementStatus.draft]:{...e?{[`${a.contractMeasurementStatus.open}`]:{isAllowed:!0},[`${a.contractMeasurementStatus.approved}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0},[`${a.contractMeasurementStatus.rejected}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0}}:{[`${a.contractMeasurementStatus.confirmed}`]:{isAllowed:!0}}},[a.contractMeasurementStatus.confirmed]:{[`${a.contractMeasurementStatus.draft}`]:{isAllowed:!t}},...e&&{[a.contractMeasurementStatus.open]:{[`${a.contractMeasurementStatus.draft}`]:{isAllowed:!0},[`${a.contractMeasurementStatus.approved}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0},[`${a.contractMeasurementStatus.rejected}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0}},[a.contractMeasurementStatus.approved]:{[`${a.contractMeasurementStatus.draft}`]:{isAllowed:!t,authorityLevel:"contractMeasurement"},[`${a.contractMeasurementStatus.open}`]:{isAllowed:!t,authorityLevel:"contractMeasurement"},[`${a.contractMeasurementStatus.rejected}`]:{isAllowed:!t,authorityLevel:"contractMeasurement"}},[a.contractMeasurementStatus.rejected]:{[`${a.contractMeasurementStatus.draft}`]:{isAllowed:!0},[`${a.contractMeasurementStatus.open}`]:{isAllowed:!0},[`${a.contractMeasurementStatus.approved}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0}}}});a.contractMoveStatus=(e=!1,t=!1)=>({[a.contractStatus.draft]:{[`${a.contractStatus.open}`]:{isAllowed:!0}},[a.contractStatus.open]:{[`${a.contractStatus.draft}`]:{isAllowed:!t&&!e},[`${a.contractStatus.inProgress}`]:{isAllowed:!0},[`${a.contractStatus.paused}`]:{isAllowed:!0},[`${a.contractStatus.finished}`]:{isAllowed:!0}},[a.contractStatus.inProgress]:{[`${a.contractStatus.draft}`]:{isAllowed:!t&&!e},[`${a.contractStatus.open}`]:{isAllowed:!0},[`${a.contractStatus.paused}`]:{isAllowed:!0},[`${a.contractStatus.finished}`]:{isAllowed:!0}},[a.contractStatus.paused]:{[`${a.contractStatus.draft}`]:{isAllowed:!t&&!e},[`${a.contractStatus.open}`]:{isAllowed:!0},[`${a.contractStatus.inProgress}`]:{isAllowed:!0},[`${a.contractStatus.finished}`]:{isAllowed:!0}},[a.contractStatus.finished]:{[`${a.contractStatus.open}`]:{isAllowed:!0},[`${a.contractStatus.inProgress}`]:{isAllowed:!0},[`${a.contractStatus.paused}`]:{isAllowed:!0},[`${a.contractStatus.draft}`]:{isAllowed:!t&&!e}}});a.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,approved:19,rejected:20,centralDeleted:26,editable:[1,2,20],ongoing:[2,3,4,19,20]};a.purchaseOrderStatus={draft:7,centralDraft:23,open:8,sent:9,accepted:10,refused:11,closed:12,approved:21,rejected:22,centralLinked:24,centralDeleted:25,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[23,7,8,22],ongoing:[8,9],finished:[10,12],allRejected:[11,22],central:[23,24,25],centralModal:[24,25]};a.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};a.groupPermission={admin:1,member:2};a.mimeTypes={DOCUMENT:{PDF:"application/pdf"},IMAGE:{JPEG:"image/jpeg",PNG:"image/png",WEBP:"image/webp"},AUDIO:{MPEG:"audio/mpeg",OGG:"audio/ogg",WAV:"audio/wav",MP4:"audio/mp4",AAC:"audio/aac"}};a.conciliationStatus={draft:"Rascunho",open:"Em an\xE1lise",done:"Finalizado",cancel:"Cancelado"};a.OPFEventEnum={created:"AUTHORIZED",login_succeeded:"AWAITING_AUTHORIZATION",error:"REJECTED"};a.openFinanceStatus={1:"AWAITING_AUTHORIZATION",2:"AUTHORIZED",3:"REJECTED"};a.openFinanceEnum={AWAITING_AUTHORIZATION:{value:1,label:"Aguardando autoriza\xE7\xE3o",enum:a.openFinanceStatus[1]},AUTHORIZED:{value:2,label:"Autorizado",enum:a.openFinanceStatus[2],event:"created"},REJECTED:{value:3,label:"Rejeitado",enum:a.openFinanceStatus[3]},connected:[1,2]};a.openFinanceAlertMessage={[a.openFinanceEnum.AWAITING_AUTHORIZATION.value]:{message:`As conex\xF5es podem levar alguns minutos para serem conclu\xEDdas,
|
|
2
|
-
portanto \xE9 normal que alguns dados ainda n\xE3o estejam vis\xEDveis.`,background:
|
|
3
|
-
informados e tente conectar novamente. Se o erro persistir, contate o suporte.`,background:a.colors.red50,borderColor:a.colors.red100,icon:"faCircleXmark",iconColor:a.colors.red500}};var v=a;var A={sources:[],baseUrl:""},be=(e={})=>{Object.keys(e).forEach(t=>{typeof e[t]=="object"&&e[t]!==null&&!Array.isArray(e[t])?A[t]={...A[t],...e[t]}:A[t]=e[t]})},De=()=>A,I=(e,t=null)=>e in A?A[e]:t;var Ae=({data:e,allowAudience:t=[...v.userType.all],permissions:o})=>{var n,r,l;try{let u=I("sources",[]),{user:d,isPublic:p,isAnonymous:m,source:f=""}=e;if(p||d!=null&&d.isCustomerView)return null;let E=[...t,v.userType.system.value],x=[d==null?void 0:d.userType,(n=d==null?void 0:d.accessedBy)==null?void 0:n.userType];return!(d!=null&&d.id)||d.isActive===!1||m||!x.some(y=>y&&E.includes(y))?h.UNAUTHORIZED.notAuthorized:(d==null?void 0:d.userType)===v.userType.system.value&&!(d!=null&&d.idCompany)?u!=null&&u.includes(f)?null:h.UNAUTHORIZED.notAuthorized:(r=v.userType.skipPermission)!=null&&r.includes((d==null?void 0:d.userType)||"")||!(o!=null&&o.length)?null:!((l=d.permissions)!=null&&l.find(y=>o==null?void 0:o.includes(y)))?h.UNAUTHORIZED.notAuthorized:null}catch{return h.UNAUTHORIZED.notAuthorized}};var U=e=>{if(typeof e!="string")return"";let t=e.trim();return t.charAt(0).toUpperCase()+t.slice(1)};var Ce=e=>{if(!e)return!1;let t=e.toUpperCase();if(!/^[0-9A-Z]{12}[0-9]{2}$/.test(t))return!1;let o=!0;for(let r=1;r<t.length;r++)if(t.charAt(r-1)!==t.charAt(r)){o=!1;break}if(o)return!1;let n=r=>{let l=0,u=r-7;for(let p=0;p<r;p++)l+=(t.charCodeAt(p)-48)*u--,u<2&&(u=9);let d=l%11;return d<2?0:11-d};return n(12)!==parseInt(t.charAt(12),10)?!1:n(13)===parseInt(t.charAt(13),10)};var ve=(e,t=!1)=>{let o,n;return o=0,e.length<11||!t&&e.split("").every(r=>r===e[0])||(Array.from({length:9}).forEach((r,l)=>{o+=parseInt(e.substring(l,l+1),10)*(11-(l+1))}),n=o*10%11,(n===10||n===11)&&(n=0),n!==parseInt(e.substring(9,10),10))?!1:(o=0,Array.from({length:10}).forEach((r,l)=>{o+=parseInt(e.substring(l,l+1),10)*(12-(l+1))}),n=o*10%11,(n===10||n===11)&&(n=0),n===parseInt(e.substring(10,11),10))};var Ie=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var Ne=e=>decodeURI(e)!==decodeURIComponent(e);var Re=e=>(...t)=>e.length>t.length?e.bind(null,...t):e(...t);var T=D(require("crypto-js")),Pe=(e,t)=>T.AES.decrypt(e,t).toString(T.enc.Utf8);var Te=(e,t)=>Object.keys(t).reduce((o,n)=>{if(e[n]===t[n]||n==="lastModifiedBy"||n==="createdAt")return o;let{oldData:r,newData:l}=o;return{oldData:{...r,[n]:e[n]},newData:{...l,[n]:t[n]}}},{});var Be=(e,t)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?t.__(e):e:"";var Se=e=>{let t={};return e==null||e.forEach(o=>{Object.keys(o).forEach(r=>{typeof o[r]=="string"&&(o[r].toLowerCase()==="true"||o[r].toLowerCase()==="false")?t[r]=o[r].toLowerCase()==="true":t[r]=o[r]})}),t};var J=D(require("crypto-js")),we=(e,t)=>(typeof e=="object"&&(e=JSON.stringify(e)),J.AES.encrypt(e,t).toString());var Le={on(e,t){document.addEventListener(e,t)},dispatch(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))},remove(e,t){document.removeEventListener(e,t)}};var M=(e,t)=>{if(Array.isArray(e)===!1)return null;let o=null;return e.some(n=>(o=t(n),!!o)),o};var Fe=(e,t)=>e?e[t]?e[t]:M(e.or,o=>o[t]):null;var Oe=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.substring(0,t)};var Ue=(e,t)=>e&&e.length&&t&&t.length?e.map(o=>Object.entries(o).filter(([n])=>t.includes(n)).reduce((n,[r,l])=>Object.assign(n,{[r]:l}),{})):[];var Me=e=>e.filter(t=>O(t).length>0&&t);var k=(e,t={})=>{let o={decimalCount:2,decimal:",",thousands:".",...t},{decimal:n,thousands:r,currencySymbol:l}=o,{decimalCount:u}=o;try{u=Math.abs(u),u=isNaN(u)?2:u;let d=e<0?"-":"",p=parseInt(e=Math.abs(Number(e)||0).toFixed(u),10).toString(),m=p.length>3?p.length%3:0;return(l?`${d}${l}`:d)+(m?p.substr(0,m)+r:"")+p.substr(m).replace(/(\d{3})(?=\d)/g,`$1${r}`)+(u?n+Math.abs(e-parseInt(p,10)).toFixed(u).slice(2):"")}catch(d){return console.log(d),""}};var g=D(require("moment-timezone")),K=e=>{let t=e?new Date(e):new Date,o={timeZone:"America/Sao_Paulo"},n=t.toLocaleString("en-US",o);return new Date(n)},Q=(e,t,o,n,r)=>{if(!e)return null;if(r)return(0,g.default)(e,t);let l=g.default.utc(e);return n||l.local(),o&&l.locale(o),l.format(t)},ke=(e,t="YYYY-MM-DD")=>{let o=(0,g.default)(e,t).add(1,"days");return typeof e=="string"?o.format(t):o.toDate()},X=(e=new Date,t=1)=>{let o=new Date(e.setDate(e.getDate()+t));return o.getDay()%6?o:X(o)},ee=(e=new Date,t=1)=>{let o=new Date(e.setDate(e.getDate()-t));return o.getDay()%6?o:ee(o)},B=e=>e?g.default.utc(e).local():null,_=e=>e&&g.default.tz(new Date(e),"America/Sao_Paulo"),_e=(e,t)=>{let o=_(e);return o&&o.format(t||"YYYY-MM-DDTHH:mm:ssZ")},je=(e,t)=>{if(!e||!t)return null;let o=B(e),n=B(t);return!o||!n?null:n.diff(o,"months")},$e=(e,t)=>{var o;return!e||!t?null:(o=B(e))==null?void 0:o.isAfter(t)},Ge=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo");return e?t.startOf("day").toDate():t.toDate()},Ve=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo").subtract(1,"day");return e?t.startOf("day").toDate():t.toDate()},qe=(e=!0)=>{let t=g.default.tz("America/Sao_Paulo").add(1,"day");return e?t.startOf("day").toDate():t.toDate()},ze=e=>{let t=K(e);return`${t.getFullYear()}${t.getMonth().toString().padStart(2,"0")}`},He=(e,t)=>{let o=new Date(e),n=new Date;return new Date(n.getFullYear()-t,n.getMonth(),n.getDate()).getTime()>o.getTime()},We=e=>g.default.max(e),Ye=e=>g.default.min(e),Ze=e=>(0,g.default)(e).isValid(),j=(e,t)=>new Date(e,t-1,1).toISOString().split("T")[0],$=(e,t)=>new Date(e,t,0).toISOString().split("T")[0],G=()=>{let e=new Date(_(new Date));return Q(e,"YYYY-MM-DD")};var Je=D(require("dayjs"));var S=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var Ke=/(?:[A-Za-z]{0,3})\$|€|£|¥/g,te=e=>{let t=S(e.toString().replace("%","").replace(Ke,"").replace(/\s/g,"").trim().split(","));if(t.length===2)return t.join(".");let o=S(t[0].split("."));return o.length===2?o.join("."):t[0].replace(/\./g,"")},Qe=e=>{if(e==null)return e;if(!te(e))return null;let t=Number(te(e));return t>=Number.MAX_SAFE_INTEGER||Number.isNaN(t)?null:t},Xe=e=>{var o,n;if(!e)return null;let t=e.toString();return t.indexOf("/")>=0?null:(t=t.replace(/[^0-9.,-]/g,""),t.includes(",")&&t.includes(".")?(t.lastIndexOf(",")>t.lastIndexOf(".")?t=t.replace(/\./g,"").replace(",","."):t=t.replace(/,/g,""),Number(t)):t.includes(",")&&((o=t.split(",")[1])==null?void 0:o.length)>0?Number(t.replace(",",".")):t.includes(".")&&((n=t.split(".")[1])==null?void 0:n.length)>0?Number(t):Number(t.replace(/[.,]/g,"")))};var et=e=>{let t=e.indexOf("."),o=e.length;return t&&o?e.substr(t,o):""};var tt=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var at=e=>{if(!e)return!1;let t=new Date(e);return!isNaN(t.getTime())};var ot=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var nt=e=>{try{return!!new URL(e)}catch{return!1}};var ae=D(require("jwt-decode")),rt=e=>{var r;let{authorization:t,Authorization:o}=e,n=(r=t||o)==null?void 0:r.split(" ");return(n==null?void 0:n[0])==="Bearer"?n[1]:null},st=e=>{let{user:t,isCustomerView:o,accessedBy:n,exp:r,iss:l}=e?(0,ae.default)(e):{};return{...t,isCustomerView:o,accessedBy:n,exp:r,currentDevice:l}};var it=(e,t,o,n)=>{let r=e.idStatus>=5?"projetos":"oportunidades",l=t==="customer"?"cliente":"profissional",u=`/${l}/${r}/perfil/${e.id}`,d=`/${l}`;return`${{operator:u,provider:u,customer:d}}/arquivos?arquivo=${o.id}${n?"&visualizar":""}`};var lt=e=>(e==null?void 0:e.length)===0?null:e;var ct=(e,t="0000")=>(t+e).slice(t.length*-1);var dt=(e,t=!1)=>{let o={};for(let n=0;n<e.length;n++){let r=e[n];o[r.value]=t?{...r}:r.label}return o};var ut=e=>e.replace(/ /g,"").split("-").reduce((t,o)=>t+U(o),"");var mt=e=>e==null?void 0:e.replace(/[,-./]/g,"");var pt=({id:e,name:t,email:o,idCompany:n,userType:r,type:l,isOwner:u,MGMCode:d,groupPermission:p,isActive:m,limitAccess:f,company:E})=>({id:e,name:t,email:o,idCompany:n,userType:r,type:l,isOwner:u,MGMCode:d,groupPermission:p,isActive:m,limitAccess:f,idPlan:E==null?void 0:E.idPlan});var ft=e=>{let t=new Array(e.length),o=0;return new Promise((n,r)=>{e.forEach((l,u)=>{Promise.resolve(l).then(n).catch(d=>{t[u]=d,o+=1,o===e.length&&r(t)})})})};var gt=(e,t)=>Object.keys(t).filter(o=>o!==e).reduce((o,n)=>({...o,[n]:t[n]}),{});var yt=(e,t,o=!0)=>{if(!e)return e;let n=e.toLowerCase();return o&&(n=n.replace(new RegExp("\\s","g"),"")),n=n.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),n=n.replace(new RegExp("\xE6","g"),"ae"),n=n.replace(new RegExp("\xE7","g"),"c"),n=n.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),n=n.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),n=n.replace(new RegExp("\xF1","g"),"n"),n=n.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),n=n.replace(new RegExp("\u0153","g"),"oe"),n=n.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),n=n.replace(new RegExp("[\xFD\xFF]","g"),"y"),n=n.replace("'",""),n=n.replace("\xB4",""),n=n.replace("`",""),t&&(n=n.replace(new RegExp("\\W","g"),"")),n};var ht=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var Et=(e,t)=>e.reduce((o,n,r)=>{let l=Math.floor(r/t),u=[...o];return o[l]||(u[l]=[]),u[l].push(n),u},[]);var xt=(e,t,o)=>{let n=o||t;return(e==null?void 0:e.map(r=>n?r[o]||r[t]:r).reduce((r,l)=>r+(Number(l||0)||0),0))||0};var bt=(e,t)=>(e==null?void 0:e.map(o=>t(o)).reduce((o,n)=>o+(Number(n||0)||0),0))||0;var Dt=e=>{let t=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(t)};var At=(e,t)=>{if(typeof e!="string"||!e)return"";let o=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return t?o:o.toLowerCase()};var V=(e,t="")=>!e||e.length<=0?[]:e.flatMap((o,n)=>{let r=t?`${t}.${n+1}`:`${n+1}`,{children:l,...u}=o;return[{...u,index:r},...V(l||[],r)]}),Ct=e=>V(e).reduce((o,n)=>n.id?{...o,[n.id]:n}:o,{});var vt=(e,t)=>{var n;let o=e?(n=Number(e).toFixed(2))==null?void 0:n.replace(".",","):0;return t?`${k(e*100)}%`:o};var It=e=>{if(!e)return{};let[t,o]=e.split("-").map(Number),n=G(),r=j(t,o),l=$(t,o);return{startDate:r,endDate:l,actualDate:n}};var Nt=({oldStatus:e,newStatus:t,total:o,user:n,moveStatus:r})=>{var E,x,b,y,z;let{userApprovalAuthorities:l,isOwner:u,groupPermission:d,company:p}=n||{},m=r==null?void 0:r[e];if(!((E=m==null?void 0:m[t])!=null&&E.isAllowed))return null;if(u||d===a.groupPermission.admin||!((x=m==null?void 0:m[t])!=null&&x.authorityLevel))return m==null?void 0:m[t];let f=l==null?void 0:l.find(N=>{var H;return(N==null?void 0:N.idApprovalAuthority)===((H=m==null?void 0:m[t])==null?void 0:H.authorityLevel)});return!f&&((y=p==null?void 0:p.approvalAuthority)!=null&&y[(b=m==null?void 0:m[t])==null?void 0:b.authorityLevel])?!1:(z=m==null?void 0:m[t])!=null&&z.maxAmount?!Number((f==null?void 0:f.maxAmount)||0)&&(f==null?void 0:f.maxAmount)!==0||Number(o||0)<=Number(f==null?void 0:f.maxAmount)?m==null?void 0:m[t]:!1:m==null?void 0:m[t]};var Rt=e=>{if(!e)return null;let t=e.replace(/[^0-9A-Za-z]/g,"").toUpperCase();return t.length===11?t.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):t.length===14?t.replace(/([0-9A-Z]{2})([0-9A-Z]{3})([0-9A-Z]{3})([0-9A-Z]{4})(\d{2})/,"$1.$2.$3/$4-$5"):t};var q=D(require("dayjs")),Pt=()=>{let e=(0,q.default)().format("YYYY-MM-DD"),t=(0,q.default)().subtract(2,"day").format("YYYY-MM-DD");return{today:e,yesterday:t}};var C;try{C=require("sharp")}catch{}var Tt=e=>{C=e},oe=10*1024*1024,Bt=300,St=300,wt=9999,Lt=9999,ne=80,Ft=async(e,t)=>{let o=Object.keys(t);return await Promise.all(o.map(async n=>{let r=Number(n),l=r*oe,u=(r+1)*oe,d=e.slice(l,u),p=await fetch(t[n],{method:"PUT",body:d,headers:{"Content-Type":e.type}});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return{ETag:p.headers.get("etag"),PartNumber:r+1}}))},Ot=async({file:e,idCompany:t=""})=>{let o=I("baseUrl","");if(!e)throw new Error("Nenhum arquivo fornecido");try{let{size:n=0,type:r="image/jpeg",name:l}=e,u={name:l,size:n,type:r},d=await fetch(`${o}/media/start/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:t,file:u})});if(!d.ok){let y=await d.json().catch(()=>({}));throw new Error(`Failed to start upload. Status: ${d.status}, Data: ${JSON.stringify(y)}`)}let p=await d.json(),{signUrls:m,uploadId:f}=p;console.log("file",e);let E=await Ft(e,m),x=await fetch(`${o}/media/complete/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:t,file:u,uploadId:f,parts:E})});if(!x.ok){let y=await x.json().catch(()=>({}));throw new Error(`Failed to complete upload. Status: ${x.status}, Data: ${JSON.stringify(y)}`)}let b=await x.json();return console.log("uploadCompleteData",b),b==null?void 0:b.location}catch(n){throw n}},Ut=async(e,t)=>{var o,n;if(!C)throw new Error(`Sharp is required for image processing. Install it with:
|
|
1
|
+
"use strict";var Re=Object.create;var S=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var Be=(e,t)=>{for(var a in t)S(e,a,{get:t[a],enumerable:!0})},ie=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ne(t))!we.call(e,r)&&r!==a&&S(e,r,{get:()=>t[r],enumerable:!(o=Te(t,r))||o.enumerable});return e};var I=(e,t,a)=>(a=e!=null?Re(Se(e)):{},ie(t||!e||!e.__esModule?S(a,"default",{value:e,enumerable:!0}):a,e)),Oe=e=>ie(S({},"__esModule",{value:!0}),e);var ga={};Be(ga,{ACTIONS_BY_PERMISSION:()=>M,ACTION_EXEMPT_MODELS:()=>Q,ALL_FINANCIAL_IDS:()=>pa,BAD_GATEWAY:()=>Me,BAD_REQUEST:()=>d,BILL_TYPE_FAMILY:()=>T,CHARGE_FAMILY:()=>U,DEFAULT_GATE:()=>Ce,DENY:()=>da,DISCRIMINANTS:()=>ve,FAMILIES:()=>be,FAMILY_BY_PERMISSION:()=>j,FORBIDDEN:()=>Fe,FULL:()=>f,IMPORT_FAMILY:()=>ua,INTERNAL_SERVER_ERROR:()=>G,IsJsonString:()=>ke,METHOD_GATE:()=>De,METHOD_NOT_ALLOWED:()=>je,NOT_ALLOWED:()=>k,NOT_FOUND:()=>_,NO_DELETE:()=>F,PRE_PAYMENT_FAMILY:()=>ne,SERVICE_UNAVAILABLE:()=>Ue,UNAUTHORIZED:()=>w,VIEW_ONLY:()=>Ee,VOBIPAY_FAMILY:()=>oe,_setSharpForTesting:()=>Jt,actionsOf:()=>Ae,asArray:()=>$,asBrazilianDate:()=>H,asDate:()=>O,asyncForEach:()=>Ge,base64ToFile:()=>sa,brazilianDateTime:()=>ue,brazilianDateToDate:()=>it,capitalize:()=>z,checkActionAccess:()=>la,checkApprovalAuthority:()=>Wt,checkCnpj:()=>qe,checkCpf:()=>He,checkEmail:()=>Ye,compressImage:()=>ra,configure:()=>$e,containsEncodedComponents:()=>We,createThumbnail:()=>oa,currentDay:()=>Z,curry:()=>Ze,dateIsValid:()=>ht,decodeToken:()=>Tt,decrypt:()=>Ke,diffObject:()=>Je,dynamici18nString:()=>Qe,elasticTransformOr:()=>Xe,encrypt:()=>et,enumHelper:()=>n,error:()=>D,eventBus:()=>tt,extractMonthInfo:()=>Yt,extractValueFromWhere:()=>at,familyOf:()=>X,familyOfRecord:()=>fa,filterAttributes:()=>ot,filterEmpty:()=>rt,findValue:()=>V,firstMonthDay:()=>Y,flatMapData:()=>qt,flattenChildren:()=>K,formatCurrency:()=>q,formatDate:()=>pe,formatDocument:()=>Zt,formatNumber:()=>bt,formatNumberAnyFormat:()=>At,gateOf:()=>te,get:()=>R,getConfig:()=>ze,getDateOpenFinance:()=>Kt,getExtension:()=>Dt,getMonthNumber:()=>mt,getNameWithoutExtension:()=>nt,getNextDay:()=>st,getNextWeekday:()=>me,getPermissionAction:()=>ca,getPreviewsWeekday:()=>fe,getToday:()=>dt,getToken:()=>Rt,getTomorrow:()=>pt,getUUIDFromEmail:()=>ia,getYesterday:()=>ut,hasDiscriminant:()=>ma,imgSrcRegex:()=>Ct,isAfter:()=>lt,isDateValid:()=>It,isGated:()=>ee,isNumber:()=>vt,isOfAge:()=>ft,isOwnBusiness:()=>Pe,isTrue:()=>ae,isValidUrl:()=>Pt,lastMonthDay:()=>W,makeRefurbishFileUrl:()=>Nt,maxDateToList:()=>yt,minDateToList:()=>gt,monthsBetween:()=>ct,normalizeString:()=>Vt,nullIfEmpty:()=>St,padLeft:()=>wt,parseArrayAsObject:()=>Bt,parseRouteToModel:()=>Ot,prepareDoc:()=>Lt,prepareSession:()=>Ft,promiseAny:()=>jt,promiseEach:()=>_e,removeProperty:()=>Mt,removeSpecialChar:()=>Ut,replaceNumberOrPercentage:()=>Ht,skipsActionGate:()=>Ie,skipsRecordLoad:()=>ya,slugify:()=>kt,splitList:()=>_t,sum:()=>Gt,sumByFunction:()=>$t,upload:()=>na,validateAccess:()=>Ve,validateMobilePhoneNumber:()=>zt,valueReplacer:()=>L});module.exports=Oe(ga);var ce={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"A\xE7\xE3o n\xE3o autorizada, atualize a p\xE1gina e tente novamente.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado.",invalidValue:"Valor informado inv\xE1lido.",invalidDoc:"O documento informado (CNPJ/CPF) est\xE1 incorreto.",docAlreadyExists:"Documento j\xE1 cadastrado.",tokenPasswordError:"Link de recupera\xE7\xE3o de senha inv\xE1lido.",errPassword:"Senha est\xE1 inv\xE1lida.",noParameters:"Par\xE2metros n\xE3o informado.",uniqueCode:"C\xF3digo j\xE1 cadastrado."};var D={},le={en:ce,"pt-br":"PT_BR_LOCALE"},c=le.en||le.en,d=400,k=405,w=401,Fe=403,_=404,je=405,G=500,Me=502,Ue=503;D.NOT_FOUND={userNotFound:{statusCode:_,code:"NF-00001",message:c.userNotFound},pageNotFound:{statusCode:_,code:"NF-00002",message:c.pageNotFound}};D.UNAUTHORIZED={notAuthorized:{statusCode:w,code:"UA-00001",message:c.notAuthorized},tokenExpired:{statusCode:w,code:"UA-00002",message:c.tokenExpired},invalidToken:{statusCode:w,code:"UA-00003",message:c.invalidToken}};D.NOT_ALLOWED={notUpdated:{statusCode:k,code:"NA-00001",message:c.notUpdated},cantDelete:{statusCode:k,code:"NA-00002",message:c.cantDelete}};D.INTERNAL_SERVER_ERROR={general:{statusCode:G,code:"ISE-00001",message:c.general},sentError:{statusCode:G,code:"ISE-00002",message:c.sentError}};D.BAD_REQUEST={noUser:{statusCode:d,code:"LIB-B-00001",message:c.noUser},noEmail:{statusCode:d,code:"LIB-B-00002",message:c.noEmail},noPassword:{statusCode:d,code:"LIB-B-00003",message:c.noPassword},invalidEmail:{statusCode:d,code:"LIB-B-00004",message:c.invalidEmail},uniqueEmail:{statusCode:d,code:"LIB-B-00005",message:c.uniqueEmail},invalidCPF:{statusCode:d,code:"LIB-B-00006",message:c.invalidCPF},invalidCNPJ:{statusCode:d,code:"LIB-B-00007",message:c.invalidCNPJ},uniqueName:{statusCode:d,code:"LIB-B-00008",message:c.uniqueName},noName:{statusCode:d,code:"LIB-B-00009",message:c.noName},noData:{statusCode:d,code:"LIB-B-00010",message:c.noData},invalidCredentials:{statusCode:d,code:"LIB-B-00011",message:c.invalidCredentials},tokenPasswordError:{statusCode:d,code:"LIB-B-00012",message:c.tokenPasswordError},errPassword:{statusCode:d,code:"LIB-B-00013",message:c.errPassword},noPhone:{statusCode:d,code:"LIB-B-00014",message:c.noPhone},noCPF:{statusCode:d,code:"LIB-B-00015",message:c.noCPF},noRG:{statusCode:d,code:"LIB-B-00016",message:c.noRG},noZipcode:{statusCode:d,code:"LIB-B-00017",message:c.noZipcode},noStreet:{statusCode:d,code:"LIB-B-00018",message:c.noStreet},noNumber:{statusCode:d,code:"LIB-B-00019",message:c.noNumber},noState:{statusCode:d,code:"LIB-B-00020",message:c.noState},noCity:{statusCode:d,code:"LIB-B-00021",message:c.noCity},noNeighborhood:{statusCode:d,code:"LIB-B-00022",message:c.noNeighborhood},noCNPJ:{statusCode:d,code:"LIB-B-00023",message:c.noCNPJ},noCompanyName:{statusCode:d,code:"LIB-B-00024",message:c.noCompanyName},noTrademarkName:{statusCode:d,code:"LIB-B-00025",message:c.noTrademarkName},noCompanyZipcode:{statusCode:d,code:"LIB-B-00026",message:c.noCompanyZipcode},noCompanyStreet:{statusCode:d,code:"LIB-B-00027",message:c.noCompanyStreet},noCompanyNumber:{statusCode:d,code:"LIB-B-00028",message:c.noCompanyNumber},noCompanyState:{statusCode:d,code:"LIB-B-00029",message:c.noCompanyState},noCompanyCity:{statusCode:d,code:"LIB-B-00030",message:c.noCompanyCity},noCompanyNeighborhood:{statusCode:d,code:"PRO-00031",message:c.noCompanyNeighborhood},noBirthdate:{statusCode:d,code:"LIB-B-00032",message:c.noBirthdate},noCompany:{statusCode:d,code:"LIB-B-00033",message:c.noCompany},noParameters:{statusCode:d,code:"LIB-B-00034",message:c.noParameters},invalidDoc:{statusCode:d,code:"LIB-B-00035",message:c.invalidDoc},docAlreadyExists:{statusCode:d,code:"LIB-B-00036",message:c.docAlreadyExists},invalidURL:{statusCode:d,code:"LIB-B-00037",message:c.invalidURL},noPermissions:{statusCode:d,code:"LIB-B-00038",message:c.noPermissions},fileLimit50:{statusCode:d,code:"LIB-B-00039",message:c.fileLimit50},fileLimit10:{statusCode:d,code:"LIB-B-00040",message:c.fileLimit10},invalidDates:{statusCode:d,code:"LIB-B-00041",message:c.invalidDates},maxLength:{statusCode:d,code:"LIB-B-00042",message:c.maxLength},uniqueCode:{statusCode:d,code:"LIB-B-00043",message:c.uniqueCode},invalidValue:{statusCode:d,code:"LIB-B-00044",message:c.invalidValue},invalidData:{statusCode:d,code:"LIB-B-00045",message:c.invalidData},invalidUUID:{statusCode:d,code:"LIB-B-00046",message:c.invalidUUID},noDate:{statusCode:d,code:"LIB-B-00047",message:c.noDate},invalidDate:{statusCode:d,code:"LIB-B-00048",message:c.invalidDate},invalidId:{statusCode:d,code:"LIB-B-00049",message:c.invalidId},noModel:{statusCode:d,code:"LIB-B-00050",message:c.noModel},sequelizeValidation:{statusCode:d,code:"LIB-B-00999"}};var ke=e=>{try{JSON.parse(e)}catch{return!1}return JSON.parse(e)};var _e=async(e,t)=>{for(let a of e)await t(a,e.indexOf(a))};var $=e=>e==null?[]:Array.isArray(e)?e:[e];var Ge=async(e,t)=>{await Promise.all(e.map((a,o)=>t(a,o,e)))};var n={};n.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund",eml:"eml"};n.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};n.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};n.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};n.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};n.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};n.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};n.userType={guest:{name:"Visitante",value:"guest",type:"visitante"},operator:{name:"Operador",value:"operator",type:"operador"},customer:{name:"Cliente",value:"customer",type:"cliente"},provider:{name:"Profissional",value:"provider",type:"profissional"},system:{name:"Sistema",value:"system",type:"sistema"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"],skipPermission:["operator","customer"],all:["system","provider","customer","operator"]};n.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};n.personTypes={pf:"pf",pj:"pj"};n.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};n.stepAccount={personal:0,address:1,documents:2};n.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};n.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};n.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};n.planType={free:{value:"free",label:"freemium"},paid:{value:"paid",label:"Pago"}};n.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};n.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};n.billType={income:"receita",expense:"despesa",transfer:"transferencia",balance:"saldo inicial"};n.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento do cliente"},balance:{value:"balance",label:"saldo inicial"}};n.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};n.getEnumValue=(e,t,a=["id","name"])=>{let o=null;return!e||!t||Object.keys(e).some(r=>e[r][a[0]]===t?(o=e[r][a[1]],!0):!1),o};n.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};n.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};n.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};n.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};n.asaasPaymentStatus={PENDING:{label:"PENDING",value:n.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:n.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:n.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:n.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:n.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:n.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:n.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:n.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:n.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:n.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:n.installmentStatuses.inAnalysis}};n.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};n.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};n.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};n.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};n.withdrawSteps={list:1,fillData:2,confirmData:3};n.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};n.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};n.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};n.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};n.paymentCreditPermission={allowed:2e4,blocked:0};n.withdrawLimit={pj:{daytime:2e4,nightly:5e3},pf:{daytime:2e4,nightly:5e3}};n.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};n.refurbishReportType={budgeted:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value],accomplished:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[n.optionsRefurbishReport.financialBudAcp.value,n.optionsRefurbishReport.physicBudAcp.value],common:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudgeted.value,n.optionsRefurbishReport.financialBudAcp.value],measurement:[n.optionsRefurbishReport.physicAccomplished.value],financial:[n.optionsRefurbishReport.financialAccomplished.value],customColumns:[n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudAcp.value],simpleExport:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value]};n.reportTypeActions={consolidatedByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howFinancialReportByProjectStatusPaid",tableTitle:"Resultado de projetos",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"consolidatedByProject"},foreseenByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"dueDate",howDoesItsWorksId:"howFinancialReportByProjectAllStatus",tableTitle:"Previs\xE3o de resultado dos projetos",tableTitleTooltip:"S\xE3o contabilizadas todas as receitas e despesas, que j\xE1 foram pagas ou ainda em aberto.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"foreseenByProject"},resultsByInstallment:{model:"installments",clickRow:!0,groupBy:"months",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howResultsWork",tableTitle:"Transa\xE7\xF5es realizadas",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial",exportEntity:"resultsByInstallment"},"cashFlow-monthly":{model:"cashFlow",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howCashFlowWork",tableTitle:"Fluxo de caixa",tableTitleTooltip:"",withResultChart:!1,filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!0},showLegend:!1,exportCsvModel:"financial/cashFlow",exportEntity:"cashFlow"},dre:{model:"dre",howDoesItsWorksId:"howDREWorks",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!1},showLegend:!1,exportCsvModel:"financial/dre",exportEntity:"dre"},"cashFlow-daily":{model:"cashFlow",howDoesItsWorksId:"howDailyCashFlowWorks",tableTitleTooltip:"",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,monthPicker:!0,columns:!1,paymentBankAccount:!0},showLegend:!1,exportCsvModel:"financial/dailyCashFlow",exportEntity:"dailyCashFlow"}};n.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};n.extraValuesPaymentType={simple:[n.extraValuesPayment.taxes,n.extraValuesPayment.discount,n.extraValuesPayment.shipping],asaas:[n.extraValuesPayment.dueDateDiscount,n.extraValuesPayment.dueDateDiscountType,n.extraValuesPayment.dueDateLimitDays,n.extraValuesPayment.fine,n.extraValuesPayment.fineType,n.extraValuesPayment.interest]};n.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};n.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};n.administrativePermissions={administrative:"administrative",admNote:"admNote",admFile:"admFile",admDetails:"admDetails",admTasks:"admTasks",admFinancial:"admFinancial",admFinancialExpense:"admFinancialExpense",admFinancialIncome:"admFinancialIncome",admFinancialResults:"admFinancialResults",admFinancialResume:"admFinancialResume",admPurchase:"admPurchase",admPurchaseQuote:"admPurchaseQuote",admPurchaseOrder:"admPurchaseOrder",admPurchaseOverview:"admPurchaseOverview",admPurchaseSolicitation:"admPurchaseSolicitation",admInventory:"admInventory",admInventoryItems:"admInventoryItems",admInventoryTransactions:"admInventoryTransactions",admStock:"admStock",admContract:"admContract"};n.colors={primary50:"#EBF0FF",primary100:"#D6E2FF",primary400:"#4F8EFA",primary500:"#2F74DE",teal500:"#00a296",teal600:"#009389",green500:"#46a22e",green600:"#40932A",yellow400:"#e0a819",yellow500:"#BA8A12",orange500:"#de7400",orange600:"#CA6A00",red50:"#fdeceb",red100:"#fac4c0",red500:"#ef4134",red600:"#D93B2F",pink500:"#e547a6",pink600:"#D04197",violet500:"#a145de",violet600:"#933FCA",neutral500:"#6F778B",neutral600:"#565E71"};n.maxInstallmentLength=60;n.contractStatus={draft:30,open:31,inProgress:32,paused:33,finished:34,editable:[30,31,32,33],active:[31,32,33],closed:[34]};n.contractMeasurementStatus={draft:1,confirmed:2,open:3,approved:4,rejected:5,editable:[1,3],paymentEnabled:[2,4]};n.contractMeasurementMoveStatus=(e=!1,t=!1)=>({[n.contractMeasurementStatus.draft]:{...e?{[`${n.contractMeasurementStatus.open}`]:{isAllowed:!0},[`${n.contractMeasurementStatus.approved}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0},[`${n.contractMeasurementStatus.rejected}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0}}:{[`${n.contractMeasurementStatus.confirmed}`]:{isAllowed:!0}}},[n.contractMeasurementStatus.confirmed]:{[`${n.contractMeasurementStatus.draft}`]:{isAllowed:!t}},...e&&{[n.contractMeasurementStatus.open]:{[`${n.contractMeasurementStatus.draft}`]:{isAllowed:!0},[`${n.contractMeasurementStatus.approved}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0},[`${n.contractMeasurementStatus.rejected}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0}},[n.contractMeasurementStatus.approved]:{[`${n.contractMeasurementStatus.draft}`]:{isAllowed:!t,authorityLevel:"contractMeasurement"},[`${n.contractMeasurementStatus.open}`]:{isAllowed:!t,authorityLevel:"contractMeasurement"},[`${n.contractMeasurementStatus.rejected}`]:{isAllowed:!t,authorityLevel:"contractMeasurement"}},[n.contractMeasurementStatus.rejected]:{[`${n.contractMeasurementStatus.draft}`]:{isAllowed:!0},[`${n.contractMeasurementStatus.open}`]:{isAllowed:!0},[`${n.contractMeasurementStatus.approved}`]:{isAllowed:!0,authorityLevel:"contractMeasurement",maxAmount:!0}}}});n.contractMoveStatus=(e=!1,t=!1)=>({[n.contractStatus.draft]:{[`${n.contractStatus.open}`]:{isAllowed:!0}},[n.contractStatus.open]:{[`${n.contractStatus.draft}`]:{isAllowed:!t&&!e},[`${n.contractStatus.inProgress}`]:{isAllowed:!0},[`${n.contractStatus.paused}`]:{isAllowed:!0},[`${n.contractStatus.finished}`]:{isAllowed:!0}},[n.contractStatus.inProgress]:{[`${n.contractStatus.draft}`]:{isAllowed:!t&&!e},[`${n.contractStatus.open}`]:{isAllowed:!0},[`${n.contractStatus.paused}`]:{isAllowed:!0},[`${n.contractStatus.finished}`]:{isAllowed:!0}},[n.contractStatus.paused]:{[`${n.contractStatus.draft}`]:{isAllowed:!t&&!e},[`${n.contractStatus.open}`]:{isAllowed:!0},[`${n.contractStatus.inProgress}`]:{isAllowed:!0},[`${n.contractStatus.finished}`]:{isAllowed:!0}},[n.contractStatus.finished]:{[`${n.contractStatus.open}`]:{isAllowed:!0},[`${n.contractStatus.inProgress}`]:{isAllowed:!0},[`${n.contractStatus.paused}`]:{isAllowed:!0},[`${n.contractStatus.draft}`]:{isAllowed:!t&&!e}}});n.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,approved:19,rejected:20,centralDeleted:26,editable:[1,2,20],ongoing:[2,3,4,19,20]};n.purchaseOrderStatus={draft:7,centralDraft:23,open:8,sent:9,accepted:10,refused:11,closed:12,approved:21,rejected:22,centralLinked:24,centralDeleted:25,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[23,7,8,22],ongoing:[8,9],finished:[10,12],allRejected:[11,22],central:[23,24,25],centralModal:[24,25]};n.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};n.groupPermission={admin:1,member:2};n.mimeTypes={DOCUMENT:{PDF:"application/pdf"},IMAGE:{JPEG:"image/jpeg",PNG:"image/png",WEBP:"image/webp"},AUDIO:{MPEG:"audio/mpeg",OGG:"audio/ogg",WAV:"audio/wav",MP4:"audio/mp4",AAC:"audio/aac"}};n.conciliationStatus={draft:"Rascunho",open:"Em an\xE1lise",done:"Finalizado",cancel:"Cancelado"};n.OPFEventEnum={created:"AUTHORIZED",login_succeeded:"AWAITING_AUTHORIZATION",error:"REJECTED"};n.openFinanceStatus={1:"AWAITING_AUTHORIZATION",2:"AUTHORIZED",3:"REJECTED"};n.openFinanceEnum={AWAITING_AUTHORIZATION:{value:1,label:"Aguardando autoriza\xE7\xE3o",enum:n.openFinanceStatus[1]},AUTHORIZED:{value:2,label:"Autorizado",enum:n.openFinanceStatus[2],event:"created"},REJECTED:{value:3,label:"Rejeitado",enum:n.openFinanceStatus[3]},connected:[1,2]};n.openFinanceAlertMessage={[n.openFinanceEnum.AWAITING_AUTHORIZATION.value]:{message:`As conex\xF5es podem levar alguns minutos para serem conclu\xEDdas,
|
|
2
|
+
portanto \xE9 normal que alguns dados ainda n\xE3o estejam vis\xEDveis.`,background:n.colors.primary50,borderColor:n.colors.primary100,icon:"faCircleInfo",iconColor:n.colors.primary500},[n.openFinanceEnum.REJECTED.value]:{message:`N\xE3o foi poss\xEDvel conectar sua conta. Verifique sua conex\xE3o e os dados
|
|
3
|
+
informados e tente conectar novamente. Se o erro persistir, contate o suporte.`,background:n.colors.red50,borderColor:n.colors.red100,icon:"faCircleXmark",iconColor:n.colors.red500}};n.exportStatus={requested:"requested",started:"started",finished:"finished",error:"error",inFlight:["requested","started"]};n.exportType={document:"document"};n.exportFormat={pdf:"pdf",csv:"csv",xlsx:"xlsx"};var C=n;var v={sources:[],baseUrl:""},$e=(e={})=>{Object.keys(e).forEach(t=>{typeof e[t]=="object"&&e[t]!==null&&!Array.isArray(e[t])?v[t]={...v[t],...e[t]}:v[t]=e[t]})},ze=()=>v,R=(e,t=null)=>e in v?v[e]:t;var Ve=({data:e,allowAudience:t=[...C.userType.all],permissions:a})=>{var o,r,i;try{let l=R("sources",[]),{user:u,isPublic:y,isAnonymous:m,source:g=""}=e;if(y||u!=null&&u.isCustomerView)return null;let h=[...t,C.userType.system.value],x=[u==null?void 0:u.userType,(o=u==null?void 0:u.accessedBy)==null?void 0:o.userType];return!(u!=null&&u.id)||u.isActive===!1||m||!x.some(A=>A&&h.includes(A))?D.UNAUTHORIZED.notAuthorized:(u==null?void 0:u.userType)===C.userType.system.value&&!(u!=null&&u.idCompany)?l!=null&&l.includes(g)?null:D.UNAUTHORIZED.notAuthorized:(r=C.userType.skipPermission)!=null&&r.includes((u==null?void 0:u.userType)||"")||!(a!=null&&a.length)?null:!((i=u.permissions)!=null&&i.find(A=>a==null?void 0:a.includes(A)))?D.UNAUTHORIZED.notAuthorized:null}catch{return D.UNAUTHORIZED.notAuthorized}};var z=e=>{if(typeof e!="string")return"";let t=e.trim();return t.charAt(0).toUpperCase()+t.slice(1)};var qe=e=>{if(!e)return!1;let t=e.toUpperCase();if(!/^[0-9A-Z]{12}[0-9]{2}$/.test(t))return!1;let a=!0;for(let r=1;r<t.length;r++)if(t.charAt(r-1)!==t.charAt(r)){a=!1;break}if(a)return!1;let o=r=>{let i=0,l=r-7;for(let y=0;y<r;y++)i+=(t.charCodeAt(y)-48)*l--,l<2&&(l=9);let u=i%11;return u<2?0:11-u};return o(12)!==parseInt(t.charAt(12),10)?!1:o(13)===parseInt(t.charAt(13),10)};var He=(e,t=!1)=>{let a,o;return a=0,e.length<11||!t&&e.split("").every(r=>r===e[0])||(Array.from({length:9}).forEach((r,i)=>{a+=parseInt(e.substring(i,i+1),10)*(11-(i+1))}),o=a*10%11,(o===10||o===11)&&(o=0),o!==parseInt(e.substring(9,10),10))?!1:(a=0,Array.from({length:10}).forEach((r,i)=>{a+=parseInt(e.substring(i,i+1),10)*(12-(i+1))}),o=a*10%11,(o===10||o===11)&&(o=0),o===parseInt(e.substring(10,11),10))};var Ye=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var We=e=>decodeURI(e)!==decodeURIComponent(e);var Ze=e=>(...t)=>e.length>t.length?e.bind(null,...t):e(...t);var B=I(require("crypto-js")),Ke=(e,t)=>B.AES.decrypt(e,t).toString(B.enc.Utf8);var Je=(e,t)=>Object.keys(t).reduce((a,o)=>{if(e[o]===t[o]||o==="lastModifiedBy"||o==="createdAt")return a;let{oldData:r,newData:i}=a;return{oldData:{...r,[o]:e[o]},newData:{...i,[o]:t[o]}}},{});var Qe=(e,t)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?t.__(e):e:"";var Xe=e=>{let t={};return e==null||e.forEach(a=>{Object.keys(a).forEach(r=>{typeof a[r]=="string"&&(a[r].toLowerCase()==="true"||a[r].toLowerCase()==="false")?t[r]=a[r].toLowerCase()==="true":t[r]=a[r]})}),t};var de=I(require("crypto-js")),et=(e,t)=>(typeof e=="object"&&(e=JSON.stringify(e)),de.AES.encrypt(e,t).toString());var tt={on(e,t){document.addEventListener(e,t)},dispatch(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))},remove(e,t){document.removeEventListener(e,t)}};var V=(e,t)=>{if(Array.isArray(e)===!1)return null;let a=null;return e.some(o=>(a=t(o),!!a)),a};var at=(e,t)=>e?e[t]?e[t]:V(e.or,a=>a[t]):null;var nt=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.substring(0,t)};var ot=(e,t)=>e&&e.length&&t&&t.length?e.map(a=>Object.entries(a).filter(([o])=>t.includes(o)).reduce((o,[r,i])=>Object.assign(o,{[r]:i}),{})):[];var rt=e=>e.filter(t=>$(t).length>0&&t);var q=(e,t={})=>{let a={decimalCount:2,decimal:",",thousands:".",...t},{decimal:o,thousands:r,currencySymbol:i}=a,{decimalCount:l}=a;try{l=Math.abs(l),l=isNaN(l)?2:l;let u=e<0?"-":"",y=parseInt(e=Math.abs(Number(e)||0).toFixed(l),10).toString(),m=y.length>3?y.length%3:0;return(i?`${u}${i}`:u)+(m?y.substr(0,m)+r:"")+y.substr(m).replace(/(\d{3})(?=\d)/g,`$1${r}`)+(l?o+Math.abs(e-parseInt(y,10)).toFixed(l).slice(2):"")}catch(u){return console.log(u),""}};var E=I(require("moment-timezone")),ue=e=>{let t=e?new Date(e):new Date,a={timeZone:"America/Sao_Paulo"},o=t.toLocaleString("en-US",a);return new Date(o)},pe=(e,t,a,o,r)=>{if(!e)return null;if(r)return(0,E.default)(e,t);let i=E.default.utc(e);return o||i.local(),a&&i.locale(a),i.format(t)},st=(e,t="YYYY-MM-DD")=>{let a=(0,E.default)(e,t).add(1,"days");return typeof e=="string"?a.format(t):a.toDate()},me=(e=new Date,t=1)=>{let a=new Date(e.setDate(e.getDate()+t));return a.getDay()%6?a:me(a)},fe=(e=new Date,t=1)=>{let a=new Date(e.setDate(e.getDate()-t));return a.getDay()%6?a:fe(a)},O=e=>e?E.default.utc(e).local():null,H=e=>e&&E.default.tz(new Date(e),"America/Sao_Paulo"),it=(e,t)=>{let a=H(e);return a&&a.format(t||"YYYY-MM-DDTHH:mm:ssZ")},ct=(e,t)=>{if(!e||!t)return null;let a=O(e),o=O(t);return!a||!o?null:o.diff(a,"months")},lt=(e,t)=>{var a;return!e||!t?null:(a=O(e))==null?void 0:a.isAfter(t)},dt=(e=!0)=>{let t=E.default.tz("America/Sao_Paulo");return e?t.startOf("day").toDate():t.toDate()},ut=(e=!0)=>{let t=E.default.tz("America/Sao_Paulo").subtract(1,"day");return e?t.startOf("day").toDate():t.toDate()},pt=(e=!0)=>{let t=E.default.tz("America/Sao_Paulo").add(1,"day");return e?t.startOf("day").toDate():t.toDate()},mt=e=>{let t=ue(e);return`${t.getFullYear()}${t.getMonth().toString().padStart(2,"0")}`},ft=(e,t)=>{let a=new Date(e),o=new Date;return new Date(o.getFullYear()-t,o.getMonth(),o.getDate()).getTime()>a.getTime()},yt=e=>E.default.max(e),gt=e=>E.default.min(e),ht=e=>(0,E.default)(e).isValid(),Y=(e,t)=>new Date(e,t-1,1).toISOString().split("T")[0],W=(e,t)=>new Date(e,t,0).toISOString().split("T")[0],Z=()=>{let e=new Date(H(new Date));return pe(e,"YYYY-MM-DD")};var xt=I(require("dayjs"));var L=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var Et=/(?:[A-Za-z]{0,3})\$|€|£|¥/g,ye=e=>{let t=L(e.toString().replace("%","").replace(Et,"").replace(/\s/g,"").trim().split(","));if(t.length===2)return t.join(".");let a=L(t[0].split("."));return a.length===2?a.join("."):t[0].replace(/\./g,"")},bt=e=>{if(e==null)return e;if(!ye(e))return null;let t=Number(ye(e));return t>=Number.MAX_SAFE_INTEGER||Number.isNaN(t)?null:t},At=e=>{var a,o;if(!e)return null;let t=e.toString();return t.indexOf("/")>=0?null:(t=t.replace(/[^0-9.,-]/g,""),t.includes(",")&&t.includes(".")?(t.lastIndexOf(",")>t.lastIndexOf(".")?t=t.replace(/\./g,"").replace(",","."):t=t.replace(/,/g,""),Number(t)):t.includes(",")&&((a=t.split(",")[1])==null?void 0:a.length)>0?Number(t.replace(",",".")):t.includes(".")&&((o=t.split(".")[1])==null?void 0:o.length)>0?Number(t):Number(t.replace(/[.,]/g,"")))};var Dt=e=>{let t=e.indexOf("."),a=e.length;return t&&a?e.substr(t,a):""};var Ct=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var It=e=>{if(!e)return!1;let t=new Date(e);return!isNaN(t.getTime())};var vt=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var Pt=e=>{try{return!!new URL(e)}catch{return!1}};var ge=I(require("jwt-decode")),Rt=e=>{var r;let{authorization:t,Authorization:a}=e,o=(r=t||a)==null?void 0:r.split(" ");return(o==null?void 0:o[0])==="Bearer"?o[1]:null},Tt=e=>{let{user:t,isCustomerView:a,accessedBy:o,exp:r,iss:i}=e?(0,ge.default)(e):{};return{...t,isCustomerView:a,accessedBy:o,exp:r,currentDevice:i}};var Nt=(e,t,a,o)=>{let r=e.idStatus>=5?"projetos":"oportunidades",i=t==="customer"?"cliente":"profissional",l=`/${i}/${r}/perfil/${e.id}`,u=`/${i}`;return`${{operator:l,provider:l,customer:u}}/arquivos?arquivo=${a.id}${o?"&visualizar":""}`};var St=e=>(e==null?void 0:e.length)===0?null:e;var wt=(e,t="0000")=>(t+e).slice(t.length*-1);var Bt=(e,t=!1)=>{let a={};for(let o=0;o<e.length;o++){let r=e[o];a[r.value]=t?{...r}:r.label}return a};var Ot=e=>e.replace(/ /g,"").split("-").reduce((t,a)=>t+z(a),"");var Lt=e=>e==null?void 0:e.replace(/[,-./]/g,"");var Ft=({id:e,name:t,email:a,idCompany:o,userType:r,type:i,isOwner:l,MGMCode:u,groupPermission:y,isActive:m,limitAccess:g,company:h})=>({id:e,name:t,email:a,idCompany:o,userType:r,type:i,isOwner:l,MGMCode:u,groupPermission:y,isActive:m,limitAccess:g,idPlan:h==null?void 0:h.idPlan});var jt=e=>{let t=new Array(e.length),a=0;return new Promise((o,r)=>{e.forEach((i,l)=>{Promise.resolve(i).then(o).catch(u=>{t[l]=u,a+=1,a===e.length&&r(t)})})})};var Mt=(e,t)=>Object.keys(t).filter(a=>a!==e).reduce((a,o)=>({...a,[o]:t[o]}),{});var Ut=(e,t,a=!0)=>{if(!e)return e;let o=e.toLowerCase();return a&&(o=o.replace(new RegExp("\\s","g"),"")),o=o.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),o=o.replace(new RegExp("\xE6","g"),"ae"),o=o.replace(new RegExp("\xE7","g"),"c"),o=o.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),o=o.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),o=o.replace(new RegExp("\xF1","g"),"n"),o=o.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),o=o.replace(new RegExp("\u0153","g"),"oe"),o=o.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),o=o.replace(new RegExp("[\xFD\xFF]","g"),"y"),o=o.replace("'",""),o=o.replace("\xB4",""),o=o.replace("`",""),t&&(o=o.replace(new RegExp("\\W","g"),"")),o};var kt=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var _t=(e,t)=>e.reduce((a,o,r)=>{let i=Math.floor(r/t),l=[...a];return a[i]||(l[i]=[]),l[i].push(o),l},[]);var Gt=(e,t,a)=>{let o=a||t;return(e==null?void 0:e.map(r=>o?r[a]||r[t]:r).reduce((r,i)=>r+(Number(i||0)||0),0))||0};var $t=(e,t)=>(e==null?void 0:e.map(a=>t(a)).reduce((a,o)=>a+(Number(o||0)||0),0))||0;var zt=e=>{let t=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(t)};var Vt=(e,t)=>{if(typeof e!="string"||!e)return"";let a=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return t?a:a.toLowerCase()};var K=(e,t="")=>!e||e.length<=0?[]:e.flatMap((a,o)=>{let r=t?`${t}.${o+1}`:`${o+1}`,{children:i,...l}=a;return[{...l,index:r},...K(i||[],r)]}),qt=e=>K(e).reduce((a,o)=>o.id?{...a,[o.id]:o}:a,{});var Ht=(e,t)=>{var o;let a=e?(o=Number(e).toFixed(2))==null?void 0:o.replace(".",","):0;return t?`${q(e*100)}%`:a};var Yt=e=>{if(!e)return{};let[t,a]=e.split("-").map(Number),o=Z(),r=Y(t,a),i=W(t,a);return{startDate:r,endDate:i,actualDate:o}};var Wt=({oldStatus:e,newStatus:t,total:a,user:o,moveStatus:r})=>{var h,x,b,A,re;let{userApprovalAuthorities:i,isOwner:l,groupPermission:u,company:y}=o||{},m=r==null?void 0:r[e];if(!((h=m==null?void 0:m[t])!=null&&h.isAllowed))return null;if(l||u===n.groupPermission.admin||!((x=m==null?void 0:m[t])!=null&&x.authorityLevel))return m==null?void 0:m[t];let g=i==null?void 0:i.find(N=>{var se;return(N==null?void 0:N.idApprovalAuthority)===((se=m==null?void 0:m[t])==null?void 0:se.authorityLevel)});return!g&&((A=y==null?void 0:y.approvalAuthority)!=null&&A[(b=m==null?void 0:m[t])==null?void 0:b.authorityLevel])?!1:(re=m==null?void 0:m[t])!=null&&re.maxAmount?!Number((g==null?void 0:g.maxAmount)||0)&&(g==null?void 0:g.maxAmount)!==0||Number(a||0)<=Number(g==null?void 0:g.maxAmount)?m==null?void 0:m[t]:!1:m==null?void 0:m[t]};var Zt=e=>{if(!e)return null;let t=e.replace(/[^0-9A-Za-z]/g,"").toUpperCase();return t.length===11?t.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):t.length===14?t.replace(/([0-9A-Z]{2})([0-9A-Z]{3})([0-9A-Z]{3})([0-9A-Z]{4})(\d{2})/,"$1.$2.$3/$4-$5"):t};var J=I(require("dayjs")),Kt=()=>{let e=(0,J.default)().format("YYYY-MM-DD"),t=(0,J.default)().subtract(2,"day").format("YYYY-MM-DD");return{today:e,yesterday:t}};var P;try{P=require("sharp")}catch{}var Jt=e=>{P=e},he=10*1024*1024,Qt=300,Xt=300,ea=9999,ta=9999,xe=80,aa=async(e,t)=>{let a=Object.keys(t);return await Promise.all(a.map(async o=>{let r=Number(o),i=r*he,l=(r+1)*he,u=e.slice(i,l),y=await fetch(t[o],{method:"PUT",body:u,headers:{"Content-Type":e.type}});if(!y.ok)throw new Error(`HTTP error! status: ${y.status}`);return{ETag:y.headers.get("etag"),PartNumber:r+1}}))},na=async({file:e,idCompany:t=""})=>{let a=R("baseUrl","");if(!e)throw new Error("Nenhum arquivo fornecido");try{let{size:o=0,type:r="image/jpeg",name:i}=e,l={name:i,size:o,type:r},u=await fetch(`${a}/media/start/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:t,file:l})});if(!u.ok){let A=await u.json().catch(()=>({}));throw new Error(`Failed to start upload. Status: ${u.status}, Data: ${JSON.stringify(A)}`)}let y=await u.json(),{signUrls:m,uploadId:g}=y;console.log("file",e);let h=await aa(e,m),x=await fetch(`${a}/media/complete/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:t,file:l,uploadId:g,parts:h})});if(!x.ok){let A=await x.json().catch(()=>({}));throw new Error(`Failed to complete upload. Status: ${x.status}, Data: ${JSON.stringify(A)}`)}let b=await x.json();return console.log("uploadCompleteData",b),b==null?void 0:b.location}catch(o){throw o}},oa=async(e,t)=>{var a,o;if(!P)throw new Error(`Sharp is required for image processing. Install it with:
|
|
4
4
|
For Lambda ARM64: npm install --platform=linux --arch=arm64 sharp
|
|
5
5
|
For Lambda x86_64: npm install --platform=linux --arch=x64 sharp
|
|
6
|
-
For local development: npm install sharp`);if(!((
|
|
6
|
+
For local development: npm install sharp`);if(!((a=e==null?void 0:e.type)!=null&&a.includes("image"))||(o=e==null?void 0:e.type)!=null&&o.includes("tif"))return null;try{let r=await e.arrayBuffer(),i=await P(Buffer.from(r)).resize(Qt,Xt,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:xe}).toBuffer(),l=new Blob([i],{type:"image/jpeg"});return new File([l],t||e.name,{type:"image/jpeg"})}catch(r){throw new Error(`Error creating thumbnail: ${r instanceof Error?r.message:"Unknown error"}`)}},ra=async(e,t)=>{var a,o;if(!P)throw new Error(`Sharp is required for image processing. Install it with:
|
|
7
7
|
For Lambda ARM64: npm install --platform=linux --arch=arm64 sharp
|
|
8
8
|
For Lambda x86_64: npm install --platform=linux --arch=x64 sharp
|
|
9
|
-
For local development: npm install sharp`);if(!((
|
|
9
|
+
For local development: npm install sharp`);if(!((a=e==null?void 0:e.type)!=null&&a.includes("image"))||(o=e==null?void 0:e.type)!=null&&o.includes("tif"))return e;try{let r=await e.arrayBuffer(),i=await P(Buffer.from(r)).resize(ea,ta,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:xe}).toBuffer(),l=new Blob([i],{type:"image/jpeg"});return new File([l],t||(e==null?void 0:e.name),{type:"image/jpeg"})}catch{return e}},sa=(e,t="application/octet-stream",a="file")=>{let o=e.replace(/^data:[^;]+;base64,/,""),r=atob(o),i=new Uint8Array(r.length);for(let l=0;l<r.length;l++)i[l]=r.charCodeAt(l);return new File([i.buffer],a,{type:t})};var ia=e=>e.split("+")[1].split("@")[0];var f=Object.freeze(["view","createEdit","delete"]),F=Object.freeze(["view","createEdit"]),Ee=Object.freeze(["view"]),p=(e,t)=>Object.freeze({actions:e,ids:Object.freeze(t)}),be=Object.freeze({expense:p(f,["financialExpense","projectExpense","admFinancialExpense"]),income:p(f,["financialIncome","projectIncome","admFinancialIncome"]),ownBusiness:p(f,["financialOwnBusiness","projectOwnBusiness","opportunityInvoiceOwnBusiness"]),supplier:p(f,["financialSupplier","projectSupplier","opportunityInvoiceSupplier"]),quote:p(f,["purchaseQuote","projectPurchaseQuote","admPurchaseQuote"]),order:p(f,["purchaseOrder","projectPurchaseOrder","admPurchaseOrder"]),solicitation:p(f,["purchaseSolicitation","projectPurchaseSolicitation","admPurchaseSolicitation"]),deposit:p(f,["inventory","projectInventory","admInventory"]),movement:p(f,["inventoryTransactions","projectInventoryTransactions","admInventoryTransactions"]),contract:p(f,["contract","projectContract","admContract"]),tasks:p(f,["tasks","schedule","opportunityTask","admTasks"]),planning:p(F,["planning","opportunityPlanning","generalPlanning"]),workDiary:p(f,["workDiary","projectWorkDiary"]),note:p(f,["note"]),admNote:p(f,["admNote"]),opportunityNotes:p(f,["opportunityNotes"]),file:p(f,["file"]),admFile:p(f,["admFile"]),opportunityFiles:p(f,["opportunityFiles"]),item:p(f,["item"]),opportunityItem:p(f,["opportunityItem"]),projectDetails:p(f,["projectDetails"]),opportunityDetails:p(f,["opportunityDetails"]),projectRegistration:p(f,["projectRegistration"]),opportunityRegistration:p(f,["opportunityRegistration"]),measurement:p(f,["measurement"]),categories:p(f,["categories"]),customer:p(f,["customer"]),composition:p(f,["composition"]),products:p(f,["products"]),units:p(f,["units"]),group:p(f,["group"]),financialRegistrations:p(f,["financialRegistrations"]),supplierRegistration:p(f,["supplier"]),bankAccount:p(f,["financialBankAccount"]),transfer:p(f,["financialTransfer"]),vobipayCharge:p(f,["vobipayCharge"]),emitNfse:p(F,["emitNfse"]),takenNFe:p(F,["takenNFe"]),hours:p(f,["performedHours"]),analytics:p(f,["analytics"])}),Q=Object.freeze(new Set(["Comments"])),j={},M={};Object.entries(be).forEach(([e,{actions:t,ids:a}])=>{a.forEach(o=>{j[o]=e,M[o]=t})});Object.freeze(j);Object.freeze(M);var X=e=>e&&j[e]||null,Ae=e=>e&&M[e]||Ee,ee=(e,t)=>Ae(e).includes(t);var De=Object.freeze({GET:{action:"view"},POST:{action:"createEdit",errorKey:"cannotCreate"},PUT:{action:"createEdit",errorKey:"cannotEdit"},PATCH:{action:"createEdit",errorKey:"cannotEdit"},DELETE:{action:"delete",errorKey:"cannotDelete"}}),Ce=Object.freeze({action:"createEdit",errorKey:"cannotCreate"}),te=e=>e&&De[e]||Ce,ca=e=>te(e).action,Ie=({user:e,isPublic:t,isAnonymous:a})=>{var o;return t||a||e!=null&&e.isCustomerView||(o=C.userType.skipPermission)!=null&&o.includes((e==null?void 0:e.userType)||"")||(e==null?void 0:e.userType)===C.userType.system.value?!0:(e==null?void 0:e.isOwner)===!0||(e==null?void 0:e.groupPermission)===1},la=({user:e,method:t,model:a,required:o,isPublic:r,isAnonymous:i}={})=>{let{action:l,errorKey:u}=te(t);if(l==="view")return{allowed:!0,action:l};if(Ie({user:e,isPublic:r,isAnonymous:i}))return{allowed:!0,action:l};if(a&&Q.has(a))return{allowed:!0,action:l};if(!(o!=null&&o.length))return{allowed:!0,action:l};let y=o.filter(h=>{var x;return(x=e==null?void 0:e.permissions)==null?void 0:x.includes(h)});if(!y.length)return{allowed:!0,action:l};let m=(e==null?void 0:e.families)||{},g=y.some(h=>{var b;if(!ee(h,l))return!0;let x=X(h);return!!x&&((b=m[x])==null?void 0:b[l])===!0});return g?{allowed:g,action:l}:{allowed:g,action:l,errorKey:u}};var da=Object.freeze(["unautorize"]),T=Object.freeze({expense:Object.freeze(["financialExpense","projectExpense","admFinancialExpense"]),income:Object.freeze(["financialIncome","projectIncome","admFinancialIncome"]),transfer:Object.freeze(["financialTransfer"]),balance:Object.freeze(["financialBankAccount"])}),U=Object.freeze({ownBusiness:Object.freeze(["financialOwnBusiness","projectOwnBusiness","opportunityInvoiceOwnBusiness"]),supplier:Object.freeze(["financialSupplier","projectSupplier","opportunityInvoiceSupplier"])}),ne=Object.freeze(["centralPayments","takenNFe"]),oe=Object.freeze(["vobipayCharge"]),ua=Object.freeze([...T.expense,...T.income]),pa=Object.freeze([...new Set([...Object.values(T).flat(),...Object.values(U).flat(),...ne,...oe])]),ve=Object.freeze(["billType","isCharge","ownBusiness","isVobiPay","idPrePayment"]),ma=(e={})=>ve.some(t=>(e==null?void 0:e[t])!==void 0&&e[t]!==null),Pe=e=>typeof e=="boolean"?e:e==="myCompany"||e==="true",ae=e=>e===!0||e==="true"||e===1||e==="1",fa=({billType:e,isCharge:t,ownBusiness:a,isVobiPay:o,idPrePayment:r}={})=>r?ne:ae(o)?oe:e==="income"&&ae(t)?Pe(a)?U.ownBusiness:U.supplier:e&&T[e]||null;var ya=({user:e,isPublic:t}={})=>{var a;return t||!(e!=null&&e.id)||e.isCustomerView||(a=C.userType.skipPermission)!=null&&a.includes(e.userType||"")?!0:e.userType===C.userType.system.value};0&&(module.exports={ACTIONS_BY_PERMISSION,ACTION_EXEMPT_MODELS,ALL_FINANCIAL_IDS,BAD_GATEWAY,BAD_REQUEST,BILL_TYPE_FAMILY,CHARGE_FAMILY,DEFAULT_GATE,DENY,DISCRIMINANTS,FAMILIES,FAMILY_BY_PERMISSION,FORBIDDEN,FULL,IMPORT_FAMILY,INTERNAL_SERVER_ERROR,IsJsonString,METHOD_GATE,METHOD_NOT_ALLOWED,NOT_ALLOWED,NOT_FOUND,NO_DELETE,PRE_PAYMENT_FAMILY,SERVICE_UNAVAILABLE,UNAUTHORIZED,VIEW_ONLY,VOBIPAY_FAMILY,_setSharpForTesting,actionsOf,asArray,asBrazilianDate,asDate,asyncForEach,base64ToFile,brazilianDateTime,brazilianDateToDate,capitalize,checkActionAccess,checkApprovalAuthority,checkCnpj,checkCpf,checkEmail,compressImage,configure,containsEncodedComponents,createThumbnail,currentDay,curry,dateIsValid,decodeToken,decrypt,diffObject,dynamici18nString,elasticTransformOr,encrypt,enumHelper,error,eventBus,extractMonthInfo,extractValueFromWhere,familyOf,familyOfRecord,filterAttributes,filterEmpty,findValue,firstMonthDay,flatMapData,flattenChildren,formatCurrency,formatDate,formatDocument,formatNumber,formatNumberAnyFormat,gateOf,get,getConfig,getDateOpenFinance,getExtension,getMonthNumber,getNameWithoutExtension,getNextDay,getNextWeekday,getPermissionAction,getPreviewsWeekday,getToday,getToken,getTomorrow,getUUIDFromEmail,getYesterday,hasDiscriminant,imgSrcRegex,isAfter,isDateValid,isGated,isNumber,isOfAge,isOwnBusiness,isTrue,isValidUrl,lastMonthDay,makeRefurbishFileUrl,maxDateToList,minDateToList,monthsBetween,normalizeString,nullIfEmpty,padLeft,parseArrayAsObject,parseRouteToModel,prepareDoc,prepareSession,promiseAny,promiseEach,removeProperty,removeSpecialChar,replaceNumberOrPercentage,skipsActionGate,skipsRecordLoad,slugify,splitList,sum,sumByFunction,upload,validateAccess,validateMobilePhoneNumber,valueReplacer});
|